Question: how to solve this please? Part 3: HHT or HTT? Suppose we have a fair coin, where the probability of heads (H) is 0.5 and
how to solve this please?
Part 3: HHT or HTT? Suppose we have a fair coin, where the probability of heads (H) is 0.5 and the probability of tails (T) is 0.5. We know from probability that if we flip the coin three times, any of the eight possible coin toss sequences is equally likely to appear. This problem concerns, rather than three coin flips, the situation where we flip coins until a certain coin toss sequence appears "Flip a coin until either HHT or HTT appears. Is one more likely to appear first? If so, which one and with what probability? Simulate this problem to estimate the probability that HHT appears first and the probability that HTT appears first. Question 3.0 In order to do the simulation, we need to generate coin flips. Write a function called generate flips that keep generating flips until either HTT or HHT appears. This function should return HTT or HHT, whichever appears first. 36]: def generate_flips) o: generate_flips()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
