Expected Damage and a Golden-Ratio Window Puzzle

Sawyer introduces expected value with an unknown video-game monster, then uses geometry to solve a painting-through-a-window problem.

SaSawyerVortrag · Jane Street
Kanal
Jane Street
Veröffentlicht
3. Juli 2020
Video
10:08
Lesezeit
4 Min.
Folien
5
Original
Englisch
Auf YouTube öffnen
Beim Scrollen schrumpft das Video in die rechte untere Ecke und läuft weiter. Untertitel folgen Ihrer Lesesprache.
LesespracheIn 2 Sprachen verfügbar
Diesen Artikel gibt es noch nicht auf Deutsch, daher wird das Original (Englisch) angezeigt.
ZUSAMMENFASSUNG

In 30 Sekunden

Sawyer poses an unanswered challenge about damage from one of three equally likely monster types and explains expected value using a die. He then solves the previous episode's window puzzle, finding a maximum segment length of (1 + √5)/2 meters and relating it to the power of a point theorem.

  1. 1Three indistinguishable monstersTimid, aggressive and deadly monsters are equally likely and deal uniformly distributed damage from 1–6, 1–12 and 1–20 respectively. The episode leaves the expected damage and conditional follow-up as challenges.
  2. 2A probability-weighted averageExpected value sums each possible outcome multiplied by its probability. A fair die has expected value 7/2, even though that value is not a possible roll.
  3. 3A window becomes a line-segment problemA one-meter square topped with a semicircle forms the window. Orienting the wider-than-tall painting perpendicular to its plane reduces the problem to finding the longest segment inside the shape.
  4. 4The longest segment through the centerAt the optimum, the segment meets the semicircle perpendicular to its tangent and passes through the circle's center. Its length is (1 + √5)/2 meters.
  5. 5Why the golden ratio appearsThe power of a point gives AB·AC = 1, while the optimal chord BC is a diameter of length 1. Together these imply AB = 1 + 1/AB.

Das Wichtigste

  1. Expected value is the probability-weighted sum of a random variable's possible outcomes.
  2. The expected value of a fair six-sided die is 3.5, even though no roll can equal 3.5.
  3. The monster challenge asks about both an unconditional expected attack and a second attack after observing four damage.
  4. A painting-window problem reduces to finding the longest line segment inside a square topped by a semicircle.
  5. That segment has length (1 + √5)/2 meters, the golden ratio, and a power-of-a-point argument explains its appearance.
VOLLTEXT

Den bearbeiteten Text nach Kapiteln lesen

Nur das Transkript
01

A monster and expected damage

Sawyer poses a new challenge involving three equally likely monster types. The bonus asks about a second attack after observing four damage from the first.

I'm Sawyer, and this is Real Numbers. Usually we solve mathematics problems motivated by real-world situations; this time our problem comes from a video game. You're exploring a haunted forest and encounter a monster whose difficulty class you cannot tell by looking at it.

There are three equally likely classes: timid, aggressive, and deadly. A timid monster deals an integer amount of damage uniformly from 1 to 6, an aggressive one from 1 to 12, and a deadly one from 1 to 20. All three look identical. On average, how much damage does the first attack from an unknown monster deal?

For a bonus, suppose that very monster deals four damage on its first attack. What is the average damage from a second attack by the same monster? To solve these questions, we need the mathematical idea behind the words ‘on average’: expected value.

02

What expected value means

Expected value weights each outcome by its probability. A fair six-sided die has expected value 3.5, even though 3.5 is not a possible roll.

The ordinary average of n values is their sum divided by n. For example, the rolls 1, 5, and 5 average 11/3. We can write this as (1/3)·1 + (1/3)·5 + (1/3)·5: a weighted sum whose equal weights add up to one.

For a probabilistic process, expected value is the average of all possible outcomes, each weighted by its probability. In other words, multiply each value a random variable can take by the probability of that value and add the results. The weights still sum to one, but need not be equal.

Expected value as a weighted sum
FOLIE 1 / 5Expected value as a weighted sumThe displayed formula multiplies each possible value by its probability and sums the results.

For a fair six-sided die, each outcome from 1 through 6 has probability 1/6. The expected roll is (1 + 2 + 3 + 4 + 5 + 6)/6 = 21/6 = 7/2. A roll can never actually be 3.5, but that number summarizes the distribution of outcomes. We'll return to ways of making that idea precise in later episodes.

03

Solving the window puzzle

The previous problem reduces to finding the longest segment in a square topped by a semicircle. Tangent geometry and the Pythagorean theorem give the golden ratio in meters.

Now for last week's problem: what is the tallest painting that can pass through a window made from a one-meter square with its top side replaced by a semicircle whose diameter is that side? The paintings are wider than they are tall, so we orient their width perpendicular to the window. Their height intersects the window as a line segment, and we seek the longest segment that fits.

The window's dimensions
FOLIE 2 / 5The window's dimensionsA one-meter square is topped by a semicircle whose diameter is the square's top edge.

We can find lower bounds by exhibiting segments. The square's diagonal has length √2, about 1.414 meters; the window's vertical height is 1.5 meters. Moving the lower endpoint to a corner while keeping the other at the top gives √((1/2)² + (3/2)²) = √(5/2), about 1.581 meters. But even that is not the maximum.

A longer candidate segment
FOLIE 3 / 5A longer candidate segmentThe diagonal from the corner to the top gives a lower bound of √(5/2) meters.

A tangent line gives the best local linear approximation to a curve. Label the lower-left corner A and a point on the semicircle B. Starting with B at the top, moving it right along the curve increases AB. Continue until the tangent at B is perpendicular to AB.

The line perpendicular to a circle's tangent at B passes through the center O. Thus the maximizing segment passes through O, the midpoint of the square's top edge. OB is the radius, 1/2 meter, and AO = √((1/2)² + 1²) = √5/2 meters. The maximum is AO + OB = (1 + √5)/2, about 1.618 meters.

The maximum segment through the circle's center
FOLIE 4 / 5The maximum segment through the circle's centerThe segment from A to B passes through O and meets the tangent at B at a right angle.

That's φ, the golden ratio, the positive solution of x = 1 + 1/x. A neat answer like this suggests a geometric principle underneath, so I looked for another explanation and found the power of a point theorem, associated with the nineteenth-century geometer Jakob Steiner.

04

The power of a point

A geometric theorem explains why the result satisfies the golden-ratio equation. Sawyer closes by restating the new monster challenge.

The theorem says that for a point P outside a circle, a line through P meeting the circle at two points has a constant product of distances from P to those intersections, regardless of the line chosen. For our window, let A be the point and let the line meet the full circle at C and B.

As B moves along the upper semicircle, AB·AC remains constant. In the limiting position at the left edge, both distances equal the one-meter side of the square, so the product is 1. Maximizing AB therefore minimizes AC, and hence maximizes BC; the longest chord is the circle's diameter, which has length 1.

At that optimum, AB = AC + 1 and AB·AC = 1. Substituting AC = 1/AB gives AB = 1 + 1/AB, precisely the equation for the golden ratio. The geometry explains why that number appears rather than merely producing it through arithmetic.

Power of a point and the golden ratio
FOLIE 5 / 5Power of a point and the golden ratioThe diagram and equations combine AB·AC = 1 with AB = AC + 1.

Returning to this week's challenge: an unknown monster is equally likely to be timid, aggressive, or deadly, with uniform damage ranges of 1–6, 1–12, and 1–20. Find the expected damage of its first attack; for the bonus, find the expected second attack from the same monster after its first deals four damage.

Mehr aus diesem Kanal

1:48:29EN
JSJane Street· 16. Okt. 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-AgentenDeveloper productivityEvals+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 Folien1: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 CollaborationEntwicklungs-Workflows & 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 & curationEntwicklungs-Workflows & TestsInvesting+2
7 Folien1:16:29EN
JSJane Street· 26. Aug. 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-Grundlagen+1
27:39EN
JSJane Street· 21. Aug. 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