Skip to main content
Formal Specification

Mauritanian milk and butter division puzzle — Formal Specification

Mauritania · counting-out · Confidence: medium

← Back to game page

Implementation Suitability

Suitability: engine-readyFidelity: directGap-fills: 0
# Tgesam ed-Dohn — AI-optimized specification ## General idea A classic discrete mathematical decanting and state-space search puzzle. Given three unmeasured containers of integer capacities (CA,CB,CC) and an initial liquid distribution (VA,0,0), the agent must navigate the discrete transition graph via maximal pouring operations to reach target volume distribution (TA,TB,TC) in minimal steps. ## Formal model - **Abstraction taken:** Direct representation of a 3D discrete integer state vector 𝐯=(vA,vB,vC)∈ℕ3 subject to capacity bounds 0≤vi≤Ci and constant total volume invariant ∑vi=Vtotal. - **Player/agent count:** 1 agent (or 2 competing agents solving puzzle instances). - **Turn model:** Strictly sequential pouring operations. ## Formal rules R1. **State Space & Capacities:** - Container capacities: 𝐂=(8,5,3). - Initial state: 𝐯0=(8,0,0). - Target state: 𝐯∗=(4,4,0). - Total volume: Vtotal=8. R2. **Legal Pouring Operations:** - A legal action is a directed pour from container i to container j (i≠j): - Amount transferred: Δ=min⁡(vi,Cj−vj). - Legal precondition: vi>0∧vj<Cj. - State update: vi′=vi−Δ, vj′=vj+Δ, vk′=vk. R3. **Action Space Enumeration:** - At any state 𝐯, there are at most 6 possible directed pour actions: - `pour(A, B)`, `pour(A, C)`, `pour(B, A)`, `pour(B, C)`, `pour(C, A)`, `pour(C, B)`. R4. **Step Budget & Scoring:** - Optimal step count N∗=7. - If 𝐯==𝐯∗ reached in k steps: - If k==N∗: Score =+10 points (Perfect). - If N∗<k≤12: Score =10−(k−N∗) points. - If k>12: State forfeits (0 points). R5. **Victory Condition:** - Solitaire: Achieving maximum score over 3 consecutive puzzle instances. - 2-Player: Player reaching target state with fewer total pours wins. ## Edge cases - **Tie at the end condition:** If both players achieve the target in identical minimal steps (k=7), match is a Draw. - **A player with no legal move:** As long as Vtotal>0, at least two directed pour actions are always legal. - **Repetition / cycles:** Bounded by hard step limit k≤12; repeated state visits consume step budget without making progress. - **Simultaneous claims on the same resource or position:** Not applicable — sequential discrete operations. - **Player elimination mid-round; turn order repair:** Not applicable. - **Resource exhaustion:** Strictly conservative volume: ∑vi=8 invariant holds across all transitions. - **Termination guarantee:** Guaranteed by finite state graph (|𝒮|≤24 reachable states) and step cap k≤12. ## State representation - **Persistent state:** Container capacities (CA,CB,CC), target state (TA,TB,TC), step counter k, state history array. - **Current state:** Volume tuple (vA,vB,vC)∈[0,8]×[0,5]×[0,3]. - **Observable information:** Perfect information — fully observable state. ## Action space - `pour(source_container, dest_container)`: - `source_container, dest_container` ∈{A,B,C},source≠dest. ## Playability notes - **Single-player-vs-AI:** Direct and ideal: Breadth-First Search (BFS) or A∗ algorithm computes the optimal shortest path in microseconds. - **Group games (N>2):** Turn-based cooperative puzzle solving. - **Physical-skill games:** Not applicable (pure discrete mathematical logic and state-space search). - **What is lost in the adaptation:** The physical sensory act of pouring white goat milk between rustic carved acacia bowls in a desert tent. ## Implementation hints - Represent state as a 3-tuple of integers; use a simple BFS queue with a visited-set hash table to solve the 7-step path: (8,0,0)→(3,5,0)→(3,2,3)→(6,2,0)→(6,0,2)→(1,5,2)→(1,4,3)→(4,4,0). - First milestone: Implement state transition function and verify the 7-step BFS solution path.

Download as JSON

Download the full game corpus entry for this game as structured JSON.

Download JSON
Cite this page

Mauritanian milk and butter division puzzle (Mauritania). (n.d.). Games of Countries. https://gamesofcountries.com/games/mr-mauritania/tgesam-ed-dohn

@misc{gamesofcountries-mr-mauritania-tgesam-ed-dohn,
  title = {Mauritanian milk and butter division puzzle (Mauritania)},
  year = {n.d.},
  publisher = {Games of Countries},
  url = {https://gamesofcountries.com/games/mr-mauritania/tgesam-ed-dohn}
}