Question

Using R-studio 2. Consider an experiment where we flip a fair coin six times in a row, and i is the number of heads toss...

Using R-studio

2. Consider an experiment where we flip a fair coin six times in a row, and i is the number of heads tossed:

            a.         Calculate the probability mass function for i = 0. . . 6 using the equation from Ross section 2.8 for Binomial Random Variables

            b.         Conduct a simulation of this experiment in R, with T trials of the experiment – pick several values of T from 10 to 10,000.

            c.         Create a plot of the theoretical result vs. your simulation at T = 100 and T = 10,000. Show that they converge as T increases.

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

Console Terminal x-sample (0:1,6,replace = TRUE) #will give 0 or 1 for 6 times where we use 1 as head and 0 as tails #so sumo

Console Terminal #b) function written below for I trials y={} > performexp-function (T) { for (i in 1:T) { x-sample (0:1,6,re

c)actuals plot for T=100

25 LO 1 2 3 5 6 0

theoretical plot for T=100

39 25 20 10 LO

actuals plot for T=10,000

6 5 4 3 2 1 0 LO 0000 0000 2500 009 000 009 C

Theoretical at T=10000 (If you cannot understand which plot it is then look at the Y axis and you will get it is for which T value)

0000 2500 0000 1500 000 009 0

R code for the above plots

#c) theoretical and actual compairision at T-100 > table(performexp (100) ) #actual result 1 2 4 5 6 14 22 28 26 7 barplot (t

As we can rightly observe that the plots start to converge as T increases from 100 to 100000 as the actuals vs theoretical difference starts becoming small in the later plots which is the tendency of Central Limit Theorem as well

Hope the above answer has helped you in understanding the problem. Please upvote the ans if it has really helped you. Good Luck!!

Add a comment
Know the answer?
Add Answer to:
Using R-studio 2. Consider an experiment where we flip a fair coin six times in a row, and i is the number of heads toss...
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