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. providing free Garena free fire accounts that happen to be affiliated with Gmail and
    Facebook, which you can use for free to sign up to your Garena free fire sport imagined id and password on your own equipment,
    And you can simply take pleasure in the game without having a concern.
    Free Fire Account Free 2021 | Garena Accounts And Password
    Free Fire Account Free

  2. Kalkınma ve ilerleme yolunda her geçen gün yeni adımlar atan ülkemiz, kendi kültür ve değerlerine sahip çıkarak her konuda kendini ilerletmiştir. Kendi mimarisi olan cami halılarımızı göz önüne olarak bu kanıya katılabilirsiniz. Motif ve desenleriyle göbekli cami halısı, saflı cami halısı, seccadeli cami halısı, yün cami halısı, naturel cami halısı bulunur.

  3. İslamiyet için önemli olan camiler İslamiyet’in yayılması ile birlikte kurulmuş, insanları bir araya getiren anlamına gelmektedir. Cami içerisinde ki düzen ve temizlik İslamiyet’in gerektirdiği gibi insanın kendini kirlerden arındırması gerektiği gibi ibadet ettiği yeri de temiz tutmalıdır. Cami içerinde ayakkabı ile girilmez. Cami halısı da bu konuda çok önemlidir. Cami halıları temiz olmalı ve belli bir düzene göre serilmelidir. Kendi sektöründe birçok cami halısı üreten firma ve şirketler vardır. Uygun fiyatta ve birçok çeşitte önümüze sunulan cami halıları güzel desen ve renkleriyle adeta insanı büyülüyor. Renklerinde anlam ve derinlik her zaman insana huzur vermiştir. Bu konuda da birçok cami halısı çeşitleri vardır. Cami halısı modelleri iplik ve dokuma kalitesini önemseyiniz, kullanılan malzeme ve kumaşı türden türe farklılık göstermektedir. Aynı durum cami halısı fiyatları içinde aynıdır her bütçeye uygun cami halısı bulabilirsiniz.

  4. Sohbet – Sohbet Odaları

    Bedava Sohbet Odaları Günümüz insanları için en eğlenceli günlük aktivitelerinin başında
    internete girmek ve sanal alemden tanıdıkları insanlar ile
    vakit geçirmektir. İnterneti sık kullanan kişiler için olmazsa olmaz bir hale gelen internet alemi, gün geçtikçe
    insanları daha da kendine bağlıyor. Durum böyle
    olunca da sanal alem ile ilgili pek çok
    site ve uygulamalar kuruluyor.

    Teknolojinin en gelişmiş siteleri arasında yer alan bedava sohbet odaları insanların dikkatini bir
    hayli çekiyor. Çünkü bedava sohbet sitesi sayesinde
    insanlar sanal elemde arkadaşları ile bedava bir şekilde sıcak bir sohbet ortamını kurabiliyorlar.

    Sohbet Odaları

  5. Greetings! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a outstanding job!

  6. I was very pleased to uncover this website.

    I need to to thank you for your time just for this fantastic read!!
    I definitely liked every little bit of it and i also have you bookmarked to look
    at new things on your blog.

    Can I simply just say what a relief to uncover somebody who really knows what they are talking about online.
    You actually know how to bring an issue to light and make it important.
    A lot more people need to read this and understand this side of the
    story. I was surprised that you’re not more popular since you certainly have the gift.

    Good post. I certainly love this site. Continue
    the good work!

    It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking
    about! Thanks

    You ought to be a part of a contest for one of the greatest blogs on the internet.
    I most certainly will recommend this blog!

    An intriguing discussion is worth comment. I do think that you should write more about this subject, it
    might not be a taboo subject but usually people do not talk about these topics.

    To the next! Cheers!!

    Good day! I simply would like to give you a huge thumbs up for your
    great info you have got right here on this post.

    I’ll be coming back to your website for more soon.

    When I originally left a comment I seem to have clicked on the
    -Notify me when new comments are added- checkbox and from now on whenever a comment is added I recieve 4 emails with the exact same comment.
    Perhaps there is an easy method you can remove me from that service?
    Many thanks!

    The next time I read a blog, I hope that it does not disappoint me as much
    as this one. I mean, Yes, it was my choice to read through, nonetheless I
    truly thought you’d have something useful to talk about.
    All I hear is a bunch of moaning about something that you can fix if you weren’t too busy seeking attention.

    Spot on with this write-up, I actually think this web site needs far more attention. I’ll probably be back again to read more, thanks for the
    info!

    You are so cool! I don’t suppose I have read anything like this before.

    So nice to discover somebody with some genuine thoughts on this issue.
    Seriously.. thanks for starting this up. This website
    is something that is required on the web, someone with a bit of originality!

    I like reading an article that will make men and women think.
    Also, thank you for allowing me to comment!

    This is the perfect webpage for anyone who hopes to understand this topic.
    You realize a whole lot its almost tough to argue
    with you (not that I personally will need to…HaHa).
    You definitely put a brand new spin on a topic that has been discussed for a
    long time. Wonderful stuff, just wonderful!

    Aw, this was a very nice post. Spending some
    time and actual effort to produce a superb article… but what can I say… I hesitate a lot and don’t seem to get nearly anything
    done.

    I’m amazed, I must say. Rarely do I encounter a blog
    that’s both educative and entertaining, and let me tell you, you have hit the nail on the head.
    The problem is something which not enough men and women are speaking intelligently about.

    I am very happy I stumbled across this in my hunt for
    something relating to this.

    Oh my goodness! Amazing article dude! Many thanks, However I am encountering
    problems with your RSS. I don’t understand why I can’t
    join it. Is there anybody getting similar RSS problems?
    Anyone that knows the answer will you kindly respond?
    Thanks!!

    An outstanding share! I’ve just forwarded this
    onto a friend who has been conducting a little homework on this.
    And he actually ordered me lunch because I discovered it for
    him… lol. So allow me to reword this…. Thanks for the meal!!
    But yeah, thanx for spending some time to discuss this subject here on your web page.

    After looking at a number of the blog articles on your web page, I honestly appreciate your technique of writing a blog.
    I added it to my bookmark webpage list and will be checking back soon. Take a look at my web site as well and let me know what you think.

    This site definitely has all of the information I wanted about this subject and
    didn’t know who to ask.

    There is certainly a lot to find out about this topic.
    I like all the points you have made.

    You’ve made some decent points there. I looked on the web for more info about the issue
    and found most people will go along with your views on this website.

    Good post. I learn something new and challenging on websites I stumbleupon on a daily basis.
    It will always be useful to read through articles from other authors and practice something from
    other websites.

    I blog frequently and I really thank you for your information. This
    article has truly peaked my interest. I’m going to book mark your
    blog and keep checking for new details about once a week.
    I subscribed to your RSS feed as well.

    Pretty! This was an incredibly wonderful post.
    Many thanks for providing this information.

    Greetings! Very helpful advice within this article!
    It’s the little changes that produce the most important changes.

    Thanks a lot for sharing!

    Hi there! This blog post could not be written much better!
    Looking at this article reminds me of my previous roommate!
    He continually kept preaching about this. I am
    going to forward this information to him. Pretty sure
    he will have a great read. Many thanks for sharing!

    Hello there, There’s no doubt that your website may be having
    web browser compatibility issues. When I take a look at your
    web site in Safari, it looks fine however when opening in Internet Explorer, it’s got some overlapping issues.

    I simply wanted to provide you with a quick heads up!
    Aside from that, great blog!

    Having read this I believed it was very enlightening.
    I appreciate you taking the time and energy to put this informative
    article together. I once again find myself personally spending a lot of time
    both reading and leaving comments. But so what, it
    was still worthwhile!

    Howdy! I could have sworn I’ve been to this blog before but after browsing through a few of
    the posts I realized it’s new to me. Regardless, I’m definitely happy I discovered it and I’ll
    be bookmarking it and checking back frequently!

    I wanted to thank you for this very good read!! I certainly enjoyed every little bit of
    it. I’ve got you book-marked to look at new things you post…

    Hi, I do think this is an excellent web site. I stumbledupon it 😉 I’m going to return once again since I book marked it.

    Money and freedom is the best way to change, may you be rich and
    continue to help other people.

    Your style is unique compared to other folks I have read stuff from.
    Thank you for posting when you’ve got the opportunity, Guess I’ll just book mark this site.

    I was able to find good info from your content.

    Great article! We are linking to this great content
    on our site. Keep up the good writing.

    That is a really good tip particularly to those new to the blogosphere.
    Short but very precise info… Thank you for sharing this one.

    A must read article!

    I could not resist commenting. Well written!

    Saved as a favorite, I really like your website!

    Great post. I will be facing some of these issues as well..

    Way cool! Some extremely valid points! I appreciate
    you penning this article and also the rest of the website is extremely good.

    Excellent blog you have here.. It’s difficult to find high quality writing like
    yours nowadays. I seriously appreciate people like you! Take care!!

    This is a topic that is close to my heart… Best wishes!
    Exactly where are your contact details though?

    I absolutely love your website.. Pleasant colors &
    theme. Did you make this website yourself? Please reply back as I’m wanting to
    create my very own blog and would like to know where you got this from
    or just what the theme is called. Thank you!

    I like it when folks get together and share thoughts. Great blog, continue the good
    work!

    Good information. Lucky me I ran across your website
    by chance (stumbleupon). I have book marked it for later!

    This site was… how do I say it? Relevant!!
    Finally I’ve found something which helped me. Thanks a lot!

    Everything is very open with a very clear explanation of
    the challenges. It was truly informative. Your website is extremely helpful.
    Thank you for sharing!

    I must thank you for the efforts you have put in penning this blog.
    I really hope to see the same high-grade content by you later on as well.
    In fact, your creative writing abilities has inspired
    me to get my own, personal website now 😉
    restolin review 2021

  7. In place of increasing from a plant, the flexibility merely regenerates inside A further related fruit which then transforms in to the Satan Fruit in issue,
    as noticed when Smiley “died” and the power of the
    Sara Sara no Mi, Model: Axolotl was reborn into a close-by apple.

    Free Account – New Free Accounts And Passwords
    free accounts

  8. Devil Fruits exist inside a cycle of reincarnation; any time a Satan Fruit consumer dies, their capability is reborn right into a new fruit at some random site on the earth.

    Free Account – New Free Accounts And Passwords
    free accounts

  9. Given that some compounds in green tea may help protect against cancer
    and heart disease, it makes sense that it could help you live longer.

    Free Account – New Free Accounts And Passwords

Comments are closed.