Question

In: Math

The following should be performed using R and the R code included in your submission. To...

The following should be performed using R and the R code included in your submission.

To obtain first prize in a lottery, you need to correctly choose n different numbers from N and 1 number from 20, known as the supplementary. That is we first draw n numbers from 1:N without replacement and then 1 number from 1:20 in another draw. Suppose n=7 and N=35. Let X be the number of drawn numbers that match your selection, 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 and with the supplementary. Plot the distribution function and the cumulative distribution function. Hint: Part of the answer involves the hypergeometric.

(b) Using R, generate 1,000,000 random numbers from this distribution and plot a histogram of the simulated data.

(c) Calculate the expected value, E(X), and the variance, σ2 (or Var(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 a single draw. What is the value of � from the Poisson approximation to the number of entries with a first prize? Use the Poisson approximation for the following. What is the probability that there will be no entry with a first prize? What is the expected number of weeks until the first prize?

Solutions

Expert Solution

a)

Without supplementary, let we draw numbers from a total of numbers the probability that numbers matches is

We can see that follows hypergeometric distribution. Here

The R code for plotting PDF and CDF is given below.

N <- 35
n <- 7
x <- 0:n
PDF <- dhyper(x, m = n, n = N-n, k = n, log = FALSE)
CDF <- phyper(x, m = n, n = N-n, k = n, log = FALSE)
plot(x,CDF, xlab = "X",col="blue", main = "CDF of Hypergeometric distribution")
#plot(x,PDF, xlab = "X",col="blue", main = "PDf of Hypergeometric distribution")

With supplementary (), let we draw numbers from a total of numbers the probability that numbers matches is

b)

The R code for generating 1000000 random number from the given distribution and drawing the histogram is given below.

n_rand <- 1000000
N <- 35
n <- 7
X <- rhyper(n_rand, m = n, n = N-n, k = n)
hist(X, breaks = 10, xlab = "X", col = "blue", main = "Histogram")

c)

The mean of the distribution, is

. The variance is

The simulated values are mean =  1.398336 variance =  0.9225554

n_rand <- 1000000
N <- 35
n <- 7
X <- rhyper(n_rand, m = n, n = N-n, k = n)
mean(X)
var(X)

d)

The symbol in the question is not visible.


Related Solutions

The Ratio Calculations should be done in a table in Excel and included with your submission....
The Ratio Calculations should be done in a table in Excel and included with your submission. The following ratios should be included for Pier 1 for 2 years: calculate these ratios below is a link to 10-K form Working Capital Current Ratio Total Debt to Total Equity Ratio Times Interest Earned RNOA ROCE Show calculations for pier 1 https://investors.pier1.com/financial-information/annual-reports
Use R to complete the following questions. You should include your R code, output and plots...
Use R to complete the following questions. You should include your R code, output and plots in your answer. 1. Two methods of generating a standard normal random variable are: a. Take the sum of 5 uniform (0,1) random numbers and scale to have mean 0 and standard deviation 1. (Use the properties of the uniform distribution to determine the required transformation). b. Generate a standard uniform and then apply inverse cdf function to obtain a normal random variate (Hint:...
Use R to complete the following questions. You should include your R code, output and plots...
Use R to complete the following questions. You should include your R code, output and plots in your answer. 1. Two methods of generating a standard normal random variable are: a. Take the sum of 5 uniform (0,1) random numbers and scale to have mean 0 and standard deviation 1. (Use the properties of the uniform distribution to determine the required transformation). b. Generate a standard uniform and then apply inverse cdf function to obtain a normal random variate (Hint:...
Use R to complete the following questions. You should include your R code, output and plots...
Use R to complete the following questions. You should include your R code, output and plots in your answer. Two methods of generating a standard normal random variable are: a. Take the sum of 5 uniform (0,1) random numbers and scale to have mean 0 and standard deviation 1. (Use the properties of the uniform distribution to determine the required transformation). b. Generate a standard uniform and then apply inverse cdf function to obtain a normal random variate (Hint: use...
Do the following using R. You must also turn in a copy of your R code....
Do the following using R. You must also turn in a copy of your R code. (10) What is the probability a beta (1, 8) random variable is less than 0.13? (11) What is the probability a beta (3, 9) random variable is greater than .4? (12) What is the probability a beta (18,4.4) random variable is between 0.6 and 0.7? (13) At what value of x is the probability that a beta (4, 7) random varable is less than...
Using the R package to answer the following two questions. You MUST submit your R code...
Using the R package to answer the following two questions. You MUST submit your R code for analysis. 2. Below are heights for a simple random sample of n = 15 young trees (in cm). (50 pts) 27, 33, 33, 34, 36, 37, 39, 40, 40, 41, 41, 42, 44, 46, 47. (a) Test the hypothesis that the mean tree height is equal to 38 cm. (b) Calculate the 95% confidence interval for the population mean of young trees. (c)...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE (SHOW ANSWERS IN R MARKDOWN FORWAT WITH CODE AND ANSWERS) PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2...
(Be sure to paste the R Console Output and code!!!) Using the following data and R,...
(Be sure to paste the R Console Output and code!!!) Using the following data and R, write a brief paragraph about whether the in-home treatment is equally effective as the out-of-home treatment for two separate groups. Here are the data. The outcome variable is level of anxiety after treatment on a scale from 1 to 10. In-Home Treatment Out-of-Home Treatment 3 7 4 6 1 7 1 8 1 7 3 6 3 5 6 6 5 4 1 2...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE PROBLEM 1 A study of 400...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2 Suppose that fasting plasma glucose concentrations (FPG) in some population are normally distributed with a mean...
Answer one of the following questions in essay form. Your submission should be at least one...
Answer one of the following questions in essay form. Your submission should be at least one page long. The essay is worth 10 points. Topic: Addiction Choose one Essay Topic for 10 points Are you addicted to technology? Does your use of technology negatively affect your daily life? Is there addiction in your family? Do you want to share your experience with addiction in family member's or friend's life?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT