GATE | GATE-CS-2005 | Question 52

A random bit string of length n is constructed by tossing a fair coin n times and setting a bit to 0 or 1 depending on outcomes head and tail, respectively. The probability that two such randomly generated strings are not identical is
(A) 1/2n
(B) 1 – (1/n)
(C) (1/n!)
(D) 1 – (1/2n)


Answer: (D)

Explanation: <!–

The probability that the two strings are identical is 
(1/2) * (1/2) * ..... * (1/2) (n times) which is 1/2n

The probability for not identical is 1 - (1/2n)

–>

let us suppose if outcome is head =>0, tail => 1
Since the coin is fare, P(H) = P(T) = 1⁄2
Length of the string is => n

P(X) = both the strings should not be identical

P(-X) = both are not identical = 1 – P(X)



If both the strings are equal, every character should be same w.r.t its positions

i.e P(X) = 1/2*1/2*…….(n times) = (1/2)^n

P(-X) = 1 – (1/2)^n

This solution is contributed by Anil Saikrishna Devarasetty

Quiz of this Question

My Personal Notes arrow_drop_up

Recommended Posts:

    Article Tags :

    Be the First to upvote.


    Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.