nowfound

Life & fun · January 14, 2012

AV

A visual explanation of Fisher–Yates shuffle

A visual explanation of Fisher–Yates shuffle launched on January 14, 2012 with 176 votes, #8 of 306 launches that month and more than 95% of that year's launches. The site was still online in September 2026, 14 years on.

Visit bost.ocks.org ↗Alternativestop 3% of January 2012

In plain words

This interactive visualization explains the Fisher–Yates shuffle algorithm, a method for randomizing the order of elements in a deck or list. It demonstrates how repeatedly selecting a random card from the remaining deck and setting it aside creates an unbiased shuffle, ensuring fair card games like Texas Hold 'em. The tool shows the algorithm's mechanics through visual diagrams, helping developers and others understand how to implement proper randomization in code without introducing bias.

written from the facts on this page · September 2026

From the sources

If you want to play a game of Texas Hold ‘em with friends, you should shuffle the deck first to randomize the order and insure a fair game. But how? A quick way of seeing an algorithm’s bias is a matrix diagram . A simple but effective way of doing this is to pull a random card from the deck repeatedly and set it aside, incrementally building a new stack. As long as you pick each remaining card from the deck with equal probability, you’ll have a perfectly-unbiased random stack when you’re done: But let’s say instead of a physical deck of cards, you wanted to write code to perform this same task with an in-memory array of n elements. Sounds straightforward (in part), but how would you pick a…from bost.ocks.org

Does a similar job

all alternatives →

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, January 2012

the whole month →
  • WM

    Life & fun · 2012 · mongout.com

  • S

    Life & fun · 2012 · johnpolacek.github.com

  • ålenkå files. Full list of files for ålenkå

    Dev tools · 2012 · sourceforge.net

  • IM

    Life & fun · 2012 · politicianmarket.com

  • HI

    I have been taking Andrew Ng's Machine Learning course. The lecture module on Neural Networks ends with an intriguing video of the ALVINN autonomous car driving itself along normal roads at CMU in the mid 90s. I was inspired by that video to see what I could build myself. A link to my incomplete write up was posted a couple of weeks ago (ouch!) but I finally finished it and open sourced the code tonight (so you can build your own self driving car). What do you think? http://blog.davidsingleton.org/nnrccar https://github.com/dps/nnrccar

    AI · 2012 · blog.davidsingleton.org

  • CC

    Life & fun · 2012 · carsabi.com