Difference between revisions of "Equivalent patterns"

From HexWiki
Jump to: navigation, search
m (Example 5: Added link.)
(Added one example of equivalence that does not arise from capture.)
Line 1: Line 1:
 
We say that two hex [[pattern]]s (subsets of a board) are '''equivalent patterns''' if, when one of them occurs embedded in ''any'' hex board, it could be replaced by the other and the side who has winning strategy does not change.
 
We say that two hex [[pattern]]s (subsets of a board) are '''equivalent patterns''' if, when one of them occurs embedded in ''any'' hex board, it could be replaced by the other and the side who has winning strategy does not change.
  
== Example 1 ==
+
== Equivalence by capture ==
 +
 
 +
Cells that are [[Captured cell|captured]] by one player can be filled in with stones of that player's color.
 +
 
 +
=== Example 1 ===
 
For example (using '*' for holes), the two patterns below are equivalent, and an example of what is known as the [[Useless triangle]].
 
For example (using '*' for holes), the two patterns below are equivalent, and an example of what is known as the [[Useless triangle]].
  
 
<hex>R2 C7 Q1 Va2 Vb1 Vc1 Vc2 Hb2 Ve2 Vf1 Vg1 Vg2 Vf2 Sa1 Sd1 Sd2 Se1</hex>
 
<hex>R2 C7 Q1 Va2 Vb1 Vc1 Vc2 Hb2 Ve2 Vf1 Vg1 Vg2 Vf2 Sa1 Sd1 Sd2 Se1</hex>
  
If Vertical was the last to move in the left pattern, he has '''captured''' the opponent stone in b2, an both players should regard it as another stone of Vertical.
+
If Red was the last to move in the left pattern, he has '''captured''' the opponent stone in b2, an both players should regard it as another stone of Red.
  
 
The knowledge of equivalent patterns turns out to be very useful to play Hex, because it allows you to disregard some pieces in the board, or prune the analysis tree. In my opinion, some patterns lead to positions that are much more clear than other equivalent patterns. My intention here is to write always in second place such pattens, and the use that I make of equivalent patterns is that in my games, mentally I always replace the first patterns by the equivalent counterparts.
 
The knowledge of equivalent patterns turns out to be very useful to play Hex, because it allows you to disregard some pieces in the board, or prune the analysis tree. In my opinion, some patterns lead to positions that are much more clear than other equivalent patterns. My intention here is to write always in second place such pattens, and the use that I make of equivalent patterns is that in my games, mentally I always replace the first patterns by the equivalent counterparts.
Line 12: Line 16:
 
Here are several examples of pairs of equivalent positions, and a short explanation on the way to prove them so.
 
Here are several examples of pairs of equivalent positions, and a short explanation on the way to prove them so.
  
== Example 2 ==
+
=== Example 2 ===
 
<hex>R3 C9 Va2 Vb1 Vc1 Vd1 Vd2 Vc3 Hb2 Hc2 Vf2 Vg1 Vh1 Vi1 Vi2 Vh3 Vg2 Vh2 Sa1 Sa3 Sb3 Sd3 Se3 Sf3 Sg3 Si3 Se1 Sf1 Se2</hex>
 
<hex>R3 C9 Va2 Vb1 Vc1 Vd1 Vd2 Vc3 Hb2 Hc2 Vf2 Vg1 Vh1 Vi1 Vi2 Vh3 Vg2 Vh2 Sa1 Sa3 Sb3 Sd3 Se3 Sf3 Sg3 Si3 Se1 Sf1 Se2</hex>
  
Line 21: Line 25:
 
This rule justifies the following equivalent pairs:
 
This rule justifies the following equivalent pairs:
  
== Example 3 ==
+
=== Example 3 ===
 
<hex>R3 C6 Va2 Vb1 Vc1 Hb2 Hb3 Vd2 Ve1 Vf1 Ve2 He3 Sa1 Sa3 Sc2 Sc3 Sd1 Sd3 Sf2 Sf3</hex>
 
<hex>R3 C6 Va2 Vb1 Vc1 Hb2 Hb3 Vd2 Ve1 Vf1 Ve2 He3 Sa1 Sa3 Sc2 Sc3 Sd1 Sd3 Sf2 Sf3</hex>
  
== Example 4 ==
+
=== Example 4 ===
 
<hex>R3 C6 Ha3 Hb3 Vb1 Vc1 Hb2 Hd3 He3 Ve1 Vf1 Ve2 Sa1 Sa2 Sc2 Sc3 Sd1 Sd2 Sf2 Sf3</hex>
 
<hex>R3 C6 Ha3 Hb3 Vb1 Vc1 Hb2 Hd3 He3 Ve1 Vf1 Ve2 Sa1 Sa2 Sc2 Sc3 Sd1 Sd2 Sf2 Sf3</hex>
  
Line 31: Line 35:
 
Equivalent pairs obtained with such rule:
 
Equivalent pairs obtained with such rule:
  
== Example 5 ==
+
=== Example 5 ===
 
<hex>R3 C7 Va1 Vb1 Vc1 Va3 Ve1 Vf1 Vg1 Ve3 Ve2 Vf2 Sc2 Sd2 Sb3 Sc3 Sd3 Sf3 Sg2 Sg3 Sd1</hex>
 
<hex>R3 C7 Va1 Vb1 Vc1 Va3 Ve1 Vf1 Vg1 Ve3 Ve2 Vf2 Sc2 Sd2 Sb3 Sc3 Sd3 Sf3 Sg2 Sg3 Sd1</hex>
  
 
This is a very instructive pattern because it shows that playing 2 rows out from a [[friendly]] edge with 2 free cells on the first row below the play is equivalent to playing at all three cells simultaneously, and hence at least as good as playing at either cell on the first row.  So as a rule, never play on the first row in such a situation.  We can see this by viewing the 3 upper red stones as part of a friendly edge.
 
This is a very instructive pattern because it shows that playing 2 rows out from a [[friendly]] edge with 2 free cells on the first row below the play is equivalent to playing at all three cells simultaneously, and hence at least as good as playing at either cell on the first row.  So as a rule, never play on the first row in such a situation.  We can see this by viewing the 3 upper red stones as part of a friendly edge.
  
This pattern, along with Example 4 can be used to show that the two move start A1 + B1 (or either single move) for vertical loses on a board 3x3 or bigger:
+
This pattern, along with Example 4 can be used to show that the two move start A1 + B1 (or either single move) for Red loses on a board 3x3 or bigger:
  
== Example 5b (Opening A1+B1 loses) ==
+
=== Example 5b (Opening A1+B1 loses) ===
  
 
<hex>R5 C9 1:*VVV**VVV 2:HVV_*BBB_ 3:H_H_*HHH_ 4:H___*HH__ 5:H****H***</hex>
 
<hex>R5 C9 1:*VVV**VVV 2:HVV_*BBB_ 3:H_H_*HHH_ 4:H___*HH__ 5:H****H***</hex>
  
So, in response to A1+B1 by vertical, horizontal can play at B2, reaching a position equivalent to just horizontal stones at A1, A2, A3, B1 & B2.  This includes the cells A1 & A2, so the original position is lost for vertical by a strategy stealing argument.
+
So, in response to A1+B1 by Red, Blue can play at B2, reaching a position equivalent to just blue stones at A1, A2, A3, B1 & B2.  This includes the cells A1 & A2, so the original position is lost for Red by a strategy stealing argument.
  
 
In fact, making the opening play B2 is equivalent to playing 5 stones at A1, A2, B1, B2 & C1, however this is known to produce a losing position on boards of size 4, 7 & 8 (see [[small boards]]).
 
In fact, making the opening play B2 is equivalent to playing 5 stones at A1, A2, B1, B2 & C1, however this is known to produce a losing position on boards of size 4, 7 & 8 (see [[small boards]]).
  
== Example 6 ==
+
=== Example 6 ===
 
<hex>R3 C5 Va3 Va1 Vb1 Vb3 Ve1 Vd1 Vd2 Vd3 Ve2 Ve3 Sc2 Sc3 Sc1</hex>
 
<hex>R3 C5 Va3 Va1 Vb1 Vb3 Ve1 Vd1 Vd2 Vd3 Ve2 Ve3 Sc2 Sc3 Sc1</hex>
  
== Example 7 ==
+
=== Example 7 ===
 
<hex>R2 C9 Va2 Vb1 Vc1 Vd1 Vd2 Sa1 Se1 Se2 Sf1 Vf2 Vg1 Vg2 Vh1 Vh2 Vi1 Vi2</hex>
 
<hex>R2 C9 Va2 Vb1 Vc1 Vd1 Vd2 Sa1 Se1 Se2 Sf1 Vf2 Vg1 Vg2 Vh1 Vh2 Vi1 Vi2</hex>
  
 
Using both rules together:
 
Using both rules together:
  
== Example 8 ==
+
=== Example 8 ===
 
<hex>R3 C9 Vc1 Vb3 Ha2 Hd2 Vh1 Vg3 Vg2 Vh2 Hf2 Hi2 Sa1 Sb1 Sd1 Se1 Sf1 Sg1 Si1 Se2 Sa3 Sc3 Sd3 Se3 Sf3 Sh3 Si3</hex>
 
<hex>R3 C9 Vc1 Vb3 Ha2 Hd2 Vh1 Vg3 Vg2 Vh2 Hf2 Hi2 Sa1 Sb1 Sd1 Se1 Sf1 Sg1 Si1 Se2 Sa3 Sc3 Sd3 Se3 Sf3 Sh3 Si3</hex>
  
== Example 9 ==
+
=== Example 9 ===
 
''(generalization of the Example 5, for any horizontal length)''
 
''(generalization of the Example 5, for any horizontal length)''
  
Line 63: Line 67:
  
 
Third rule for equivalent patterns (rather obvious) rule: Any area surrounded by a single chain of each enemy may be randomly filled. This happens because the outcome of the game does not depend on it at all.
 
Third rule for equivalent patterns (rather obvious) rule: Any area surrounded by a single chain of each enemy may be randomly filled. This happens because the outcome of the game does not depend on it at all.
 +
 +
== Equivalence for reasons other than capture ==
 +
 +
Capture is not the only way in which equivalent patterns arise. For example, the following two patterns are equivalent:
 +
<hexboard size="3x9"
 +
  coords="hide"
 +
  contents="E *:e1 *:e2 *:e3
 +
  E *:a1 *:a2 *:b3 *:c3 *:d3 R b1 c1 d1 d2 B a3 B b2 E a:c2
 +
  E *:f1 *:f2 *:g3 *:h3 *:i3 R g1 h1 i1 i2 B f3 B h2 E a:g2"
 +
  />
 +
This is easily seen by noticing that if the cells marked "a" are both blue, the patterns become equal, whereas if the cells marked "a" are both red, then the blue piece next to them are dead and therefore the patterns become equivalent. So whenever one player's strategy calls for playing in the cell marked "a" in one of these two patterns, the same player can play in the cell marked "a" in the other pattern.
 +
 +
  
 
== Practical example ==
 
== Practical example ==
Line 78: Line 95:
 
* f6 and h5 swap color, as in Example 1.
 
* f6 and h5 swap color, as in Example 1.
  
* The horizontal group from d8 to l11 is completely wrapped by a strongly connected group belonging to the opponent, except for a narrow section (typically, 2 cells). This kind of groups typically are captured, exactly in the same reason as in Example 1.  
+
* The blue group from d8 to l11 is completely wrapped by a strongly connected group belonging to the opponent, except for a narrow section (typically, 2 cells). This kind of groups typically are captured, exactly in the same reason as in Example 1.  
  
 
* If blue moves to i7, red moves to i9 and conversely, in both cases enclosing the blue group h8-h9-f10 as before. So, we can use the second rule for detecting equivalent patterns, capturing it.
 
* If blue moves to i7, red moves to i9 and conversely, in both cases enclosing the blue group h8-h9-f10 as before. So, we can use the second rule for detecting equivalent patterns, capturing it.
Line 84: Line 101:
 
* The equivalence in Example 5 can be used for the stone in c12.
 
* The equivalence in Example 5 can be used for the stone in c12.
  
* The equivalence in Example 4 can be used, adding a stone for vertical at m11.
+
* The equivalence in Example 4 can be used, adding a stone for Red at m11.
  
 
* The area in the bottom of the board is now surrounded by a red chain and a blue chain. Therefore, it may be filled as we please.
 
* The area in the bottom of the board is now surrounded by a red chain and a blue chain. Therefore, it may be filled as we please.
  
The blue stone in j6 remained, completely alone and too near to the red group to be of any use in such a small region, so it is obvious that vertical has won.
+
The blue stone in j6 remained, completely alone and too near to the red group to be of any use in such a small region, so it is obvious that Red has won.
  
 
[[Category: Strategy]]
 
[[Category: Strategy]]
 
[[Category: Computer Hex]]
 
[[Category: Computer Hex]]
 
[[Category: Theory]]
 
[[Category: Theory]]

Revision as of 00:11, 27 September 2020

We say that two hex patterns (subsets of a board) are equivalent patterns if, when one of them occurs embedded in any hex board, it could be replaced by the other and the side who has winning strategy does not change.

Equivalence by capture

Cells that are captured by one player can be filled in with stones of that player's color.

Example 1

For example (using '*' for holes), the two patterns below are equivalent, and an example of what is known as the Useless triangle.

abcdefg12

If Red was the last to move in the left pattern, he has captured the opponent stone in b2, an both players should regard it as another stone of Red.

The knowledge of equivalent patterns turns out to be very useful to play Hex, because it allows you to disregard some pieces in the board, or prune the analysis tree. In my opinion, some patterns lead to positions that are much more clear than other equivalent patterns. My intention here is to write always in second place such pattens, and the use that I make of equivalent patterns is that in my games, mentally I always replace the first patterns by the equivalent counterparts.

Here are several examples of pairs of equivalent positions, and a short explanation on the way to prove them so.

Example 2

The equivalence is obtained by applying two times the example 1.

Both examples before are instances of the following rule to produce equivalence pairs. Given a chain G, let the neighborhood of G, neigh(G), be the set of cells next to one of those in G but not belonging to it. In a given pattern P1, suppose that G is a chain owned by the player A, and that C is a cell in neigh(G) such that any cell of A next to C belongs to G. Let P2 be the pattern that results when A occupies C (removing an opponent stone, if necessary), therefore P2 contains a chain G' containing G and C. If neigh(G')=neigh(G) then P1 and P2 are equivalent.

This rule justifies the following equivalent pairs:

Example 3

Example 4

Another rule producing equivalent patterns: If there are two empty cells C1 and C2 in a pattern, such that if the opponent of the player A occupies one of them, A can occupy the other capturing the latter, then an equivalent position is obtained if both C1 and C2 are occupied by A.

Equivalent pairs obtained with such rule:

Example 5

This is a very instructive pattern because it shows that playing 2 rows out from a friendly edge with 2 free cells on the first row below the play is equivalent to playing at all three cells simultaneously, and hence at least as good as playing at either cell on the first row. So as a rule, never play on the first row in such a situation. We can see this by viewing the 3 upper red stones as part of a friendly edge.

This pattern, along with Example 4 can be used to show that the two move start A1 + B1 (or either single move) for Red loses on a board 3x3 or bigger:

Example 5b (Opening A1+B1 loses)

So, in response to A1+B1 by Red, Blue can play at B2, reaching a position equivalent to just blue stones at A1, A2, A3, B1 & B2. This includes the cells A1 & A2, so the original position is lost for Red by a strategy stealing argument.

In fact, making the opening play B2 is equivalent to playing 5 stones at A1, A2, B1, B2 & C1, however this is known to produce a losing position on boards of size 4, 7 & 8 (see small boards).

Example 6

Example 7

Using both rules together:

Example 8

Example 9

(generalization of the Example 5, for any horizontal length)

Third rule for equivalent patterns (rather obvious) rule: Any area surrounded by a single chain of each enemy may be randomly filled. This happens because the outcome of the game does not depend on it at all.

Equivalence for reasons other than capture

Capture is not the only way in which equivalent patterns arise. For example, the following two patterns are equivalent:

aa

This is easily seen by noticing that if the cells marked "a" are both blue, the patterns become equal, whereas if the cells marked "a" are both red, then the blue piece next to them are dead and therefore the patterns become equivalent. So whenever one player's strategy calls for playing in the cell marked "a" in one of these two patterns, the same player can play in the cell marked "a" in the other pattern.


Practical example

Let us see a practical example. In game #206040 at Little Golem, the situation after 55. m2 is shown in the board below.

abcdefghijklm12345678910111213

Clearly, m2 is strongly connected to the top, because the stone in f4 is a ladder escape. On the other hand, it is strongly connected to the bottom exactly if blue cannot connect k3 with the right, using j6 and maybe the group in h8-h9-f10 as a ladder escape. In fact he cannot do it, and it is much clearer if some patterns are locally replaced by other equivalent ones, rendering:

abcdefghijklm12345678910111213

The changes have been:

  • f6 and h5 swap color, as in Example 1.
  • The blue group from d8 to l11 is completely wrapped by a strongly connected group belonging to the opponent, except for a narrow section (typically, 2 cells). This kind of groups typically are captured, exactly in the same reason as in Example 1.
  • If blue moves to i7, red moves to i9 and conversely, in both cases enclosing the blue group h8-h9-f10 as before. So, we can use the second rule for detecting equivalent patterns, capturing it.
  • The equivalence in Example 5 can be used for the stone in c12.
  • The equivalence in Example 4 can be used, adding a stone for Red at m11.
  • The area in the bottom of the board is now surrounded by a red chain and a blue chain. Therefore, it may be filled as we please.

The blue stone in j6 remained, completely alone and too near to the red group to be of any use in such a small region, so it is obvious that Red has won.