Question

Suppose that your boss instead asks that you toss a fair coin six times, record the...

Suppose that your boss instead asks that you toss a fair coin six times, record the number of heads, and then repeat the process, for 2000 times in total. How might you simulate this process with a U(0,1) random number generator? Try to generate the outcome for each group of six tosses at once (i.e., use 2000 random numbers, rather than 12,000 individuals outcomes which you bundle into groups of size six).

Homework Answers

Answer #1

Let, X denotes number of heads in 6 tosses of fair coin

We have to repeat this process 2000 times. We want such 2000 values of x using U(0,1) variable

First, select 2000 uniform(0,1) variates, let they are, y=(y1,y2, .................,y1999,y2000)

Now, treat them as the probabilities, now we will get values of binomail variable X(i) such that probability of X(i) is yi where X(i) is number of heads in 6 tosses of fair coin at i'th process

Here is the R code for same

y=runif(2000,0,1) # It gives 2000 random values between 0 and 1
X=qbinom(y,6,0.5) # It gives 2000 values of X, where X is defined above, here in binomail random variable, n=6, p = 0.5 and X is the assumed value whose probability is y

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
Suppose you toss a fair coin three times. Which of the following events are independent? Give...
Suppose you toss a fair coin three times. Which of the following events are independent? Give mathematical justification for your answer.     A= {“heads on first toss”}; B= {“an odd number of heads”}. A= {“no tails in the first two tosses”}; B=     {“no heads in the second and third toss”}.
Suppose you toss a fair coin​ 10,000 times. Should you expect to get exactly 5000​ heads?...
Suppose you toss a fair coin​ 10,000 times. Should you expect to get exactly 5000​ heads? Why or why​ not? What does the law of large numbers tell you about the results you are likely to​ get? Choose the correct answer below. 1)Should you expect to get exactly 5000​ heads? Why or why​ not? A)You​ shouldn't expect to get exactly 5000​ heads, because you cannot predict precisely how many heads will occur. B.You​ shouldn't expect to get exactly 5000​ heads,...
You toss a fair coin six times. What is the probability that at least one toss...
You toss a fair coin six times. What is the probability that at least one toss results in a tail appearing? Round your answer to four decimal places.
Suppose you toss a coin 100 times. Should you expect to get exactly 50 heads? Why...
Suppose you toss a coin 100 times. Should you expect to get exactly 50 heads? Why or why not? A. Yes, because the number of tosses is even, so if the coin is fair, half of the results should be heads. B. No, because the chance of heads or tails is the same, the chance of any number of heads is the same. C. No, there will be small deviations by chance, but if the coin is fair, the result...
Language: Python Write a program to simulate an experiment of tossing a fair coin 16 times...
Language: Python Write a program to simulate an experiment of tossing a fair coin 16 times and counting the number of heads. Repeat this experiment 10**5 times to obtain the number of heads for every 16 tosses; save the number of heads in a vector of size 10**5 (call it headCounts). You should be able to do this in 1-3 lines of numpy code. (Use np.random.uniform1 to generate a 2d array of 10**5 x 16 random numbers between 0 and...
Suppose you are asked to toss a coin 16 times and calculate the proportion of the...
Suppose you are asked to toss a coin 16 times and calculate the proportion of the tosses that were heads. a.    What shape would you expect this histogram to be and why? b.    Where you do expect the histogram to be centered? c.    How much variability would you expect among these proportions? d.    Explain why a Normal model should not be used here.
5. If you toss a coin 10 times, you got 8 head out of ten tosses....
5. If you toss a coin 10 times, you got 8 head out of ten tosses. What is the probability of this event if the coin is fair (P[X=8|Coin=normal], X is a random variable representing number of head out of ten tosses)? What is the probability of this event if the coin is fake( P[X=8|Coin=fake])?
To test the hypothesis that a coin is fair, you toss it 100 times. Your decision...
To test the hypothesis that a coin is fair, you toss it 100 times. Your decision rules allow you to accept the hypothesis only if you get between 40 and 60 tails in 100 tosses. What is the probability of committing Type II error when the actual probability of tails is 0.7?
java beginner level NO ARRAYS in program Flip a coin (Assignment) How many times in a...
java beginner level NO ARRAYS in program Flip a coin (Assignment) How many times in a row can you flip a coin and gets heads? Use the random number generator to simulate the flipping of the coin. 0 means heads, 1 means tails. Start a loop, flip it, if heads, count it and keep flipping. If tails, stop the loop. Display the number of times in a row that heads came up. Once this is working, wrap a while loop...
Suppose we toss a fair coin n = 1 million times and write down the outcomes:...
Suppose we toss a fair coin n = 1 million times and write down the outcomes: it gives a Heads-and-Tails-sequence of length n. Then we call an integer i unique, if the i, i + 1, i + 2, i + 3, . . . , i + 18th elements of the sequence are all Heads. That is, we have a block of 19 consecutive Heads starting with the ith element of the sequence. Let Y denote the number of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT