Possible # of legal positions.

General conversations about Go belong here.
User avatar
Solomon
Gosei
Posts: 1848
Joined: Tue Apr 20, 2010 9:21 pm
Rank: AGA 5d
GD Posts: 0
KGS: Capsule 4d
Tygem: 치킨까스 5d
Location: Bellevue, WA
Has thanked: 90 times
Been thanked: 835 times

Possible # of legal positions.

Post by Solomon »

From the wiki page on Go and mathematics, the number of legal moves positions based on the size of the Go board:

(1, 1) -> 1
(2, 2) -> 57
(3, 3) -> 12,675
...
(19, 19) -> 2.08168199382 * 10^170

My question is, is there a function that takes the board size as input and can output the possible number of legal moves positions?
cyndane
Dies in gote
Posts: 65
Joined: Mon Jan 14, 2013 12:02 pm
Rank: 1k KGS
GD Posts: 0
Has thanked: 10 times
Been thanked: 16 times

Re: Possible # of legal positions.

Post by cyndane »

The function isnt specified here, but maybe reading some of John Tromps work would reveal it? The sequence itself may be interesting to you?

https://oeis.org/search?q=1%2C57%2C1267 ... &go=Search
xed_over
Oza
Posts: 2264
Joined: Mon Apr 19, 2010 11:51 am
Has thanked: 1179 times
Been thanked: 553 times

Re: Possible # of legal positions.

Post by xed_over »

wouldn't a 1x1 board have 0 legal positions? The first stone played would have no free liberties, so its already illegal.

or is suicide legal? In that case, the number of legal moves would be 2 (one each for black and white), after that the board position repeats. (or maybe it repeats after the first move, so we're back to 1 legal move)
User avatar
Shawn Ligocki
Dies with sente
Posts: 109
Joined: Sat Dec 28, 2013 12:10 am
Rank: AGA 1k
GD Posts: 0
KGS: sligocki
Online playing schedule: Ad hoc
Location: Boston
Has thanked: 159 times
Been thanked: 19 times

Re: Possible # of legal positions.

Post by Shawn Ligocki »

xed_over wrote:wouldn't a 1x1 board have 0 legal positions? The first stone played would have no free liberties, so its already illegal.

or is suicide legal? In that case, the number of legal moves would be 2 (one each for black and white), after that the board position repeats. (or maybe it repeats after the first move, so we're back to 1 legal move)
No, it has 1 legal position, the empty board. (At least I assume that a position is a choice of {Black, White, or Empty} for every coordinate on the board and legal means that all groups have >= 1 liberty.)
Uberdude
Judan
Posts: 6727
Joined: Thu Nov 24, 2011 11:35 am
Rank: UK 4 dan
GD Posts: 0
KGS: Uberdude 4d
OGS: Uberdude 7d
Location: Cambridge, UK
Has thanked: 436 times
Been thanked: 3718 times

Re: Possible # of legal positions.

Post by Uberdude »

Legal positions or legal moves? the thread content and title are inconsistent.
User avatar
Shawn Ligocki
Dies with sente
Posts: 109
Joined: Sat Dec 28, 2013 12:10 am
Rank: AGA 1k
GD Posts: 0
KGS: sligocki
Online playing schedule: Ad hoc
Location: Boston
Has thanked: 159 times
Been thanked: 19 times

Re: Possible # of legal positions.

Post by Shawn Ligocki »

I suspect there's no simple way to specify the function, but you can read the paper by Tromp and Farnebäck that is mentioned in the Wikipedia article:

http://www.researchgate.net/publication ... f5f2a0.pdf
User avatar
Solomon
Gosei
Posts: 1848
Joined: Tue Apr 20, 2010 9:21 pm
Rank: AGA 5d
GD Posts: 0
KGS: Capsule 4d
Tygem: 치킨까스 5d
Location: Bellevue, WA
Has thanked: 90 times
Been thanked: 835 times

Re: Possible # of legal positions.

Post by Solomon »

Uberdude wrote:Legal positions or legal moves? the thread content and title are inconsistent.
Sorry Uberdude. I meant positions in the post, but of course both are of interest.
DrStraw
Oza
Posts: 2180
Joined: Tue Apr 27, 2010 4:09 am
Rank: AGA 5d
GD Posts: 4312
Online playing schedule: Every tenth February 29th from 20:00-20:01 (if time permits)
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Has thanked: 237 times
Been thanked: 662 times
Contact:

Re: Possible # of legal positions.

Post by DrStraw »

Almost certainly there cannot be a function which gives an exact value. But there may be one which gives a fair estimate. Sort of like the the approximate formula x/logx for the number of primes.
Still officially AGA 5d but I play so irregularly these days that I am probably only 3d or 4d over the board (but hopefully still 5d in terms of knowledge, theory and the ability to contribute).
gowan
Gosei
Posts: 1628
Joined: Thu Apr 29, 2010 4:40 am
Rank: senior player
GD Posts: 1000
Has thanked: 546 times
Been thanked: 450 times

Re: Possible # of legal positions.

Post by gowan »

Of course there is such a function! It is defined by P(n) = the number of legal go positions on an nxn board. Equally of course this definition doesn't help you to compute the function's values but that's not what Araban asked.

I think some care is needed in stating what counts as a legal position. Is it true that all arrangements of stones such that each group has at least one liberty are reachable from an empty board by a sequence of moves valid according to whatever rule set is being used?
DrStraw
Oza
Posts: 2180
Joined: Tue Apr 27, 2010 4:09 am
Rank: AGA 5d
GD Posts: 4312
Online playing schedule: Every tenth February 29th from 20:00-20:01 (if time permits)
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Has thanked: 237 times
Been thanked: 662 times
Contact:

Re: Possible # of legal positions.

Post by DrStraw »

gowan wrote:Of course there is such a function! It is defined by P(n) = the number of legal go positions on an nxn board. Equally of course this definition doesn't help you to compute the function's values but that's not what Araban asked.

I think some care is needed in stating what counts as a legal position. Is it true that all arrangements of stones such that each group has at least one liberty are reachable from an empty board by a sequence of moves valid according to whatever rule set is being used?
If you are going to be pedantic then maybe it is not a function. Maybe the number of different board positions depends on the rule set and so it is merely a relation. I'm not actually sure if a position can be legal under one rule set and not under another.
Still officially AGA 5d but I play so irregularly these days that I am probably only 3d or 4d over the board (but hopefully still 5d in terms of knowledge, theory and the ability to contribute).
Mef
Lives in sente
Posts: 852
Joined: Fri Apr 23, 2010 8:34 am
Rank: KGS [-]
GD Posts: 428
Location: Central Coast
Has thanked: 201 times
Been thanked: 333 times

Re: Possible # of legal positions.

Post by Mef »

DrStraw wrote: I'm not actually sure if a position can be legal under one rule set and not under another.
To my knowledge there are no positions among common rule sets that would be legal in one but not another. The only ways to make a position illegal is to have a group with no liberties remain on the board, and this is universally forbidden. I suppose there would be strange exceptions for tournament rules where a player can accept the position "as is" (implicitly under AGA) as opposed to having a forfeit occur (Japanese)...But I'm thinking we'll skip over that because it's a bit too much of a meta game
User avatar
ez4u
Oza
Posts: 2414
Joined: Wed Feb 23, 2011 10:15 pm
Rank: Jp 6 dan
GD Posts: 0
KGS: ez4u
Location: Tokyo, Japan
Has thanked: 2351 times
Been thanked: 1332 times

Re: Possible # of legal positions.

Post by ez4u »

Mef wrote:
DrStraw wrote: I'm not actually sure if a position can be legal under one rule set and not under another.
To my knowledge there are no positions among common rule sets that would be legal in one but not another. The only ways to make a position illegal is to have a group with no liberties remain on the board, and this is universally forbidden. I suppose there would be strange exceptions for tournament rules where a player can accept the position "as is" (implicitly under AGA) as opposed to having a forfeit occur (Japanese)...But I'm thinking we'll skip over that because it's a bit too much of a meta game
What about suicide moves? If Black plays a suicide move as a ko threat, does the turn end with the suicide stones still on the board? In other words, does White remove the stones as a part of her turn? If so, that would seem to create such a position, no?
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21
moboy78
Dies with sente
Posts: 72
Joined: Sun May 19, 2013 7:23 am
GD Posts: 0
KGS: moboy78
IGS: moboy78
Has thanked: 6 times
Been thanked: 9 times

Re: Possible # of legal positions.

Post by moboy78 »

xed_over wrote:wouldn't a 1x1 board have 0 legal positions? The first stone played would have no free liberties, so its already illegal.

or is suicide legal? In that case, the number of legal moves would be 2 (one each for black and white), after that the board position repeats. (or maybe it repeats after the first move, so we're back to 1 legal move)
I would imagine having a 1x1 board is impossible. The smallest board you could conceivably have is a 2x2 board.
DrStraw
Oza
Posts: 2180
Joined: Tue Apr 27, 2010 4:09 am
Rank: AGA 5d
GD Posts: 4312
Online playing schedule: Every tenth February 29th from 20:00-20:01 (if time permits)
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Has thanked: 237 times
Been thanked: 662 times
Contact:

Re: Possible # of legal positions.

Post by DrStraw »

moboy78 wrote:
I would imagine having a 1x1 board is impossible. The smallest board you could conceivably have is a 2x2 board.
Attachments
1x1 board.jpg
1x1 board.jpg (4.43 KiB) Viewed 9176 times
Still officially AGA 5d but I play so irregularly these days that I am probably only 3d or 4d over the board (but hopefully still 5d in terms of knowledge, theory and the ability to contribute).
User avatar
moyoaji
Lives in sente
Posts: 773
Joined: Fri Jun 14, 2013 12:53 pm
Rank: KGS 1 kyu
GD Posts: 0
Universal go server handle: moyoaji
Location: Michigan, USA
Has thanked: 143 times
Been thanked: 218 times

Re: Possible # of legal positions.

Post by moyoaji »

ez4u wrote:What about suicide moves? If Black plays a suicide move as a ko threat, does the turn end with the suicide stones still on the board? In other words, does White remove the stones as a part of her turn? If so, that would seem to create such a position, no?
Suicide functions exactly like capturing. So if black plays a suicide move, then white immediately captures his stones. This occurs as part of black's turn, not white's turn, so the board state never has stones without liberties on it.

The only thing that might vary would be if the board state contained many important kos. A triple ko rule would end a game before it reached 7 or 8 large kos, so these board positions would be unreachable under certain rulesets. However, they would not necessarily be illegal board states.
"You have to walk before you can run. Black 1 was a walking move.
I blushed inwardly to recall the ignorant thoughts that had gone through
my mind before, when I had not realized the true worth of Black 1."

-Kageyama Toshiro on proper moves
Post Reply