I am currently reading Michael Soltys' Analysis of Algorithms (2nd Edition), and Problem 1.13 of the subsection titled Invariance reads:
Let $n$ be an odd number, and suppose that we have the set $\{1,2,\dots,2n\}$. We pick any two numbers $a$, $b$ in the set, delete them from the set, and replace them with $|{a-b}|$. Continue repeating this until just one number remains in the set; show that this remaining number must be odd.
However, I picked $n=3$ and performed the following.
- I start with $\{1,2,3,4,5,6\}$.
- I pick $1$ and $2$; I end up with $(\{1,2,3,4,5,6\}-\{1,2\})\cup\{|{1-2}|\}=\{1,3,4,5,6\}$.
- I pick $1$ and $6$; I end up with $\{3,4,5\}$.
- I pick $3$ and $5$; I end up with $\{2,4\}$.
- And finally, I pick $2$ and $4$; I end up with $\{2\}$.
Clearly, $2$ is not an odd number.
Is there something I misunderstood in my attempt?