What's wrong with the following shuffle algorithm?
This approach cannot work, for the following simple reason. The probability to obtain any permutation is of the form $A/n^n$, for integer $A$. However, we need it to be $1/n!$, so we need $A = n^n/n!$. Unfortunately, for $n \geq 3$ this is not an integer.

One can still ask why we might expect this algorithm to work, and where is the gap between our intuition and reality.
After the $i$'th step of the algorithm, $A[i]$ is a uniformly random element. So if we randomize $A[0]$, then $A[1]$, then $A[2]$, and so on until $A[n-1]$, won't we get a random permutation?
While it is true that $A[n-1]$ will be completely random, this is not the case for other entries. Indeed, let us try to analyze the distribution of $A[0]$ as the algorithm progresses.
After the first iteration, $A[0]$ is uniformly random.
After the second iteration, $A[1]$ is uniformly random, but this comes at a cost: we might have swapped $A[0]$ and $A[1]$. This means that $A[0]$ will have a slight preference towards $1$ (the original value of $A[1]$) and $0$ (the value of $A[1]$ in case it was swapped with $A[0]$).
Quantitatively, after the second iteration, if $i &gt; 1$ then
$$ \Pr[A[0] = i] = \frac{1}{n} \cdot \left(1 - \frac{1}{n}\right) = \frac{1}{n} - \frac{1}{n^2}, $$
since this happens when $A[0]$ was swapped with $A[i]$, and $A[1]$ was not swapped with $A[0]$. Similarly,
$$ \Pr[A[0] = 0] = \frac{1}{n} \cdot \left(1 - \frac{1}{n}\right) + \frac{1}{n} \cdot \frac{1}{n} = \frac{1}{n}, $$
accounting for the additionally possibility in which $A[1]$ is swapped with $A[0]$ in the second round. Finally,
$$ \Pr[A[0] = 1] = \frac{1}{n} \cdot \left(1 - \frac{1}{n}\right) + \left(1 - \frac{1}{n}\right) \cdot \frac{1}{n} = \frac{2}{n} - \frac{2}{n^2}, $$
accounting for the possibility that $A[0]$ was not swapped with $A[1]$, but $A[1]$ was swapped with $A[0]$.
Similar phenomena persist throughout the algorithm.