In a binary code of length n
p(exactly i errors in specified positions)=$t^i (1-t)^{n-i}$.
I have an example where $C=\{000,111\}$, the binary repetition code of length 3.
Suppose 111 is transmitted.
Then the received words will be decoded as 111 are ${111,011,101,110}$
Why does P$($decoding as $111$ $)$= $(1-t)^3+3t(1-t)^2$ ?
P(decoded as 111 ) = P(111 transmitted) + P(one zero transmitted)
Assuming probability of transmitting zero is $t$ we have
P(111 transmitted) = $ (1-t)^3$
P(one zero transmitted) = ${3}\choose{1}$ $ t (1-t)^2 $