Live data from Hacker News

The Fisher-Yates shuffle is backward

possiblywrong.wordpress.com

21–23 of 23 posts

Re: The Fisher-Yates shuffle is backward

#23

That’s funny. I’ve always done it the forwards way. I didn’t even realise that wasn’t the usual way. I suppose one of the benefits of having a poor memory is that one sometimes improves things in the course of rederiving them from an imperfect recollection.

Same, I've implemented it a number of times and always done it forward, and can't recall ever seeing it backwards. I've looked at the wikipedia page for it more than once too, which, as the article mentions, shows it backwards. Maybe it's because it's so easy to prove to yourself that Fisher-Yates generates every possible combination with the same probability[1], and so forwards or backwards just doesn't register as…

On further inspection the one I'm used to is forward-mirrored, which is exactly the same as backward but the opposite direction.
Post reply on HN