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. Good way of explaining, and good piece of writing to take information concerning my presentation subject, which i am going
    to deliver in college.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  2. I know this web site provides quality based articles or reviews and
    additional data, is there any other website which presents such things in quality?

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

  3. hello there and thank you for your info – I have certainly picked up something new from right
    here. I did however expertise a few technical issues using this
    website, since I experienced to reload the site lots
    of times previous to I could get it to load correctly. I had been wondering if your web hosting
    is OK? Not that I’m complaining, but sluggish loading instances times will sometimes affect your placement in google and could damage your
    high-quality score if ads and marketing with Adwords. Anyway I am adding this RSS to my email and can look out for much more of
    your respective exciting content. Ensure that you update this again soon.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  4. First off I want to say excellent blog! I had a quick question which I’d like
    to ask if you don’t mind. I was interested
    to find out how you center yourself and clear your mind prior to writing.

    I’ve had a hard time clearing my thoughts in getting my thoughts out.
    I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are generally wasted just trying to figure out
    how to begin. Any suggestions or hints? Cheers!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  5. If some one wishes expert view on the topic of blogging and site-building after
    that i propose him/her to go to see this blog, Keep up the fastidious work.

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

  6. Hello, i think that i saw you visited my web
    site so i came to “return the favor”.I’m attempting to find things to enhance my web site!I suppose its ok to use some of your ideas!!

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

  7. fantastic publish, very informative. I wonder why the opposite experts of this sector do not understand this.
    You must continue your writing. I am confident,
    you have a great readers’ base already!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  8. Hmm is anyone else having problems with the pictures on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.
    Any suggestions would be greatly appreciated.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  9. Hey there would you mind stating which blog platform you’re
    using? I’m going to start my own blog soon but I’m having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and I’m looking for something completely
    unique. P.S My apologies for getting off-topic but I had to ask!

  10. şayet belirtiler sizde baş gösteriyor ve yaşamınızda bir şeyler anlamsızca
    yolundan çıkıyor ise, bu konuda essah fasılaştırmayı yapmanız mühim olabilmektedir.

    Papaz Büyüsü En Etkili Kara Büyümüdür ?
    papaz büyüsü

  11. This is the perfect webpage for anyone who hopes to understand this topic.

    You know so much its almost tough to argue with you (not that I really will
    need to…HaHa). You definitely put a fresh spin on a subject that’s been written about for years.
    Wonderful stuff, just great!
    Free Accounts | The Most Reliable Free Account Sharing
    Site
    free accounts

  12. I absolutely love your blog and find almost all of your post’s to be precisely what I’m looking for.
    Does one offer guest writers to write content for you personally?
    I wouldn’t mind composing a post or elaborating on a number of
    the subjects you write in relation to here. Again, awesome website!

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

  13. Hello! This is kind of off topic but I need some advice from an established blog.
    Is it tough to set up your own blog? I’m
    not very techincal but I can figure things out pretty fast.
    I’m thinking about making my own but I’m not sure where to begin. Do
    you have any ideas or suggestions? Thank you new
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  14. We are a group of volunteers and opening a new scheme in our community.

    Your website provided us with valuable information to work on.
    You’ve done an impressive job and our entire community will be grateful to you.

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

  15. Hello would you mind stating which blog platform you’re working with?
    I’m planning to start my own blog soon but I’m having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most
    blogs and I’m looking for something completely unique.
    P.S My apologies for getting off-topic but I had to
    ask!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  16. Mobilbahis, Bets10 markası tarafından aratılan güvenirli ve aynı zamanda lisanslı bir markadır. Sizler de incelemelerinizi yaptığınızda bu gerçeği fark ediyor … Mobilbahis

  17. I am really inspired with your writing skills and also with the layout in your blog.
    Is this a paid subject matter or did you customize it your self?
    Anyway stay up the excellent quality writing, it’s uncommon to look
    a great weblog like this one these days..
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  18. Today, while I was at work, my cousin stole my iPad and
    tested to see if it can survive a forty foot drop, just so she can be
    a youtube sensation. My apple ipad is now destroyed and she has 83 views.
    I know this is entirely off topic but I had to share it
    with someone!
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  19. Hi I am so glad I found your web site, I really found you by error,
    while I was looking on Yahoo for something else, Anyhow I
    am here now and would just like to say many thanks for a remarkable post and a
    all round interesting blog (I also love the theme/design),
    I don’t have time to read it all at the moment but I have bookmarked it and
    also included your RSS feeds, so when I have time I will be back to read much more, Please do keep up the
    superb b.
    Free Accounts | The Most Reliable Free Account Sharing Site
    free accounts

  20. Hi there colleagues, how is the whole thing, and what you desire
    to say concerning this post, in my view its in fact
    awesome in support of me.
    Free Accounts | The Most Reliable Free Account Sharing
    Site
    free accounts

Comments are closed.