http://www.perlmonks.org?node_id=441099


in reply to Re: A bad shuffle
in thread A bad shuffle

Actually, the original "naive_shuffle" is not a Fisher-Yates shuffle, it is a "naive shuffle" implementation. The OP's analysis is correct.

His final algorithm, however, is a correct Fisher-Yates implementation.