Project Euler Lab - Problem 807

#807 - Loops of Ropes

● ResearchOfficial difficulty: 93%RandomnessTier C - reduced scale in browser; full scale in notebookNot viewed
↖ Euler Lab

Given a circle \(C\) and an integer \(n > 1\), we perform the following operations.

In step \(0\), we choose two uniformly random points \(R_0\) and \(B_0\) on \(C\).
In step \(i\) (\(1 \leq i < n\)), we first choose a uniformly random point \(R_i\) on \(C\) and connect the points \(R_{i - 1}\) and \(R_i\) with a red rope; then choose a uniformly random point \(B_i\) on \(C\) and connect the points \(B_{i - 1}\) and \(B_i\) with a blue rope.
In step \(n\), we first connect the points \(R_{n - 1}\) and \(R_0\) with a red rope; then connect the points \(B_{n - 1}\) and \(B_0\) with a blue rope.
Each rope is straight between its two end points, and lies above all previous ropes.

After step \(n\), we get a loop of red ropes, and a loop of blue ropes.
Sometimes the two loops can be separated, as in the left figure below; sometimes they are "linked", hence cannot be separated, as in the middle and right figures below.

Let \(P(n)\) be the probability that the two loops can be separated.
For example, \(P(3) = \frac{11}{20}\) and \(P(5) \approx 0.4304177690\).

Find \(P(80)\), rounded to \(10\) digits after decimal point.

This problem is taken from Project Euler, Problem 807.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=807. Published Sunday, 11th September 2022, 02:00 am. Solved by 157 members at time of mirroring.

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.