Question: Show clearly the steps and workings. Consider the following recursive algorithm TWOTAILS, which takes as input a positive integer k: Algorithm TWOTAILS(A):/il coin flips made
Consider the following recursive algorithm TWOTAILS, which takes as input a positive integer k: Algorithm TWOTAILS(A):/il coin flips made arc mutually independent flip a fair coin twice: if the coin came up heads exactly twice then return 2* else TWOTAILS(k + 1) endif You run algorithm TWOTAILS(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)? (a) (1/4)^k middot 3/4 (b) (1/4)^k-1 middot 3/4 (c) (3/4)^k middot 1/4 (d) (3/4)^k-1 middot 1/4 You repeatedly, and independently, roll two fair dice, until the sum of the values of the two dice is equal to 12. Define the random variable X to be the number of times you roll the pair of dice. What is the expected value of X? (a) 30 (b) 30 (c) 20 (d) 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
