I am reading Knuth's "The Art of Computer Programming" Volume 4 Fascicle 2A.
Needless to say I am pretty poor in Mathematics and I need help understanding some of the proofs. If anyone has any suggestions on how to understand these problems please let me know.
I am on Page 3 Section 7.2.1.1-:
Another way to define the sequence $\Gamma_n = g(0),g(1),..g(2^n-1)$ is to give explicit formula for its individual elements. [...]
When $k=2^n+r$, where $0\leq r < 2^n$, relation (5) tells us that $g(k)$ is equal to $2^n+g(2^n-1-r)$. Therefore we can prove by induction on $n$ that the integer $k$ whose binary representation is $(\ldots b_2b_1b_0)_2$ has a Gray binary equivalent $g(k)$ with the representation $(\ldots a_2a_1a_0)_2$ where $$a_j = b_j \oplus b_{j+1}\quad\text{for $j\geq0$}$$
[...] by inverting the system of equations [we get]:$$b_j=a_j \oplus a_{j+1} \oplus a_{j+2} \oplus\cdots \quad\text{for $j\geq0$} $$
Okay now my questions are as follows-:
- Why is $k=2^n+r$ ? What is $r$ ? If $k$ representts the nth term for which the Gray code is calculated then why is it $2^n+r$ ? Isn't that more than the number of possible combinations ?
- Can someone tell me the induction proof that is done to get the formula for the Gray code from binary ? That is, what is the intuition behind the XOR ing two binary digits to get one gray digit ?
- It says that if we invert the system of equations we get back the binary from the Gray Code, but what I don't understand is that only two binary digits are required to get one Gray Code digit, but how come when obtaining binary from Gray we have to XOR all digits of Gray Code ? How is that inverting the equations ?
Also if anyone has any advice on how make reading this book easy, please let me know.