First, initialize the enhanced plotting package:
![[Graphics:Images/Binomial_gr_1.gif]](Images/Binomial_gr_1.gif)
(On some machines, this command mught be just " <<Graphics")
Mathematica calls the "Choose" ratio of factorial "Binomial":
![[Graphics:Images/Binomial_gr_2.gif]](Images/Binomial_gr_2.gif)
Name a list 'v' and fill it with integers to 20:
![[Graphics:Images/Binomial_gr_4.gif]](Images/Binomial_gr_4.gif)
'Binomial' can operate on the list to compute all 21 values; let's call that list `bv':
![[Graphics:Images/Binomial_gr_6.gif]](Images/Binomial_gr_6.gif)
BarChart can make a histogram of this distribution:
![[Graphics:Images/Binomial_gr_8.gif]](Images/Binomial_gr_8.gif)
Ick, the autoscaling doesn't work so nicely for the y-axis of BarChart; perhaps some of you smart people can figure out what option fixes this...
Let's try old reliable ListPlot instead:
![[Graphics:Images/Binomial_gr_11.gif]](Images/Binomial_gr_11.gif)
Much better, we see the characteristic 'bell curve' shape. Now let's normalize it to make the binomial distribution for N=20:
![[Graphics:Images/Binomial_gr_14.gif]](Images/Binomial_gr_14.gif)
![[Graphics:Images/Binomial_gr_16.gif]](Images/Binomial_gr_16.gif)
`%' means the previous result in Mathematica ; the above line takes the previous result and causes it to be evailuated Numerically:
Let's look at this normalized form:
![[Graphics:Images/Binomial_gr_18.gif]](Images/Binomial_gr_18.gif)
We understand it's structure much better by using a semi-log plot, which shows that the log of this distribution is very nearly parabolic, that is, the distribution is well-approximated by a Gaussian form:
![[Graphics:Images/Binomial_gr_21.gif]](Images/Binomial_gr_21.gif)
Left as an exercise to the student: Extend this to the general binomial distribution where p is not 1/2. Look at various limits, for example, the Poisson limit where p is `small' but N is `large'.