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.

SaSawyer登壇者 · Jane Street
チャンネル
Jane Street
公開日
2020年7月3日
動画
10:08
読了時間
4 分
スライド
5
原文
英語
YouTube で開く
スクロールすると動画は右下に小さくなって再生を続けます。字幕は閲覧言語に合わせて切り替わります。
閲覧言語2 言語で読めます
この記事はまだ日本語に翻訳されていないため、英語の原文を表示しています。
要約

30 秒でわかる

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.

ポイント

  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.
全文

チャプターごとに整えた全文を読む

文字起こしのみ
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
スライド 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
スライド 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
スライド 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
スライド 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
スライド 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.

同じチャンネルの記事

1:48:29EN
JSJane Street· 2026年10月16日How 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.コーディングエージェントDeveloper productivity評価(Evals)+2
スライド 9 枚1:05:45EN
JSJane Street· 2026年9月11日Cyrus 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 Collaboration開発ワークフローとテスト+2
1:25:00EN
JSJane Street· 2026年9月2日Eric 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 & curation開発ワークフローとテストInvesting+2
スライド 7 枚1:16:29EN
JSJane Street· 2026年8月26日Grant 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 & attentionMathematics機械学習の基礎+1
4:41EN
JSJane Street· 2026年7月6日Inside Jane Street’s Internship: Projects, Mentorship and LearningCody · Jane StreetInterns and employees describe collaborative interviews, learning finance from the basics, and working on projects used by the firm.CareersCompany CultureMachine Learning+1
1:34:29EN
JSJane Street· 2026年6月24日Jacob Baskin on Building Superstore and Scheduling the HiveYaron Minsky, Jacob Baskin · Jane StreetThe Jane Street engineer traces the design choices behind a distributed analytical database and the challenge of allocating a growing research cluster.インフラとデプロイSoftware engineeringDecision Making+1