AI Grounds
Open AI Grounds on a desktop
These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.
AI Grounds
These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.
Guided discovery
Choose a branch, read a scripted result, and update its visited path.
This is a small demonstration of selection and backpropagation, not a game solver. All three illustrations share generic branches A–D and repeating scripted outcomes. No legal moves, deeper tree expansion or random game rollout is implemented.
c gives the exploration bonus more or less weight. Editing a control pauses Run; counts stay fixed. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.
Includes the 64 seeded visits. Lowering the budget stops without undoing evidence. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.
64 total visits = 64 seeded + 0 new steps. 1 remaining. Ready.
score = Q + c × sqrt(ln N / n)
Q is successes / visits. N is parent visits; n is branch visits. ln is the natural logarithm. At fixed N and c, fewer visits give a larger bonus. UCB means upper confidence bound; here the score is a selection priority, can exceed 1, and is not a win probability or proof.
| Branch | Successes / visits | Q | Bonus | Score | Meaning |
|---|---|---|---|---|---|
| A | 27 / 38 | 0.71 | 0.46 | 1.17 | Best observed Q |
| B | 8 / 14 | 0.57 | 0.76 | 1.33 | Wait |
| C | 3 / 9 | 0.33 | 0.95 | 1.29 | Wait |
| D | 1 / 3 | 0.33 | 1.65 | 1.98 | Next selection |
Best observed Q: A. This describes the record. Next selection chooses where to sample next; neither label is a final move recommendation.
Dashed outline: next selection. Solid orange path and “Last”: last completed Step. Counts are successes / visits. The diagram adds no child nodes.
Root · 39 / 64
↓ Four existing child branches
Branch A27 / 38Not visited last
Branch B8 / 14Not visited last
Branch C3 / 9Not visited last
Branch D1 / 3Next
Root Q = 39 / 64 = 0.61. Root counts sum the child counts, so its Q is weighted by visits, not an equal average of four branch Q values.
No new result yet. Press Step to create a recorded update. The seeded counts are teaching fixtures, not a reconstructed game history.
This demo implements root selection and a two-node count backup. It substitutes repeating 0/1 outcome scripts for simulation and has no expansion, terminal game rules or alternating player perspective. Repeated scripts are not independent random samples, so Monte Carlo convergence guarantees do not apply. A real implementation must specify game rules, rollout policy, reward viewpoint and final-action rule.
An unvisited branch gets priority ∞ in this engine and is selected before visited ones; all four provided branches begin visited. Q is displayed as 0 for an unvisited branch as a placeholder, not a reward estimate.
Browne et al. · A Survey of Monte Carlo Tree Search MethodsA board sketch only: A–D are generic branches, not legal Tic Tac Toe moves. Changing an illustration does not change the search record or outcome scripts.
X O X O X · · · ·
Each branch repeats its listed script. The next result uses the branch’s pre-Step visit count modulo script length as a zero-based index, including seeded visits.