Class Example 18:
Probability Histograms for the Binomial(n,p) distribution
1.  Different choices of p: p: 0.05 0.1 0.2 0.5 0.8 0.9 0.95 0.99
x P{X = x} P{X = x} P{X = x} P{X = x} P{X = x} P{X = x} P{X = x} P{X = x}
0 0.358485922 0.121576655 0.011529 9.54E-07 1.05E-14 1E-20 9.54E-27 1E-40
Note: careful choice of $ signs 1 0.377353603 0.270170344 0.057646 1.91E-05 8.39E-13 1.8E-18 3.62E-24 1.98E-37
means that a single formula 2 0.188676801 0.285179807 0.136909 0.000181 3.19E-11 1.539E-16 6.54E-22 1.86E-34
can be "dragged" in both directions 3 0.059582148 0.190119871 0.205364 0.001087 7.65E-10 8.3106E-15 7.46E-20 1.11E-31
4 0.013327586 0.089778828 0.218199 0.004621 1.3E-08 3.1788E-13 6.02E-18 4.65E-29
5 0.002244646 0.031921361 0.17456 0.014786 1.66E-07 9.15496E-12 3.66E-16 1.47E-26
6 0.000295348 0.008867045 0.1091 0.036964 1.66E-06 2.05987E-10 1.74E-14 3.65E-24
7 3.10893E-05 0.001970454 0.05455 0.073929 1.33E-05 3.70776E-09 6.61E-13 7.23E-22
8 2.65895E-06 0.000355776 0.022161 0.120134 8.66E-05 5.4226E-08 2.04E-11 1.16E-19
9 1.86593E-07 5.27076E-05 0.007387 0.160179 0.000462 6.50711E-07 5.17E-10 1.53E-17
10 1.08028E-08 6.44204E-06 0.002031 0.176197 0.002031 6.44204E-06 1.08E-08 1.67E-15
11 5.16878E-10 6.50711E-07 0.000462 0.160179 0.007387 5.27076E-05 1.87E-07 1.5E-13
12 2.04031E-11 5.4226E-08 8.66E-05 0.120134 0.022161 0.000355776 2.66E-06 1.12E-11
13 6.60829E-13 3.70776E-09 1.33E-05 0.073929 0.05455 0.001970454 3.11E-05 6.8E-10
14 1.73902E-14 2.05987E-10 1.66E-06 0.036964 0.1091 0.008867045 0.000295 3.37E-08
15 3.6611E-16 9.15496E-12 1.66E-07 0.014786 0.17456 0.031921361 0.002245 1.33E-06
16 6.02155E-18 3.1788E-13 1.3E-08 0.004621 0.218199 0.089778828 0.013328 4.13E-05
17 7.45703E-20 8.3106E-15 7.65E-10 0.001087 0.205364 0.190119871 0.059582 0.000961
18 6.54125E-22 1.539E-16 3.19E-11 0.000181 0.136909 0.285179807 0.188677 0.015856
19 3.62396E-24 1.8E-18 8.39E-13 1.91E-05 0.057646 0.270170344 0.377354 0.165234
20 9.53674E-27 1E-20 1.05E-14 9.54E-07 0.011529 0.121576655 0.358486 0.817907
Small p: 
larger p means more Heads
p = 0.05, "expect 1 Head in 20", so 0
and 1 are most likely, bigger numbers
very unlikely.
p = 0.1,  "expect 1 Head in 10", so 2 is
most likely, near 2 happens a lot.
p = 0.2,  "expect 1 Head in 5", so 4 is
most likely
p = 0.5, "expect 1/2 will be Heads", so
10 is most likely, "shape" looks familiar?
Large p:
Symmetric with small p, not surprising
since #S's ~ Bi(n,p),
while #F's ~ BI(n,1-p)
Thus lessons similar to above
"at this end".
Extremely large p:
p = 0.99:  "expect 99 out of 100 Heads"
so see X = 20 "almost all the time"
Clearly not a normal distribution here
"less variability" for more extreme p
2. Different choices of n: p = 0.3
n 3 10 30 100 100, N.A.
x
0 0.343 0.028247525 2.25E-05 3.23E-16 4.30021E-11
1 0.441 0.121060821 0.00029 1.39E-14 1.75215E-10
2 0.189 0.233474441 0.001801 2.94E-13 6.80722E-10
3 0.027 0.266827932 0.007203 4.12E-12 2.52167E-09
4 0.200120949 0.020838 4.28E-11 8.90692E-09
5 0.102919345 0.04644 3.52E-10 2.99975E-08
6 0.036756909 0.082928 2.39E-09 9.63301E-08
7 0.009001692 0.121854 1.37E-08 2.94957E-07
8 0.001446701 0.150141 6.85E-08 8.6114E-07
9 0.000137781 0.157291 3E-07 2.39722E-06
10 5.9049E-06 0.141562 1.17E-06 6.36301E-06
11 0.110308 4.1E-06 1.61041E-05
12 0.074852 1.3E-05 3.88623E-05
13 0.044418 3.78E-05 8.94213E-05
14 0.023115 0.000101 0.000196188
15 0.010567 0.000248 0.000410415
16 0.004246 0.000564 0.00081864
17 0.001498 0.001194 0.001556977
18 0.000464 0.00236 0.002823519
19 0.000126 0.004365 0.004882235
20 2.96E-05 0.007576 0.008049445
21 6.04E-06 0.012368 0.012654136
22 1.06E-06 0.019034 0.018967861
23 1.58E-07 0.027665 0.027109626
24 1.97E-08 0.038039 0.036944348
25 2.03E-09 0.04956 0.048005589
26 1.67E-10 0.061269 0.059477801
27 1.06E-11 0.071967 0.070264719
28 4.88E-13 0.080412 0.079147835
29 1.44E-14 0.085562 0.085008054
30 2.06E-16 0.086784 0.087056343
31 0.083984 0.085008054
32 0.077611 0.079147835
33 0.068539 0.070264719
34 0.057884 0.059477801
35 0.04678 0.048005589
36 0.036199 0.036944348
37 0.026834 0.027109626
Don't need to see part for x = 41,…100, 38 0.019067 0.018967861
since all prob's really small 39 0.01299 0.012654136
40 0.00849 0.008049445
Increasing n:
more trials means more Heads
more trials means "more variability"
shape "more normal" for larger n?
Which normals approximate?
i.e. what is mu?  sigma?
mu increases with n?
sigma increases with n?
3.  Normal Approximation:
a.  n = 100, p = 0.3
Looks very close
np >= 10?
30
n(1-p) >= 10?
70
p 0.5 0.05 0.95 0.2
b.  n = 20, p = 0.5
0 8.09991E-06 0.241808866 1.25E-83 0.018306
c.  n = 20, p = 0.05 1 5.41551E-05 0.409306143 3.58E-75 0.054652
2 0.000296442 0.241808866 3.58E-67 0.119372
d.  n = 20, p = 0.95 3 0.001328563 0.04985906 1.25E-59 0.190755
4 0.004874891 0.003588095 1.52E-52 0.223016
e.  n = 20, p = 0.2 5 0.014644983 9.01222E-05 6.47E-46 0.190755
6 0.036020845 7.90037E-07 9.61E-40 0.119372
7 0.072537073 2.41719E-09 4.98E-34 0.054652
8 0.119593416 2.5812E-12 9E-29 0.018306
9 0.161434226 9.62014E-16 5.68E-24 0.004486
10 0.178412412 1.25138E-19 1.25E-19 0.000804
11 0.161434226 5.68125E-24 9.62E-16 0.000106
12 0.119593416 9.00217E-29 2.58E-12 1.01E-05
13 0.072537073 4.97849E-34 2.42E-09 7.11E-07
14 0.036020845 9.60942E-40 7.9E-07 3.65E-08
15 0.014644983 6.47357E-46 9.01E-05 1.37E-09
16 0.004874891 1.52208E-52 0.003588 3.77E-11
17 0.001328563 1.24905E-59 0.049859 7.59E-13
18 0.000296442 3.57744E-67 0.241809 1.12E-14
19 5.41551E-05 3.57611E-75 0.409306 1.2E-16
20 8.09991E-06 1.24766E-83 0.241809 9.47E-19
b.  n = 20, p = 0.5
Looks very close
np >= 10?
10
n(1-p) >= 10?
10
Right on boundary
c.  n = 20, p = 0.05
Not too bad, except boundary
np >= 10?
1
n(1-p) >= 10?
19
Unacceptable on left side
d.  n = 20, p = 0.95
Not too bad, except boundary
np >= 10?
19
n(1-p) >= 10?
1
Unacceptable on right side
e.  n = 20, p = 0.2
distortion not terrible?
np >= 10?
4
n(1-p) >= 10?
16
criterion sets high standards!