Gambling system

Author
Discussion

Dr Jekyll

Original Poster:

23,820 posts

268 months

Tuesday 29th October 2013
quotequote all
To try to prove that a friends suggestion for a gambling system wouldn’t work I set up a computer simulation.

The simulation repeatedly generated a random number of either 1 or 2 and essentially represented 2 players always betting HEADS on the same spinning coin.

If the random process came up with a WIN both players won twice their stake, if it was LOSE both lost their stake.

The only difference between the players was that the first player one would stake 2 units if the previous spin was a loss and 1 unit if the previous spin was a win. The second player would do the opposite.

Bizarrely, over runs of 10,000 spins the first player nearly always did better than the second.

Change it to 1 in six odds and this still happened but was rather less pronounced, 7 runs out of 10.

When I changed it to 1 in 40 then player 2 did better.

I can only think it’s something to do with the random number generator not being truly random, perhaps having long runs of alternate win/lose/win/lose. Anyone know what’s going on here?



nsi

329 posts

205 months

Tuesday 29th October 2013
quotequote all
7 runs out of 10 is not statistically significant.

ReallyReallyGood

1,632 posts

137 months

Tuesday 29th October 2013
quotequote all
Did the first player keep doubling after each loss, or just after the first loss?

Could indeed be your random number generator, it needs to be exactly 50-50 (obviously), out of interest what randomization technique are you using?

Edited to add:
I can't think of a game where this is a real-life situation though as there is no house edge here, so it's not necessarily a useful simulation.

Edited by ReallyReallyGood on Tuesday 29th October 12:14

Dr Jekyll

Original Poster:

23,820 posts

268 months

Tuesday 29th October 2013
quotequote all
When I say 7 out of 10 runs, each run was the result of 10,000 spins.

The players didn't repeatedly double up, it was always either 1 unit or 2 staked.

I'd rather not be specific about the random number generator in case my boss sees the thread and wonders why I'm not concentrating on the credit card system he's paying me for.

ReallyReallyGood

1,632 posts

137 months

Tuesday 29th October 2013
quotequote all
Could always benchmark the RNG and print the ratio of Wins/Losses. Over 10000 it should be within 0.5% I'd imagine.

blindswelledrat

25,257 posts

239 months

Tuesday 29th October 2013
quotequote all
Dr Jekyll said:
To try to prove that a friends suggestion for a gambling system wouldn’t work I set up a computer simulation.

The simulation repeatedly generated a random number of either 1 or 2 and essentially represented 2 players always betting HEADS on the same spinning coin.

If the random process came up with a WIN both players won twice their stake, if it was LOSE both lost their stake.

The only difference between the players was that the first player one would stake 2 units if the previous spin was a loss and 1 unit if the previous spin was a win. The second player would do the opposite.

Bizarrely, over runs of 10,000 spins the first player nearly always did better than the second.

Change it to 1 in six odds and this still happened but was rather less pronounced, 7 runs out of 10.

When I changed it to 1 in 40 then player 2 did better.

I can only think it’s something to do with the random number generator not being truly random, perhaps having long runs of alternate win/lose/win/lose. Anyone know what’s going on here?
My take on it is that over a limited number of spins it is fairly random as to which of the two will do better.
Over in infinite number of spins then the one who doubles his stake will always win.

ReallyReallyGood

1,632 posts

137 months

Tuesday 29th October 2013
quotequote all
You say they win twice their stake; do you mean on top of their wager, or including their wager.

i.e. bet 1, after a win, balance is increased by 1. OR bet 1, after a win, balance is increased by 2.

Dr Jekyll

Original Poster:

23,820 posts

268 months

Tuesday 29th October 2013
quotequote all
There are only ever 2 stakes, 1 or 2.

Player 1:

If last spin was a win, stake is 1, else 2.

Player 2:

If last spin was a win, stake is 2, else 1.

mattnunn

14,041 posts

168 months

Tuesday 29th October 2013
quotequote all
Computers don't generate random numbers, only pseudo randoms ones.

I think your computer is having a laugh at your expense, it's going to happen increasingly as we edge nearer toward the technological singularity.

Dr Jekyll

Original Poster:

23,820 posts

268 months

Tuesday 29th October 2013
quotequote all
ReallyReallyGood said:
You say they win twice their stake; do you mean on top of their wager, or including their wager.

i.e. bet 1, after a win, balance is increased by 1. OR bet 1, after a win, balance is increased by 2.
I tried both, player 1 still did better.

mrmr96

13,736 posts

211 months

Tuesday 29th October 2013
quotequote all
Dr Jekyll said:
When I say 7 out of 10 runs, each run was the result of 10,000 spins.

The players didn't repeatedly double up, it was always either 1 unit or 2 staked.

I'd rather not be specific about the random number generator in case my boss sees the thread and wonders why I'm not concentrating on the credit card system he's paying me for.
Ok, flip a fair coin 10,000 times and write down HEADS if heads came out more often, or TAILS if tails came out more often. For this 'run' the outcome is 50/50 whether there would be more heads or tails.

Repeat this 10 times, and you'll have HEADS or TAILS written down ten times. The fact that 7 out of 10 times you got more HEADS than TAILS out of 10,000 flips is STILL not statistically significant because you're taking the result of only 10 tests.

Instead, please do 1,000 runs of 1,000 flips and then report back. I bet player 1 wins less than 70% of the time.

Edited by mrmr96 on Tuesday 29th October 13:24

Dr Jekyll

Original Poster:

23,820 posts

268 months

Tuesday 29th October 2013
quotequote all
If I was the slightest bit interested in the number of heads vs the number of tails I would. But both players are betting heads. What I'm interested in which player's strategy gives the best result on a given number of heads v tails.

Incidentally I just did a run of 100,000 spins and got 49,144 heads.

mrmr96

13,736 posts

211 months

Tuesday 29th October 2013
quotequote all
Dr Jekyll said:
If I was the slightest bit interested in the number of heads vs the number of tails I would. But both players are betting heads. What I'm interested in which player's strategy gives the best result on a given number of heads v tails.

Incidentally I just did a run of 100,000 spins and got 49,144 heads.
Sorry, my post was intended as an analogy, with heads and tails representing a positive outcome for player 1 vs. player 2.

The point is that you've only looked at 10 outcomes for player 1 vs. player 2. So instead of doing 10 games of 10,000 turns each. Play 1,000 games of 1,000 turns each and see who wins most.

Presently you've shown player 1 winning 70% (7 out of 10 games). But my point is that I don't think you'll see player 1 winning so many once you've played a larger number of games. (The number of turns per game isn't really significant, so long as it's large enough to give a fair outcome to that game.)

Dr Jekyll

Original Poster:

23,820 posts

268 months

Tuesday 29th October 2013
quotequote all
mrmr96 said:
Sorry, my post was intended as an analogy, with heads and tails representing a positive outcome for player 1 vs. player 2.

The point is that you've only looked at 10 outcomes for player 1 vs. player 2. So instead of doing 10 games of 10,000 turns each. Play 1,000 games of 1,000 turns each and see who wins most.

Presently you've shown player 1 winning 70% (7 out of 10 games). But my point is that I don't think you'll see player 1 winning so many once you've played a larger number of games. (The number of turns per game isn't really significant, so long as it's large enough to give a fair outcome to that game.)
First of all, when I said player 1 did better 7 times out of 10 I meant 'about 3/4', I didn't literally mean only 10 runs.

Secondly the 7 out of 10 applied to a simulated dice (6 to 1) not a coin and I can put that down to chance.

With a coin (which my original question was about) it was much more pronounced. I've just had player 1 win more (or lose less) than player 2 on 20 out of 20.

The point isn't how often player 1 wins, it is why his different stake strategy seems to consistently maximise(minimise) his wins(losses). Which is why I suspect the random number generator is giving a lot of alternate win/lose/win/lose sequences.

mrmr96

13,736 posts

211 months

Tuesday 29th October 2013
quotequote all
Dr Jekyll said:
The point isn't how often player 1 wins, it is why his different stake strategy seems to consistently maximise(minimise) his wins(losses).
MY point is that I don't think his strategy WILL consistently maximise his wins. it just LOOKS like it does because I don't think you've done enough tests to conclude one way or the other.

ReallyReallyGood

1,632 posts

137 months

Tuesday 29th October 2013
quotequote all
On the face of it I can't see why, given for a fair coin both players will be betting either 2 or 1 unit an equal number of times (but alternately) on a 50-50 outcome.

I can only assume some defect in the simulation.

Dr Jekyll

Original Poster:

23,820 posts

268 months

Tuesday 29th October 2013
quotequote all
mrmr96 said:
Play 1,000 games of 1,000 turns each and see who wins most.
Just tried this.

Player 1 772 wins, player 2 223, draws 5.

hairykrishna

13,593 posts

210 months

Tuesday 29th October 2013
quotequote all
Dr Jekyll said:
Incidentally I just did a run of 100,000 spins and got 49,144 heads.
There's something wrong with your code or your random number generator.

ReallyReallyGood

1,632 posts

137 months

Tuesday 29th October 2013
quotequote all
Do you have the win/lose ratio? I hypothesise that whenever the win ratio is higher than 50% the same player will always win (player 2, as the more wins in the run, the more he stakes and wins). And vice versa, a win ratio of < 50% player 1 will win.

Which then moves the problem from being a player-strategy one, to a simulation one. i.e. the winner is determined by the win ratio directly.

Edited by ReallyReallyGood on Tuesday 29th October 14:08

mrmr96

13,736 posts

211 months

Tuesday 29th October 2013
quotequote all
Dr Jekyll said:
mrmr96 said:
Play 1,000 games of 1,000 turns each and see who wins most.
Just tried this.

Player 1 772 wins, player 2 223, draws 5.
Ok, wow. That changes my mind then. That's weird isn't it?

Based on my interpretation of how you say the game works, I'd have expected there to be no difference between the two betting strategies. For one to come out better so consistently is quite odd.

Are you quite sure you've modelled it correctly?