Binomial Probability Distribution, N=20, p=0.2
In[60]:=
 ![RowBox[{RowBox[{p, =, 0.2}], ;}] q = 1 - p ; probability = Table[    Binomial[20, i] p^iq^(20 - i)       , {i, 0, 20}]](../HTMLFiles/binomial_9.gif) 
Out[62]=
 ![RowBox[{{, RowBox[{0.0115292, ,, 0.0576461, ,, 0.136909, ,, 0.205364, ,, 0.218199, ,, 0.17456, ... , 1.30057*10^-8, ,, 7.65041*10^-10, ,, 3.18767*10^-11, ,, 8.38861*10^-13, ,, 1.04858*10^-14}], }}]](../HTMLFiles/binomial_10.gif) 
 These values are the probability of getting exactly  successes in 20 trials, where the probability of success
successes in 20 trials, where the probability of success ![FormBox[RowBox[{p, =, 0.2}], TraditionalForm]](../HTMLFiles/binomial_12.gif) , for m=0,1,2,...,20.
, for m=0,1,2,...,20.
In[58]:=
 ![{probability, Range[0, 20]}//TableForm](../HTMLFiles/binomial_13.gif) 
Out[58]//TableForm=
| 0.0115292 | 0.0576461 | 0.136909 | 0.205364 | 0.218199 | 0.17456 | 0.1091 | 0.0545499 | 0.0221609 | 0.00738696 | 0.00203141 | 0.000461685 | 0.0000865659 | 0.0000133178 | 1.66473*10^-6 | 1.66473*10^-7 | 1.30057*10^-8 | 7.65041*10^-10 | 3.18767*10^-11 | 8.38861*10^-13 | 1.04858*10^-14 | 
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 
 And here are the cumulative probabilities, which you get by adding the numbers in the previous list from 0 up to  .  This gives the probability of 0 to
.  This gives the probability of 0 to  successes in 20 trials, again with
 successes in 20 trials, again with ![FormBox[RowBox[{p, =, 0.2}], TraditionalForm]](../HTMLFiles/binomial_16.gif) .
.
In[40]:=
 ![cumulative = Table[ Total[probability[[Range[i + 1]]]], {i, 0, 20}]](../HTMLFiles/binomial_17.gif) 
Out[40]=
 ![RowBox[{{, RowBox[{0.0115292, ,, 0.0691753, ,, 0.206085, ,, 0.411449, ,, 0.629648, ,, 0.804208 ... 437, ,, 0.999898, ,, 0.999985, ,, 0.999998, ,, 1., ,, 1., ,, 1., ,, 1., ,, 1., ,, 1., ,, 1.}], }}]](../HTMLFiles/binomial_18.gif) 
In[82]:=
 ![p1 = ListPlot[probability, PlotJoinedTrue, PlotStyleHue[.6]] ; p2 = ListPlot[c ... xesLabel {"m", "probability"}, PlotLabel->"N=20, p=0.2"]](../HTMLFiles/binomial_19.gif) 
 ![[Graphics:../HTMLFiles/binomial_20.gif]](../HTMLFiles/binomial_20.gif) 
Out[84]=
  
Created by Mathematica (September 30, 2003)