bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Backgammon "starting position" and how GnuBG handles it.


From: Murat K
Subject: Backgammon "starting position" and how GnuBG handles it.
Date: Tue, 19 Mar 2024 02:46:30 -0600
User-agent: Mozilla Thunderbird

On 3/16/2024 6:15 PM, Ian Shaw via "Bug reports for and general discussion 
about GNU Backgammon. wrote:

You wrote "Not the "equity" but the "equity difference"
between the "from" position and the "to" position."

I said that because you had written: "The Contact Net does
not have an input for Opening Roll, which makes sense. The
bot plays by maximizing the equity of the next position.
The opening layout – with doubles prohibited - is never
the next position."

I don't know if the bot's not having an input is critical
because it can and indeed does seem to handle it later as
a special condition.

Each position has an average equity, which belongs to the
position itself, regardless of specific dice rolls, except
the starting position that can have two different equities
based when during the game it occurs.

What I had said applies to when the starting position is
the "previous position" not when it is the "next position".

Actually there is more to "maximizing equity" than this. I
will explain it further down.

I can't see any difference in outcome between selecting
the play that maximises the equity of the move made, and
maximising the equity gain between the current position
and the new position. The latter option just adds an
unnecessary subtraction step, so I doubt that's how it's
programmed.

There is a philosophical question here, aside from how the
bot is programmed. When you land on a "next position" from
any other "previous position", it may not matter but when
the "previous position" is the stating position, it does
matter, in that the equity gain may not come solely from
the dice roll and how it is played.

I agree that the Temp Map you posted is showing the equity
with doubles allowed. I've put then into a spreadsheet so
you can see the calculations.

Thanks for the effort that allows one to see the net luck of
rolls (as played as the bot plays) without having to calculate
them individually.

Your first table is exactly the same as GnuBG's temperature
map. The second table show the net luck after subtracting the
average luck but I fail to understand the use of the last two
tables...?

The equity of 31 after returning to the opening position is
+0.219. The equity after an opening 31 is also +0.219.


I can't believe that you are saying this. How can it not be?

The luck of a roll is its deviance from the average equity of
the position, which is different between the initial and later
occurrences of the starting roll. At the expense of insulting
you, I must say I just felt that I may be too stupid to waste
may time here... :(

> I conclude that there is no problem with the equity calculation
> that would affect how gnubg plays.

Based on what? I had mentioned the bug in GnuBG code not to
dwell on the obvious small error which may hardly ever happen
in real life, (I personally don't remember ever seeing a game
recycled to the starting position in my entire life), but to
indicate that GnuBG does treat the initial and recycled cases
of the starting position differently. The question is whether
it does it correctly.

Here is the section of code for you all's convenience:

272    if (is_init_board && n0 != n1)      /* FIXME: this fails
                                    if we return to the initial
                                    position after a few moves */
273             return LuckFirst(anBoard, n0, n1, &ci, &ecLuck);
274         else
275             return LuckNormal(anBoard, n0, n1, &ci, &ecLuck);

The visible evidence such as the tempreature map and the eval
screen prove that GnuBG isn't doing it right at least partially.

I'm just not going to waste my time inspecting the rest of the
code, (which we used to call "spaghetti code" in the old days
and in the case of GnuBG I'm tempted to call it "macaroni and
cheese" code), in order to see if it does correctly internally
in other function. Perhaps someone from the GnuBG team, with a
mastery of its code, can tell us.

The temp map was a later addition to gnubg, so I don't think
it's used in the luck calculation.

Do you know when was it added? (BTW: To be fair, I know but I
am asking to see if you know what you are talking about).

Even if the luck calculation is down as per the temperature
map, and there is an error in the luck calculation of the
opening roll, it won't permeate through to other rolls.
It's not just the temperature map. I had also attached the eval
screen. I agree that there won't be a ripple effect as far as
bot playing against itself but even so the final luck and skill
figures will reflect the calculation error.

The> luck calculation is based on the actual roll compared to
the> other 21 (14 in the opening) possible rolls.

Exactly. Because of another gamblegammon fallacy that luck+skill=1,
the error you will make playing the same dice roll at the initial
occurrence of the starting roll will be different than the error if
you do the same play at a recycled occurrence of the starting roll.

The luck of 31 after returning to the opening position is +0.112.

Where do you see that? The temperature map and the eval screen
both show the same values for both. Have you actually looked??

It's a good roll but not as good as any double. It's just above
the average of +0.107. The worst roll is 14 at -0.113. The luck
of an opening 31 is +0.219. It's a great roll, compared to the
average of 0.000. The worst roll is 14 at -0.219.

There is never such a thing as a position with an average equity
of 0.000

You are explaining it to me but your own ears don't hear yourself.

You want to make a distinction between the game not started being
on roll before the move. For example, if you tossed a coin to see
who started and then the winner rolls any non-double and plays it.
Then winning the opening roll would show a luck of +0.052.

It's not shown anywhere as such but, yes, that is what is understood.

The luck of an opening 31 is +0.167.

Yes.

This adds to +0.219, the same as above.

No. This is the fallacy. The coin toss happens outside of the game.
Like deciding who will play whites in a single "skill game" of chess.
It gives an advantage to a player without any skill involved. BG is
more of a game of luck than skill but still deciding who will start
playing happens outside of game and not requiring any amount of skill,
however small the requirement for skill in BG may be. Again, this is
so because of the fallacy luck+skill=1.

When calculating how lucky a player was during a game, you can't add
that +0.052 equity gained from the coin toss to the equity gained
from the dice roll. Simple to understand, no?

If the opening roll were a coin toss, I wouldn’t speak in the same
terms. I would say, "the equity before the toss is zero" because
that's the average equity of all 30 possible outcomes (player 1
wind the toss & rolls, player 2 wins the toss and rolls). I would
also say, "the equity having won the toss is +0.052 before rolling"
because that's the average equity of the remaining 15 possible outcomes.

Do you agree with the preceding paragraph?

Of course I do, since that's what I had also said in different words
except the word "remaining". Winning the opening roll doesn't deplete
any rolls to speak of remaining rolls. It's just a special occurrence
of the "starting position" as the "from position", based on an arbitrary
rule that the opening roll can't be a double.

I'm sure the match equity tables are calculated correctly. The
starting player of any subsequent game is equally likely, so the
equity of each game starts at zero.

You guys are the master of the "cube skill theory" who try to make a
rocket science out of gamblegammon and I would dare to challenge you
in that arena but maybe you can educate me more on this regarding it
in special cases of N-aways. Like 2-away, 1-away, post-crawford, etc.
Do you think it would matter differently if there aren't many or any
subsequent games...??

Now, to what I said I would explain more at the beginning.

After a player makes a move at any position, starting or otherwise,
the equity will be said to be maximized if the resulting position's
average equity if the highest compared to the results of other moves.

But that average can be the average of rolls with close equities of
luck, similar numbers of lucky and unlucky rolls, many somewhat lucky
and just a couple of super unlucky rolls, etc. etc.

Here is my argument. A player who believes to be the stronger player
will try to reduce the element of luck, which he won't need as much
as his weaker opponent. To this end, he would make his moves to end
up with "next positions" that will give his opponent the least swings
of luck, namely lucky swings since he doesn't rely on his opponent's
getting unlucky in order to beat him.

Thus the move that immediately maximizes the equity difference between
the "previous/from position" and the "next/to position" may not be, in
fact I am arguing that often it is not, the best play...

Does anyone dig this...?

MK


reply via email to

[Prev in Thread] Current Thread [Next in Thread]