TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Storing binary data in playing cards (2014)

77 pointsby vmooreabout 1 year ago

10 comments

cypherpunks01about 1 year ago
It&#x27;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:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lehmer_code" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lehmer_code</a><p>The python library &#x27;permutation&#x27; has some functionality around this that&#x27;s fun to play with:<p><a href="https:&#x2F;&#x2F;permutation.readthedocs.io&#x2F;en&#x2F;stable&#x2F;#permutation.Permutation.lehmer" rel="nofollow">https:&#x2F;&#x2F;permutation.readthedocs.io&#x2F;en&#x2F;stable&#x2F;#permutation.Pe...</a><p>I found new joy in shuffling a deck of cards, after learning that every (proper) shuffle that every human&#x27;s ever done has returned a unique deck that nobody&#x27;s ever held before.<p>edit: I just remembered a guy who made a javascript demo that encodes small strings into a card deck order: <a href="https:&#x2F;&#x2F;jerde.net&#x2F;peter&#x2F;cards&#x2F;cards.html" rel="nofollow">https:&#x2F;&#x2F;jerde.net&#x2F;peter&#x2F;cards&#x2F;cards.html</a> (explanation page linked)
评论 #39587381 未加载
评论 #39586745 未加载
satori99about 1 year ago
This reminds me of Pontifex, the playing card based cipher designed by Bruce Schneier for Neal Stephenson&#x27;s <i>Cryptonomicon</i>.<p><a href="https:&#x2F;&#x2F;www.schneier.com&#x2F;academic&#x2F;solitaire&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.schneier.com&#x2F;academic&#x2F;solitaire&#x2F;</a>
评论 #39585946 未加载
qsortabout 1 year ago
I don&#x27;t understand the claim that this is more efficient, it&#x27;s trivial to find a method that&#x27;s information-theoretically optimal: choose an arbitrary order for the cards, and encode log(52!)&#x2F;log(2) bits as the lexicographic order of the permutation, doing a binary search each time.<p>Shouldn&#x27;t be too hard to do even with pen and paper since the 2-adic eval of 52! is large.
评论 #39586261 未加载
评论 #39586321 未加载
评论 #39586256 未加载
评论 #39584633 未加载
jvandonselabout 1 year ago
They seem to be ignoring another useful aspect of a deck of cards. Each card could be placed face-up or face-down in the deck.
评论 #39585274 未加载
styfleabout 1 year ago
This reminded me of the De Bruijn Sequence card trick.<p><a href="https:&#x2F;&#x2F;sites.math.washington.edu&#x2F;~billey&#x2F;classes&#x2F;562.winter.2018&#x2F;problem.sets&#x2F;debruijn.trick.pdf" rel="nofollow">https:&#x2F;&#x2F;sites.math.washington.edu&#x2F;~billey&#x2F;classes&#x2F;562.winter...</a>
peterburkimsherabout 1 year ago
This reminded me of T-Codes, a form of variable-length self-synchronising codes for communicating based on letter and word frequency.<p><a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20180329104930&#x2F;http:&#x2F;&#x2F;tcode.auckland.ac.nz&#x2F;~mark&#x2F;T-codes:%20Intro.html" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20180329104930&#x2F;http:&#x2F;&#x2F;tcode.auck...</a>
dcowabout 1 year ago
This is cool (especially the encryption), but certain sequences of bits can’t be encoded. If you have n items left in the sequence then you cannot encode a run of n zeros. So it’s not a general encoding scheme.
评论 #39602224 未加载
naragabout 1 year ago
First thing that came to mind: <a href="https:&#x2F;&#x2F;www.imdb.com&#x2F;title&#x2F;tt0060581" rel="nofollow">https:&#x2F;&#x2F;www.imdb.com&#x2F;title&#x2F;tt0060581</a><p>Of course that information would be redundant.
thseusabout 1 year ago
There is also the possibility to use Braille to encode binary data in cards, even though it was designed mainly for reading and writing.
082349872349872about 1 year ago
see also <a href="https:&#x2F;&#x2F;www.cabinetmagazine.org&#x2F;issues&#x2F;40&#x2F;sherman.php" rel="nofollow">https:&#x2F;&#x2F;www.cabinetmagazine.org&#x2F;issues&#x2F;40&#x2F;sherman.php</a>