Infinite series are challenging (even when you know it)! I describe some background before asking my question(s).
A programming assignment asked to use an abstraction called product
to verify the following approximation of $\pi$:
$$ \frac{\pi}{4}=\frac{2\cdot 4\cdot 4\cdot 6\cdot 6\cdot 8\cdot 8 \cdots}{3\cdot 3\cdot 5\cdot 5\cdot 7\cdot 7 \cdots}\tag{1}\label{eq1} $$
I, rather credulously, rearranged the series in \eqref{eq1} as:
$$
{\pi\over 4}=2\cdot \left(\frac{4\cdot 4}{3\cdot 3} \right)\cdot \left(\frac{6\cdot 6}{5\cdot 5} \right)\cdot \left(\frac{8\cdot 8}{7\cdot 7} \right)\cdots = 2\cdot\prod_{i=1}^{\infty} \left(\frac{2i+2}{2i+1} \right)^2
\tag{2}\label{eq2}
$$
Then I wrote the program (using $10$ terms of the form $\left(\frac{2i+2}{2i+1} \right)^2$ where $i$ goes from $1$ to $10$) only to realize that I had committed a blunder. My faithful program calculated ${\pi\over 4}$ as $17.675817$.
I then looked up Wallis Product on Wikipedia which defines it as: $$ {\pi\over \textbf{2}}= \left(\frac{2\cdot 2}{1\cdot 3} \right)\cdot \left(\frac{4\cdot 4}{3\cdot 5} \right)\cdot \left(\frac{6\cdot 6}{5\cdot 7} \right)\cdots = \prod_{n=1}^{\infty}\frac{4n^2}{4n^2-1} \tag{3}\label{eq3} $$
I removed the bug in my program by using Wallis Product as defined in \eqref{eq3}.
I am somewhat aware of the convergent tests of infinite series, but I guess I am not that familiar with their valid manipulations. Here are my questions based on this experience:
Exactly what disallows equation \eqref{eq2} as a rearrangement of \eqref{eq1}? Why aren't these two equations equivalent?
Why is \eqref{eq3} a valid rearrangement of \eqref{eq1} (if it is, that is)?