# How to turn a shuffled deck of card into bits

Suppose I fairly shuffle a deck of 52 playing cards, and I want to generate some bits. You could look at each pair of cards, see which is higher or lower, and output either a 0 or 1. That’s 26 independent (you can convince yourself) and fair bits, guaranteed. If you were a computer, you could encode the permutation as a number between 0 and 2^225.58, and use standard methods to get 220+ expected bits out–but I’m not a human, so I can’t do that.

What’s a good way to generate lots of independent, fair bits using a single shuffled deck of cards as a human? Points for both guaranteed bits and expected bits.

Sorry for the kind of “wiki” nature of this question.

MathOverflow Asked by Zachary Vance on January 24, 2021

Staying with your pairs, you can get more bits that are pretty independent by using characteristics of playing cards.

• Your Bit 1: 0 increasing order, 1 decreasing order
• Bits 2 & 3: Suit of lower card (say 00 club, 01 diamond, 10 heart, 11 spade)
• Bit 4: 0 if the lower card is even (2, 4, 6, 8, 10, Q), 1 if odd (A, 3, 5, 7, 9, J, K)*

Notes: Towards the end, knowing suit and parity data for the lower cards of previous pairs could compromise independence, so stop somewhere before 104 bits. *Concerning Bit 4, there are more odds, but the lower card is a king only when the two cards are both kings--since you probably won't be using all pairs anyway, skip such a pair.

Depending on the "memory" of the human user, you could go from the 2 permutations of pairs (increasing or decreasing) to the 6 permutations applied to triples or the 24 permutations applied to quadruples along with more complicated patterns for suits and ranks. These are all somewhat imprecise on independence, but in a hopefully small enough way that could be quantified.

Answered by Brian Hopkins on January 24, 2021

## Related Questions

### Is there a source in which Demazure’s function $p$ defined in SGA3, exp. XXI, is calculated?

0  Asked on December 15, 2021 by inkspot

### Potential p-norm on tuples of operators

1  Asked on December 15, 2021 by chris-ramsey

### Understanding a quip from Gian-Carlo Rota

5  Asked on December 13, 2021 by william-stagner

### What is Chemlambda? In which ways could it be interesting for a mathematician?

1  Asked on December 13, 2021

### Degree inequality of a polynomial map distinguishing hyperplanes

1  Asked on December 13, 2021

### The inconsistency of Graham Arithmetics plus $forall n, n < g_{64}$

2  Asked on December 13, 2021 by mirco-a-mannucci

### Subgraph induced by negative cycles detected by Bellman-Ford algorithm

0  Asked on December 13, 2021

### How to obtain matrix from summation inverse equation

1  Asked on December 13, 2021 by jdoe2

### Is $arcsin(1/4) / pi$ irrational?

3  Asked on December 13, 2021 by ikp

### A mutliplication for distributive lattices via rowmotion

0  Asked on December 13, 2021

### Tensor product of unit and co-unit in a closed compact category

1  Asked on December 13, 2021 by andi-bauer

### Finite subgroups of $SL_2(mathbb{C})$ arising as a semi-direct product

1  Asked on December 13, 2021 by user45397

### Uniqueness of solutions of Young differential equations

0  Asked on December 13, 2021

### Differentiation under the integral sign for a $L^1$-valued function (shape derivative)

0  Asked on December 13, 2021

### Digraphs with exactly one Eulerian tour

2  Asked on December 13, 2021

### Exactness of completed tensor product of nuclear spaces

1  Asked on December 11, 2021

### An integral with respect to the Haar measure on a unitary group

1  Asked on December 11, 2021

### Best known upper bound for Dedekind zeta function on line $sigma=1$ in the $t$ aspect

0  Asked on December 11, 2021

### Regularity with respect to the Lebesgue measure through dimensions

0  Asked on December 11, 2021 by titouan-vayer

### Reference request on Gentzen’s proof of the consistency of PA

1  Asked on December 11, 2021