Project Euler Lab - Problem 978

#978 - Random Walk Skewness

● AppliedOfficial difficulty: 25%RandomnessTier B - browser, with the efficient algorithmNot viewed
↖ Euler Lab

In this problem we consider a random walk on the integers \(\mathbb{Z}\), in which our position at time \(t\) is denoted as \(X_t\).

At time \(0\) we start at position \(0\). That is, \(X_0=0\).
At time \(1\) we jump to position \(1\). That is, \(X_1=1\).
Thereafter, at time \(t=2,3,\dots\) we make a jump of size \(|X_{t-2}|\) in either the positive or negative direction, with probability \(1/2\) each way. If \(X_{t-2}=0\) we stay put at time \(t\).

At \(t=5\) we find our position \(X_5\) has the following distribution: \[ X_5=\begin{cases} -1\quad&\text{with probability }3/8\\ 1\quad&\text{with probability }3/8\\ 3\quad&\text{with probability }1/8\\ 5\quad&\text{with probability }1/8\\ \end{cases} \] The standard deviation \(\sigma\) of a random variable \(X\) with mean \(\mu\) is defined as \[ \sigma=\sqrt{\mathbb{E}[X^2]-\mu^2} \] Furthermore the skewness of \(X\) is defined as \[ \text{Skew}(X)=\mathbb{E}\biggl[\Bigl(\frac{X-\mu}{\sigma}\Bigr)^3\biggr] \] For \(X_5\), which has mean \(1\) and standard deviation \(2\), we find \(\text{Skew}(X_5)=0.75\). You are also given \(\text{Skew}(X_{10})\approx2.50997097\).

Find \(\text{Skew}(X_{50})\). Give your answer rounded to eight digits after the decimal point.

This problem is taken from Project Euler, Problem 978.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=978. Published Sunday, 11th January 2026, 04:00 am. Solved by 393 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 B - browser, with the efficient algorithm
Runs in the browser only with the intended efficient algorithm; a naive loop will hit the timeout.

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.