Post
Topic
Board Gambling discussion
Re: Does martingale really works?
by
dooglus
on 09/03/2015, 19:05:11 UTC
Honestly house edge doesnt even matter that much, you would lose even with 0% house edge using martingale.

Well, this is interesting.

My gut reaction upon reading that was that you are wrong: with 0% house edge you are equally likely to double-up or bust. Because with a 0% house edge the casino's expected profit is 0 regardless of how you play.

So I wrote another simulation. It simulates a player with 15 chips using martingale, starting with bets of 1, doubling on loss, betting at a 0% edge casino.

To my surprise he doubles up 38% of the time and busts 62% of the time.

Can anyone explain how that could be? Is the casino actually making a decent profit from this 0% edge game? I don't believe it.

Here's the code:

Code:
#!/usr/bin/env python

import random

start = 15                         # starting bankroll
target = 30                        # target bankroll
base = 1                           # starting bet
rounds = wins = 0

while True:
    bankroll = start
    bet = base
    rounds += 1

    while True:
        if random.random() < 0.5:  # we won
            bankroll += bet        # award winnings
            bet = base             # reset
            if bankroll >= target: # we reached the target
                wins += 1
                break
        else:                      # we lost
            bankroll -= bet        # subtract loss
            bet *= 2               # double bet
            if bet > bankroll:     # we can't afford the next bet
                break

    if rounds % 100000 == 0:
        print "%6d wins out of %6d rounds (%6.3f%%)" % (wins, rounds, wins * 100.0 / rounds)

and the output:

Code:
37662 wins out of 100000 rounds (37.662%)
 75430 wins out of 200000 rounds (37.715%)
113539 wins out of 300000 rounds (37.846%)
151692 wins out of 400000 rounds (37.923%)
189569 wins out of 500000 rounds (37.914%)