Real Numbers: A Marching Band Challenge, Expected Damage, and Bayes’ Rule

Sawyer introduces a marching-band expected-value puzzle and uses linearity and Bayesian updating to solve a monster-attack problem.

SaSawyerIntervenant · Jane Street
Chaîne
Jane Street
Publié
7 juil. 2020
Vidéo
9:40
Lecture
3 min
Diapositives
4
Original
anglais
Ouvrir sur YouTube
En faisant défiler, la vidéo se réduit en bas à droite et continue. Les sous-titres suivent votre langue de lecture.
Langue de lectureDisponible en 2 langues
Cet article n’est pas encore disponible en français ; il s’affiche dans l’original en anglais.
RÉSUMÉ

En 30 secondes

In this episode, Sawyer asks how many rows of a randomly stepping marching band will be in step, leaving that challenge for viewers. He explains linearity of expectation and solves an earlier problem about monster damage, including an update after observing a first attack of four damage.

  1. 1A marching band puzzleForty musicians form ten rows of four and randomly choose a starting foot. The challenge asks for the expected number of rows in step.
  2. 2Linearity of expectationThe expected sum of random variables equals the sum of their expectations, and constants can be factored out.
  3. 3A mixed monsterThree equally likely monster types deal damage uniformly over ranges 1–6, 1–12, and 1–20; expected first-attack damage is 41/6.
  4. 4Update after four damageBayes’ rule changes the probabilities of timid, aggressive, and deadly monsters to 5/9, 5/18, and 1/6.
  5. 5Predict the second attackWeighting the type-specific mean damage by those updated probabilities yields 5.5.

À retenir

  1. Linearity of expectation lets us add expected values without computing the full distribution of a sum.
  2. Three standard dice have an expected sum of 10.5.
  3. The first monster attack has expected damage 41/6 under the specified mixture of monster types.
  4. A first attack of four damage changes the probabilities of the monster types through Bayes’ rule.
  5. After that observation, the expected damage of the second attack is 5.5.
TEXTE INTÉGRAL

Lire le texte remanié, chapitre par chapitre

Transcription seule
01

Marching bands and linearity

Sawyer poses a puzzle about rows of marching musicians. He introduces expected value and shows how linearity gives the mean sum of three dice.

Welcome back to Real Numbers. After introducing expected value last episode, we will use it to explore another problem involving a probabilistic average.

You are photographing a marching band with 40 members arranged in ten rows of four. Each musician independently chooses a left or right starting foot with equal probability. What is the expected number of rows whose four members march in step?

The marching-band photo
DIAPOSITIVE 1 / 4The marching-band photoThe illustration shows rows of four and the desired synchronized step.

For the bonus, suppose exactly 20 students start on the left foot and 20 on the right, but all 40 are randomly arranged into the ten rows. What is the expected number of in-step rows? The episode leaves both questions for viewers.

Expected value is a probability-weighted average of the outcomes of a random process. Its useful linearity property says E[X + Y] = E[X] + E[Y], and E[aX] = aE[X] for a constant a.

A fair six-sided die has expected value 3.5. The distribution of the sum of three dice is more complicated, with middle values more likely than extreme values. But linearity gives E[X + Y + Z] = 3.5 + 3.5 + 3.5 = 10.5 without calculating that distribution.

Last week’s problem involved a video-game monster equally likely to be timid, aggressive, or deadly. Its damage is uniform from 1 to 6, 1 to 12, or 1 to 20 respectively. What is the expected damage of its first attack?

02

The first monster attack

Three equally likely monster types have different damage distributions. Direct calculation and linearity both give an expected first-attack damage of 41/6.

Calculate the unconditional probability of each damage value by summing over the possible monster types. For damage 1 through 6, all three types can produce each value, giving probability 1/10 per value.

Only aggressive or deadly monsters can deal damage 7 through 12, giving probability 2/45 per value. Damage 13 through 20 requires a deadly monster and has probability (1/3) × (1/20) = 1/60 per value.

Probability of 13 damage
DIAPOSITIVE 2 / 4Probability of 13 damageOnly the deadly monster can deal 13 damage, giving probability 1/3 × 1/20.

Multiply each damage value by its probability and add: (1+…+6)/10 + (7+…+12)×2/45 + (13+…+20)/60 = 41/6, or about 6.833.

A shorter method separates damage into timid, aggressive, and deadly contributions, only one of which is nonzero for a given monster. Their expected contributions are (1/3)×(7/2) = 7/6, (1/3)×(13/2) = 13/6, and (1/3)×(21/2) = 7/2. Linearity again gives 41/6.

03

Updating after an observation

Seeing four damage makes a timid monster more likely. Bayes’ rule produces a second-attack expectation of 5.5.

The bonus asks for the expected damage of the second attack after the first deals four. Although all three types could deal four, that observation changes how likely each type is. We must update the prior probabilities rather than simply reuse 41/6.

The unconditional probability of four damage is 1/10. Bayes’ rule gives P(timid | 4) = [(1/6)×(1/3)]/(1/10) = 5/9; similarly P(aggressive | 4) = 5/18 and P(deadly | 4) = 1/6.

Bayesian update after four damage
DIAPOSITIVE 3 / 4Bayesian update after four damageThe formulas calculate the posterior probabilities of all three monster types.

The probabilities sum to one, but now favor a timid monster. Four damage is possible for all types, yet it accounts for a larger share of the timid monster’s narrower range. In contrast, a first attack of 16 would identify the monster as deadly.

Assuming the second attack follows the same type-specific distribution, weight the means by the updated probabilities: (5/9)×(7/2) + (5/18)×(13/2) + (1/6)×(21/2) = 11/2 = 5.5.

Expected damage of the second attack
DIAPOSITIVE 4 / 4Expected damage of the second attackThe calculation weights the type-specific means by the updated probabilities to obtain 5.5.

Now return to the marching band: find the expected number of in-step rows when each musician chooses a starting foot independently, and then when exactly 20 choose each foot and the members are randomly arranged. Submit your reasoning.

Sur la même chaîne

6 diapositives15:33EN
JSJane Street· 26 oct. 2026Figgie Strategy: Reading Hands, Winning Majorities and Pricing CardsBradley, Mike · Jane StreetJane Street traders Bradley and Mike analyze three games to show how private information, market competition and timing affect card prices.Decision MakingMathematicsFintech
1:48:29EN
JSJane Street· 16 oct. 2026How AI Is Changing Programming: John Krazit and Ron MinskyRon Minsky, John Krazit · Jane StreetJane Street’s AI tooling lead and the Signals and Threads host examine agent infrastructure, security, code review and the changing experience of writing software.Agents de codeDeveloper productivityÉvaluations+2
1:36:37EN
JSJane Street· 23 sept. 2026Aaron Bauer on Teaching Software Engineering in the Age of AIRon Minsky, Aaron Bauer · Jane StreetHow learning goals, active practice and editor design shape engineering education when models can generate the code.AI in EducationSoftware engineeringEducation+2
9 diapositives1:05:45EN
JSJane Street· 11 sept. 2026Cyrus Omar on Live Programming and a Computational Commons for Humans and AICyrus OmarA demonstration of Hazel shows how immediate feedback, structured collaboration and carefully scoped permissions could support people and AI agents working together.Programming LanguagesHuman-AI CollaborationWorkflows de développement et tests+2
1:25:00EN
JSJane Street· 2 sept. 2026Eric Mannes on Turning Messy External Data Into Trading ResearchRon, Eric Mannes · Jane StreetFrom commodity futures and an Excel risk system to point-in-time datasets and AI, Eric Mannes explains the domain knowledge behind data engineering at Jane Street.Data quality & curationWorkflows de développement et testsInvesting+2
7 diapositives1:16:29EN
JSJane Street· 26 août 2026Grant Sanderson and Alok Puranik: Positional Encodings Through Group TheoryGrant Sanderson, Alok Puranik · 3Blue1BrownStarting with assumptions about attention, they derive matrix exponentials and connect rotations, decay and Jordan blocks to RoPE and ALiBi.Transformers & attentionMathematicsFondamentaux du ML+1