Question

Graph using Rstudio: 1. Suppose four distinct, fair coins are tossed. Let the random variable X...

Graph using Rstudio:

1. Suppose four distinct, fair coins are tossed. Let the random variable X be the number of heads. Write the probability mass function f(x). Graph f(x).

2.  For the probability mass function obtained, what is the cumulative distribution function F(x)? Graph F(x).

3. Find the mean (expected value) of the random variable X given in part 1

4. Find the variance of the random variable X given in part 1.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The probability that any given fair coin lands on head is 0.50

1) Let X be the number of heads when 4 coins are tossed. We can say that X has a Binomial distribution with parameters, number of trails (number of coins tossed) n=4 and success probability (The probability that any given fair coin lands on head) p=0.50

The Probability mass function of X is given by

ans: The Probability mass function f(x) is

In the tabular form, the Probability mass function f(x) is

x f(x)
0 0.0625
1 0.25
2 0.375
3 0.25
4 0.0625

R code to graph this (without using the R built in binomial function dbinom )

---

#set the values of x
x<-0:4
#get the values of f(x)
fx<-choose(4,x)*0.5^4
#plot f(x)
plot(x,fx,typ="l",main="probability mass function f(x)",ylab="f(x)")

---

#get this graph

2. The cumulative distribution function F(X) is

ans: The cumulative distribution function F(X) is

In the tabular form, the cumulative distribution function F(X) is

x f(x) F(x)
0 0.0625 0.0625
1 0.25 0.3125
2 0.375 0.6875
3 0.25 0.9375
4 0.0625 1

R code to graph F(x), without using the builtin function pbinom.

---

#set the values of x
x<-0:4
#get the values of f(x)
fx<-choose(4,x)*0.5^4
#get the cumulative distribution F(x)
Fx<-cumsum(fx)
#plot F(x)
plot(x,Fx,typ="l",main="Cumulative distribution F(x)",ylab="F(x)")

---

#get this graph

3. The expected value of X is

The expected value can also be calculate using the formula for expectation for Binomial distribution

ans: the mean (expected value) of the random variable X is 2

4. The variance of X can be obtained using the formula for the variance for Binomial distribution

The variance can also be calculated using the f(x).

First we find the expectation of

The variance of X is

ans: the variance of the random variable X is 1

Add a comment
Know the answer?
Add Answer to:
Graph using Rstudio: 1. Suppose four distinct, fair coins are tossed. Let the random variable X...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT