Question

using r coding Let Y be the random variable defined by: Y = 1 with probability...

using r coding

Let Y be the random variable defined by: Y = 1 with probability 0.10, 5 with probability 0.20 ,10 with probability 0.40, 15 with probability 0.20, 19 with probability 0.10

)

Write an R program to simulate NOBS observations of the random variable Y. For NOBS=10000, find the sample mean and sample standard deviation.

Write an R program to simulate NGAME games. Using the sample results for a simulation with NGAME = 40000

Homework Answers

Answer #1

Here we have the discrete distribution of defined as

So we can see that the theoretical mean is

So we can see that the theoretical standard deviation is

The R code for simulating NOBS = 10000 samples from the above distribution is given below:

NOBS <- 10000
Y <- sample(c(1,5,10,15,19), size = NOBS, prob = c(0.1,0.2,0.4,0.2,0.1), replace = TRUE)
mean(Y)
sd(Y)

The the sample mean is 10.0704 and sample standard deviation is 5.110093.

Both matches with the theoretical values.

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
Q6/   Let X be a discrete random variable defined by the following probability function x 2...
Q6/   Let X be a discrete random variable defined by the following probability function x 2 3 7 9 f(x) 0.15 0.25 0.35 0.25 Give   P(4≤  X < 8) ــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ Q7/ Let X be a discrete random variable defined by the following probability function x 2 3 7 9 f(x) 0.15 0.25 0.35 0.25 Let F(x) be the CDF of X. Give  F(7.5) ــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ Q8/ Let X be a discrete random variable defined by the following probability function : x 2 6...
Let Y ∼ Unif(1, 5) R1. Write code in R that will simulate the setup in...
Let Y ∼ Unif(1, 5) R1. Write code in R that will simulate the setup in question 3a, and hence, allow you to roughly check your answer. 3a. If you generate 5 random numbers based on Y , what is the probability you’ll get more (numbers greater than 4) than (numbers less than or equal to 4)? R2. Write code in R that will simulate the setup in question 3b, and hence, allow you to roughly check your answer. 3b....
Problem 3. Let x be a discrete random variable with the probability distribution given in the...
Problem 3. Let x be a discrete random variable with the probability distribution given in the following table: x = 50 100 150 200 250 300 350 p(x) = 0.05 0.10 0.25 0.15 0.15 0.20 0.10 (i) Find µ, σ 2 , and σ. (ii) Construct a probability histogram for p(x). (iii) What is the probability that x will fall in the interval [µ − σ, µ + σ]?
Let Y be a random variable with a given probability density function by f (y) =...
Let Y be a random variable with a given probability density function by f (y) = y + ay ^ 2, with y E [0; 1] and a E [0; 2]. Determine: The value of a. The Y distribution function. The value of P (0,5 < Y < 1)
1 (a) Let f(x) be the probability density function of a continuous random variable X defined...
1 (a) Let f(x) be the probability density function of a continuous random variable X defined by f(x) = b(1 - x2), -1 < x < 1, for some constant b. Determine the value of b. 1 (b) Find the distribution function F(x) of X . Enter the value of F(0.5) as the answer to this question.
Suppose X is a random variable with with expected value -0.01 and standard deviation σ =...
Suppose X is a random variable with with expected value -0.01 and standard deviation σ = 0.04. Let X1, X2, ... ,X81 be a random sample of 81 observations from the distribution of X. Let X be the sample mean. Use R to determine the following: Copy your R script b) What is the approximate probability that X1 + X2 + ... +X81 >−0.02?
Using R, simulate tossing 4 coins as above, and compute the random variable X(the outcome of...
Using R, simulate tossing 4 coins as above, and compute the random variable X(the outcome of tossing a fair coin 4 times & X = num of heads - num of tails.). Estimate the probability mass function you computed by simulating 1000 times and averaging.
Let K be a random variable that takes, with equal probability 1/(2n+1), the integer values in...
Let K be a random variable that takes, with equal probability 1/(2n+1), the integer values in the interval [-n,n]. Find the PMF of the random variable Y = In X. Where X = a^[k]. and a is a positive number, let n = 7 and a = 2. Then what is E[Y ]?
Let random variable X ∼ U(0, 1). Let Y = a + bX, where a and...
Let random variable X ∼ U(0, 1). Let Y = a + bX, where a and b are constants. (a) Find the distribution of Y . (b) Find the mean and variance of Y . (c) Find a and b so that Y ∼ U(−1, 1). (d) Explain how to find a function (transformation), r(), so that W = r(X) has an exponential distribution with pdf f(w) = e^ −w, w > 0.
Let Y denote a geometric random variable with probability of success p, (a) Show that for...
Let Y denote a geometric random variable with probability of success p, (a) Show that for a positive integer a, P(Y > a) = (1 − p) a (b) Show that for positive integers a and b, P(Y > a + b|Y > a) = P(Y > b) = (1 − p) b This is known as the memoryless property of the geometric distribution.