Please explain briefly Consider the following recursive algo

Please explain briefly?

Consider the following recursive algorithm TiireeHeadsOrThreeTails, which takes as input a positive integer k: Algorithm ThreeHeadsOrThreeTails(A:): // all coin flips made are mutually independent flip a fair coin three times; if the result is HHH or TTT then return k else ThreeHeadsOrThreeTails(A; + 1) endif You run algorithm ThreeHeadsOrThreeTails(I), i.e., with k = Define the random variable X to be the value of the output of this algorithm. What is the expected value of XI

Solution

When a fair coin is tossed 3 times, sample space would be

having 2 cube = 8 events.

P(HHH, TTT) = 2/8 = 0.25

Prob for other outcomes = 0.75

Hence this is binomial with expected value = np

= 0.25 n where n is the no of trials.

Please explain briefly? Consider the following recursive algorithm TiireeHeadsOrThreeTails, which takes as input a positive integer k: Algorithm ThreeHeadsOrThr

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site