PHY 411-506 Home Home  |  Course Outline  |  Lectures  |  Homework  |  Files

Lecture 4: January 24


Binomial, Poisson, and Gaussian Distributions

These probability distributions occur are extremely useful in studying random processes and in analyzing experimental data with random measurement errors and uncertainties.

The Binomial Distribution

This distribution was introduced by Jacob Bernouilli. It describes the distribution of outcomes of a experiment which consists of N "Bernouilli trials". Each trial has two outcomes: "success" occurs with probability p, and "failure" with probability 1 - p. The distribution PB(n) of n successes is given by the binomial formula:
[jan24_eq1.gif]

The Poisson Distribution

This distribution is obtained from the binomial distribution in the limit that the number of trials N becomes very large and the probability of success p becomes very small, with the mean value <n> = pN held fixed. For values of n << N in this limit:
[jan24_eq2.gif]

The Gaussian Distribution

This distribution has two parameters, the mean x0 about which it is a symmetric "bell shape", and the standard deviation s which determines the width of the bell.
[jan24_eq3.gif]
This distribution is named for Johann Carl Friedrich Gauss. The Gaussian distribution should be familiar from analysis of experimental errors, which are usually Gaussian distributed about a mean value with a standard deviation that one uses to plot "error bars" on experimental data points.

The Gaussian distribution is very important because of the "Central Limit Theorem" of statistics. This theorem applies to random variables with almost any distribution! The theorem states that the averages of sufficiently large numbers of independently chosen random variables is Gaussian distributed, regardless of the shape of the underlying distribution!

Relationship between Poisson and Gaussian distributions

When the mean of the Poisson distribution becomes large, it tends to the Gaussian distribution with standard deviation equal to the square root of the mean:
[jan24_eq4.gif]

The following applet illustrates this relationship by plottin the Poisson and Gaussian distributions with equal mean values and standard deviations:

The Poisson distribution is plotted both as a histogram for integer n, and as an analytic continuation using Euler's Gamma function:

[jan24_eq5.gif]
with the Gamma function computed using comphys.numerics.SpecialFunctions.gamma method. This applet is generated by PoissonGaussian.java:
// PoissonGaussian.java

import comphys.*;
import comphys.graphics.*;
import comphys.numerics.*;

public class PoissonGaussian extends Picture {

    double m = 1;               // mean value

    double poisson (double x) {
        double xFactorial = SpecialFunctions.gamma(x + 1);
        return Math.pow(m, x) * Math.exp(-m) / xFactorial;
    }

    double gaussian (double x) {
        double x0 = m;          // center at mean value
        double sigma = Math.sqrt(m);
        double factor = 1 / sigma / Math.sqrt(2 * Math.PI);
        double exponent = (x - x0) / sigma;
        exponent *= - exponent / 2;
        return factor * Math.exp(exponent);
    }

    double xMin = 0;
    double xMax = 5;
    double yMin = 0;
    double yMax = 0.5;
    int points = 100;

    void findMax () {
        yMax = 0;
        for (int i = 0; i < 100; i++) {
            double x = xMin + i * (xMax - xMin) / points;
            double y = poisson(x);
            if (y > yMax)
                yMax = y;
            y = gaussian(x);
            if (y > yMax)
                yMax = y;
        }
    }

    class Graph extends Plot {
        Graph () {
            setSize(400, 400);
            setBackground("white");
        }

        public void paint () {
            clear();
            findMax();
            setColor("black");
            drawAxes(xMin, xMax, yMin, 1.2 * yMax);
            plotString("  y_max = " + Easy.format(yMax, 4), xMin, 1.01 * yMax);
            setColor("red");
            double x = (int) xMin;
            double yOld = poisson(x);
            while (x <= (int) xMax) {
                double x1 = x - 0.5;
                if (x1 < xMin)
                    x1 = xMin;
                double x2 = x + 0.5;
                if (x2 > xMax)
                    x2 = xMax;
                double y = poisson(x);
                plotLine(x1, yOld, x1, y);
                plotLine(x1, y, x2, y);
                x += 1;
                yOld = y;
            }
            plotString("____ Poisson", xMin, 1.21 * yMax);
            setColor("pink");
            x = xMin;
            double dx = (xMax - xMin) / points;
            yOld = poisson(x);
            for (int i = 0; i < points; i++) {
                x += dx;
                double y = poisson(x);
                plotLine(x, y, x - dx, yOld);
                yOld = y;
            }
            setColor("blue");
            x = xMin;
            yOld = gaussian(x);
            for (int i = 0; i < points; i++) {
                x += dx;
                double y = gaussian(x);
                plotLine(x, y, x - dx, yOld);
                yOld = y;
            }
            x = xMin + 0.6 * (xMax - xMin);
            plotString("____ Gaussian", xMin + x, 1.21 * yMax);
            plotString("sigma = " + Easy.format(Math.sqrt(m), 4), x, 1.1*yMax);
                       
        }
    }

    Graph graph;
    Reader mReader, x0Reader, xMinReader, xMaxReader;

    public void init () {
        add(graph = new Graph());
        add(xMinReader = new Reader("x min", xMin, 4));
        add(xMaxReader = new Reader("x max", xMax, 4));
        add(mReader = new Reader("", m, 4));
        addControlPanel();
    }

    public void draw () {
        graph.repaint();
    }

    public void erase () {

    }

    public void reset () {
        m = mReader.readDouble();
        xMin = xMinReader.readDouble();
        xMax = xMaxReader.readDouble();
        graph.repaint();
    }

    public static void main (String[] args) {
        PoissonGaussian pg = new PoissonGaussian();
        pg.frame("Poisson and Gaussian distributions", 430, 530);
    }
}


UB Physics Home Questions or comments: phygons@acsu.buffalo.edu