Came across this problem, and while i know the correct answer, I cannot seem to rationalize it.
Given 2 bit strings that are generated randomly , where each bit is either 0 or 1 (eg 001010101010). What is the probability that the bit at a specific place will equal the bit in the same place in the other string?
Now, the correct answer is noticing that there are only four possible combinations for this; 00, 01, 10, 11 , where only two of them lead the numbers being the same. Thus the answer is 1/2
However, the way that I think about this, is to say, the probability that the bit in string 1 will be a certain number is 1/2, the probability that the bit in the other string will be 1/2 , so 1/4.
Or using the formula , two random integers are equal in a range [m,n]
1/(n-m+1)*(n-m+1) = 1/(2)(2) = 1/4
Can someone help me rationalize this
Whatever the value of the bit in the first number, the corresponding bit in the other number is either the same or different, with equal probability. In other words, the probability is $\frac12$. The probability of all bits being the same in two $n$-bit numbers is therefore $(\frac12)^n$. This should make sense because there are $2^n$ such numbers; fixing one, the second has a $\frac1{2^n}$ chance of being the same.
That's true, but you're accounting for only one of two possibilities. You've counted the probability of both bits being $0$, say. The probability of both being $1$ is also $\frac14$, so the overall probability that the bits are identical is $\frac14+\frac14=\frac12$, which agrees with my first paragraph.