(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)
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:
Get Answers For Free
Most questions answered within 1 hours.