Consider a binary code with 5 bits (0 or 1) in each code word. An example of a code word is 01010. In each code word, a bit is a zero with probability 0.8, independent of any other bit.
(a) What is the probability of the code word 00111?
(b) What is the probability that a code word contains exactly three ones?
The Correct Answer and Explanation is:
(a) What is the probability of the code word 00111?
Each bit is a 0 with probability 0.8 and a 1 with probability 0.2.
The code word 00111 has two 0s and three 1s.
So, the probability of this specific code word is: P(00111)=(0.8)2×(0.2)3=0.64×0.008=0.00512P(00111) = (0.8)^2 \times (0.2)^3 = 0.64 \times 0.008 = 0.00512
Answer: 0.00512
(b) What is the probability that a code word contains exactly three ones?
To find this, we need to compute the probability that any 5-bit code word has exactly three 1s (and thus, two 0s). Since the bits are independent, we use the binomial distribution.
The formula for the probability of exactly kk successes (1s) in nn independent trials (bits), where each success has probability pp, is: P(X=k)=(nk)pk(1−p)n−kP(X = k) = \binom{n}{k} p^k (1 – p)^{n – k}
Here:
- n=5n = 5 (number of bits),
- k=3k = 3 (we want exactly 3 ones),
- p=0.2p = 0.2 (probability a bit is 1),
- 1−p=0.81 – p = 0.8 (probability a bit is 0).
So, P(exactly 3 ones)=(53)(0.2)3(0.8)2=10×0.008×0.64=10×0.00512=0.0512P(\text{exactly 3 ones}) = \binom{5}{3} (0.2)^3 (0.8)^2 = 10 \times 0.008 \times 0.64 = 10 \times 0.00512 = 0.0512
Answer: 0.0512
Explanation
In binary coding, each code word is a fixed-length sequence of bits (0s and 1s). In this problem, we’re given that each of the 5 bits in a code word independently takes the value 0 with a probability of 0.8 and 1 with a probability of 0.2.
Part (a): Specific Code Word Probability
To find the probability of a specific code word like “00111”, we multiply the probabilities of each bit occurring in that exact position. Since independence is assumed, the joint probability is simply the product:
- First two bits are 0s: 0.8×0.80.8 \times 0.8
- Next three bits are 1s: 0.2×0.2×0.20.2 \times 0.2 \times 0.2
So, P(00111)=0.82×0.23=0.00512P(00111) = 0.8^2 \times 0.2^3 = 0.00512
Part (b): Probability of Exactly Three Ones
To calculate the probability that any 5-bit code word has exactly 3 ones (regardless of position), we use the binomial distribution. The binomial coefficient (53)=10\binom{5}{3} = 10 tells us how many different code words have exactly 3 ones. Each of these combinations has the same probability: 0.23×0.820.2^3 \times 0.8^2 because the bits are independent.
So, the total probability is: 10×0.008×0.64=0.051210 \times 0.008 \times 0.64 = 0.0512
This problem illustrates how probability theory and binomial distribution help analyze random patterns in binary data, which has applications in error detection, data compression, and coding theory.
