# Level 2 TiqTaqToe: Solved **P1 has an advantage (~59%) but no forced win.** Level 2 TiqTaqToe with Entanglement has been completely solved using exhaustive game tree search. The entangling move dramatically rebalances the game compared to Level 1, confirming the manual's observation that "the situation suddenly becomes much less clear." *Note: Results updated January 2026 after fixing a bug where observed pieces could still be interacted with after observation. See [Appendix: Bug Comparison](#appendix-bug-comparison) for details.* ## Game Rules (Level 2) All Level 1 rules apply, plus two new moves: - **Entangling move**: Invade opponent's classical piece (value 4) with one die in their square and one in an empty square. Their piece splits (4 → 2+2) and becomes anti-correlated with yours: if one is at square A, the other is at square B. - **Half-entangling move**: Same as entangle, but targeting one half of opponent's superposition (value 2 → 1+1). Creates partial entanglement. The entangling moves let P2 interfere with P1's pieces, countering the first-player advantage from Level 1. ## Results | Opening | P1 Win | Draw | P1 Loss | |---------|--------|------|---------| | **Classical to Corner** | **59.38%** | 0.00% | 40.63% | | **Classical to Edge** | **59.38%** | 0.00% | 40.63% | | **Classical to Center** | **59.38%** | 0.00% | 40.63% | | Superposition: Edge + Edge | 56.25% | 0.00% | 43.75% | | Superposition: Corner + Corner | 54.69% | 0.00% | 45.31% | | Superposition: Edge + Corner | 53.13% | 0.00% | 46.88% | | Superposition: Corner + Edge | 53.13% | 0.00% | 46.88% | | Superposition: Center + Corner | 51.56% | 3.13% | 45.31% | | Superposition: Corner + Center | 51.56% | 3.13% | 45.31% | | Superposition: Center + Edge | 51.56% | 0.00% | 48.44% | | Superposition: Edge + Center | 51.56% | 0.00% | 48.44% | ## Key Findings ### 1. Classical Beats Superposition The optimal opening is **any classical move** (59.38% win)—Corner, Edge, and Center are all equivalent. This reverses Level 1 where superposition dominated. The manual warned: "a superposition move, which was a decent opening move in Level 1, is now suddenly a poor opener." Why? Superposition exposes both halves to entangling counterplay. P2 can half-entangle to "drag" probability away from P1's squares. ### 2. Level 1 Optimal is Now Worst Corner + Center superposition—the Level 1 forced win—is now among the **weakest** openings at only 51.56% win rate. Any opening involving the center in superposition performs poorly, as the center square is particularly vulnerable to entanglement. ### 3. Game is Much More Balanced | Level | P1 Optimal Win Rate | Advantage | |-------|---------------------|-----------| | Level 1 | 100% | Total | | Level 2 | 59.38% | Moderate | P1 still has an edge (extra piece on board, potentially first move after observation), but P2's entangling moves provide strong counterplay. ### 4. Draws are Nearly Eliminated Draw rates are 0% for most openings, with only Center + Corner superpositions allowing 3.13% draws. The game is almost always decisive. ## Comparison: Level 1 vs Level 2 | Opening Type | Level 1 Best | Level 2 Best | |--------------|--------------|--------------| | Classical | 75% (Corner/Center) | **59.38%** (any) | | Superposition | **100%** (Corner+Center) | 56.25% (Edge+Edge) | | **Optimal** | Superposition | **Classical** | The introduction of entanglement: - Penalizes superposition openings (exposes to half-entangle) - Makes classical openings relatively stronger - Reduces P1's overall advantage by ~40 percentage points - Equalizes all classical openings (position no longer matters) ## Strategic Insights ### For P1 (First Player) - Open with **any classical move**—Corner, Edge, and Center are all equivalent - Avoid superposition openings—they invite entanglement - If using superposition, Edge + Edge is strongest (no center vulnerability) ### For P2 (Second Player) - Use entangling moves aggressively to disrupt P1's pieces - Half-entangle superposition halves to split P1's probability - Target the center square when possible—center-involving superpositions are P1's weakest ### Why Classical? Classical openings avoid creating the two-square vulnerability that superposition provides. P2 can still entangle, but the resulting 50/50 split is less damaging than disrupting an existing superposition. The choice of square (Corner/Edge/Center) doesn't matter—P2's entangling response equalizes them all. ## Optimal Play Sequence With both players playing optimally, the game proceeds: ``` Move 1 (P1): Classical to TL (corner) X | . | . --+---+-- . | . | . --+---+-- . | . | . Move 2 (P2): Classical to C (center) X | . | . --+---+-- . | O | . --+---+-- . | . | . Move 3 (P1): Superposition TM+BR X |x50| . ---+---+--- . | O | . ---+---+--- . | . |x50 Move 4 (P2): Half-entangle TM→BL X |25/50| . ---+-----+--- . | O | . ---+-----+--- 25/50| . |x50 Move 5 (P1): Entangle C→MR X |25/50| . ---+-----+----- . |50/50|50/50 ---+-----+----- 25/50| . | x50 Move 6 (P2): Classical to TR X |25/50| O ---+-----+--- . |50/50|50/50 ---+-----+--- 25/50| . |x50 Move 7 (P1): Superposition ML+BM → Observation X |25/50| O ---+-----+----- x50|50/50|50/50 ---+-----+----- 25/50| x50| x50 ``` **Observation outcomes:** - P1 wins: 43.8% - P2 wins: 25.0% - Game continues: 31.3% **Key observations:** - P1 opens classically in corner; P2 responds classically in center - P1's superposition (Move 3) creates presence in two squares - P2's half-entangle (Move 4) drags part of P1's TM presence to BL, creating O presence there too - P1's entangle (Move 5) disrupts P2's center, creating anti-correlated X/O in C and MR - P2 secures a classical corner (TR) while P1 spreads further with superposition - Final board: P1 has probability in 7 squares; P2 has 2 classical + entangled shares in 2 more ### Continuation Example When the game continues past observation (31.3% of outcomes), here's one example scenario: ``` Collapsed board (6.3% probability): x | x | o (lowercase = observed/locked pieces) --+---+-- x | x | o --+---+-- o | . | . P2 to move (2 empty squares remain) ``` In this collapse: - P1 has TL, TM, ML, C (4 pieces) — no three-in-a-row - P2 has TR, MR, BL (3 pieces) — no three-in-a-row - All observed pieces are locked and cannot be entangled or cancelled **Move 8 (P2):** Superposition BM+BR ``` x | x | o --+---+--- x | x | o --+---+--- o |o50|o50 ``` **Second observation outcomes:** - P2 wins: 50% (O collapses to BR, completing TR-MR-BR) - P1 wins: 50% (O collapses to BM; P1 places at BR, completing TL-C-BR) This branch is a coin flip. More broadly, the 0% draw rate under optimal play means every continuation eventually resolves to a decisive winner—there are no stalemates. This illustrates why P1's overall win rate is "only" 59.4% despite having more pieces—when P1 doesn't win at the first observation, P2 often has the advantage in continuation play, clawing back P1's initial lead. ### Analyzing the Pre-Observation Board ``` X |25/50| O TL | TM | TR ---+-----+--- ---+----+--- x50|50/50|50/50 ML | C | MR ---+-----+--- ---+----+--- 25/50| x50| x50 BL | BM | BR ``` **Classical pieces:** X at TL, O at TR. **Probability distribution:** - TL: 100% X (classical) - TM: 25% X, 50% O (from half-entangle) - TR: 100% O (classical) - ML: 50% X (superposition) - C: 50% X, 50% O (from entangle, anti-correlated with MR) - MR: 50% X, 50% O (from entangle, anti-correlated with C) - BL: 25% X, 50% O (from half-entangle, correlated with TM) - BM: 50% X (superposition) - BR: 50% X (superposition) **X's main threats:** - TL-C-BR diagonal: 100% × 50% × 50% = 25% - TL-ML-BL column: 100% × 50% × 25% = 12.5% - TL-TM-TR row: blocked (O at TR) - ML-C-MR row: 50% × 50% × 50% = 12.5% (but C and MR anti-correlated, so actually 25%) - BL-BM-BR row: 25% × 50% × 50% = 6.25% **O's main threats:** - TR-MR-BR: 100% × 50% × 0% = 0% (BR has no O) - TR-C-BL diagonal: 100% × 50% × 50% = 25% - TM-C-BM column: 50% × 50% × 0% = 0% (BM has no O) The entanglement correlations make exact calculation tricky—C and MR are anti-correlated (if X is at one, O is at the other), and TM/BL are correlated through the half-entangle. But the rough picture shows X has ~50% worth of winning line probability vs O's ~25%, with the continuation scenarios (31.3%) favoring P2 enough to bring the final win rate to 59.4%. ## Technical Details | Metric | Value | |--------|-------| | Nodes explored | 40,192,783 | | Unique states (cache) | 4,302,295 | | Computation time | 6 min 35 sec | | Nodes/second | ~102,000 | **Algorithm:** Expectimax with memoization using "worlds" representation—quantum state as probability distribution over classical boards. Entanglement handled via correlated world-splitting. **Solver:** - `Assets/Level2Solver.cs` (Unity version) - `Level2SolverStandalone.cs` (standalone with progress reporting) **Run (Unity):** Tools → TiqTaqToe Analysis → Run Level 2 Solver **Run (standalone):** ```bash mcs -out:Level2Solver.exe Level2SolverStandalone.cs mono Level2Solver.exe ``` --- ## Appendix: Bug Comparison The original solver had a bug where observed pieces (after the observation phase) could still be cancelled or entangled in continuation games. The correct behavior is that observed pieces become "locked"—they cannot be interacted with. ### Bug Details After observation, pieces should transition from `Symbol.X`/`Symbol.O` to `Symbol.ObservedX`/`Symbol.ObservedO`. The move generator only allows cancel/entangle operations on regular `X`/`O` symbols, so observed pieces become untouchable. The buggy solver kept pieces as regular `X`/`O` after observation, allowing them to be entangled or cancelled in subsequent turns. ### Results Comparison | Opening | P1 Win (Bug) | P1 Win (Fixed) | Draw (Bug) | Draw (Fixed) | |---------|-------------|----------------|------------|--------------| | Classical to Corner | 56.25% | **59.38%** | 6.25% | 0.00% | | Classical to Edge | 59.38% | 59.38% | 1.56% | 0.00% | | Classical to Center | 59.38% | 59.38% | 1.56% | 0.00% | | Superposition: Edge + Edge | 56.25% | 56.25% | 3.13% | 0.00% | | Superposition: Corner + Corner | 56.25% | 54.69% | 6.25% | 0.00% | | Superposition: Edge + Corner | 56.25% | 53.13% | 0.00% | 0.00% | | Superposition: Corner + Edge | 56.25% | 53.13% | 0.00% | 0.00% | | Superposition: Center + Corner | 53.91% | 51.56% | 4.69% | 3.13% | | Superposition: Corner + Center | 53.91% | 51.56% | 4.69% | 3.13% | | Superposition: Center + Edge | 56.25% | 51.56% | 0.00% | 0.00% | | Superposition: Edge + Center | 56.25% | 51.56% | 0.00% | 0.00% | ### Key Observations 1. **Classical Corner improved**: The biggest change is Classical to Corner jumping from 56.25% to 59.38%, equalizing all classical openings. With the bug, P2 could re-entangle P1's observed corner piece in continuations, giving them an extra attack vector. 2. **Draws nearly vanished**: Most openings went from 1.56–6.25% draws to 0%. Observed pieces being untouchable means fewer continuation games and more decisive first-observation outcomes. 3. **Superposition openings weakened**: Most superposition openings dropped 2–5 percentage points. The bug was inadvertently helping P1 by allowing counter-interference in continuations—P1, having more pieces, benefited more from the chaos. 4. **Center involvement now worse**: Openings involving the center in superposition (Center+Edge, Edge+Center, Center+Corner, Corner+Center) dropped from 53.91–56.25% to 51.56%. The center's vulnerability to entanglement is now more pronounced. --- *Analysis performed January 2026 on Apple M5 MacBook Pro.*