plotting in python using binomial
Posted on 2011-09-02
I am trying to learn python and graphing. Could anybody help me with the following?
I want to plot a graph of probabilities using the Binomial which I will write as B(N,n,p); where N is the total number of events, n is the number of successes and p is the probability of a success.
What I want to do is plot the probability of the n events occurring for varying N but fixed n and p.
For example, if n = 20 and p = 0.1, I would like to work out the probability of P(n=20, p=0.1) for N = 20, ... , 100.
Could someone give me the Python code which would allow me to do this?
Thanks in advance