clear echo on %Solution to Quiz #1 %We have the weights (using cut and paste!) weights=[159 110 171 199 129 176 188 102 107 167 138 171 174 171 189 170 186 114 149 145 ]; %Now for question 1: ave=mean(weights) stdev=std(weights) %you could also do this directly via: n=length(weights) ave=sum(weights)/n stdev=((norm(weights)^2-ave^2*n)/(n-1))^.5 %Which yields the same result... %note that matlab uses the correct n-1 normalization for the standard deviation. %Type in "help std" and "help mean" for more information... %Now for question 2: %We will exceed 900 lb if the average weight of the five (m) exceeds 180 lb. The %standard deviation of the -average- of five students (assuming independence) is %reduced from the population standard deviation by (m)^.5. Thus, we can use the %error function to get the answer: m=5; probover=1-0.5*(1+erf((180-ave)*m^.5/stdev/2^.5)) %Note that the probability we are -over- this amount is 1-prob of being under... %And finally for question 3: %The three assumptions are: independence, normal distribution, and accuracy of %population mean and standard deviation estimates. %a). Independence. Student weights (among the five) can be either positively or %negatively covariant. If positive (birds of a feather flock to an elevator together) %then we underestimate the standard deviation and probability. If negative (a large %student is unlikely to squeeze into a packed elevator) we overestimate the standard %deviation and probability. This is the sort of biased sampling issue you run into in %many types of experiments. %b). Normal distribution. Our overall probability is fairly low, thus we are on %the tail of the gaussian normal distribution. In general, this means that the %gaussian probability is likely to underestimate the true probability. %c). Assumption of accuracy of population estimates. The values calculated for (1) %have error in them as well - thus error in these estimates means that the %probability estimate is itself a random variable. We will look at calculating %the confidence interval of the probability estimate in a later quiz. echo off