Puerto Rico seat position... something really ridiculous is going on.

Discussions about BGA (all languages)
Forum rules
Warning: challenging a moderation in Forum = 10 days ban
More info & details about how to challenge a moderation: viewtopic.php?p=119756
User avatar
sourisdudesert
Administrateur
Posts: 4630
Joined: 23 January 2010, 22:02

Re: Puerto Rico seat position... something really ridiculous is going on.

Post by sourisdudesert »

Thanks for computing the odds :)

Here is the actual PHP code that is randomizing the players:

Code: Select all

        if( $bOrderPlayerRandomly )
        {
            // Shuffling player order (preserving keys)
            $keys = array_keys($players);
            $new_players = array();

            shuffle($keys);

            foreach($keys as $key) {
                $new_players[$key] = $players[$key];
            }

            $players = $new_players;
        }                

Notes:
_ $bOrderPlayerRandomly is set to "false" in case of a rematch, to perform a "players rotation" (already explained in other threads).
_ Why we are using the "shuffle" function is explained here: https://boardgamearena.com/faq?anchor=f ... ing_random . Basically, it is based on on Mersenne Twister algorithm, which is used by most Poker websites to randomize the card decks.


At the end, this discussion makes me think of this part of the (great) conference given at Google's headquarter by Eric Hautemont (former Days of Wonder CEO) about the players who could never believe that the dice rolled by the AI of Memoir 44' was fair. The best is to watch his exact words here:
https://youtu.be/LFj8Gw4maXg?t=1144

Hope this helps.
User avatar
dschingis27
Posts: 745
Joined: 27 June 2015, 18:30

Re: Puerto Rico seat position... something really ridiculous is going on.

Post by dschingis27 »

Thank you very much. I was going to ask for this. :)
User avatar
Rex Goodheart
Posts: 77
Joined: 28 September 2011, 23:20

Re: Puerto Rico seat position... something really ridiculous is going on.

Post by Rex Goodheart »

"The expectation is 4/8 as it occurs twice in the TTT case and once each in the other 2 cases."

That's correct. The expectation is 4/8, which is the sum of the right column.

" and each time the streak is extended it will count as another streak of 14. "

That's correct. And it's accounted for by summing all the identical probabilities of games 14 through 5151. Conditionality is already accounted for, just as in your example, because the probability for each game listed already depends on the previous 13 games.
User avatar
sprockitz
Posts: 666
Joined: 23 October 2014, 02:22

Re: Puerto Rico seat position... something really ridiculous is going on.

Post by sprockitz »

RexGoodheart wrote: 28 February 2020, 15:18 "The expectation is 4/8 as it occurs twice in the TTT case and once each in the other 2 cases."

That's correct. The expectation is 4/8, which is the sum of the right column.

" and each time the streak is extended it will count as another streak of 14. "

That's correct. And it's accounted for by summing all the identical probabilities of games 14 through 5151. Conditionality is already accounted for, just as in your example, because the probability for each game listed already depends on the previous 13 games.
My point was the expected value is correct (and comes out as such in the simple example) but not the streak probability occurring at least once...and that is due to conditional probability and the simple 3 coin flip example shows that the formula you used isn't correct.

For example, for #15 the probability of that making a streak of 14 is either 0.5 (if 14 made a streak) or a value of approximately 1 - .0000610351563/2 if #14 did not make a streak. This gives 85.5% of not happening at least once or 14.5% chance of happening at least once...which gets us in the ballpark with the 13.0%. This still works out where the expected value for each #14 to #5151 is .000061... but broken down based on the conditional probability is .000061*0.5 + .999939*.000061/~2. So if you are computing the probability of it never happening you can't use the expected value for each individual case as this expected value is much higher if a streak has already occurred on the previous number and thus skews the results dramatically.

Like the link shared, the calculated closed form solution is much more detailed. I want to find out what the right answer is now.

Here is the 15 state Markov model:
0.5 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0
0.5 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0
0.5 0 0 0.5 0 0 0 0 0 0 0 0 0 0 0
0.5 0 0 0 0.5 0 0 0 0 0 0 0 0 0 0
0.5 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0
0.5 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0
0.5 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0
0.5 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0
0.5 0 0 0 0 0 0 0 0 0.5 0 0 0 0 0
0.5 0 0 0 0 0 0 0 0 0 0.5 0 0 0 0
0.5 0 0 0 0 0 0 0 0 0 0 0.5 0 0 0
0.5 0 0 0 0 0 0 0 0 0 0 0 0.5 0 0
0.5 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0
0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

and can use this link to calculate: https://kilin.clas.kitasato-u.ac.jp/sof ... arkov.html

spits out a probability of 0.15. And while it only gives 2 significant figures, you can tell it is much much closer to .145 than .155 as you only have to decrease the 5151 to 5142 to get it to drop to 0.14 (really ~ 14.49) versus increasing it to 5529 to get it up to 0.16 (really ~15.50). And gives me confidence in the solution above using the conditional probability.
Last edited by sprockitz on 28 February 2020, 16:56, edited 2 times in total.
User avatar
sprockitz
Posts: 666
Joined: 23 October 2014, 02:22

Re: Puerto Rico seat position... something really ridiculous is going on.

Post by sprockitz »

I also realized my biggest oversimplification in getting to .130

since the first occurrence will occur on average almost halfway through a cycle, the probability of a second occurrence is roughly half that (close enough for things with relatively small probabilities). Also using .155 as the base instead of iterating throws things off too, but was looking for a quick approximation. In retrospect though figuring out the probability of #n giving a streak of 14 given 1:n-1 hasn't given a streak of 14 was a simpler and better (actual not estimated) approach.

Reworking the ad hoc approach though gets me to 0.143 which was at least pretty close.
User avatar
Rex Goodheart
Posts: 77
Joined: 28 September 2011, 23:20

Re: Puerto Rico seat position... something really ridiculous is going on.

Post by Rex Goodheart »

I believe I now have a handle on this streak stuff.

I've finally reconciled two numbers...

First, we know that with 3 coin flips there are 8 possible outcomes, and that the probability of not having a streak of two tails is 5/8 = .625

I couldn't figure out why that didn't reconcile with:

- after two coin flips the probability of not having a streak of two tails is .75
- the probability of getting a tail on the third coin flip that would complete a streak of two tails is .25
- therefore the probability of not having a streak of two tails after 3 flips would seem through lazy analysis to be .75 * .75 = .5625

But why doesn't that yield what we already know is the correct answer of .625?

Well, upon further inspection we have to add something back in: the probability that a new streak can emerge from both sides: success and failures.

The correct calculation is (.75 * .75) + (.25 * .25) = .625
Locked

Return to “Discussions”