This is just a quick note to demonstrate basic properties of the binomial distribution using Mathematica.


    First, initialize the enhanced plotting package:

[Graphics:Images/Binomial_gr_1.gif]

(On some machines, this command might be just " <<Graphics")

Mathematica calls the "Choose" ratio of factorials "Binomial":

[Graphics:Images/Binomial_gr_2.gif]
[Graphics:Images/Binomial_gr_3.gif]

Name a list 'v' and fill it with integers to 20:

[Graphics:Images/Binomial_gr_4.gif]
[Graphics:Images/Binomial_gr_5.gif]

'Binomial' can operate on the list to compute all 21 values; let's call that list `bv':

[Graphics:Images/Binomial_gr_6.gif]
[Graphics:Images/Binomial_gr_7.gif]

BarChart can make a histogram of this distribution:

[Graphics:Images/Binomial_gr_8.gif]

[Graphics:Images/Binomial_gr_9.gif]

We could also use old reliable ListPlot instead:

[Graphics:Images/Binomial_gr_10.gif]

[Graphics:Images/Binomial_gr_11.gif]

[Graphics:Images/Binomial_gr_12.gif]

In either case we see the characteristic 'bell curve' shape. Now let's normalize it to make the binomial distribution for N=20:

[Graphics:Images/Binomial_gr_13.gif]
[Graphics:Images/Binomial_gr_14.gif]
[Graphics:Images/Binomial_gr_15.gif]
[Graphics: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:

[Graphics:Images/Binomial_gr_17.gif]

Let's look at this normalized form:

[Graphics:Images/Binomial_gr_18.gif]

[Graphics:Images/Binomial_gr_19.gif]

We understand its 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 (and hence justifies expanding the log of the distribution in our Taylor's series):

[Graphics:Images/Binomial_gr_20.gif]

[Graphics: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'.


Converted by Mathematica      September 24, 2003