Question

(1) Use ‘sample’ function to generate a vector of 100 random numbers that follows a multinomial...

(1) Use ‘sample’ function to generate a vector of 100 random numbers that follows a multinomial distribution with probability (0.1, 0.15, 0.3, 0.45).

(2) Without using the ‘sample’ function, generate a vector of 100 random numbers that follows a multinomial distribution with probability (0.1, 0.15, 0.3, 0.45).

(3) Calculate the probability for 2.5 < X < 9 in a Poisson distribution with the mean 6. (using R)

Homework Answers

Answer #1

1. Using 'sample' function to generate 100 random numbers from given distribution as follows

R-Code:

2. Without using 'sample' function, use 'rmultinom' function to generate 100 random numbers from given distribution as follows

R-code:

3) P(2.5 <X<9) = P(X <=8 ) - P(X<2.5) = P(X<=8) - P(X<=2) = 0.8472375 -0.0619688 = 0.7852687

since X is discrete random variable

R-code:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
(1) Generate 80 normally distributed random variables with the mean 30 and the standard deviation 8,...
(1) Generate 80 normally distributed random variables with the mean 30 and the standard deviation 8, and store them in the vector ‘rand.vec. Then plot their empirical distribution function. (2) Given a normal distribution with the mean 30 and the standard deviation 8, find the two values of x that contain the middle 70% of the normal curve area. (3) Calculate the probability for 2.5 < X < 10 in a Poisson distribution with the mean 6 use in R...
Generate 100 random numbers using the RAND function and create a frequency distribution and a histogram...
Generate 100 random numbers using the RAND function and create a frequency distribution and a histogram with bins of width 0.1. Apply the chi-square goodness of fit test (see Chapter 5) to test the hypothesis that the data are uniformly distributed. This question is from Business Analytics 3rd Edition by James R Evans and from Chapter 12 and question 1 The question is from following book and from Chapter 12 question 1 Textbook: James Evans, Business Analytics, 3nd edition, 2019,...
Use R to code a function to generate a random sample of size n from the...
Use R to code a function to generate a random sample of size n from the Beta(a, b) distribution by the acceptance-rejection method. (1) Generate a random sample of size 3000 from the Beta(4,3) distribution. (2) Graph the histogram of the sample with the theoretical Beta(4,3) density superimposed. Answer the above questions by showing the R codes and results.
Generate 100 instances of a Poisson(3) random variable. What is the mean? What is the variance...
Generate 100 instances of a Poisson(3) random variable. What is the mean? What is the variance as computed by the R function var?
Use µ = 2.5 and σ = 1 to generate many independent sets of ten random...
Use µ = 2.5 and σ = 1 to generate many independent sets of ten random numbers, each. If I were to repeatedly carry out the one-sample t-test and significance level α = 0.05 to test the hypothesis that the mean µ used to generate those random numbers was µ = 2.5 for each new vector of ten numbers, how often, on average, would you expect to reject the null hypothesis? Explain how you come to your conclusion.
How to do the following in R: Write a function to generate a random sample of...
How to do the following in R: Write a function to generate a random sample of size n from the Beta(a,b) distribution by the acceptance-rejection method. Generate a random sample of size 1000 from the Beta(3,2) distribution.
Question 1 Refer to the probability function given in the following table for a random variable...
Question 1 Refer to the probability function given in the following table for a random variable X that takes on the values 1,2,3 and 4 X 1 2 3 4 P(X=x) 0.4 0.3 0.2 0.1 a) Verify that the above table meet the conditions for being a discrete probability distribution b) Find P(X<2) c) Find P(X=1 and X=2) d) Graph P(X=x) e) Calculate the mean of the random variable X f) Calculate the standard deviation of the random variable X...
Let X denote a random variable that follows a binomial distribution with parameters n=5, p=0.3, and...
Let X denote a random variable that follows a binomial distribution with parameters n=5, p=0.3, and Y denote a random variable that has a Poisson distribution with parameter λ = 6. Additionally, assume that X and Y are independent random variables. Derive the joint probability distribution function for X and Y. Make sure to explain your steps.
How to do the following in R: Write a function to generate a random sample of...
How to do the following in R: Write a function to generate a random sample of size n from the Gamma(α,1) distribution by the acceptance-rejection method. Generate a random sample of size 1000 from the Gamma(3,1) distribution. (Hint: you may use g(x) ∼ Exp(λ = 1/α) as your proposal distribution, where λ is the rate parameter. Figure out the appropriate constant c).
How to do the following in R: Write a function to generate a random sample of...
How to do the following in R: Write a function to generate a random sample of size n from the Gamma(α,1) distribution by the acceptance-rejection method. Generate a random sample of size 1000 from the Gamma(3,1) distribution. (Hint: you may use g(x) ∼ Exp(λ = 1/α) as your proposal distribution, where λ is the rate parameter. Figure out the appropriate constant c).