title: Pairing strategy
text: # Pairing strategy
  
  In a positional game, a pairing strategy is a strategy that a player can use to guarantee victory, or at least force a draw. It is based on dividing the positions on the game-board into disjoint pairs. Whenever the opponent picks a position in a pair, the player picks the other position in the same pair.
  
  ## Example
  
  Consider the 5-by-5 variant of Tic-tac-toe. We can create 12 pairwise-disjoint pairs of board positions, denoted by 1,...,12 $below:^{:3}$
  
  | 11 | 1 | 8 | 1 | 12 |
  | - | - | - | - | - |
  | 6 | 2 | 2 | 9 | 10 |
  | 3 | 7 | * | 9 | 3 |
  | 6 | 7 | 4 | 4 | 10 |
  | 12 | 5 | 8 | 5 | 11 |
  
  Note that the central element (denoted by *) does not belong to any pair; it is not needed in this strategy.
  
  Each horizontal, vertical or diagonal line contains at least one pair. Therefore the following pairing strategy can be used to force a draw: "whenever your opponent chooses an element of pair i, choose the other element of pair i". At the end of the game, you have an element of each winning-line. Therefore, you guarantee that the other player cannot win.
  
  Since both players can use this strategy, the game is a draw.
  
  This example is generalized below for an arbitrary Maker-Breaker game. In such a game, the goal of Maker is to occupy an entire winning-set, while the goal of Breaker is to prevent this by owning an element in each winning-set.
  
  ## Pairing strategy for Maker
  
  A pairing-strategy for Maker requires a set of element-pairs such $that:^{:119}$
  
  * All pairs are pairwise-disjoint;
  * Every set that contains at least one element from each pair, contains some winning-set.
  
  Whenever Breaker picks an element of a pair, Maker picks the other element of the same pair. At the end, Maker's set contains at least one element from each pair; by condition 2, he occupies an entire winning-set (this is true even when Maker plays second).
  
  As an example, consider a game-board containing all vertices in a perfect binary tree except the root. The winning-sets are all the paths from the leaf to one of the two children of the root. We can partition the elements into pairs by pairing each element with its sibling. The pairing-strategy guarantees that Maker wins even when playing second. If Maker plays first, he can win even when the game-board contains also the root: in the first step he just picks the root, and from then on plays the above pairing-strategy.
  
  ## Pairing strategy for Breaker
  
  A pairing-strategy for Breaker requires a set of element-pairs such that:
  
  * All pairs are pairwise-disjoint;
  * Every winning-set contains at least one pair.
  
  Whenever Maker picks an element of a pair, Breaker picks the other element of the same pair. At the end, Breaker has an element in each pair; by condition 2, he has an element in each winning-set.
  
  An example of such pairing-strategy for 5-by-5 tic-tac-toe is shown $above.^{:2–3}$ show other examples for 4x4 and 6x6 tic-tac-toe.
  
  Another simple case when Breaker has a pairing-strategy is when all winning-sets are pairwise-disjoint and their size is at least 2.
  
  