> From: Robert Jasiek <
jas...@snafu.de>
Ah, exactly the best person to discuss this topic, since you have
been publishing the FAQ including rulesets and also you have posted
some newsgroup articles about theoretical questions and algorithms,
and several years ago you seemed to appreciate my Lasker-Maas
ruleset, although I was disappointed the current rules-FAQ doesn't
mantion them, presumably because they've never been used for an
official tournament/match nor any online server, and I haven't even
implemented them myself in any (informal) server or demonstrated
program.
Before I respond to your article, let me include an update on my
current random-symmetric play-to-end software: Since a week ago
when I achieved the first working version, I've made these
upgrades:
- I now check for playing into cul-de-sacs which can be "obviously"
converted into an eye if the entrance were played instead. Such
moves now give NO as to permission for play in random-symmetric
algorithm. In particular two-point-eyes don't get half-filled
(which just means reaching a final position takes fewer moves),
two-point false eyes get filled only at the connection points, not
at the already-connected points, and multi-point linear eyes never
get filled at the endpoints, only in the middle points. This
doesn't change the fact that the algorithm will always terminate,
but it significantly improves the quality of truly random, making
it less frustrating for the kibitzer.
- I've changed the random-symmetric algorithm to have a parameter
as to the probability that black gets next move, instead of always
50% each player. This allows me to bias the sample according to one
player stronger than the other. By using a range of such
probabilities from nearly 0 to nearly 1, I can effectively see what
happens if one or the other player gets all the moves he could
possibly want, and thus kill any tactically alive group that isn't
absolutely connected with absolutely solid eyes.
- I have a simple loop that alternates plays, respecting the
situational super-ko rule. After showing the board, before asking
the next player to choose a move, it plays-to-end with very strong
bias of pblac=0.01 and pblack=0.99 to detect (almost always) the
absolutely best each player could achieve if the other player
decides to pass perpetually. I use it as a reminder that there are
still some connections needed before the random lookahead is
guaranteed to compute the correct score. As soon as the low bound
and upper bound are equal, it offers to end the game right now
without further removing of dead stones, because it *knows* what's
alive and what's dead already.
- Using Monte Carlo sampling (random play to end) with pblack
ranging over several values from near 0 to near 1, I get a
sampleset that estimates the range of end results. Using that, I
wrote a playing program that makes "safe" moves by making the legal
move whereby the Monte Carlo samples after just that one move (no
deeper lookahead except the random-play-to-end itself) have worse
case possible result as least-bad as possible.
- Using the random-play-to-end, with a wide range of pblacks,
looking at the actual final boards (with territory filled) rather
than the score obtained on the whole board: For each point on the
original board, tabulate among all the end-boards (with territory
filled), +1 for that board-point belonging to black at the end, -1
for that board-point belonging to white at the end, 0 for that
board-point being unfilled due to seki, then scale those
per-board-point totals to a range of 1 to 9 so that they can be
printed on the empty spaces. For example, with this original board:
A B C D E F G
7 - X - - - - X 7
6 X X X - X X - 6
5 - X - X - X - 5
4 X X - X X O - 4
3 O O - O O - - 3
2 O - O - - O - 2
1 - O O - O - - 1
A B C D E F G
One of the runs of this who-might-control-which-points-of-board
gives this whole-board matrix:
((9 9 8 7 7 7 7)
(9 9 9 7 8 8 7)
(9 9 7 8 8 8 7)
(9 9 5 8 8 3 6)
(1 1 4 2 2 3 5)
(1 1 1 2 2 2 3)
(1 1 1 2 2 2 3))
which when embedded into only the empty points, gives this view:
A B C D E F G
7 9 X 8 7 7 7 X 7
6 X X X 7 X X 7 6
5 9 X 7 X 8 X 7 5
4 X X 5 X X O 6 4
3 O O 4 O O 3 5 3
2 O 1 O 2 2 O 3 2
1 1 O O 2 O 2 3 1
A B C D E F G
Now to answer your questions:
> >In 1996 [...]
> >The purpose of such an algorith, if I could get it to work
> >reliably, would be to generate Monte Carlo estimates
> Does this mean that you discovered MC for go years before everybody
> else? I thought that MC for go was discovered in the 2000s.
I thought of the idea, and wrote some code, but realized my
algorithm wasn't working, and didn't have a name for it at that
time, later heard of some new Go program that claimed to use Monte
Carlo methods, but from what I could tell from online descriptions
it wasn't like mine. Since mine wasn't practical (player with live
group tended to fill his own eyes, turning a live group to a
one-eyed group, at which point the opponent killed it), it didn't
"terminate", and I didn't have an easy way to detect which true
eyes shouldn't be filled and which false eyes should be filled, I
had two reasons not to brag about having the idea first, that I
didn't have it working at all usefully, and thus I had no way to
collect evidence that if it were made to work it'd actually give
good results.
The key difference between my idea and what I read about on the net
that others did is that my idea is to randomly choose who gets to
move next, rather than respecting the alternating play, thus
there's no need to worry about the ko rule (see my answer to you
below), no need to synchronize ko captures with ko threats, no need
to even care about ko threats, just treat any ko at this point as
"random winner".
So yes I was one of the people who thought of the general idea of
"Monte Carlo" sampling of how a game might end several years before
anybody had anything working well enough to publish reports of it.
As to who got such a general idea very first, I have no idea.
> Why do you not state a condition for illegal repetition (ko)? Do
> you treat them as YES for the sake of generating random plays and
> detect ko bans only later?
My key realization circa 1996 was that when randomly choosing who
plays next in Monte Carlo lookahead, you really don't need to care
about any ko restriction, because the following two random
sequences are identical in result:
- Black captures ko, white retakes ko, white fills ko.
- White fills ko.
Because we're choosing not just points on board but who gets to
play next at random, if a ko is the only playable point available
my algorithm will oscillate the ko back and forth until one of the
players randomly gets two moves in a row to fill it. Because my
algorithm is *not* supposed to choose the best move in alternating
play, not even close, because it's choosing *random* moves, some
samples will have black winning ko and some will haVe white winning
ko, thus correctly providing an interval around whatever the
tactically correct result would be with perfect alternating play.
The primary purpose of my algorithm is to correctly play out which
groups are alive and which are dead, *after* players have decided
the game is over and have filled dame and have made a few extra
moves inside their own territory to make absolutely sure their live
groups won't be killed if they now start passing and letting the
other player get several moves in a row to try to kill them.
Likewise remove all possibility of opponent rescuing his dead
stones, by *you* making extra moves to spoil any possible eye
shape, so that if you pass lots of consecutive times he still can't
make his dead stones come to life.
So if the game is truly **over**, all live groups solidly
connected, all dead groups totally eye-shape-spoiled, there will be
no possible sequence of legal moves that change the outcome, except
if a player fills his own eyes, which my algorithm avoids.
And if the game is not yet truly over, if there are still some
needed connection points, my algorithm can play against the human
to force him to make connections, and if there's any chance for a
dead group to make eyes, the computer can try to make eyes forcing
the human to truly kill it absolutely and forever.
And if the game is not yet over at all, my algorithm will give a
rough idea what might happen if one or the other players falls
asleep or has a mental lapse or is exhausted and in byo yomi,
showing how the winner isn't yet absolutely determined under such
mental-lapse situations. (Remember that Honinbo game earlier this
year when a player in byo yomi failed to correctly respond to a
threat against his tactically live group, allowing the opponent to
kill it.)
So if the game is truly *over* as defined above, any ko that might
occur is totally irrelevant, the invading stones are dead whether
they win the ko or not, so randomly playing out the ko, ignoring
the rule against repetition, gives the correct result in every
case.
I'm rather proud of my realization back then (circa 1996) that, for
those reasons, the ko rule can be ignored when using my (at that
time only proposed, but now perfected) algorithm.
> >- If illegal move (suicide), then NO.
> >- If capture, then YES.
> >- If fill one-point true-eye, then NO.
> >- If self-atari:
> > - If self dead-shape (rabbity-six or less) .AND. at least one opposing group
> > is put into atari with the remaining liberty shared with this group,
> > then YES; (Toward dead-eye-shape kill, or snapback, see examples 1,2.)
> > - Else NO. (Don't ruin a seki by giving other group two eyes, and don't
> > sacrifice dead shape if opponent can capture it and have one
> > eye where the other liberty is located plus one eye where the
> > dead-shape was killed, see example 3.)
> >- All other moves YES. (Toward killing dead enemy stones/groups inside
> > already-live group, and reducing all territory inside already-live group
> > to nothing except one-point eyes, whereupon no further moves will be
> > considered and thus algorithm will terminate.)
> Many thanks!
Thanks for what, for so clearly stating my rule for permitting or
not permitting a legal move in my algorithm?
> Do you suggest a definition for "self dead-shape"? Citing from
> Capturing Races 1, there are related definitions (the "eye" defined
> there is not a general definition of eye but defines a "semeai-eye"):
> "For semeais, an _eye_ is a region so that
> - it consists of connected intersections,
Ok so far.
> - it is surrounded by one player's stones of essential strings,
Huh? This sounds like jibbeish.
> - it does not contain any stone of an essential string,
More apparent jibberish.
> - if the player and his opponent play only within the region and do
> not remove any surrounding stone, the player moving first can
> necessarily fill all but one intersection and
> - if the player and his opponent play only within the region, the
> player moving _second_ cannot necessarily permanently partition it
> into at least two regions."
This is too complicated for my purpose, requiring actual minmax
alternating-play lookahead just to define an eye. My algorithm for
testing a one-point-eyeshape (i.e. ponnuki, or analagous 3-stone
edge shape, or 2-stone corner shape) as to whether it's a true eye
or a false eye, assumes all eyes have already been reduced to
one-point eyes. If some eyes are larger, Monte Carlo play-to-end
will sometimes play in the wrong places and fill what is tactically
a one-point-eye because of some larger eye elsewhere looking like a
way to separate the groups. But some other Monte Carlo samples will
happen to play better, showing a range of results, some correct
some wrong, but with the correct result somewhere within the span
of samples. With my restricted question, the question can be
answered with a static analysis (plus one trick that I'm keeping
secret for now), no lookahead needed to *define* what's a one-point
eye and what's a one-point false eye.
One caveat: Before I added the restriction on filling cul-de-sacs,
every eye truly reduced to one or more one-point eyes before the
random-symmetric play ended. At such a time, my definition of true
eye vs. false eye is (to my strong belief) absolutely correct, thus
when only one-point-eyeshapes remain, the false ones will be filled
(or captured if the other player randomly gets an extra move) while
every one of the true eyes will be preserved unfilled. But at an
earlier stage, while larger eyes still exist, my algorithm might
mistakenly fill a tactically-true eye because my algorithm treats
it as a false eye instead. I haven't yet done enough analysis of
this problem to decide whether it's a serious problem or not. In
particular, if two not-yet-connected strings share exactly two
eyes, one a one-point eye and one a two-point eye, all three empty
spaces are playable, so there's a 2/3 chance the two-point eye will
be half-filled yielding two one-point eyes wherey my algorithm will
correct leave both unfilled, but a 1/3 chance the one-point eye
will be filled instead, self-killing a formerly live group. With
only 1/3 chance of the wrong move in such a case, and Monte Carlo
methodology producing several random samples, it's very unlikely
the one wrong move will be selected for EVERY sample, so on first
thought it seems not to be a problem to worry about. With larger
eyes, the chance of randomly filling the one point eye instead of
reducing the multi-point eye is even smaller, but there might be a
case I haven't thought about that cause a serious problem.
(snipped more definition of eye that requires lookahead hence is
not suitable for my purposes)
> >algorithm (not described in this article) for
> >distinguishing true eyes from false eyes,
(Note this algorithm is *only* in the case where all eyes are one
point each.)
> Can you publish that algorithm, please?
I am not aware of any professional journal that would be willing to
publish such algorithm, and I'm not willing to post on the Web and
thus lose all my rights, so for the moment I'll keep it as a "trade
secret" until such time as I find somebody who can help me get a
patent on it.
> >and finally to include
> >the above algorithm for distinguishing possibly-useful moves (YES
> >per the above spec) from moves that are obviously worthless or
> >actually bad (NO per the above spec),
> How about a proof?
Huh? How can I prove that a move is "obviously worthless or
actually bad" if it satisfies my criterion?? It seems we have to
first define our terms and *then* we can make a claim using those
terms. All I have is a set of restrictions on legal moves, and a
claim that random lookahead of moves respecting those restrictions
will always terminate, and prior to terminating it'll never kill a
solidly connected two-eyed group and never break a minimal-liberty
seki (but it might kill a two-eyed group that isn't yet solidly
connected, and might break a seki if there are any extra
liberties). Is that the theorem you want me to prove, or what?
> >Experiments
> >late that night into Monday morning showed that in EVERY case the
> >algorithm reached a stable state, never self-destructing a group
> >that was absolutely alive (two eyes) and never breaking a seki,
> >always stopping when all eyes have been reduced to one-point eyes
> >and all sekis have been reduced to minimal liberties.
> Experiments are good - proof is better:)
There was an article in the American Mathematical Monthly several
decades ago equating a FOR-ALL/THERE-EXISTS statement in logic with
a two-person zero-sum all-or-nothing game. The thesis was that
sometimes it's better to just challenge crowdsourcing (using
21st-century jargon instead what the AMM used long ago to make it
more succinct) to see who wins a game rather than write a formal
proof as to who wins. Besides, checking a proof to see if it's
correct begs the question back to crowdsourcing of referees for the
proof, or else gets into infinite regress proving that the proof is
correct, or else requires conversion of the formal proof into
something that can be fed into an automated theorem-proving
program, but then who proves that the automated theorem-proving
program doesn't have a bug that mistakenly accepts a false proof?
Also, I can't define my algorithm with mathematical precision until
after I get a patent on my true/false-one-point-eye algorithm so
that that part of the algorithm can safely be made public, and
without defining my algorithm so precisely there's nothing to prove
that can be precisely stated.
> >Furthermore, if you are playing against the computer, if you pass
> >before the above critera have been satisfied, my algorithm will
> >give the computer the ability to continue to make additional moves
> >which might steal some points from you (killing some of your live
> >stones or rescuing some of its own stones) if you fail to respond
> >correctly, as well as make safety plays for its own groups, as well
> >as take dame if any are unfilled (you should have taken them
> >*before* you passed, you definitely lose points in this case if
> >there are an odd number of dame or if you fail to match the
> >computer at filling half the dame each), until the above criteria
> >are finally satisfied, at which point it will be able to count the
> >score.
> Ok.
Furthermore I imagine a Go server (using area scoring from the
outset, or during second stage of Lasker-Maas) whereby after a
player passes, if the opponent next also passes, the game-finisher
in the server will not tell the first passer that there was another
pass, but instead will pretend to be the other player, playing
additional moves against the player who passed first, and whenever
any of those moves threatens already-settled life/death questions
the first passer will be forced to stop passing or else suffer loss
of his group or life of dead opponent's group.
Likewise after two passes, the second passer will be confronted
with the computer playing moves on behalf of the first passer.
If either player makes a mistake and lets the computer steal
points, two different scores are computed, one for each player
against the computer, and if it turns out that one of the two
players made sufficient mistake to go behind in points when
formerly ahead, then at this point both players are losing to the
computer, and both are marked as having lost the game.
> >If any Internet Go server were to switch to Lasker-Maas rules,
> >instead of having players manually mark dead groups (as currently
> >done on IGS, which can cause nasty disputes if somebody marks a
> >live group as dead, and in any case it's a burden on the players),
> >then my algorithm could be used during stage 2 to (1) ask players
> >to please fill dame and fill connection points etc. to satisfy the
> >above criterion, actually telling the player which groups are in
> >danger of being captured if the opponent gets unlimited sequential
> >moves, then (2) automatically remove exactly the dead stones
> >without any possible mistake/dispute.
> Good idea. Wouldn't it be straightforward to adopt your algorithm
> to other, area scoring rulesets?
Yes. Any ruleset where there's no penalty for filling your own
territory, but there is possible penalty for leaving unfilled dame
before passing (if the other player then takes advantage to fill
dame instead), which includes stage 2 of Lasker Maas ruleset, and
whole game of regular area-scoring rulesets, could use my
algorithm.
However if there's a rule that white must make the last move, with
pass stones if white would normally pass first instead, in order
that area scoring has the same result as territory-only scoring,
there might be a problem. I have never played with AGA or NZ or
similar ruleset, and haven't studied all such rulesets, so I don't
know whether random-symmetric play would give the correct result in
all cases. But I suspect that the pass-stone rule or whatever they
use would invalidate the score per my algorithm. But really I don't
know.
Note that at present I'm using only the simplified ruleset (which I
invented circa 1964 when I first thought of programming a computer
to play Go, and which I actually implemented circa 1977 on a
computer at M.I.T., whereby my "expert system" would *always* win
if given first move on 5*5 or 7*7 board, thanks to a halfway decent
heuristic for choosing semi-safe moves, plus an exception list for
exact boards early in the game; although I called it "Computer
scoring" before I learned the "area scoring" jargon during the
1990's and before I discovered the online ruleset listing which
called it "Simplified rules" or somesuch).
I plan to stick with the "computer rules" a.k.a. simplified
area-scoring rules in the near future, until I have used the Monte
Carlo algorithm to guide a higher-level algorithm that would do
actual minmax lookahead. But if I ever get the higher-level
algorithm well enough developed, whereby it self-trains to maximize
area score, then at some point I'll want to implement Lasker-Maas
rules. My current idea is that every point in the game my program
will pretend both players suddenly pass, entering stage 2 of
Lasker-Maas rules, then the Monte Carlo lookahead will compute who
controls which points of the board, then an adjustment to the score
will be made according to who made more moves prior to this point
in order to correctly compute the empty-territory-only score. This
adjusted score, instead of the raw whole-area-score, would guide
the minmax optimization to distinguish between two possible next
moves that yield the same whole-area score but maybe one of them
gets one more point than the other under empty-territory-only
score. But until such time as it's close enough to the end of the
game that brute force lookahead can guarantee maximal area score in
a reasonable time, there's no point bothering with trying to
guarantee maximal empty-territory-only score.
Google-groups-search-key: imtrgfdi