The Gumiho word selection algorithm

How Gumiho decides which word to review next — and what a complete 5,000-word journey looks like.

The algorithm

One selection rule, a recency-biased weighting, and a score that can move in both directions.

01 · Weighting

Weight = number²

Each available word is assigned a weight equal to its number squared (β = 2). The later a word sits in the progression, the larger its number — and its weight.

02 · Draw

Weighted random draw

Each exercise draws a word at random with probability proportional to its weight. The most recently unlocked word dominates the draw, while older words remain in the pool for light review.

03 · Score

+1 on success, −1 on error

A correct answer raises the score by 1; a wrong answer lowers it by 1 (floored at 1). The score controls availability: only words with index 1 through score are in the pool.

// public/script.js — weighted selection (β = 2) function selectWeightedRecentWord(words, beta) { beta = beta || 2; const weights = words.map(w => Math.pow(w.number, beta)); const total = weights.reduce((a, b) => a + b, 0); let r = Math.random() * total; for (let i = 0; i < words.length; i++) { r -= weights[i]; if (r <= 0) return words[i]; } return words[words.length - 1]; }

The β = 2 weighting function

The weight grows as the square of the word number: recent words are heavily favoured, while earlier words keep a small chance of appearing for spaced review.

Weight as a function of the word number

As word 100 is assigned a weight of 10,000, it is 10,000 times more likely to occur than word 1, whose weight is only 1.

Simulation — a 5,000-word journey

To quantify the behavior of the algorithm, a learner was simulated through the entire vocabulary of 5,000 words.

Simulation model

  1. Start. The learner begins at score 1: only word 1 is available.
  2. Draw. Each exercise draws a word from the available pool (words with index 1 through score) using the weighted selection described above.
  3. Mastery rule. A word is considered mastered once it has appeared 7 times. The learner automatically answers incorrectly on the first 7 appearances of any word — before that threshold, the word is simply not known yet. From the 8th appearance on, the learner never gets it wrong again: the word is known by heart.
  4. Score. A correct answer increases the score by 1; a wrong answer decreases it by 1 (minimum 1).
  5. Stop. The simulation stops when the score first reaches 5,000.
Appearances per word
0 – 38
minimum 0 · maximum 38
Mean (at score 5,000)
13.4412
standard deviation σ = 7.11222
Mastered at score 5,000
4,000
80% of the words (≥ 7 appearances)
Exercises
67,206
31,107 errors · 36,099 successes

Mastered words at score 5,000 — across 10 runs

The exact number of mastered words varies slightly from one random run to another; the ratio itself is remarkably stable.

SeedWords masteredShare
14,01880.36%
73,98679.72%
134,00480.08%
214,03280.64%
424,00080%
993,98479.68%
1234,01780.34%
5004,02380.46%
10003,99579.9%
20244,02880.56%

Distribution of appearances

Number of words that were seen exactly N times when the score reaches 5,000. The peak sits around 10–20 appearances; 147 words were never seen — the very end of the list, unlocked only at the finish.

Mastery threshold comparison

How the number of repetitions needed to master a word shapes the journey — thresholds of 5, 7, 10 and 14 appearances, averaged over 10 random runs per threshold.

Comparing thresholds at score 5,000

The share of mastered words stays close to 80% whatever the threshold; the threshold mainly scales the total effort and the number of appearances per word.

ThresholdExercisesMastered (avg)Share (min–max)Mean app.σMaxNever seen
549,2924,02479.72% – 81.7%9.858365.4435431186
767,2104,00979.68% – 80.64%13.4427.0958538142
1093,9453,98079.08% – 80.56%18.7899.5731250114
14130,1543,98778.56% – 81.02%26.030812.78876285