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.

SaSawyerSpeaker · Jane Street
Channel
Jane Street
Published
Jul 7, 2020
Video
9:40
Read
3 min
Slides
4
Original
English
Open on YouTube
Scroll to read and the video shrinks to the bottom-right corner. Captions follow your reading language.
Reading languageAvailable in 2 languages
You're reading the original English.
SUMMARY

In 30 seconds

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.

Takeaways

  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.
FULL TEXT

Read the edited text by chapter

Transcript only
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
SLIDE 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
SLIDE 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
SLIDE 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
SLIDE 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.

More from this channel

1:48:29EN
JSJane Street· Oct 16, 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.Coding agentsDeveloper productivityEvals+2
1:36:37EN
JSJane Street· Sep 23, 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 slides1:05:45EN
JSJane Street· Sep 11, 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 CollaborationDeveloper workflows & testing+2
1:25:00EN
JSJane Street· Sep 2, 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 & curationDeveloper workflows & testingInvesting+2
7 slides1:16:29EN
JSJane Street· Aug 26, 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 & attentionMathematicsML fundamentals+1
27:39EN
JSJane Street· Aug 21, 20263Blue1Brown and Jane Street on Trading, Machine Learning and CultureGrant Sanderson, Nitya, In Young, Craig, Alok · 3Blue1BrownGrant Sanderson talks with Jane Street colleagues about market making, shared compute, research and the paths that brought them to the firm.Machine LearningFintechCompany Culture+2