Question

In: Math

A fair coin is tossed until the first head occurs. Do this experiment T = 10;...

A fair coin is tossed until the first head occurs. Do this experiment T = 10; 100; 1,000; 10,000 times in R, and plot the relative frequencies of this occurring at the ith toss, for suitable values of i. Compare this plot to the pmf that should govern such an experiment. Show that they converge as T increases. What is the expected number of tosses required? For each value of T, what is the sample average of the number of tosses required?

Solutions

Expert Solution

A fair coin is tossed until the first head occurs. Let X be the number of tosses required. Then X ~ Geometric(p = 0.5).

We will use rgeom function in R to generate the samples for T = 10; 100; 1,000; 10,000

For T = 10, run the below R code to plot the relative frequencies and compare this plot to the pmf of Geometric distribution.

x1 = rgeom(10, 0.5)

hist(x1, probability = TRUE, xlab = "X", main = "Relative frequencies")

k = c(0:14)

lines(k, 0.5^k, lwd = 2, col = "blue") # To plot pmf P(X = k) = 0.5^k

For T = 100, run the below R code to plot the relative frequencies and compare this plot to the pmf of Geometric distribution.

x2 = rgeom(100, 0.5)

hist(x2, probability = TRUE, xlab = "X", main = "Relative frequencies")

k = c(0:14)

lines(k, 0.5^k, lwd = 2, col = "blue") # To plot pmf P(X = k) = 0.5^k

For T = 1000, run the below R code to plot the relative frequencies and compare this plot to the pmf of Geometric distribution.

x3 = rgeom(1000, 0.5)

hist(x3, probability = TRUE, xlab = "X", main = "Relative frequencies")

k = c(0:14)

lines(k, 0.5^k, lwd = 2, col = "blue") # To plot pmf P(X = k) = 0.5^k

For T = 10000, run the below R code to plot the relative frequencies and compare this plot to the pmf of Geometric distribution.

x4 = rgeom(10000, 0.5)

hist(x4, probability = TRUE, xlab = "X", main = "Relative frequencies")

k = c(0:14)

lines(k, 0.5^k, lwd = 2, col = "blue") # To plot pmf P(X = k) = 0.5^k

We see that as T increases, the PMF (shown in blue line) is more approaching towards the relative frequencies plot. Thus, hey converge as T increases.

From Geometric distribution,  expected number of tosses required = 1/p = 1/0.5 = 2

Sample average of the number of tosses required for T = 10 is 0.7

mean(x1)

Sample average of the number of tosses required for T = 100 is 0.78

mean(x2)

Sample average of the number of tosses required for T = 1000 is 1.031

mean(x3)

Sample average of the number of tosses required for T = 10000 is 1.0079

mean(x4)


Related Solutions

A fair coin is tossed until a head appears. Given that the first head appeared on...
A fair coin is tossed until a head appears. Given that the first head appeared on an even-numbered toss, find the probability that it occurred on the second or the fourth toss.
An experiment is to flip a coin until a head appears for the first time. Assume...
An experiment is to flip a coin until a head appears for the first time. Assume the coin may be biased, i.e., assume that the probability the coin turns up heads on a flip is a constant p (0 < p < 1). Let X be the random variable that counts the number of flips needed to see the first head. (a) Let k ≥ 1 be an integer. Compute the probability mass function (pmf) p(k) = P(X = k)....
A fair coin will be tossed three times. (a) Indicating a head by H and a...
A fair coin will be tossed three times. (a) Indicating a head by H and a tail by T write down the outcome space. (b) What is the probability that on the first toss the outcome with a tail? (c) What is the probability of obtaining exactly two heads from the three coin tosses? (d) What is the probability that the first toss gives a tail and exactly two heads are obtained from the three coin tosses? Are the outcomes...
1. A fair coin is tossed twice. Consider the following events: a) A = a head...
1. A fair coin is tossed twice. Consider the following events: a) A = a head on the first toss; b) B = a tail on the first toss; c) C = a tail on the second toss; d) D = a head on the second toss. Are events A and B mutually exclusive ? WHY or WHY NOT ? Are events C and D Independent ? WHY or WHY NOT ? 2. Suppose there are 3 similar boxes. Box...
A coin has a probability of 1/4 for head, and is repeatedly tossed until we throw...
A coin has a probability of 1/4 for head, and is repeatedly tossed until we throw head. The successive results of the toss are independent of each other. What is the probability that the first time we throw head after an odd number of toss? Hint: Use the law of total probability and consider the event that the first toss is head is, and her complement, as conditioning events. Correct answer: 3/7
1. A coin is tossed 100 times, each resulting in a tail (T) or a head...
1. A coin is tossed 100 times, each resulting in a tail (T) or a head (H). If a coin results in a head, Roy have to pay Slim 500$. If the coin results in a tail, Slim have to pay Roy 500$. What is the probability that Slim comes out ahead more than $20,000?
A fair coin is flipped until a head appears. Let the number of flips required be...
A fair coin is flipped until a head appears. Let the number of flips required be denoted N (the head appears on the ,\1th flip). Assu1ne the flips are independent. Let the o utcon1es be denoted by k fork= 1,2,3, . ... The event {N = k} 1neans exactly k flips are required. The event {,v;;, k} n1eans at least k flips are required. a. How n1any o utcon1es are there? b. What is Pr[N = k] (i.e., the probability...
The second game You toss a fair coin until Head appears and you are paid the...
The second game You toss a fair coin until Head appears and you are paid the number of Tails received, for example, if we obtain TTTH you get 3 rubles. How much do you agree to pay the host for the game? The third and fourth games We have a deck of 52 cards. a) We randomly choose 5 cards (without repetition) and get 5 rubles for any ace or king chosen; b) We randomly choose 5 cards (with repetition,...
Suppose a fair coin is tossed 3 times. Let E be the event that the first...
Suppose a fair coin is tossed 3 times. Let E be the event that the first toss is a head and let Fk be the event that there are exactly k heads (0 ≤ k ≤ 3). For what values of k are E and Fk independent?
Suppose a fair coin is tossed 3 times. Let E be the event that the first...
Suppose a fair coin is tossed 3 times. Let E be the event that the first toss is a head and let Fk be the event that there are exactly k heads (0 ≤ k ≤ 3). For what values of k are E and Fk independent?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT