News:

VIP Donor members can now edit photo galleries and utilise an extended Custom Profile with buddy lists. Join them - for the price of a beer!

Main Menu

How do 'luck' calculations work..

Started by diane, June 26, 2010, 01:50:48 AM

Previous topic - Next topic

diane

Quote1. Rollout¹    13/11 13/10                  eq:+0,906
     Player  : 79,43% (G:33,22% B:1,06%)
     Opponent: 20,57% (G:2,93% B:0,25%)
     Confidence: ± 0,005 (+0,901<E<+0,911)
     Duration: 17 minutes 32 seconds

   2. Rollout¹    13/10 8/6                    eq:+0,895 (-0,011)
     Player  : 79,00% (G:33,07% B:1,07%)
     Opponent: 21,00% (G:2,93% B:0,21%)
     Confidence: ± 0,005 (+0,890<E<+0,900)
     Duration: 14 minutes 20 seconds

   3. Rollout¹    13/8                         eq:+0,894 (-0,012)
     Player  : 79,60% (G:31,59% B:1,07%)
     Opponent: 20,40% (G:2,74% B:0,22%)
     Confidence: ± 0,005 (+0,889<E<+0,899)
     Duration: 12 minutes 32 seconds

   4. Rollout¹    13/11 8/5                    eq:+0,885 (-0,021)
     Player  : 78,72% (G:33,03% B:1,08%)
     Opponent: 21,28% (G:2,98% B:0,23%)
     Confidence: ± 0,005 (+0,880<E<+0,890)
     Duration: 12 minutes 16 seconds

Ok, I have a feeling like I am picking up a can of worms and throwing them all over the floor...but here goes  ;)

I have heard tell that a good player will appear more lucky, because they are 'creating luck', a concept I am wrestling with.

I spotted something in some of the match rollouts - and would like to see if I now understand this - or if I am making it too simple.

In the roll out above [and indeed all rollouts/evaluations], the best moves have the highest equity, with the least good moves coming out with negative results - judged against the best move.

If the equity increases with a good move...the player has a better chance of something good happening next roll - ie more rolls work well for them etc...

Under analysis - does this 'maximising equity per move' directly translate into a good luck rating in analysis...quite simply because the program is is using potential equity changes to measure how lucky a player is in a match?

Does anyone understand that - and am I completely missing the point?
Never give up on the things that make you smile

sixty_something

it is late or early here and i am soon going to bed, but i can't resist giving you my perspective to see if others can clarify this for both of us .. i spent a lot of time with GNUbg during my hiatus from FIBS and other on-line activities .. during that time i asked this very same question

the answer i found was that "luck" in GNUbg is indeed a calculation .. the "luck" calculation is based on the change in equity from one position to the next regardless of whether the player chose the optimal or best move or not .. for a match, one can take the sum of all these "luck" calculations for consecutive positions to come up with the totals we see on the Match Analysis well within any round-off error

i very carefully did those calculations for every consecutive pair of positions in a few matches .. it was quite tedious .. as i recall, my notes were on the backs of a few envelopes .. so, this was very sophisticated stuff - lol .. i may have entered them into Excel, but i can't seem to find them at the moment .. the originals are somewhere in a box or buried under a stack of miscellaneous other papers in preparation for my move next month

regardless, my definition of a "luck" calculation based on those careful empirical observation is simply the change in equity from one position to the next .. GNUbg uses threshholds to define lucky, very lucky, unlucky, and very unlucky .. what we see are only very lucky in boldface and very unlucky in italics

for a match or game. "luck" is simply the sum of all "luck" calculations for all positions in the game .. the various ways GNUbg describes our luck is also defined with threshholds .. the exact values of those threshholds are not known by me

regarding the allegation that "a good player will appear more lucky, because they are 'creating luck'", is  related to "luck" calculations after the fact .. where one may literally see the "creation of luck" is a little more complicated .. you may glimpse it, IMO, but not actually find it by looking carefully at a series of Temperature Maps for each possible move .. what you will notice is that the best moves tend to be those that create the more intense shading in a temperature map regardless of the roll, i.e. the best moves optimize potential equity gain from one move to the next roll whatever the next roll may be

therein, IMO, is the "creation of luck" concept best illustrated

in conclusion i would add that "creation of luck" approaches equity in the future tense while "luck calculations" measure it in the present tense which when summed provide a past tense tabulation for an entire game or match

hope that helps .. remember it is late or early here still and my research notes are on the back of an envelope in an undisclosed location .. my brain may be in a similar undisclosed location as well ;)

A little inaccuracy sometimes saves tons of explanation. -- Unknown
e-mail me

blitzxz

Quote from: diane on June 26, 2010, 01:50:48 AM
Under analysis - does this 'maximising equity per move' directly translate into a good luck rating in analysis...quite simply because the program is is using potential equity changes to measure how lucky a player is in a match?

Does anyone understand that - and am I completely missing the point?

No it does not. "Objective" (bot) luck doesn't depend on what the player moves. And everybody has zero luck in the long run even the world best players. (But in the long run really means in the EXTREMELY LONG run.) However, maximizing equity increaces chances to win and subjectively this may seem as good player is "making his luck to happen".

boomslang

I havent checked GnuBG's source code, but I am pretty sure 'luck' is calculated as follows:

For a specific roll, luck is the difference between the equity/MWC after playing the roll correctly and the weighed average of 21 equities/MWC's after playing all 21 possible rolls correctly.

Luck for a game/match for a specific player is the sum of luck for all rolls for the player during that game/match.

Quote from: diane on June 26, 2010, 01:50:48 AM

I have heard tell that a good player will appear more lucky, because they are 'creating luck', a concept I am wrestling with.


They are not creating luck, they move in such a way that few of their opponents rolls are good rolls and more of their own rolls are good rolls. This duplication and diversification is already incorporated in the equity of the position. The player might apppear more lucky, but it is just the result of maximizing equity, i.e. making the correct move.

RickrInSF

i think a good example of the appearance of creating luck can be seen with dorbel's last 5 3 move, many lower ranked players would have simply moved two men off the 13 and made two blocks, instead dorbel made it so the next roll, there are more "lucky" rolls

sixty_something

#5
Quote from: boomslang on June 26, 2010, 02:17:55 PM
I havent checked GnuBG's source code, but I am pretty sure 'luck' is calculated as follows:

For a specific roll, luck is the difference between the equity/MWC after playing the roll correctly and the weighed average of 21 equities/MWC's after playing all 21 possible rolls correctly.

Luck for a game/match for a specific player is the sum of luck for all rolls for the player during that game/match.

that sounds as if it may be correct, boomslang .. i do recall small errors creeping into my calculations which i couldn't explain .. when summed for the match the errors on "luck" calculations for individual rolls tended to be well within an acceptable margin of error

if you ever have a chance while browsing through GNUbg code, i'd be interested in knowing that answer .. also, do you know what the threshhold settings are in match analysis for the various luck factor phrasings, i.e. "Go to bed!", "Go to Las Vegas immediately!", etc
A little inaccuracy sometimes saves tons of explanation. -- Unknown
e-mail me

ah_clem

I have heard tell that a good player will appear more lucky, because they are 'creating luck', a concept I am wrestling with.


I think the best way to understand this is that there are two notions of the term "luck" . People who understand probability (including blitzxz, boomslang, and the folks behind gnubg)  define the term in strictly mathematical terms - the luck for each roll is just the difference between the equity before the roll and the equity immediately afterward.  With this definition, nothing anyone can do over the board (other than manipulating the dice) affects luck.  Luck is orthogonal to  the checker play and cube decisions.


But most people don't understand probability, so their notion of "luck" is more nebulous.  In their world, if a player rolls something that allows him to do something good, that's a "lucky" roll. If the player rolls something that forces him to play something awkward, that's an "unlucky" roll.

The thing is,  good players position their checkers so that lots of rolls allow them to do something good and few rolls force them to do something awkward, thus many rolls will look "lucky".  Conversely, beginners will pile their checkers up on a few points where most rolls deteriorate their position, and when the inevitable happens they see it as "unlucky". So if you think about "luck" like most people do, the good player is more "lucky" because he gets more good rolls and fewer bad ones.  Of course, if you understand probability, you can see that it's not luck at work here, but skill at maximizing the number of good rolls and minimizing the number of bad ones.

For example, a beginner will think it's "unlucky" that he misses an indirect shot seven points away (1 in 6 or 17% chance), and then think it's "lucky" that his opponent hits a direct shot six points away ( 17/36 or  47% chance) But the player who understands that there's a huge difference between two seemingly very similar positions will play the percentages, and the player who doesn't understand the game will think it's luck.

Bottom line: good players will create positions where many rolls allow them to have good plays.  When the good rolls come up, many weaker players will think it's "lucky", but it ain't.  It's just playing the odds and maximizing equity.


diane

Quote from: ah_clem on June 28, 2010, 03:29:24 AM
I have heard tell that a good player will appear more lucky, because they are 'creating luck', a concept I am wrestling with.


I think the best way to understand this is that there are two notions of the term "luck" .

For example, a beginner will think it's "unlucky" that he misses an indirect shot seven points away (1 in 6 or 17% chance), and then think it's "lucky" that his opponent hits a direct shot six points away ( 17/36 or  47% chance) But the player who understands that there's a huge difference between two seemingly very similar positions will play the percentages, and the player who doesn't understand the game will think it's luck.

Thanks clem - these two I am good with.  It is just the creating luck thing...which is essentially making the best moves so more rolls work for you next time...expressed mathematically, but in words  ;) I am interested in.

Gnu gives an overall luck rating on a match - measured about the change of equity you would have got, if you had played the best move, for each move played.

In my head...if you play well and increase the number of rolls which 'work well' next go, then they will give higher equity change - and therefore rate as 'lucky'.

Does this accumulation of the positive equity equate to, say, bots appearing more lucky [on analysis] more often?

Never give up on the things that make you smile

ah_clem

Quote from: diane on June 28, 2010, 03:57:46 AM


In my head...if you play well and increase the number of rolls which 'work well' next go, then they will give higher equity change - and therefore rate as 'lucky'.



Placing your checkers well will result in a higher  equity, but not a higher  equity change due to the roll. gnu calculates luck by looking at the equity before the roll and comparing it to the equity after the roll.  The pre-roll calculation is basically the average of the equity of all the possible rolls, so any equity advantage you gain from placing the checkers well will already be reflected in the pre-roll equity.  Since luck is just the change in equity, this increased equity won't be won't be reflected in the luck.

To cite a simple example, lets say  it's almost the end of the game and you have a choice of two moves - one allows you to win with 100% certainty  no matter what happens, and the other gives you opponent a non-zero chance.  For example:


GNU Backgammon  Position ID: AAAARQAAAAAAAA
                 Match ID   : cAklAAAAAAAA
+13-14-15-16-17-18------19-20-21-22-23-24-+     O: oin
|                  | O |                  | OOO 0 points
|                  |   |                  | OOO
|                  |   |                  | OOO
|                  |   |                  | OOO
|                  |   |                  | OO
v|                  |BAR|                  |     1 point match (Cube: 1)
|                  |   |                  | XX
|                  |   |                  | XX 
|                  |   |                  | XXX
|                  |   |                  | XXX Rolled 21
|                  |   |       X        X | XXX 0 points
+12-11-10--9--8--7-------6--5--4--3--2--1-+     X: You
Pip counts: O 25, X 5




If you play 4/1  it doesn't matter what the dice do, you've already won.  Compared to 4/2 1/off, it's a big increase in equity, yet since the dice are irrelevant, every roll will be marked as having neutral luck.  Your  advantage is already built into the pre-roll equity calculation.  Hopefully this is easy to see at 100% GWC, but it works the same way at every other GWC.


boomslang

Quote from: diane on June 28, 2010, 03:57:46 AM
Does this accumulation of the positive equity equate to, say, bots appearing more lucky [on analysis] more often?

I think if you look at the luck of bots (and good players) have during a match or game, then you will see that they are more often 'lucky' (meaning having a positive sum of MWC/equity) than 'unlucky' (meaning having a negative sum of MWC/equity).

Bots need less luck to win a match because they don't waste equity/MWC by making bad moves. This means that *if* they lose, it is because they were really unlucky. But since all players will have zero luck in the long run, this must be compensated by having a 'moderate' positive luck more than 50% of the matches/games.

I dont know if anyone can back this up with empirical data though. I might give it a go if I can find some spare time.

ah_clem

Quote from: diane on June 28, 2010, 03:57:46 AM

Does this accumulation of the positive equity equate to, say, bots appearing more lucky [on analysis] more often?


I am aware of no evidence that bots appear more lucky on analysis.  If you stick to the mathematical definition of luck as implemented by gnubg et. al. the bots should have neutral luck in the long run, just like everyone else.

If you find evidence that their luck is  different (outside the customary statistical confidence intervals, of course)  I'd be very interested in seeing it.

RickrInSF

vic shouting everytime he looses to a bot does NOT count as evidence

dorbel

I agree with boomslang. The total amount of luck between two sides must tend towards zero over time, because there is an equal total of positive and negative luck on every roll. However, this doesn't mean that there are an equal number of lucky and unlucky rolls on each turn. Good play will lead to more "lucky" than "unlucky" rolls in the course of a game, hence the better player will be slightly more likely to have positive luck at the end of each game and at the end of each match. The lesser player will balance this out with a greater amount of luck in fewer matches, thus wasting a lot of it.

Part of the problem is that the bot definition of luck is incomplete. There are several other different kinds of "luck", i.e. events over which we have no control, that affect the outcome of games but are not measured by the bot. However, good play can only ever have a positive effect in the long term, so forget about luck and play better! You'll get luckier.

sixty_something

i am inclined to agree that "luck" calculations in the long run will tend toward a zero sum for both bots and humans .. however, i think there may be a difference in the distribution of luck

for example, let's take a look at a "PerfectBot", call it PB, that plays only 5 point matches and plays at the highest possible skill setting .. after say a thousand matches, the distribution of "luck" in each match against a wide variety of opponents, would, IMO, look like a normal distribution for PB and be tending toward a zero sum

i would further suggest that the opponents "luck" distribution would look different .. exactly how different i am not sure .. would it be skewed? would it have a wider range of outliers? would it still tend toward a zero sum?

the only way to tell is by collecting such a dataset .. it would seem to me that the owner of the GammonBot's and BlunderBot's might be able to help us here .. for example, when a bot finishes a match, couldn't it simply output to a file a data record with a collection of match analysis values for collection and review? if so, i think we'd come a lot closer to understanding the answer to this very intriguing question

IMO, since a bot would tend toward making perfect moves which by definition include a careful analysis of how any "luck" in the next roll(s) might impact equity values

would said bot therefore tend toward optimizing "luck"?

i think that may be a distinction without a difference .. "equity" and "luck" are just two aspects of the goal seeking neural net seeking out a match win .. whether they are independent aspects is a very interesting question

finally, none of this directly explains the three sets of 66's by a bot that beat Tanika today or vic's lament that his "luck" in a match today was a personal worst at -208 .. for me, those two examples are interesting in that we humans tend to remember such examples of bad "luck" far more than good "luck" .. would a collection of data over time from bots games with humans recording and examining both "skill" and "luck" provide any additional insights? perhaps, IMO

while we might not see individual instances, as above, i think the data over time would confirm by tending toward zero sum "luck" that humans roll three sets of 66's to win as often as bots do and, when human "luck" hits +208 or bots hit -208, it is much easier to assign and remember as ones skill not luck ;)

A little inaccuracy sometimes saves tons of explanation. -- Unknown
e-mail me

ah_clem

Quote from: dorbel on June 28, 2010, 08:07:28 PM
I agree with boomslang. The total amount of luck between two sides must tend towards zero over time, because there is an equal total of positive and negative luck on every roll. However, this doesn't mean that there are an equal number of lucky and unlucky rolls on each turn. Good play will lead to more "lucky" than "unlucky" rolls in the course of a game, hence the better player will be slightly more likely to have positive luck at the end of each game and at the end of each match. The lesser player will balance this out with a greater amount of luck in fewer matches, thus wasting a lot of it.

Yes.  Good players will have more rolls with positive luck because they arrange their checkers so that most rolls play well.   IOW, with good play most rolls are above average.  The thing is, with so many rolls above average, they're not very far above average so the roll will be only slightly lucky. Conversely, poor play makes for a very few lucky rolls, but when they happen they are way above the average roll (which is brought down by so many poorly playing rolls) and are marked as very lucky.

So with good checker play you should expect a lot of rolls that are marked as slightly lucky and a few that are marked as very unlucky.  For poor play, one expects the opposite: lots of slightly unlucky plays with a few very lucky ones.

I'm not sure that it follows that "the better player will be slightly more likely to have positive luck at the end of each game and at the end of each match."  Maybe I'm missing something....

Zorba

Maybe it helps to see backgammon as a game of american football (sorry for the real football fans, but yeah, this is what it's called  ;)). I'll ignore (back-)gammons and the cube. The middle line of the game is equity 0, or 50% GameWinningChances. Your scoring line is equity +1, or 100% GWC, Opponent's scoring line is -1 or 0% GWC.

The game starts with the ball in the middle: equity zero (or 50% GameWinningChances).  A lucky roll brings you closer to the goalline, as equity increases. An unlucky roll takes you farther away, decreasing equity. The good side of the middle line is positive equity, or >50% GWC; the bad side of the middle line is negative equity, or <50% GWC. The same goes for opponent's rolls, but with the opposite effect for you. So basically, luck comes in two forms for a player: good luck on his own roll, or bad luck on opponent's roll.

If this was all there was to backgammon, just luck and no skill, then it's just waiting until one side gets enough cumulative luck (including bad luck for opponent) to cross the goalline (i.e. win the game). Obviously both sides have equal chances, and the total amount of luck needed to win a game this way is half the playing field, in bg equity +1 (or 50% GWC).

Now, the skill factor basically means that you can make errors in the game, which will bring you farther away from the goalline than just the luck factor would have determined. The same is true for your opponent, but with the reverse effect for you: an error by opponent will bring you closer to your goalline, without needing luck.

An example: you win the opening roll 3-1. This is lucky. You go from the middle line to the next line, ten yards closer to the goalline, just on luck alone. Equity wise, say you jump from 0 to +0.1 and in GWC from 50% to 55%.

Now suppose you play the 3-1 wrong, 24/23 13/10. This is like a 0.1 error, or -5% GWC. It will set you back 10 yards, and you're back to the middleline.

You were lucky, but you haven't made any progress in the game, because of your blunder. Basically, you threw away some of the luck you got, by playing a bad move. If you do this often, and your opponent doesn't, it's easy to see that you will need more good luck to win a game, than your opponent does!

So, when a good player plays a bad player, the latter will make a lot more errors, bringing the better player closer to the goallline all the time, without him needing luck for that.

As it is however, single backgammon games tend to have a huge luck factor, meaning that the advantage a better player creates by the above process is typically quite small. Like, with equal luck for both sides, after a series of moves, the better player has moved 10 yards from the middle line, closer to the goalline. Still plenty of yards to go, and luck will be needed to cross that distance. But your opponent will need even more luck to win this game, as he's farther away from his goalline.

In equity terms: after a bunch of moves in a game, the better player can expect to have gained f.i. +0.2 equity due to opponent's errors being worse than his. Now the better player needs "only" 0.8 luck to win the game; the worse player needs 1.2 luck to win the game. 0.8 luck is more likely to happen than 1.2 luck. So yes, the better player gets lucky more often, but by smaller amounts; the worse players gets lucky less often, but by bigger amounts (as he needs them!). Multiply the two (frequency of luck * amount of luck) and the total luck both sides receive is still equal.

The fascist's feelings of insecurity run so deep that he desperately needs a classification of some things as successful or superior and other things as failed or inferior. This also underlies the fascist's embracement of concepts like mental illness and IQ tests.  - R.J.V.

Luck is my main skill

diane

These are fascinating worms..I mean replies  ;)

This is uncovering more than I originally considered.

To clarify what I am attempting to understand...here are some more words, and sorry Zorba, I dont do American Handball  :laugh: :laugh:

Backgammon is a mix of luck and skill, the more skillful you are, the better your chances of winning - and that is the only aspect of the game you can influence.....or is it.....

If I roll Zorbas 3-1 opening as described above - and play the optimum move, I have an equity change about that roll.
If I play it correctly, I influence the potential equity change on the next roll positively....
If I play it wrongly, I have the opposite effect.

So, roll 1 has an imaginary equity gain of +3 [nice roll  ;) ]

Played correctly - total so far +3
played incorrectly, still +3, cos that is irrespective of what I did with it.

The we split into two parallel universes  ;)

Universe 1 - where I played correctly, so the next roll has more good things I can do with it, therefore better potential equity gain..

Roll 2 has an imaginary equity gain of +2 [it wasnt as nice an imaginary roll]

I play this correctly and get the +2 equity...total in the imaginary game so far = +5 luck factor...ooh arent I getting lucky  :cool:

Universe 2 - where I played the first roll incorrectly...the next roll has less good things I can do with it - therefore less potential equity gain..

Roll 2 here has +1 associated with it...I play this one incorrectly too - but since in a luck calculation, we are only looking at what I could have got...it is still +1

Total for game so far..+4 luck factor

And on this process goes.

Leaving aside that bad luck comes too, regardless of what you play, and what your opponent is doing with his own good or bad fortune...doesn't this show that by playing well, a backgammon player influences her own luck factor [as calculated by the analysis programs] for the better....leading to a potential statement that...

Increasing your skill level not only improves your chances of winning, but increases your overall game luck factor?

Now this wont ever overcome a -208 luck factor, but it should help to convince the ever increasing 'analysing crowd' that it is still worth improving play, because improved play improves luck ratings.

That is of course, if my reasoning isn't as full of holes as the England defence  :laugh: :laugh:
Never give up on the things that make you smile

blitzxz

Quote from: sixty_something on June 28, 2010, 09:12:36 PM
i think the data over time would confirm by tending toward zero sum "luck"

I've been thinking this too, but after about 35000 moves in my database my luck rate per move is +4 millipoints EMG. This means that if I would be able to play with -4 snowie error rate I should be able to challange perfect playing (zero lucky) bots even after 35000 moves. (If I'm understanding this correctly?) I'm starting to believe I must possess supernatural lucky aura and it will never go to zero. :D Any one else have long stats about their luck?

Zorba

#18
Quote from: diane on June 29, 2010, 04:05:58 AM
If I roll Zorbas 3-1 opening as described above - and play the optimum move, I have an equity change about that roll.
If I play it correctly, I influence the potential equity change on the next roll positively....
If I play it wrongly, I have the opposite effect.

The first statement is correct; the second and third are wrong.

About one: In bot-speak, the roll changes your equity, in this case positive, because it's a lucky roll.

The bot determines that it's a lucky roll, by looking at what it thinks is the best play with the roll, determining the equity after playing that (8/5/6/5) and then comparing that to all the other scenarios possible, and the associated best plays with that. 8/5 6/5 gives you a better position than any of the other scenarios, so it's a lucky roll, far above average.

Now, you have just rolled, not moved yet. In these equity calculations, a move can only be correct (equity is what the bot already determined above) or an error (equity is less than what the bot had determined; the difference is your error). You cannot "gain" equity with a good move; all you can do is avoid losing equity by not making any errors.

So a bad move, lowers your equity right away. It doesn't per se influence anything on the next roll. You just start out with lower equity.

A good move, i.e. the correct move, gives you the equity the bot thinks you should have (i.e. higher than after any other move). It doesn't per se influence anything on the next roll either. You just start out with the equity you should have had.
The fascist's feelings of insecurity run so deep that he desperately needs a classification of some things as successful or superior and other things as failed or inferior. This also underlies the fascist's embracement of concepts like mental illness and IQ tests.  - R.J.V.

Luck is my main skill

diane

Quote from: blitzxz on June 29, 2010, 11:15:11 AM
Any one else have long stats about their luck?

Yes...I should go to bed... :laugh: :laugh:

I have all the matches I have played saved - and analysed hundreds of them..I kept a spreadsheet for a long time and it was, frankly, depressing.
Never give up on the things that make you smile