1. Generate 1000 samples for each of the following discrete random variables:
(a). Binomial distribution with n=40, p=0.7, and distr. with n=50, p=0.5
(b). Geometric distribution with p=0.5 and distr. with p=0.3
(c). Poisson distribution with λ= 6 and λ= 4.5
For each class of the above distribution, plot probability mass function for each set parameters on one figure (you should have two curves on each figure and have three figures overall). In addition, you should also plot the corresponding analytical results (probability mass function curve based on distribution formulas) on the same figure. In this way, you can verify whether your simulated random variables match with analytical results. That means on each figure, there are four curves (two simulations, two analytical). Use "legend" to denote each curve, and use different line style and color for each curve (see help on plot()). You should show the X-axis with reasonable range such that the curves can be clearly seen (check wikipiedia's figures for these distributions).
In addition, calculate the mean value and variance of generated samples for each distribution (sample mean and sample variance). Compare the results with the analytical results.