WRITING AND SOFTWARE BY IAN SHARPE
I once read a novel in which a sure-fire way to win at gambling was described. Called the Martingale System, its simplicity and logic were an instant hit with an impressionable teenager.
You wager on an event where the odds are 50/50. Heads or tails on the flip of a coin maybe, or odd/even on the roulette wheel. Actually roulette either/or bets aren't quite 50/50 because of the zero. It may score an automatic loss, or allow the house to keep a chunk of your stake. This is the casino's profit margin.
A European wheel has the numbers 0 – 36. American wheels add 00, which puts an additional bias in favour of the house.
In the Martingale System, you decide on a standard amount to bet and commence play.
If you win, you either place another bet or walk away with your profit. If you lose, you bet again, this time double what you just lost.
If you win this bet, you cover your losses in the previous game and make a small profit. If you lose again, you double up once more. The system tells you to keep doubling until the run of losses breaks. When you eventually win, all your losses are wiped out, you have a small profit, and you revert to your standard bet.
Here's an example betting session. The currency matters not, I'm British so I use pounds:
After the win, your next bet is £10.
Notice how a losing streak requires an exponential growth in stake. If you experience an unduly long run of losses, you will run out of money to stake further bets. In the above example, the next bet would have been £80. With a reserve of only £70 you cannot cover your full loss even if you bet £70 and win.
If you reach your limit, you can place no further bets and have sustained a large loss. Either take it on the chin, or come back another time with a larger reserve and continue where you left off.
Given a large enough pot in relation to your basic stake, wipe-out events should be rare. In general, you should make a series of small wins that add up to a good return.
And that's the Martingale deal: steady small gains offset by a smaller chance of a large loss.
Armed with that valuable nugget of gaming strategy, could you make a living just playing the Martingale system in an honest online casino?
That's tricky to answer definitively.
No matter how big your reserve in relation to your standard wager, there is always the possibility of a sequence of losses long enough to wipe you out.
If you just play the Martingale system once or twice by way of experiment, there is a fair chance that you will avoid such a calamitous event. But play it continually with the aim of making a living and sooner or later, you will encounter the killer streak.
What we really want to know is, for a given regular stake and a given reserve, how likely is it that we will be wiped out?
We could calculate the answer from probability theory. We could also set up a simulator that reports the outcome of a large number of trial games.
And that's what you will find below.
WARNING: The simulator is an afternoon's hack. It seems to work properly but has not been rigorously tested. Therefore you should not interpret your experience as a guarantee of real-life behaviour. Results are written back into this page.
Suppose you hit the casino with £1,000 in your pocket and decide to make £10 bets. And we'll also suppose that you intend to play 10 games per hour in the hope of making a steady income. That would give around 1500 games per month.
So enter 10, 1000 and 1500 and press the button to run a simulation of a month's worth of roulette. The simulation stops early if you lose your reserve.
As in real life, two runs are rarely the same. You get a few very good ones, a few very bad ones and plenty of middling ones. Try it many times to get a feel for what happens. Notice how often long runs of losses occur, and how often you fail to survive (zero reserve and aborted trial).
Increase the ratio between stake and reserve and try a different number of games.
Some sets of parameters lead to frequent disasters but you can tweak the inputs until good runs are in the clear majority.
You may then be tempted to head for the casino and take a chance on applying your 'safe' parameters. That's your call, but...
These outfits operate to make a profit. Many clever people have tried to beat them. Any casino that can't handle players who use systems would not have survived to do business with you.
With few exceptions, anything you do will have been seen before and the house rules stacked against it.
Beware of maximum and minimum stakes and maximum payouts which effectively limit the run of doubling and force you to reduce the ratio between reserve and stake.
William Hill's Internet casino, for example, at the time of writing has a maximum £1,500 bet on its Classic Casino roulette. Minimum outside bet (which includes all the either/or type bets we're interested in) is £5. That imposes a limit of eight straight losses with Martingale because after that, the next bet must be £2,555.
To follow an eight-loss sequence through, you would need a cash reserve of £2,555. Try £5 and £2555 in the simulator over 100 games and you will find a scary number of clean-outs and large losses (reserve greatly reduced). And it's easy to get through 100 games in an hour if you turn off the animations!
This tells us that if you were to do it for real, you might bomb out soon after you start. And if you get away with it for a while, tears are inevitable within a few hours.
Call me yellow, but for me Martingale is only OK for an occasional small fun bet. No way would I apply it regularly with serious money!
Somebody emailed to say that the simulator and my reasoning are flawed because I do not take account the law of averages. According to my correspondent, it goes like this: say even or red comes up a few times in succession. The likelihood of the same result coming up in the next bet steadily drops. Therefore, Martingale is far safer than I am making out.
That definitely isn't true. Roulette wheels do not have a memory. Neither does a coin. Heads and tails are always equally likely no matter what happened previously. Suppose you flip 20 tails in a row. The chance of tails coming up next time is exactly the same as it was on the first occasion. There is no spring-like force of nature winding up to push the odds towards heads.
Please don't take me to task if you disagree. I have already spent enough time playing email tennis with this one. Read what the others say and you're welcome to believe what you will.
I offer professional services in software development, databases, data manipulation and writing. Find out more at IanSharpe.com.
I am a happy user of DigitalOcean virtual private servers. I get commission if you open an account with DO through this link and stay a while. DigitalOcean will credit $10 to your account when you add a payment method. That gets you a decent chunk of free VPS hosting and helps support this site.
This is the personal web site of Ian Sharpe, a software developer and writer based in Bath, United Kingdom.
Before taking up software development full-time I had a career in computer magazine publishing. A hobbyist obsession with programming diverted me into magazines from an even earlier career in railway civil engineering. That was in 1986 and for the next 16 years I was a writer and editor on high-profile titles. Some visitors may remember me from publications of yore such as PC Plus, PC Answers, PC Today and CPC Computing.
Much of the material on this site originates from that period and was written to fill column inches to short dealines. I created the software as an adjunct to the writing so not a lot time was spent on it!
There used to be a lot more (I reckon I wrote over a million words over my magazine career) but I drop items that become too outdated. The remainder survives while it stays popular, which remarkably it does.
And so the articles do not represent current interests or recent experience although I occasionally refresh them with new material.
There is no binding theme, just whatever came into my head to publish. Hence '@random'. That said, several pages deal with aspects of randomness. I don't know how that came about and it certainly wasn't a plan.
Some of my publishing experiences were exceptionally satisfying and many were great fun. But the world changed and the tide turned against the big-circulation magazines of the eighties and nineties. The gravy train was running out of juice and it was time to disembark, re-invent and move on.
I had an ambition to write software professionally. I also had some ability, always having done it as a sideshow to my writing. I got my first magazine job partly on the strength of my ability to crank out publishable code in Z80 assembly language and Basic. Over the years I edited reams of programming tutorials in a variety of languages written by some very capable people.
So I switched career once more and spent five years as a developer at a busy digital printing outfit.
Now I work freelance, dividing my time between projects at local technical software/electronics company Dot Software and whatever else I am engaged in. My professional services site is www.iansharpe.com.
Because my personal site is mostly old material, writing emails about it is not my favourite activity. Even 'quick' questions can take longer to answer than you might expect. It feels rude not to reply and sometimes I will respond, but forgive me if I do not.
If there is a real problem (or opportunity!) my address is firstname.lastname@example.org.
If you have a few moments, please take a look at MailMyOwner.com.
It would be great to have a link to MailMyOwner on social media, blogs and forums you use. Thank you!
Your download should be visible wherever your browser puts them.