Comment

Comment by cypherpunks01

It's always been pretty mind-blowing to me that you can store over 225 bits of information just in an ordering of one deck of cards. A standard way to store data in this way is a factoradic encoding like Lehmer coding:

https://en.wikipedia.org/wiki/Lehmer_code

The python library 'permutation' has some functionality around this that's fun to play with:

https://permutation.readthedocs.io/en/stable/#permutation.Pe...

I found new joy in shuffling a deck of cards, after learning that every (proper) shuffle that every human's ever done has returned a unique deck that nobody's ever held before.

edit: I just remembered a guy who made a javascript demo that encodes small strings into a card deck order: https://jerde.net/peter/cards/cards.html (explanation page linked)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton