Gambling system

Author
Discussion

Dr Jekyll

Original Poster:

23,820 posts

262 months

Tuesday 29th October 2013
quotequote all
ReallyReallyGood said:
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 overall). 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 suspect this is what's happening, less than 50% wins so player 2 has an advantage.

Edited to add: Bugger, changed the simulator so '1' was a win instead of '2' and player 1 still has an advantage, though less of one.
'Player 1 637 player 2 349 draws 14'
But this would explain why odds of 1 in 6 or 1 in 40 reduce player one's advantage. It must be to do with the way the random numbers are generated.

Edited by Dr Jekyll on Tuesday 29th October 14:11

hairykrishna

13,185 posts

204 months

Tuesday 29th October 2013
quotequote all
Let me expand my previous comment. The standard deviation for 100k flips is 158. You'd expect to get 49,144 heads only one time in millions of tests. Your number generator is broken or there's something up with your code.

mattnunn

14,041 posts

162 months

Tuesday 29th October 2013
quotequote all
rand(o,m)

where o = omg

and

m = my goodness

mrmr96

13,736 posts

205 months

Tuesday 29th October 2013
quotequote all
hairykrishna said:
Let me expand my previous comment. The standard deviation for 100k flips is 158. You'd expect to get 49,144 heads only one time in millions of tests. Your number generator is broken or there's something up with your code.
Fair comment. I'd second your conclusion.

Dr Jekyll

Original Poster:

23,820 posts

262 months

Tuesday 29th October 2013
quotequote all
The random number generator is certainly a bit odd.

I tried another simulation with 4 players.

1: Betting on heads, stakes 2 after a loss 1 after a win.
2: Betting on heads, stakes 1 after a loss 2 after a win.
3: Betting on tails, stakes 2 after a loss 1 after a win.
4: Betting on tails, stakes 1 after a loss 2 after a win.

This covers any propensity for the generator to be biased towards either heads or tails.

Interestingly players 1 and 3 do consistently better than 2 and 4. As if the basic problem is that wins and losses are coming up alternately, without as many runs of heads or tails that a true random system would produce.

mattnunn

14,041 posts

162 months

Tuesday 29th October 2013
quotequote all
So how do you generate the random number?

You have not broken the maths, there is an error somewhere (if you have broken maths then call Victor)

hairykrishna

13,185 posts

204 months

Tuesday 29th October 2013
quotequote all
Dr Jekyll said:
The random number generator is certainly a bit odd.

I tried another simulation with 4 players.

1: Betting on heads, stakes 2 after a loss 1 after a win.
2: Betting on heads, stakes 1 after a loss 2 after a win.
3: Betting on tails, stakes 2 after a loss 1 after a win.
4: Betting on tails, stakes 1 after a loss 2 after a win.

This covers any propensity for the generator to be biased towards either heads or tails.

Interestingly players 1 and 3 do consistently better than 2 and 4. As if the basic problem is that wins and losses are coming up alternately, without as many runs of heads or tails that a true random system would produce.
The thing is though, it is biased - that's what the 49,100 number tells you. It might not be biased the same way every run but it's certainly not producing a 50:50 heads/tails randomisation.

Is it a standard random number library? Or have you written it?

This is such a trivial probability problem my guess is that there's a code error, in your code, where you determine the win/loss condition rather than in the random number generator. Even a crap one would be more than adequate for 100k coin tosses.

V8LM

5,174 posts

210 months

Tuesday 29th October 2013
quotequote all
What random number generator are you using?

Dr Jekyll

Original Poster:

23,820 posts

262 months

Tuesday 29th October 2013
quotequote all
hairykrishna said:
The thing is though, it is biased - that's what the 49,100 number tells you. It might not be biased the same way every run but it's certainly not producing a 50:50 heads/tails randomisation.

Is it a standard random number library? Or have you written it?

This is such a trivial probability problem my guess is that there's a code error, in your code, where you determine the win/loss condition rather than in the random number generator. Even a crap one would be more than adequate for 100k coin tosses.
I used an existing random number generator, and I've written separate routines to check what it produces and got odd results such as 49,100. I think it's the seed process that's at fault, it's taking the seed from the system time but probably repeating sequences.

V8LM

5,174 posts

210 months

Tuesday 29th October 2013
quotequote all
If you are seeding it once at the start of the run and getting an average of 0.491 for 100k trials then the generator is faulty. Even Microsoft Excel does better than that!

TwigtheWonderkid

43,427 posts

151 months

Sunday 3rd November 2013
quotequote all
I have a system whereby I can guarantee going into any casino and coming out with a small fortune. The trick is to go in with a large one.

98elise

26,681 posts

162 months

Sunday 3rd November 2013
quotequote all
It sounds like your friend has come up with the same system I came up with about 20 years ago.

You bet on red in a roulete, if you win you pocket the winnings, and keep the bet on red. If you lose and double the stake, again each time you lose, until red comes up. When red comes up, you win your original stake (+ cover any losses to date).

Effectively every time red comes up, you are pocketing your original stake as profit.....perfect plan....other than;

Its a already a well known system
The odds are against you in roulete
Even a short run on black will hit the table limits
A long run of black will bankrupt you, and its inevitable.




FarmyardPants

4,112 posts

219 months

Monday 4th November 2013
quotequote all
You could try changing your head/tail decider to call the existing one N times (for an odd number N) and then deciding that it's a head if you get more heads than tails from those draws. This might mitigate your rng's propensity to give alternating answers.