########### # Blatt 4 # ########### #aufgabe 3 #b ?dpois a<-dpois(0:15,2) b<-dpois(0:15,4) round(a, digit = 3) round(b, digit = 3) which(a==max(a)) which(b==max(b)) #zweiter Index bei b fehlt!!! #moegliche Loesung: all.equal(b[4],b[5]) #Hoechste Anzahl also bei 1 und 2 Unfaellen, bzw. 3 und 4 all.equal(b[4], b[5]) #b par(mfrow = c(2,1)) barplot(a, names.arg = (0:15), xlab = "Anzahl Unfaelle", ylab = "Wahrscheinlichkeit") barplot(b, names.arg = (0:15), xlab = "Anzahl Unfaelle", ylab = "Wahrscheinlichkeit") #c differenz<-(a-b) which(abs(differenz) == max(abs(differenz))) #bei einem Unfall liegt die hoechste Differenz vor #d dpois(6, 4) dpois(0:10, 6)