Skip to content
Little GolemMake your next move.

endgame table

Public forum discussion.

Dots-and-boxes

#1 · wccanard

1 Jan 2009

Let's see if I can post a table...

<font face="courier"><br/>position    |value value(posn+n) for n=4  5  6  7  8  9 10 11
<br/>-------------------------------------------------------------
<br/>   .        | 0                        4  5  6  7  8  9 10 11
<br/>   4L       | 4                        0  1  2  3  4  5  6  7
<br/>   6L       | 6                        2  3  4  5  6  7  8  9
<br/>  4L+6L     | 2                        2  1Q 0Q 1  2  3  4  5
<br/>  4-4L      | 4                        4  3  2  3  4  5  6  7
<br/> 6L+4-4L    | 2                        2  3  4  3  2  3  4  5
<br/>   3        | 3                        3  4  5  6  7  8  9 10
<br/>  3+4L      | 1                        1Q 0Q 1* 2  3  4  5  6
<br/>  4L+4L     | 0                        4Q 3  2  1  0  1  2  3
<br/> 3+4L+4L    | 3                        3* 23 1  2  1Q 0Q 1  2
<br/> 4-4L+4L    | 0                        0  1  2  1  0  1  2  3
<br/>    </font>

#2 · wccanard

1 Jan 2009

OK, that's as good as I can expect (the double carriage-returns don't have to be there but I don't know how to get rid of them). This is a table of endgame values.

The history: I used to have a much bigger table (25k of text; computer-generated) of certain endgame values, but later on, as I understood dots and boxes endgames better, I managed to compress it into the above. I *never* look at this table now (in fact it took me a while to find; I do my endgame calculations by hand now because I got quite practiced at them). As I recall I generated the table by hand, so it might contain mistakes.

Here's how to read it. Going down we have entries like 4L+6L or 3+4L+4L. These are loony endgames (i.e. endgames where the next move will be one where the guy who has won the chain battle will be able to play all-but-two or all-but-four). Notation: 3 is a 3-chain, 4L and 6L are 4-loops and 6-loops, and 4-4L means a 4-chain running into a 4-loop (a "dipper"). The top entry (".") means "nothing".

The first column in the table is the value of that game. So e.g. v(4L+6L)=2---the person not in control opens the 6-loop, the controller takes 2 and now whether or not he gives away 4 he'll end up with no more (he wins 4 and loses 4).

The other columns are the values of the game on the left plus an isolated long chain of length 4,5,6,... . A standard man-in-the-middle argument shows that if the length of the long chain changes by 1 then the value of the game changes by 1---but it might go up or down. Eventually it starts going up and keeps going up (when staying in control to the end is the best idea) but this might not happen for a long time. I remember at the time being fascinated by the ups and downs of the rows. I find it highly unlikely that one could devise an endgame which fitted an arbitrary up and down pattern (e.g. does there exist one which goes down for 100 then up for 100 and then down for 100 and then up forever? Probably not but I can't prove this).

The other annotations (Q, * or 3) mean "open the quad is best", "opening either the shortest chain or the shortest loop is best" and "opening the 3-chain is best". Note in particular that the last but 1 line of the table does *not* say that the value of 3+5+4L+4L is 23, it says that it's 2 and that opening the 3-chain is best [look at the spacing].

For a more general endgame position, with more than one long chain, you use the "5+5=6" rule: two isolated chains of lengths a,b>=4 can be replaced with an isolated chain of length a+b-4 without changing the value of the game.

One can easily add to the table as appropriate if one finds oneself in an endgame not on the table. I did this myself for a while but when I stopped using the table I stopped adding to it. Maybe this table is of some help to some other people though.

#3 · Macbi

1 Jan 2009

I've been looking at similar things. Can you tell me, since you proved 5+5=6, is there a similar 10L+10L=12L rule? Does 8L+8L=8L?

#4 · Macbi

1 Jan 2009

Okay, when thinking about the pattern of ups and downs, I've been think about them as a position's signature. wccanard's been looking at the pattern as a long chain length increases from 4. I've been defining them so that we can extend this pattern back into the negative numbers:

The signature is a function from the integers to the integers. We find the signature of a position K (with only loony moves remaining) by calculating the value of K and and a game G of value x (x can be as positive or negative as we like). We compel the players to play in G only when they are done playing in K. If you prefer, x is a reward (or punishment if negative) for not being the person to play when K finishes. Thus any loony endgame K has a signature k(x).

The signature of a 4-chain is |x-2|+2 which is just a 45 degree line coming down and then turning up again at (2,2). The signature of a 3-chain is just 1 less than a 4 chain. The signature of a quad is |x-4| which hits the x-axis at x=4.

What do we know about signatures?

k(0) is the value of K

With the exception of the signature of the empty position (y=x), all signatures are non-negative everywhere.

They change by 1 or -1 as we step between the integers.

For a signature to have value 0 at some point, the position must have a quad (or it's the empty position again). In anything else the second player must already have some boxes by the time they get to choose whether to double deal or not.

Past certain values in both positive and negative directions the signature will stop wibbling about and will climb upwards only (Apart from the empty position). The most positive minimum is where CV=V. The most negative minimum is placed in a similar way, but we need to account for the fact that the controlling player will take all the boxes in the last chain, and give their opponent the -x.

#5 · Macbi

1 Jan 2009

Is there some sort of word limit? I just lost a load of the post!

#6 · Macbi

1 Jan 2009

I'll type it out again.

#7 · Macbi

1 Jan 2009

But first, a picture:

#10 · Macbi

1 Jan 2009

How pretty.

Now, what else can we say about signatures?

Things we (I) suspect about signatures:

(1) The amount of minima a signature has can be calculated from its constituents. Complicated things have more minima (Q,Q,3,3 has 9!), simple ones have less.

(2) Within the boundaries stated above, we can make arbitrary signatures.

(3) The highest a maximum can be is 4. I suspect this because this is the most we have to sacrifice in a double dealing move. This contradicts (2).

(4) You can calculate a positions signature from those of it's constituents. e.g. you can combine signatures of 3 and Q to get the signature of {3,Q}. This would allow us to calculate the values of complicated endgames more quickly.

#11 · Macbi

1 Jan 2009

(1)

Photobucket

Above (I hope) is a table showing the number of minima against the amount of quads and 3-chains in a position. If anyone can spot a pattern in those I'll be impressed, amazed, and grateful.

(2) and (3) if wccanard couldn't disprove 2, I doubt I can. I think there's something in the idea about a max height for maximums, but I can't make it rigorous.

(4) Unfortunately this can't be done because we can find C and K so that c(x)=k(x) but (C,A) doesn't have the same signature as (K,A) for some A. {Q,8} has the same signature as {4-Q,8}; but {3,3,Q,8} and {3,3,4-Q,8} differ at x=2. (It took me a while to find that example.)

I think (4) means that signatures aren't useful, but (2) and (3) are still interesting questions.

(Another point to ponder, Q and 4 have the same value in the negative direction, but different values in the positive direction. Why?)

#12 · flipster

1 Jan 2009

Ah, it's nice to see someone who is interested in dots and boxes theory.

I don't see why you made up a 'reward' though. Dots and boxes doesn't have such a reward, so you're just complicating things, and in fact by adding x it becomes a whole other game. I'm not saying it's not interesting, but I don't see how this is 'useful'.

#13 · Macbi

1 Jan 2009

Imagine we have a dots and boxes position. Using the 5+5=6 rule we can squish all the long chains into one long chain. As we vary the long chains length by one, we know that the value of the game goes up or down by one. If we could predict whether it would go up or down then we might be able to use this to calculate values more easily. However if we make this long chain too small () it might not be played last. In order to extend the pattern in a mathematically nice way, way replace the chain with a reward which is given at the end of the game. This way, we can look at "all" of each signature, and spot properties that we might not otherwise have done.

#14 · wccanard

1 Jan 2009

Macbi: "very long" loops do also add---I think I didn't get round to typing this up, but if a,b>=8 then aL+bL=(a+b-8)L.

As for signatures, if x is very large (e.g. x > total number of boxes in the position) then the value of a game G plus signature x will just v(G+x), because the best thing to do is to keep control to the end. But as x gets smaller I would expect the notions to start diverging, and in particular I don't even see that the first "wobble" would necessarily occur in the same place (I'm talking about your signature idea vs my table idea). In particular the questions you propose about signatures might not be related to the questions I mentioned about v(G+x). On the other hand both types of question might be hard. I've never thought about these signatures. I agree that if one could understand "wobbles" in my table perfectly then it would be easy to compute values---in some sense the two questions are the same. Wobbles in signatures are something I've not thought about though.

#15 · Macbi

2 Jan 2009

I think that your table values should always be the same as my signature values, because the very long (=) chains always get opened last. Hence a chain of length n in your table is the same as a reward of n in a signature.

btw (3) is false since 4L-100 has a maximum at 100.

#16 · wccanard

2 Jan 2009

my gut feelings are: (1) the table values aren't the same as the signature values, and (2) you shouldn't be able to construct arbitrary signatures because I suspect, although I never managed to prove, that if the graph goes up 5 times in a row then it will keep going up. i.e. all "oscillations" have amplitude at most 4.

I'll get back to you on (1).

wcc

#17 · wccanard

2 Jan 2009

[clarification: I never managed to prove that table oscillations must have size at most 4; I don't know anything about signature oscillations]

#18 · wccanard

2 Jan 2009

Macbi: your assertion that we're doing the same thing (tables, signatures) seems to be equivalent to the following assertion: if G is a loony endgame containing an isolated n-chain (n>=4) then there's an optimal play of G which finishes with someone opening the n-chain. Is this true? I don't immediately see either a proof or a counterexample.

#19 · Macbi

2 Jan 2009

It is equivalent. I thought that assertion had been proved and was common knowledge, but I can't find why I thought that. In Berlekamps book he states:

"If a loony endgame contains a loop of length k and an independant chain of length n, and if n>=k, then a canonical player should always prefer playing on the loop to playing on the chain, except possibly when k=n=4" This would seem to imply that there's a counterexample with 4 and a quad.

#20 · wccanard

2 Jan 2009

Berlekamp is summarising what Scott proved in her thesis. I saw Scott's thesis in June and made some notes on it; unfortunately the notes are at work and I'm at home. You have to be careful. IIRC the assertion, when correctly formulated, assumes that the loop of length k is the smallest loop and that the position is loony. For example, if I got it right, in [Icelandic 2x2]+100+6+6L, opening the 6-chain is a lousy move but opening the 6-loop is even worse (it loses control and decreases the terminal bonus). What Scott writes is correct though---Berlekamp just explains it slightly too vaguely (in my opinion, at least). Note that in the game 3+4+5+Q+Q opening the quad is not an optimal move, and opening the 4-chain is; this perhaps explains the exception k=n=4? I could say more on Monday when I go back to work.

#21 · wccanard

2 Jan 2009

PS you say "it is equivalent" above. Can you prove this or is it just a gut feeling? I don't know a proof or a counterexample, so in my mind the question is still open.

#22 · flipster

2 Jan 2009

Yes but I don't think there's a proof that opening a chain is never better than opening a dipper or bracelet of some sort. It's believable though.

"As we vary the long chains length by one, we know that the value of the game goes up or down by one. If we could predict whether it would go up or down then we might be able to use this to calculate values more easily."

Understatement. If you can do that, then you can calculate the value of every loony endgame. For example if you want to calculate the value of G+4, then you can just compute v(G+1000) [which is the controlled value] and then decrease the length of the chain by one 996 times.

I just don't believe you could find a function to calculate the value of a loony endgame by looking at some graphs and 'spotting properties'.

#23 · wccanard

2 Jan 2009

PPS are you asserting that for an arbitrary game G, v(G+n)=v(G + incentive n) for n>=4, or are you just asserting it for loony endgames?

#24 · Macbi

2 Jan 2009

Oh, I'm talking purely in terms of loony endgames.

#25 · Macbi

2 Jan 2009

As for the equivalency, if the chain in your version is opened last, it will act exactly like a reward, meanwhile, if we have a reward of >=4 it might as well be a chain that is given to whoever is in control.

If you really want then a man in the middle argument will work for one direction of implication:

We assume that there is an optimum play where the players open the long chain last, so we canonically restrict our opponents to play this way. We play one expert in a loony endgame {G,n-chain} (n>=4), and one in the game {G} with a reward of n. Whichever one goes first they have to move in G, so we copy their move into the other game. They have to keep playing in G til there are no more moves left, at which point we're to move in one game, and they're to move in the other, so we'll either get the reward or all the long chain, and the rest of the boxes will be split evenly as well. This just seems really obvious to me, if you can see what i'm missing, please point it out.

#26 · wccanard

2 Jan 2009

Yeah, I really do want a proof ;-) But that's just the kind of person I am. One has to be careful with these arguments too. For example, any argument that works just as well with "very long loop" replacing "very long chain" isn't going to work because I am pretty sure that it's *not* the case that v(G+incentive n)=v(G+(n-loop)) for n>=8 (or even for n>=1000). Your argument above seems to work just as well for long loops, does it not?

#27 · flipster

2 Jan 2009

The problem is that there's no proof that playing the long chain last is optimal.

#28 · Macbi

2 Jan 2009

It does. But then it proves that the assertion: "There exists a optimum play where players open the very long loop last" implies that "v(G+incentive n)=v(G+(n-loop)) for n>=8", which is not useful, since that intial assumption is false.

#29 · Macbi

2 Jan 2009

@ flipster: I know, I'm just trying to show that if we have that proof then wccanard's table values and my signatures are the same.

#30 · flipster

2 Jan 2009

wait, did I hit send message?

What I wanted to say:

If G is a loony endgame with dippers, loops and a long chain then as far as I know, noone knows how to decide which move to play

#31 · wccanard

2 Jan 2009

@flip: right, but it could still be the case that there are always moves which are at least as good as opening the long chain (as long as the long chain has length >= 4).

Macbi: it wouldn't surprise me if "v(G+incentive n)=v(G+n) for n>=4" is equivalent to the assertion "there's an optimal play in G+n involving opening the n-chain last if n>=4". But you think that both assertions are true! What I'm trying to establish is if you have a proof that they are true, not if you have a proof that they are equivalent.

#32 · flipster

2 Jan 2009

Do you have a reason to assume that playing the long chain last is optimal? I agree it sounds reasonable at least but it's hard to think about complex endgames with dippers and bracelets etc and make meaningful assumptions, imo.

#33 · Macbi

2 Jan 2009

Ah, okay when you said:

'PS you say "it is equivalent" above. Can you prove this or is it just a gut feeling?'

I thought you were asking if I could prove that "v(G+incentive n)=v(G+n) for n>=4" is equivalent to the assertion "there's an optimal play in G+n involving opening the n-chain last if n>=4". But in fact it seems that you were asking if I could prove that your table values were equivalent to my signature values, which I can't, yet. Does that make sense now?

#34 · Macbi

2 Jan 2009

To be clear, I was talking to wccanard then, not you flipster.

#35 · wccanard

2 Jan 2009

Aah I see the misunderstanding. Yes it makes sense! I can't think seriously about these problems at the minute; I'm just glancing at the forums whilst babysitting 3 kids. When I'm at work on Monday I'll have some time for this though.

#36 · wccanard

5 Jan 2009

So Macbi: I tested the hypothesis that v(G+4) = v(G + incentive 4) for about 120 random loony endgames G and it was true in each case. So you may well be right and my gut feeling may well be wrong. The most complicated thing that G had in it was a dipper. I don't know whether to try earmuffs for a counterexample or whether to start seriously thinking about trying to prove your suspicion.

#37 · Macbi

5 Jan 2009

I've been trying to get a man-in-the-middle proof of it, but I'm failing because there's no obvious canonical move to play instead of the non-canonical one: "play in the long chain".

#38 · Macbi

5 Jan 2009

I'm glad that you haven't found a counter example though,I've been playing all my games using this hypothesis!

#39 · wccanard

5 Jan 2009

I was motivated to implement earmuffs so I did. Still no counterexamples.

Flipster: I agree that if the position is topologically complicated then it's very hard to understand what is happening. Even when the controlled value is positive one has to work hard to work out the best line of play because there are topological problems that one must solve (finding the maximal set of node-disjoint loops). But it still might be the case that adding an isolated chain doesn't do much, in some sense.

However ultimately I agree with flipster---even if my gut feeling is wrong and Macbi's incentive approach really does turn out to be a generalisation of my table above, which it may well be, it still might be very hard to actually use these ideas to understand the incentives of a complicated position (and in particular to compute the value of a position) in terms of its simpler subpositions---things might be genuinely "deeper" in some sense. I guess that in some sense Macbi has come to the same conclusion with his Q+8 example above. Even so, the incentive is a rather fascinating invariant of a position!

#40 · wccanard

5 Jan 2009

Macbi: if you're trying to MITM it then perhaps the argument after playing in the long chain should just be a "brute force" one rather than anything inductive. See the proof of Prop. 31 in my technical notes. If one canonical guru is opening the long chain then this tells you that opening the long chain is a canonical move, which tells you a lot about the value of the position, and you have to somehow use this.

Another random comment: perhaps it's the case that one should try and prove something stronger---sometimes this is easier. For example trying to prove v(G+(m-chain)+(incentive n)) = v(G+incentive (m+n)) for some reasonable values of m and n.

Perhaps this comment is important: do you believe v(G+n)=v(G+incentive n) for an arbitrary game G? If not---if you only believe it for G loony---then you'll somehow have to use looniness (lunacy?) in your proof. My Prop. 31 is valid for all games G.

I bet flipster could prove the assertion v(G+n)=v(G + incentive n) for simple loony endgames, if it's true.

#41 · wccanard

5 Jan 2009

Let me try posting a position.

<font face="courier"><br/>   +-----+-----+-----+
<br/>                     |
<br/>   +-----+-----+     +
<br/>   |     |           |
<br/>   +-----+     +     +
<br/>   |                 |
<br/>   +     +     +-----+
<br/>    </font>

#42 · wccanard

5 Jan 2009

I hope that's clear. Let G be that position. Note that G is most certainly not loony.

My claim is that the value of G + incentive 4 is not the same as v(G+4).

Let's say it's P1 to move. Note that G is going to be "1 chain", and that this will occur in 2 moves if no-one plays a loony move.

OK so how to play G+4 as a standard dots and boxes endgame. If P1 just makes a quiet move in G then P2 turns the resulting position into one long chain, possibly by sacrificing a box, and in each of these lines P2 will beat P1 by at least 6 boxes.

What if P1 tries something more aggressive in G+4? He could pre-emptively open the 3-chain in G. But then P2 just eats all 3 boxes and continues to make the quad in G, and we're heading for an SCB worth 1 and a LCB worth 0 so P2 will win by 4 boxes in this line.

Finally, what if P1 opens the 4-chain (the chain not in G at all?). Aah, but this is the best move! Whatever P2 does, he's going to end up a mere 2 boxes ahead at the end. Let's say he takes all but two (and thus keeps control). Now again any quiet move by P1 in G will see him losing a huge chain, but now pre-emptively opening the 3-chain---well, this is delicate. The correct line involves an idea which I've only seen come up in real play twice [once flipster played this against me *grr* :-)]. P1 opens the 3-chain and the optimal play for P2 is to take all three boxes and then pre-emptively open the quad! (which is currently looking rather like a 3-chain). Whatever P1 does he ends up 2 boxes down in total.

#43 · wccanard

5 Jan 2009

The above argument showed (well, sketched a proof that) v(G+4)=2. Now finally I claim that v(G + incentive 4) is 4. Again the quiet moves for P1 are disastrous, causing him to lose by at least 6. But opening the 3-chain prematurely only costs him 4 on this occasion. P2 takes all three boxes and again just makes a quiet move in the resulting position, takes the box he's offered on his next move and opens the quad. This is the optimal line unless I've slipped up.

Macbi: I wouldn't be surprised if you were to now show me a much much more trivial example of a game that isn't a loony endgame for which v(G+4) isn't v(G+incentive 4) :-)

#44 · wccanard

5 Jan 2009

I just used my program to check that Macbi's incentives really do agree with my table values for incentive 0 and n>=4, for G in the table.

#45 · wccanard

5 Jan 2009

Macbi: I tried to complete your 3/Q table above and I get different answers :-(

Let's consider the position Q+Q+3+3 with incentive -12. My understanding is that you're asserting that the value of this is 4 but I make it 6. P1 opens something and P2 definitely should stay in control because his plan is to only lose control at the very end, handing P1 the penalty of 12.

If P1 leaves a quad till the end, then he makes a profit of 6 in 3+3+Q and then loses 4+12=16, costing him 10. If P1 leaves a 3-chain until the end, then he makes a profit of 9 in 3+Q+Q and then loses 3+12=15, so this is the best line, costing P1 only 6.

If P2 dares lose control at any point other than the last move then suddenly P1 will make a huge profit because he'll keep control until the last move and swipe the 12 thus losing by at most 2 boxes, so P1 will never do this.

What do you think?

#46 · wccanard

5 Jan 2009

I think your table (of numbers of minima) extends to this:

<font face="courier"><br/>Q\3 0   1   2   3   4   5   6   7   8   9  10
<br/>-----------------------------------------------
<br/>0 [ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10 ]
<br/>1 [ 1,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12 ]
<br/>2 [ 2,  5,  8,  9, 10, 11, 12, 13, 14, 15, 16 ]
<br/>3 [ 3,  9, 12, 13, 14, 15, 16, 17, 18, 19, 20 ]
<br/>4 [ 4, 11, 16, 17, 18, 19, 20, 21, 22, 23, 24 ]
<br/>5 [ 5, 15, 20, 21, 22, 23, 24, 25, 26, 27, 28 ]
<br/>6 [ 6, 17, 24, 25, 26, 27, 28, 29, 30, 31, 32 ]
<br/>    </font>

(I'm sure I could get further but I'm still a bit worried that our figures disagree)

#47 · wccanard

5 Jan 2009

I believe your comments after the table about Q+8 vs 4->Q+8 though :-/ Well spotted. The "reason" that the signatures of Q and 4 agree on one side but not the other is that it costs the same to lose control with Q and 4, but it doesn't cost the same to keep control. I'm sure you're well aware of this!

#48 · wccanard

6 Jan 2009

Flipster pointed out to me that v(G) and v(G+4) [the first two columns in my table] are always congruent mod 4. If that observation holds in general, and if Macbi's idea about signatures really are a generalisation of v(G+n), then there's another (conjectural, at least) obstruction to constructing a position with arbitrary signature.

#49 · ypercube

6 Jan 2009

I guess you mean the usual Dots-and-Boxes game where every square is connected to 4 other squares :)

#50 · wccanard

6 Jan 2009

Yes, although much of what is said here works for strings-and-coins on an arbitrary (not even planar) graph.

I should clarify though: Flipster certainly didn't conjecture that v(G)=v(G+4) for an arbitrary game G. He wondered if was true for a large class of simple loony endgames though.

Last page