PLEASE EXPLAIN ? Consider the following recursive algorithm Two TAILS, which tak
ID: 3151459 • Letter: P
Question
PLEASE EXPLAIN ?
Consider the following recursive algorithm Two TAILS, which takes as input a positive integer k: Algorithm Two Tails(A;)://all coin flips made are mutually independent flip a fair coin twice; if the coin came up heads exactly twice then return 2^k else Two TAILS(k + 1) endif You run algorithm Two Tails(1), i.e., with k = 1. Define the random variable X to be the value of the output of this algorithm. Let k Greaterthanorequalto 1 be an integer. What is Pr(X = 2^k)? (1/4)^k middot 3/4 (1/4)^k -1 middot 3/4 (3/4)^k middot 1/4 (3/4)^k - 1 middot 1/4Explanation / Answer
Answer : D. (3/4)^(k-1) . 1/4
As it will keep on calling recursively till (k-1) times with probability 3/4.
And finally return once with probability 1/4.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.