10,000 Nights at a Casino – Using Python to test my Roulette Strategy

A few years ago, friends and I took a pit stop in Macau during a trip through Asia after our graduation.  While there, I came up with a fairly simple roulette strategy that I thought could work for someone with enough of a bankroll.  Since then, my friend Steve and I have argued about 15x about the validity of this strategy.  In fact, Steve even wrote a VBA program to prove that I was wrong.  Well, Steve, I wrote my own program this past rainy Sunday (to highlight my gambling prowess, this Sunday I also doubled up in Texas Hold ‘EM poker after flopping a full house with 7, 2 off suite – but that’s a story for another day).

The strategy is as follows: put $1 on black.  If you win, take your winnings off the table and put a new $1 bet down.  If you lose, then put $2 down, if you lose again, double it to $4, if you lose again, double it to $8, and keep doubling down until you win, then take all of your money off the table (your winnings will offest your previous string of losses and leave you with a $1 profit), and start again with a $1 bet.  Of course, the problem becomes, what happens when you lose 10 times in a row.  Well, I’m glad you asked.

First off, let’s analyze the probability of you losing that many times in a row.  There are 38 possibilities in a roulette wheel – numbers 1-36, 0, and 00.  So, your chances of not hitting your color are ((38-18)/38, or about 53%.  So, you don’t have a great chance of winning if you just play once.  But, what are the chances of you losing several times in a row?  The below table illustrates how low these odds become (‘Necessary Bet’ is the bet needed to recover losses and make $1.  The ‘Probability’ is the cumulative probability of losing n many times in a row.  See R1:T17 of the first tab of the excel I link to at the bottom of the post for the calculations):

Below is a graph of what your pay offs may look like.  Note that you are winning only $1 at a time until you eventually get really unlucky, somewhere around your 13,000th spin in this case, and lose money beyond your bankroll which forces you to quit and walk out of Macau penniless (but hopefully not indebted to some Asian Gangsters).  Notice how the blue bar suddenly drops to -$9,000…

This type of payoff structure is analogous to “picking up nickles in front of a steam roller.”  If you haven’t already, you should read When Genius Failed, the story of the demise of Long Term Capital Management.  LTCM was a hedge fund run by Nobel laureates who made thousands of tiny bets using computer programs in a strategy called statistical arbitrage, among others.  The hedge fund blew up as they thought the scenarios that would cause their fund to collapse would only occur once every few centuries (it only took a few years for the fund to meet its very spectacular end in one of the first “too big to fail” situations.  Fun fact: all Wall Street banks pitched in to help unwind the fund’s assets, and thus divert a systemic break in the economy, except for Bear Stearns who refused to help…).

Below is a zip file with three Python programs whose outputs are captured in the excel.  The programs assume that you start with $100, and can borrow up to $5,000 from your friend (except for the last one that assumes you can borrow $15,000).  So, just as LTCM relied on leverage to try to double down on their bets and save their fund, this strategy also relies on loans to stay afloat in bad times when the odds go against you.

The first program is what would happen if you sat down and played until you went bust.  I ran this program once, and you make about $6,000 before hitting some bad luck and going bust (this is shown in the line graph above).  The second program basically runs the first program 10,000 times in order to get an average payout.  However, this one assumes you are only willing to play 100 games in a row as even 100 games would probably take a very long time in reality.  The last program is the same as the second, except that the player can lose up to $15,000 before quitting, and, if they have played 100 games and are at a negative value at the 100th game, they will play until they either recoup their losses, or go bust and lose $15,000.  This last scenario actually yields a positive expected value of about $4 (see the third table of the excel file I link to at the end of the post.  Expected value is what you would expect to win, on average, if you played this strategy many times).  Here is the distribution of returns from spending 10,000 nights in the casino with your friend that has $15,000 he can loan you if need be.  Pay no attention to the long tails where you lose $8,000 – that’s like a 10 sigma event and would NEVER happen 🙂

Conclusion: is this an effective strategy?  Not really.  Even if you found a table that let you start with $1 bets, and you had the patience to sit down and do this, and you had the bankroll, it’s just not going to yield all that much cash over time.

Please feel free to look over my code and let me know if you come up with any other conclusions by modifying it!  Also – I’m not a programmer – these scripts were very easy to do and took me only a few hours to write all three and conduct all analysis because Python is super easy!  If you want to learn more, MIT has FREE courses on Python that you should check out.  Enjoy!

To quote a really great “anti-recruiter” LinkedIn profile describing time spent at a large quant hedge fund: “I earn above-market returns 95% of years by collecting theta, selling volatility in the form of financial derivatives, naked short put options, and in summary, collect nickels and dimes in front of steam rollers, hoping the black swans never appear during my lifetime.

Attachments:

The Excel: Roulette Output

Python programs: Roulette Programs

7,734 Replies to “10,000 Nights at a Casino – Using Python to test my Roulette Strategy”

  1. Definitely believe that which you stated. Your favorite
    reason seemed to be on the internet the simplest thing to be aware of.
    I say to you, I definitely get annoyed while people think about worries that they plainly don’t know about.
    You managed to hit the nail upon the top and also defined
    out the whole thing without having side-effects , people could take a signal.
    Will probably be back to get more. Thanks
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  2. I was more than happy to discover this page. I want to to thank you for your time just for this wonderful
    read!! I definitely savored every bit of it and I have you book marked to look at new information on your
    site.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  3. With havin so much content do you ever run into any issues of plagorism or copyright infringement?
    My website has a lot of completely unique content I’ve either
    created myself or outsourced but it looks like a lot of it is popping it up all over the web without my agreement.
    Do you know any techniques to help prevent content from being stolen? I’d truly appreciate it.

    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  4. I need to to thank you for this good read!!
    I certainly loved every bit of it. I have you book-marked to
    look at new stuff you post…
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  5. Very nice post. I just stumbled upon your weblog and wished to say that
    I’ve truly enjoyed surfing around your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  6. I’m curious to find out what blog platform you have been utilizing?

    I’m having some small security issues with my latest blog and I’d like to find something more
    safeguarded. Do you have any solutions?
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  7. Your style is very unique in comparison to other folks I’ve read stuff from.

    Many thanks for posting when you’ve got the
    opportunity, Guess I’ll just bookmark this page.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  8. I just couldn’t leave your web site before suggesting that I actually enjoyed the usual info an individual supply for your visitors?
    Is going to be again continuously in order to inspect new posts
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  9. Pretty section of content. I just stumbled upon your website
    and in accession capital to assert that I acquire actually
    enjoyed account your blog posts. Any way I’ll be subscribing to your feeds and even I achievement you get right of entry to
    constantly rapidly.
    Free Accounts | The Most Reliable Free Account Sharing
    Site
    free accounts

  10. aa
    Hello just wanted to give you a quick heads up.

    The words in your article seem to be running off
    the screen in Internet explorer. I’m not sure if this is a formatting issue or something to do with web browser compatibility but I thought I’d
    post to let you know. The layout look great though!

    Hope you get the issue resolved soon. Thanks
    Free Accounts | The Most Reliable Free Account
    Sharing Site
    free accounts

  11. It’s actually very complicated in this busy life to listen news on TV, therefore I just use internet for that reason, and obtain the latest information.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  12. I know this if off topic but I’m looking into starting my own weblog and was curious what all is
    needed to get set up? I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web smart so I’m not 100% sure. Any recommendations or advice would be
    greatly appreciated. Kudos
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  13. An interesting discussion is definitely worth comment.
    I believe that you should write more about this topic,
    it might not be a taboo subject but usually folks don’t discuss such
    issues. To the next! Many thanks!!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  14. Nice post. I was checking constantly this blog and I am impressed!
    Very useful info particularly the remaining phase 🙂 I take care of such
    information a lot. I used to be looking for this certain info for a very lengthy time.
    Thank you and good luck.
    Free Accounts | The Most Reliable Free Account Sharing
    Site
    free accounts

  15. At this time it sounds like Movable Type is the preferred blogging platform out there right now.
    (from what I’ve read) Is that what you’re using on your blog?

    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  16. Wow that was odd. I just wrote an incredibly long comment but after I
    clicked submit my comment didn’t appear. Grrrr…
    well I’m not writing all that over again. Anyway, just wanted to say wonderful blog!

    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  17. Hi there to all, how is all, I think every
    one is getting more from this site, and your views are pleasant in favor of new people.

    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  18. Amazing! This blog looks just like my old one! It’s on a entirely different topic but it
    has pretty much the same layout and design. Outstanding choice
    of colors!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  19. Spot on with this write-up, I honestly believe this amazing site
    needs far more attention. I’ll probably be returning to see more,
    thanks for the information!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  20. all the time i used to read smaller articles which as well clear their motive,
    and that is also happening with this post which I am reading at this place.

    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  21. I have read a few just right stuff here. Certainly worth
    bookmarking for revisiting. I surprise how so much attempt
    you set to create this kind of great informative site.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  22. What’s Happening i am new to this, I stumbled upon this I’ve discovered It positively useful and it has helped me out
    loads. I’m hoping to contribute & aid other customers like its helped me.
    Good job.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  23. Wow, incredible blog layout! How long have you been blogging
    for? you made blogging look easy. The overall look of your website is wonderful, let alone
    the content!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

Comments are closed.