Skip to content
Related Articles

Related Articles

GATE | GATE-CS-2005 | Question 52

Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

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
Related Articles

Start Your Coding Journey Now!