Consolidation: Discrete Distributions, pdf and cdf > #Blood Type SW Ex 3.47 pp.108-9 > k=0:6 > rbind(k, signif(dbinom(k, s=6, p=.85),3), signif(pbinom(k, s=6, p=.85),3)) k 0.00e+00 1.000000 2.00000 3.0000 4.000 5.000 6.000 1.14e-05 0.000387 0.00549 0.0415 0.176 0.399 0.377 #dbinom: Pr{Y=k} 1.14e-05 0.000399 0.00589 0.0473 0.224 0.623 1.000 #pbinom: Pr{Y<=k} compare with Table 3.9 Y = number with Rh positive (out of 6) mean(Y) = 6*.85 =5.1, var(Y) = .765 Pr{Y=4} = .176; note Pr{Y=4} = Pr{Y<=4} - Pr{Y<=3} Pr{at least 4 persons Rh positive} = 1 - Pr{Y<=3} = .953 Ex 3.28 Pr{at least one person Rh negative} = Pr{Y<6} = Pr{Y<=5} = .623 = 1 - Pr{Y=6} ----------------------------------------------------------------------------- from Glover&Mitchell text EXAMPLE 3.10 Suppose it is known that the probability of recovery from infection with the Ebola virus is 0.10. If 16 unrelated people are infected, determine: (a) The expected number who will recover; (b) The probability that 5 or fewer recover; (c) The probability that at least 5 will recover; (d) The probability that exactly 5 will recover. Y=number recover, (a) E(Y) = 1.6 (note Y=1,Y=2 below have largest probability) > rbind(k, signif(dbinom(k, s=16, p=.1),3), signif(pbinom(k, s=16, p=.1),3)) k 0.000 1.000 2.000 3.000 4.0000 5.0000 6.00000 0.185 0.329 0.275 0.142 0.0514 0.0137 0.00279 0.185 0.515 0.789 0.932 0.9830 0.9970 0.99900 (b) Pr{Y<=5} = .997 (c) Pr{Y>=5} = 1 - Pr{Y<=4} = .017 (d) Pr{Y=5} = .0137 EXAMPLE 3.12 An ichthyologist studying the spoonhead sculpin, Cottus ricei, catches specimens in a large bag seine that she trolls through the lake. She knows from many years experience that on average she will catch 2 fish per trolling run. Find the probabilities of catching (a) No fish on a particular run; (b) Fewer than 6 fish on a particular run; (c) Between 3 and 6 fish on a particular run. Use Poisson Distribution (unit is an outing) > rbind(k, signif(dpois(k, 2),3), signif(ppois(k, 2),3)) k 0.000 1.000 2.000 3.000 4.0000 5.0000 6.000 0.135 0.271 0.271 0.180 0.0902 0.0361 0.012 0.135 0.406 0.677 0.857 0.9470 0.9830 0.995 Y=#sculpin caught (a) Pr{Y=0} = .135 (b) Pr{Y<=5} =.983 (c) Pr{Y<=6 and Y>= 3} = Pr{Y<= 6} - Pr{Y<= 2} = .995 - .677 = .318 I think between includes the endpoints 3 and 6 if not then the answer is Pr{Y=4 or 5} = .1263 Alternatively, if.... > # binomial approximation; discretize the outing into say 1000 seine troll segments > # each segment having p = .002 of catch > rbind(k, signif(dbinom(k, s=1000, p=.002),3), signif(pbinom(k, s=1000, p=.002),3)) k 0.000 1.000 2.000 3.000 4.0000 5.000 6.000 0.135 0.271 0.271 0.181 0.0902 0.036 0.012 0.135 0.406 0.677 0.857 0.9480 0.984 0.996