
Number of legal Go positions computed - tromp
http://tromp.github.io/go/legal19.html
======
richard_todd
Does anyone try to count equivalence classes (after rotation or reflection)
instead of raw board positions? To my mind, that would also be of interest if
you want to know how many actually distinct game situations there are. I guess
as a rough under-estimate you'd just divide the count by (4 rotations * 2
reflections)?

~~~
tromp
That estimate would be equally precise and rough, in that the first 85 of 170
digits would all be correct.

Correcting the last 85 digits amounts to counting all positions with various
symmetries, which would be as big an undertaking as computing L19, but a whole
lot messier..

~~~
qwerty1793
Sorry, but how did you compute this? Do you know that there are less than
10^85 board positions which have a symmetry?

~~~
tromp
The bulk of symmetric positions are those with 180 degree rotation or
reflection symmetry, and there are at most 3^{10x19} of those (I had
mistakenly bounded it as 3^180). So it's actually less than 10^90, meaning
that L19/8 is correct in the first 80 digits.

------
Fargren
I played very little Go a very long time ago, so I don't know this: could
there be any legal positions that aren't reachable by any legal moves?

~~~
tromp
No; you can reach any legal position by just playing all its stones and
passing for the side that's done placing its stones.

------
daveloyall
A note for the author and new readers:

L19 means "the number of legal positions for a 19x19 board".

cf. L18 which means "the number of legal positions for an 18x18 board".

L19 does NOT mean position L:19 on the Go board. :)

------
Alex3917
The fact that the number of valid positions is 19 x 19 in base 3 is wild.
You'd have to be almost dan-level to immediately recognize that the pic above
isn't actually a real game.

~~~
teraflop
There are only 3^289 possible configurations of pieces on the board, so the
fact that the number of _legal_ configurations fits in a 289-digit ternary
number is kind of trivial.

~~~
infinity0
Yeah, I'm surprised more comments aren't pointing this out. To spell it out
further:

> the number of valid positions [of a game on a 19 x 19 board] is 19 x 19 in
> base 3

This statement is true when replacing 19 with _any number_ , since the number
of _legal and illegal_ configurations is exactly 3^(n*n).

------
tel
As I remarked elsewhere, what was more interesting to me was that the 2x2
board has hundreds of billions of games (assuming a superko, I suppose).

It's easy to recognize that there must be a lot of them, but hundreds of
billions is absurdly fast growing. As another data point, the 2x1 board has 8
games.

~~~
tromp
Table 7 on page 30 of our paper shows 9 games for 2x1. Did you forget the
shortest game "pass pass"? The number of non-empty games is even, according to
the color of the first stone played.

~~~
tel
Yup, forgot pass-pass!

------
sago
There are billions of valid games on a _2x2_ board? Can anyone explain or link
to something that explains how this is possible?

~~~
fargo
. . . . | B . . . | B . W . | B B W . | . . W W | B . W W | B B . . | B B W .
| B B . B | . . W . | . B W . | B B W .

Loops are possible in a 2x2

~~~
drdeca
Isn't it generally a rule that the game board can never be returned to a state
it was previously in?

~~~
tel
Generally the rule is that you can't return the board to the position it was
last in, but some rule sets extend it to any position it was ever in to avoid
a few pathological scenarios. Without this infinite loops can exist.

------
tromp
Previous discussion at

[https://news.ycombinator.com/item?id=9167781](https://news.ycombinator.com/item?id=9167781)

~~~
Someone
That discussion is worth reading, but looking at the title of the HN article,
it was about the earlier result for a 18x18 board.

This is a new result for the 19x19 board that appears to use the same URL.

------
ultramancool
To make sense of big numbers like this where any state is valid, I find it
good to compare with cryptographic key sizes, so in case anyone else is
wondering:

log_2(L19) = 565 bits

~~~
dragontamer
Chess is also a great game to compare against, since these numbers have been
computed for chess many years ago.

[https://en.wikipedia.org/wiki/Shannon_number](https://en.wikipedia.org/wiki/Shannon_number)

10^43 is the approximate number of chess positions. In contrast, 19x19 Go has
approximately 10^170 positions.

------
hendekagon
Tromp's website is a treasure-trove of really cool things

------
cinquemb
Although the determinate of that matrix = 0, and if it's conjugate transpose
determinant is non zero then I wonder if all valid possible configurations on
this board can be represented by a complex lie group?

Edit: did the work, it does, but too lazy to describe the group
[https://gist.github.com/cinquemb/18e494348045725e2b60](https://gist.github.com/cinquemb/18e494348045725e2b60)

------
33a
Does this take into account the super ko rule? If so, seems a bit small.

EDIT: Never mind, no it doesn't.

~~~
tasuki
Kos aren't relevant in any way when evaluating the validity of a board
position. (They're only relevant when evaluating validity of move sequences.)

------
schoen
Neat, is this sequence in OEIS?

~~~
3JPLW
Yes:
[https://oeis.org/search?q=1%2C57%2C12675&sort=&language=engl...](https://oeis.org/search?q=1%2C57%2C12675&sort=&language=english&go=Search)

~~~
schoen
Cool! It looks like OEIS only lists terms up to n=14, but they seem to be
getting them directly from the researcher who did the computation, so
hopefully it will be updated in the future.

~~~
tromp
They couldn't fit more terms on the A094777 page, but it links to a more
complete table at
[https://oeis.org/A094777/b094777.txt](https://oeis.org/A094777/b094777.txt)
which will soon be updated with the 19x19 result.

~~~
schoen
Congratulations on your results.

------
horsecaptin
Does this mean that a computer will soon be beating people at Go?

~~~
pmontra
This result is not related to AI. However a new pro-vs-computer match has been
announced today for February 6.

Japanese original
[http://www.nihonkiin.or.jp/event/area/other/post_704.html](http://www.nihonkiin.or.jp/event/area/other/post_704.html)

Google translation
[https://translate.google.com/translate?hl=en&ie=UTF8&prev=_t...](https://translate.google.com/translate?hl=en&ie=UTF8&prev=_t&sl=ja&tl=en&u=http://www.nihonkiin.or.jp/event/area/other/post_704.html)

The translation is pretty bad on technical terms. Obviously it's not about
chess or shogi, but about go, and the "ten stage" should be the Tengen title,
currently held by Ida Atshushi, the human player. I think this is the first
time a Japanese title holder plays in one of these matches. It will be a 4
stone match. If the computer wins it should be at least 5 dan, maybe 6 dan
(amateur scale). One should be at least 7 dan to be as strong as the weakest
pros.

~~~
tunesmith
Thanks for clarifying amateur vs pro - it's easy to overlook the fact that dan
levels are completely different when comparing amateur and pro. Is it that 7
dan amateur is roughly comparable to 1 dan pro?

~~~
igravious
30kyu -> 1kyu (amateur)

1dan -> 9dan (amateur)

1dan -> 9dan (pro abbrev. to 1p -> 9p)

I think 8d ama can start to have competitive games with 1p or 2p... I mean
they're getting into the same ball-park in terms of strength but averaged out
over time a rank above _will_ beat a rank below, that's why they are in the
ranks they are in after all :)

------
pavel_lishin
Can someone explain why factoring L19 is relevant?

~~~
tromp
1\. It's become a tradition, at least for counting legal positions in Go

2\. there are surprising similarities between the runtime complexities of dumb
and smart algorithms for counting and factoring

------
joeyh
I wonder what's the smallest Go board such that the number of legal positions
is a legal position?

(Not expecting an answer anytime soon.)

~~~
tromp
My previous writeup of the L18 result at

[https://web.archive.org/web/20150310085851/http://tromp.gith...](https://web.archive.org/web/20150310085851/http://tromp.github.io/go/legal.html)

answers your question: "only L2, L3, L7 and L10 can be represented as legal
positions themselves", graced with a picture of L10. L2=57 is 2010 in ternary,
which looks like

    
    
        O .
        X .

------
awl130
[https://en.wikipedia.org/wiki/List_of_top_title_holders_in_G...](https://en.wikipedia.org/wiki/List_of_top_title_holders_in_Go)

------
tel
Maybe it's a legal position if the numbers spiral out from the center.

Or, more precisely, I'd be okay with any sort of "nice" arrangement of digits
which made it work.

------
tetraodonpuffer
as a benchmark it seems would be interesting to port this to java/scala and
running it on a spark cluster, since it's map-reduce from the post (didn't
look at the code) it should be possible I would think

------
fiatjaf
Why would anyone waste time calculating this? You may be curious, but you're
not living to satisfy useless curiosity.

~~~
jwmerrill
Hacker News' charter (from the guidelines): "anything that gratifies one's
intellectual curiosity."

