I'm stuck at homework task I'm working on. I would really appreciate some help.
Here is the task:
Let $f$ be a function on binary numbers defined recursively as follows.
- $f(0) = 1$ and $f(1) = 0$
- $f(b0) = f(b)1$ , where $b$ is a binary number
- $f(b1) = f(b)0$, where $b$ is a binary number
The following is a proof by induction that $f(f(b)) = b$ for all binary numbers $b$. Find out what should be in the empty boxes below.
Basic-step. It is the $1_____$ which holds for $b = 0$ and $b = 1$ By inserting $0$ for $b$, we get $f(f(0)) = 0$ The following calculation shows that this is true.
$f(f(0)) = f(1)$ at point $1$ in the definition of $f$,
$= 0$ at point $1$ in the definition of $f$
By inserting $1$ for $b$, we get $f(f(1)) = 1$. The following calculation shows that this is true.
$f (f (1)) = f (0)$ at point $1$ in the definition of $f$
= $1$ at point $1$ in the definition of $f$
$2_____$*step*. Assume that the statement holds for a binary number $b$, that is, $f(f(b)) = b$ which is $3_____$, and from this, we must show that the $4_____$ holds for a binary number $bx$, that is $f(f(bx))$ = $5_____$, where $x$ is either $0$ or $1$ We have two cases, one for $x = 0$ and one for $x = 1$
If $x = 0$ we get the following.
- $f(f(b0)) = f(f(b)1)$ at $6_____$ in the definition of $f$
- $= f(f(b))0$ at point $3$ in the definition of $f$
- $= b0$ by induction hypothesis
If $x = 1$, we get the following-
- $f(f(b1)) =$ $f$($7_____$) at $8_____$ in the definition of $f$
- $= f(f(b))1$ at point $2$ in the definition of $f$
- $= b1$ by induction hypothesis
At $9_____$ it follows that $10_____$ for all binary numbers $b$.
Edit:
I tried solving this task, would appreciate if someone could check if I've done this correctly:
$f(f(b))$
Induction-step
$f(b)$
$f(f(bx))$
$bx$
point $2$
$f(f(b)0)$
point $3$
induction
assumption is true
Thanks a lot.
I will quote dfeuer, because it is pity that this remains only in the comments: