Limit Distributions-Poisson Distribution
system:sage


<p>We begin by considering a random variable $X_k$ with Binomial distribution $B(k;p)$. This means that $P(X_k=r)=\binom{k}{r}p^r (1-p)^{k-r}$.</p>

{{{id=1|
def binom(k,p,r):
    return N(binomial(k,r)*p^r*(1-p)^(k-r))
///
}}}

<p>We now plot the frequency plot of $X_k$ for a fixed $p$ and $k$ varying over some range.</p>

{{{id=14|
p=1/2
binoms=[bar_chart(map(lambda r:binom(k,p,r),range(k+1)),color='gray',width=0.2)
for k in range(4,31)]
///
}}}

<p>We animate this sequence of plots.</p>

{{{id=16|
binanim=animate(binoms,xmin=0,xmax=21,ymin=0,ymax=0.5,figsize=[6,4])
///
}}}

<p>Looking at all the charts together, we see that:</p>
<ul>
<li>Since the expectation $E(X_k)=kp$ keeps increasing with $k$, the centre of the plot moves to the right.</li>
<li>The height of the peak decreases and the distribution "flattens out".</li>
</ul>

{{{id=8|
binanim.show(delay=100)
///
}}}

<p>We now take the random variable $V_k$ whose distribution is given by $B(k;c/k)$ for some fixed value of $c$. The mean of this sequence of distributions remains fixed and $V_k$ converge to a random variable $V$ which has the Poisson Distribution</p>
<p>\[ P(V=r)=\frac{c^r e^{-c}}{r!}\]</p>

{{{id=9|
c=0.9
pois=bar_chart(map(lambda r:c^r*exp(-c)/factorial(r),range(6)), width=0.3,color="orange") # This is the Poisson
plseq=[pois+bar_chart(map(lambda r:binom(2*k,c/(2*k),r),range(6)),color='gray',width=0.15)
for k in range(1,30)] # These are all the Binomials
poisanim=animate(plseq,xmin=0,xmax=6,ymin=0,ymax=c/2,figsize=[6,4])
///
}}}

{{{id=10|
poisanim.show(delay=70)
///
}}}

{{{id=17|

///
}}}