- Recall the parity-bit error detecting method, which uses the function f : B8 → B9 , where B = {0, 1}, defined by f(b1, b2, . . . , b8) = (b1, b2, . . . , b8, b9) where b9 is the sum of the previous 8 bits modulo 2:
$b_9 = 0$ if $(b_1+b_2...b_8)$ is even
$b_9 = 1$ if $(b_1+b_2...b_8)$ is odd
(a) Is f injective? Justify your answer.
(b) Is f surjective? Justify your answer.
I am having trouble trying to prove if f is injective/surjective. I don't know how to approach the question. Mostly, i'm really confused at $B^8$ where B = {0,1} as I don't know how to raise the set $\{0,1\}$ to the power of $8$
$B^8$ is the Cartesian product of eight copies of $B$: $B \times B \times \dots \times B$. It is the set of all sequences $(b_1, \dots, b_8)$ with all $b_i \in B$.
So, $f$ is a function that takes as argument a sequence of $8$ bits and produces a sequence of $9$ bits. The first $8$ bits of the result are the same as the argument and the $9$th bit is defined in the question.
(Hint: the way the $9$th bit is defined is irrelevant for both (a) and (b)).