Question

Simulate with Rstudio and also make sure to compare by solving by hand(exact calculation) Show all...

Simulate with Rstudio and also make sure to compare by solving by hand(exact calculation) Show all work.

What is the expected value of a binomial distribution where 25 coins are flipped, each having a 30% chance of heads? • Compare your simulation with the exact calculation.

What is the variance of a binomial distribution where 25 coins are flipped, each having a 30% chance of heads? • Compare your simulation with the exact calculation.

Example:If ? ~???????? 10, . 5 , what is the E[?]? using calculation E ? = 5.

• Simulation: run the experiment 100,000 times.

• flips <- rbinom (100000, 10, .5 )

• mean (flips): the average number of heads

0 0
Add a comment Improve this question Transcribed image text
Answer #1
# Generate 100 occurrences of flipping 10 coins, each with 30% probability
rbinom(100,10,.3)
FALSE   [1] 2 2 0 4 4 5 3 2 3 2 2 3 4 4 3 4 6 1 2 1 1 3 3 2 4 3 2 3 3 2 3 4 2 2 4
FALSE  [36] 0 2 5 2 2 6 3 1 3 1 2 1 2 3 2 3 2 1 2 5 3 4 3 2 3 3 6 3 2 1 3 1 5 2 2
FALSE  [71] 4 5 0 3 1 3 3 4 0 3 3 4 3 4 5 5 4 1 1 4 1 4 2 4 3 4 3 2 1 2
# Calculate the probability that 2 are heads using dbinom
dbinom(2,10,.3)
FALSE [1] 0.2334744
# Confirm your answer with a simulation using rbinom
mean(rbinom(10000,10,.3)==2)
FALSE [1] 0.2391
# Calculate the probability that at least five coins are heads
1-pbinom(4,10,.3)
FALSE [1] 0.1502683
# Confirm your answer with a simulation of 10,000 trials
mean(rbinom(10000,10,.3)>=5)
FALSE [1] 0.1497
# Here is how you computed the answer in the last problem
mean(rbinom(10000, 10, .3) >= 5)
FALSE [1] 0.1437
# Try now with 100, 1000, 10,000, and 100,000 trials
mean(rbinom(100, 10, .3) >= 5)
FALSE [1] 0.15
mean(rbinom(1000, 10, .3) >= 5)
FALSE [1] 0.156
mean(rbinom(10000, 10, .3) >= 5)
FALSE [1] 0.1501
mean(rbinom(100000, 10, .3) >= 5)
FALSE [1] 0.14969
# Calculate the expected value using the exact formula
25*.3
FALSE [1] 7.5
# Confirm with a simulation using rbinom
mean(rbinom(10000,25,.3))
FALSE [1] 7.5268
# Calculate the variance using the exact formula
25*.3*(1-.3)
FALSE [1] 5.25
# Confirm with a simulation using rbinom
var(rbinom(10000,25,.3))
FALSE [1] 5.278581
# Simulate 100,000 flips of a coin with a 40% chance of heads
A <- rbinom(100000, 1, .4)

# Simulate 100,000 flips of a coin with a 20% chance of heads
B <- rbinom(100000, 1, .2)

# Estimate the probability both A and B are heads
mean(A & B)
FALSE [1] 0.07967
# You've already simulated 100,000 flips of coins A and B
A <- rbinom(100000, 1, .4)
B <- rbinom(100000, 1, .2)

# Simulate 100,000 flips of coin C (70% chance of heads)
C <- rbinom(100000, 1, .7)

# Estimate the probability A, B, and C are all heads
mean(A&B&C==1)
FALSE [1] 0.05593
Add a comment
Know the answer?
Add Answer to:
Simulate with Rstudio and also make sure to compare by solving by hand(exact calculation) Show all...
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
  • Can Dogs Understand Human Cues? EXPLORATION Dogs have been domesticated for about 14,000 years. In that...

    Can Dogs Understand Human Cues? EXPLORATION Dogs have been domesticated for about 14,000 years. In that time, have they been able to develop an understanding of human gestures such as pointing or glancing? How about simi lar nonhuman cues? Researchers Udell, Giglio, and Wynne tested a small number of dogs in order to answer these questions. In this exploration, we wll first see whether dogs can understand human gestures as well as nonhuman gestures. To test this, the researchers positioned...

  • Students must show work to receive full credit. 1. Differentiate “Empirical Probability” and “Classical Probability”. 2....

    Students must show work to receive full credit. 1. Differentiate “Empirical Probability” and “Classical Probability”. 2. Define “Independent Events”, “Mutually Exclusive Events”, and “Collectively Exhaustive Events”. 3. Suppose there are 15 red marbles and 5 blue marbles in a box. (3.a) If an individual randomly selects two marbles without replacement, what is the probability that both marbles are red? (3.b) If an individual randomly selects two marbles with replacement, what is the probability that both marbles are red? 4. Solve...

  • E) Deseribe the probabuiity histogram (symmetry, shape, center And the mean of this discrete rand...

    c-f on this page We were unable to transcribe this imagee) Deseribe the probabuiity histogram (symmetry, shape, center And the mean of this discrete random variable, Х. (Reminden This is asking you to find the mean or a random variable. .not a sample mean.) Show your 二つ、 e) Find the standard deviation of the random variable, X. (Reminder: This is asking you to find the standard deviation of a random variable...not a sample standard deviation.) Keep EXACT fractions throughout the...

  • You will look at both 1st and 2nd order approaches as you perform your analysis. Use math lab and Simulink as needed. Please show all calculations and any other means of analysis / simulation for full...

    You will look at both 1st and 2nd order approaches as you perform your analysis. Use math lab and Simulink as needed. Please show all calculations and any other means of analysis / simulation for full credit. Question three is the one needed to be solved, but 2 is needed to solve 3. Question 2) (25 points) Suppose instead of the cooling chamber modeled as a 1t order system, that the chamber was modeled as a 2nd system due to...

  • Please show all work and explain here is the data and explanation of 12.4 here is appendix D

    please show all work and explain here is the data and explanation of 12.4 here is appendix D 12.12. * In Problem 12.4, find the value of x2. If the dice really are true, what is the probability of getting a value of X2this large or larger? Explain whether the evidence suggests the dice are loaded. (See Appendix D for the necessary probabili- ties.) 12.4.I throw three dice together a total of 400 times, record the number of sixes in...

  • Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales...

    Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales for Crèmes Ice Cream Judd Hemming is the eastern regional marketing manager for Crèmes Ice Cream. Eac quarter, he completes two separate analyses: an analysis comparing ice cream flavor sale volumes from all regional locations with the same quarter sales volumes from the previou year and an analysis comparing total sales in dollars, including mean, median, mode, and standard deviation, of sales by store....

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