The following should be performed using R and the R codeincluded in your submission.
To obtain first prize in a lottery, you need to correctly choosen different numbers from N and 1 number from 20, known as thesupplementary. That is we first draw n numbers from 1:N withoutreplacement and then 1 number from 1:20 in another draw. Supposen=7 and N=35. Let X be the number of drawn numbers that match yourselection, where the supplementary counts as 8, so that X=0,…,15.For a first prize X=15 i.e. all numbers are matched.
(a) Calculate probabilities P(X=x), x=0, 1, …, 7, without andwith the supplementary. Plot the distribution function and thecumulative distribution function. Hint: Part of the answer involvesthe hypergeometric.
(b) Using R, generate 1,000,000 random numbers from thisdistribution and plot a histogram of the simulated data.
(c) Calculate the expected value, E(X), and the variance, ?2 (orVar(X)). Obtain the mean and the variance of the simulated data.Compare the estimates with the theoretical parameters.
(d) Assume that each week 10,000,000 entries are lodged, for asingle draw. What is the value of ? from the Poisson approximationto the number of entries with a first prize? Use the Poissonapproximation for the following. What is the probability that therewill be no entry with a first prize? What is the expected number ofweeks until the first prize?