Lecture 59 · Mathematics

Build the 124-card encoder

Video in production

This lecture is still face down. Its script is written; filming and animation are under way.

Meanwhile, read the outline

What you will learn

Construct and prove an explicit 124-card encoder using modular selection, label compression and permutation rank.

Before this lecture

In this lecture

An outline of the lecture, scene by scene, with the statements that appear on screen. It follows the draft script, so details may change in production.

  1. Select the hidden card by a complete modular rule

    • Sorted hand 23,27,59,87,93
    • 289≡4 mod 5→hide fourth card 87
    • Zero remainder selects position 5
  2. Define compression with original and new labels distinct

    • Delete four visible labels
    • h′=h−(m−1)
    • Example 87→compressed 84
  3. Derive residue and enumerate exactly 24 candidates

    • h+s≡m mod 5
    • h′≡1−s mod 5
    • 4,9,…119: 24 candidates; 84 is 17 th
  4. Encode candidate index by four-card lexicographic permutation

    • Candidate 17→permutation 3412
    • 12+4=16 skipped rows
    • Message 59,93,23,27
  5. Decode complete worked message and invert compression safely

    • Received 3412→index 17
    • 4+5×16=84 compressed
    • Restore gaps→87 original
  6. Prove both membership and sufficiency for arbitrary hand

    • Actual hidden card is in candidate list
    • Permutation recovers its unique index
    • Decompression returns the original label
  7. Specify guided encoder with exact boundary checks

    • Zero residue selects fifth card
    • Candidate and permutation indices are one-based
    • Independent decode must match hidden label
  8. Retrieve compact recipe and prepare live finale

    • Sort/select; delete; residue; rank; permute
    • Use one consistent convention
    • Next: perform the 124-card protocol

Companion interactive

Planned

Encode any five labels and independently decode the ordered message.

The interactive for this lecture is being built and will appear here.

Notes

Written notes for this lecture will appear here.

Sources

How these sources were used
  • Norman Do, “A Mathemagical Card Trick”: Exact one-based m≡sum convention and compressed-label residue 1−s used here.
  • Shai Simonson and Tara S. Holm, “Using a Card Trick to Teach Discrete Mathematics”: Related explicit construction uses shifted m=(sum mod 5)+1 convention. Do not mix its−s compressed residue with our 1−s convention; examples independently re computed.