Lecture 12 · Mathematics

Design a Hummer routine that survives testing

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

Design and audit a new Hummer-style colour-separation routine by stating its preparation, move family, invariant and finish.

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. Write a routine specification before testing it

    • Promise: separate colours by direction
    • Preparation: alternating colours, all down
    • Moves: cuts and top-two packet turns
    • Finish: reverse even-position faces
  2. Run a completely explicit six-card example

    • Start: R 1 B 1 R 2 B 2 R 3 B 3, all down
    • Cut 2; turn 2; cut 1; turn 2
    • Finish: flip positions 2, 4, 6
  3. Identify the encoded category and the global phase

    • t: red 1, black 0
    • q = f ⊕ p
    • q = t ⊕ g, with one shared g
    • Odd cut toggles g
  4. Prove that the finish decodes colour membership

    • Even-position flip mask = 1 ⊕ p
    • f′ = q ⊕ 1 = t ⊕ g ⊕ 1
    • Same colour → same final direction
  5. Compare three different mechanisms without merging their promises

    • Count invariant → a number
    • One defect → a selected identity
    • Category code → a chosen group
  6. Use a concrete failing experiment to improve the specification

    • Illegal test: flip only R 1
    • Final reds: UP, DOWN, DOWN
    • Failure: no single shared phase
  7. Design an exhaustive checker that audits the stated model

    • Store identities AND faces
    • Expand every reachable state
    • Test the finish, not an intermediate appearance
    • Six-card check: 1, 440 reached states
  8. Specify a playable routine-design lab with a complete worked submission

    • Specify → test → explain → revise
    • Worked finish: all reds up, all blacks down
    • Every guarantee has stated hypotheses

Companion interactive

Planned

Build and justify a six-card Hummer colour-separation routine, then repair a deliberately invalid extension.

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
  • Persi Diaconis and Ron Graham, Magical Mathematics: The signed-position constraint and colour-separation corollary motivate this original six-card design exercise.
  • Colm Mulcahy, Mathematical Card Magic: CATO and alternating-background principles provide the related selection routine used for comparison.