Mathematical Curiosities & Special Topics

Nim Game Solver

Classify a normal-play Nim position and produce one winning move when available.

Mathematical Curiosities & Special Topics

Enter model data

Private calculation in your browser

Use the labelled probability protocol, game rule, finite bound, or numerical model. Simulations are seeded and reproducible; theoretical results remain separate. Inputs stay on this device.

Result

Enter valid values to see the result.

Your entries are calculated in this browser and are not submitted to 365CALCS.COM.

Quick guide

How to use this calculator

  1. Select the stated protocol, strategy, approximation, or conversion mode when one is available.
  2. Enter the labelled finite bound, probabilities, payoffs, sequence state, or special-function argument.
  3. Read the theoretical or deterministic result separately from any seeded empirical result.

Calculation method

Apply the stated mathematical model

The position is losing exactly when the bitwise XOR of all heap sizes is zero.

The calculator validates model hypotheses, finite work limits, probability domains, singular cases, and numerical approximation ranges before returning a result.

Worked example

Worked example

Heaps 3,4,5 have nim-sum 2 and a winning reduction.

The position is losing exactly when the bitwise XOR of all heap sizes is zero.

Supported inputs

Precision and limits

Model scope

Paradoxes depend on their information or randomization protocol. Queueing, games, fractals, and cellular automata use exactly the visible assumptions; changing those assumptions changes the answer.

Deterministic versus simulated

Exact combinatorial and theoretical probabilities are labelled separately from seeded pseudorandom simulations. Reusing a seed reproduces the same finite experiment.

Numerical methods

Finite double-precision arithmetic is used for probability models and special functions. Gamma uses a bounded Lanczos approximation, Bessel J uses a bounded convergent series, and erf/erfc disclose their approximation error.

Limits

Iteration, grid, candidate, trial, and series caps are visible in field labels or calculator-specific notes. A bounded trace never claims to prove an unresolved conjecture.