4. Binomial distribution

In this task you have to plot three diagrams in a figure. The first diagram shows the binomial distribution with paramteres \((n,p)\) (the title is "Binomial distribution"). The second diagram shows the result of the simulation of this distribution (the title is "Binomial distribution simulated with 1000 experiments"). The third picture shows the first \(n+1\) columns of the diagram of the Poisson distribution with parameter \(\lambda=n\cdot p\) which approximates our binomial distribution (the ttitle is "Binomial distribution approxiamted with Poisson-distribution").

The output of this program will look like this (the scale and color is not an essential part of the figure):

title

The inputs are \(n\), \(p\), \(k\), where \(n\) and \(p\) are the parameters of the binomial distribution, and \(k\) is the number of simulations. The file should be called binom.py and be run by the next command:

python3 binom.py 12 0.3 1000