Here is the correct algorithm:
for (i = n - 1; i > 0; i--) exchange a[i] with a random element of 'a' at index from 0 to i inclusive
It is too late for me to change the assignment; thus you can use the original algorithm I stated.
But you can also use this one instead. This will yield a much better shuffling. And it's faster.
Sorry for the error.