Project Euler Lab - Problem 683

#683 - The Chase II

● ResearchOfficial difficulty: 75%Two-player gamesTier C - reduced scale in browser; full scale in notebookNot viewed
↖ Euler Lab

Consider the following variant of "The Chase" game. This game is played between \(n\) players sitting around a circular table using two dice. It consists of \(n-1\) rounds, and at the end of each round one player is eliminated and has to pay a certain amount of money into a pot. The last player remaining is the winner and receives the entire contents of the pot.

At the beginning of a round, each die is given to a randomly selected player. A round then consists of a number of turns.

During each turn, each of the two players with a die rolls it. If a player rolls a 1 or a 2, the die is passed to the neighbour on the left; if the player rolls a 5 or a 6, the die is passed to the neighbour on the right; otherwise, the player keeps the die for the next turn.

The round ends when one player has both dice at the beginning of a turn. At which point that player is immediately eliminated and has to pay \(s^2\) where \(s\) is the number of completed turns in this round. Note that if both dice happen to be handed to the same player at the beginning of a round, then no turns are completed, so the player is eliminated without having to pay any money into the pot.

Let \(G(n)\) be the expected amount that the winner will receive. For example \(G(5)\) is approximately 96.544, and \(G(50)\) is 2.82491788e6 in scientific notation rounded to 9 significant digits.

Find \(G(500)\), giving your answer in scientific notation rounded to 9 significant digits.

This problem is taken from Project Euler, Problem 683.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=683. Published Saturday, 12th October 2019, 01:00 pm. Solved by 385 members at time of mirroring.

Why this is useful

Direct Quant. Markov/absorbing-state and simulation reasoning is exactly the machinery behind pricing, risk, and execution models (Phases 7, 8, 13).

We classify relevance honestly - not every Euler problem is a trading application.

Learning mode

Pick how much scaffolding you want. Your choice is remembered per problem.

Scratchpad

Mathematical notes, formulas, pseudocode, hypotheses, complexity notes. Saved automatically with your progress.

Python workbench

Tier C - reduced scale in browser; full scale in notebook
Browser runs a reduced, clearly-labelled educational scale; the original scale is provided in a local notebook.

Real Python (Pyodide) in a sandboxed Web Worker - no network, no filesystem, no DOM access. Ctrl/Cmd+Enter runs. Escape leaves the editor. Stop terminates the worker.

Python runtime not loaded (it boots on first run - a one-time local load).

Check your answer

Answers are checked against a salted hash held in a separate file - not printed in this page. This prevents accidental spoilers; it is not cryptographic protection (see the build notes).

Progressive hints

Confidence

Low confidence schedules this problem for spaced review, even if you solved it.

Reference solution

Spoiler
The complete original explanation (interpretation, naive approach, insight, proof, complexity, Python implementation, tests, common mistakes, alternatives) is hidden and lazy-loaded. Reveal it only after a meaningful attempt - the struggle is where the learning happens.