########### # Blatt 6 # ########### #aufgabe 3 #a #Nikotin <- read.table("/Users/anatol/Desktop/U?-leiter/W_theo/Nikotin.txt",header=T,sep="\t", quote="");attach(Nikotin) nik<-c(123,311,242,474,375,449,419,185,33,564,256,242,312,179,456,232,389,429,309,269,274,274,157,348,384,274,179,306,260,346,106,468,597,233,304,448,182,527,155,347,74,471,260,213,346,304,256,233,227,607,464,469,209,314,456) hist(nik, breaks = 12, freq = F,, xlim = c(0,700), ylim = c(0,0.004), ylab = "relative Haeufigkeit", main = "Histogramm der Nikotinmessungen") m<-mean(nik) v<-var(nik) s<-sd(nik) lines(dnorm(1:700, m, s)) #Parameterwerte sind aus den Daten bestimmt worden #anpassung nur gut bei default Histogramm #b par(mfrow = c(2,1)) plot(dnorm(seq(0,700), m,s), type = "l", ylab = "Wahrscheinlichkeit", main = "Dichte") k<-(-3:3) abline(v=(315 + k * 131)) plot(pnorm(seq(0,700), m,s), type = "l", ylab = "Wahrscheinlichkeit", main = "Verteilung") #c pnorm(500,m,s) - pnorm(300,m,s) 315/131 #Null liegt ca. 2.4 mal die Standardabweichung vom Erwartungswert entfernt pnorm(0,m,s) #negative Werte sind nicht realistisch. Die Wsk. dafŸr ist aber auch sehr klein #d sum(dbinom(c(0,1),20,1-pnorm(500,m,s))) sum(dbinom(c(0,1),20,4/55)) #aufgabe 4 #a assi<-pnorm(5,4,2) * (1 - pnorm(4,2,4)) + 1 - pnorm(5,4,2) #b prof<-1-pnorm(15,12,3) #c assi * prof #aufgabe 5 #b par(mfrow = c(5,1)) hist(pnorm(rnorm(100,5,2), 5,2), breaks = seq(0,1,0.05), freq = F, col = "grey") lines(seq(0,1,0.05),dunif(seq(0,1,0.05),0,1), col = "red") hist(pnorm(rnorm(1000,5,2), 5,2), breaks = seq(0,1,0.05), freq = F, col = "grey") lines(seq(0,1,0.05),dunif(seq(0,1,0.05),0,1), col = "red") hist(pnorm(rnorm(10000,5,2), 5,2), breaks = seq(0,1,0.05), freq = F, col = "grey") lines(seq(0,1,0.05),dunif(seq(0,1,0.05),0,1), col = "red") hist(pnorm(rnorm(100000,5,2), 5,2), breaks = seq(0,1,0.05), freq = F, col = "grey") lines(seq(0,1,0.05),dunif(seq(0,1,0.05),0,1), col = "red") hist(pnorm(rnorm(1000000,5,2), 5,2), breaks = seq(0,1,0.05), freq = F, col = "grey") lines(seq(0,1,0.05),dunif(seq(0,1,0.05),0,1), col = "red")