Question

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

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.

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 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....

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 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 σ = 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 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 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 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.

If you flip a coin once and denote the result using y variable,
let y=1 if you get a head, and y=0 if you get a tail, further
suppose the probability to get a head is β, what is the probability
function of the random variable y?
A.
Pr(y)=β1-y(1-β)y
B.
Pr(y)=βy(1-β)1-y
C.
Pr(y)=yβ(1-y)(1-β)
D.
Pr(y)=y(1-β)(1-y)β

3. (10pts) Let Y be a continuous random variable having a gamma
probability distribution with expected value 3/2 and variance 3/4.
If you run an experiment that generates one-hundred values of Y ,
how many of these values would you expect to find in the interval
[1, 5/2]?
4. (10pts) Let Y be a continuous random variable with density
function f(y) = 1 2 e −|y| , −∞ < y < ∞ 0, elsewhere (a) Find
the moment-generating function of...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 4 minutes ago

asked 4 minutes ago

asked 11 minutes ago

asked 16 minutes ago

asked 17 minutes ago

asked 24 minutes ago

asked 24 minutes ago

asked 36 minutes ago

asked 39 minutes ago

asked 46 minutes ago

asked 48 minutes ago

asked 52 minutes ago