Discrete Conditional Probability: Determine Pr(A | B) for bit strings

367 Views Asked by At

Question: You are given a uniformly random bitstring of length five. Define the events:

A = "the bitstring contains at most four $1$'s",

B = "the bitstring contains an odd number of $1$'s".

What is $ \operatorname{Pr}(A | B)$?

Answer: $15/16$

Attempt: I used the conditional probability formula of $\operatorname{Pr}(A \cap B) / \operatorname{Pr}(B)$

I found $\operatorname{Pr}(A) = 1/(2 \times 4) = 1/16$ And for $\operatorname{Pr}(B) = 3/10$

$\operatorname{Pr}(A \cap B) = 3/10 \times 1/8$ (since need probability of odd number of 1s and at most four 1's)

$\operatorname{Pr}(A | B) = (3/10 \times 1/8) / 3/10 = 1/8$

1

There are 1 best solutions below

0
On BEST ANSWER

I'm afraid you are very confused about this. You are correct in your formula for the conditional probabilities, but your computation of the numerator and denominator are all wrong.

First of all, there are $2^5=32$ possible bit strings, and they are all equally likely, so the probability of any given string is ${1\over32}.$

For the probability of at most four $1$s, it's easiest to look at the complement. There is only one bit string that does not have at most four $1$s, namely the one with five $1$s, so Pr(A)$={31\over32}.$

Now for the probability of B, we have to count the bit strings with an odd number of $1$s, so that the strings with exactly one, three, or five $1$s. There are $5$ with one $1$, ${5\choose3}=10$ with three $1$s, and one with five $1$s or $16$ in all, so Pr(B)$={16\over32}=\frac12.$ All but the last have at most fours $1$s, so that Pr($A\cap B)={15\over 32},$ and we get the answer in the book by division.