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. You could apply this logic to every casino game regardless of the underlying odds. Everytime you lose double your bet until you cover your losses. If this strategy had positive expected return you could beat any game in the casino with ease from roulette to craps.

  2. I found this post while searching for some free downloads. Thanks for sharing will be sure to follow this blog regularly and will email this article to my all my buddies.

  3. love it! i’ve had this same “debate” with friends in the past. i think the problem you’d run into with the double-up strategy is table wager maximums. have you accounted for these bet limits in your analysis? casinos have them for this very reason.

    stick to hold ’em phil. it’s the only casino game i can think of where the odds aren’t in the house’s favor (besides the rake). but stop playing 7-2 off. talk about terrible EV!

  4. Comfortably, the article is actually the greatest on this deserving topic. I fit in with your conclusions and will thirstily look forward to your future updates. Just saying thanks will not just be enough, for the extraordinary lucidity in your writing. I will right away grab your rss feed to stay abreast of any updates. Pleasant work and much success in your business dealings!

  5. This is one of the best informative article about casino gambling I have ever seen before. The Strategy you have given of Roulette is very useful to all Roulette lovers, including me. 

    1. Your online gambling source – news, strategies, bonuses and reviews.

      Roulette system software is your online gambling source and our team is devoted to providing you with the most popular and effective casino strategies as well as the latest gambling news on a daily basis.

      http://online-roulette-systems.info

  6. I like your article and your code is simple and easy to understand. I made some modifications and a few adjustments: 
    http://codepad.org/RID8HVG5 Obviously with a higher bankroll you can sustain those times when you can loose as much as 14 times in a row (which is very unlikely to occur). Have fun! Remember: Responsible Gambling!

  7. This is only working on a fair real roulette table, since almost 99% of roulette in casino are rigged with electromagnic ball guiding system you will always lose in casinos unless the casino system wants you to win.

  8. This method does not work because all roulette tables have limits, precisely to stop this method, which is called Martingale. It is nothing new about this.
    Casinos do not need to have electromagnetic balls on roulette tables, the odds always favour the house. You had watch too many movies or listen to too many conspiracy theories. Every country has a ruling body that inspect casino operations for fairness on table games. Unless your 99% comment about rigged roulette tables is meant for illegal operated casinos.

  9. Also, probabilities of hitting a number on roulette are 1 out of 37 if the layout holds only a zero, or 1 out of 38 if the layout hold zero and double zero. This odds do not change at all, every spin has the same 1:37 or 1:38, your odds of hitting a number on the wheel are the same all the time. Thereby the odds of hitting red or black are always the same, 52.63% against you. That 2.63% is the house advantage on you, that is actually 5.26%, because is 52.63% against your 47.37%.

    1. Thanks for checking out the post! You’re of course right. This was a thought experiment I had 6 years ago, and an excuse to learn some python. I wouldn’t recommend it as an income strategy!

  10. You did Martingale strategy. Try to do plots of Fibonacci, Labouchere, D’Alembert, always single number, Reverse Martingale and Reverse Fibonacci.

  11. Cami Halısı Nereden Alınır?

    Cami halısı modelleri satın almak için bu alanda üretim gerçekleştiren firmalardan destek alabilirsiniz.
    Camilerle uyumlu olan cami halıları ibadetleri çok daha farklı bir noktaya getiriyor.
    Cami halılarının mutlaka kaliteli materyallerden üretilmesi gerekir.
    Cami halısı konusunda biz sizlere gerekli desteği sunabiliriz.
    Cami halıları uzun süre kullanılan ibadet ürünlerinden bir tanesidir.
    En uygun renk ve desenlerde cami halısı satın almak
    isterseniz sitemizi ziyaret edebilirsiniz. Cami halı fiyatları konusunda da gerekli desteği bizlerden alabilirsiniz.
    Cami halıları kültürümüzde önemli bir yerde bulunuyor.

    Camilerde ibadet edilirken dinimizin usullerine göre hareket etmemiz gerekiyor.
    Halılar birer zemin döşemesi olarak cami zeminlerinde kullanılır.
    Cami halısı fiyatları da kullanılacak alana göre hesaplanır.

    Cami Halıları

  12. Esra Erol’un programında eşi ve çocuklarını bırakarak yufkacı Muammer Ay’a kaçtığı için günlerce Türkiye’nin gündeminde yer alan Hamide Duman ve
    yasak aşkının sarmaş dolaş pozları ortaya çıktı.
    Ailesini terk ederek Ay’a kaçan Duman, sevgilisiyle art arda pozlar verdi.
    Ay ise bu pozları sosyal medya hesabından paylaşarak adeta herkese nispet yaptı.

    Geçtiğimiz aylarda ATV’de yayınlanan Esra Erol’da programına çıkan Mehmet Duran isimli iki çocuk babası Mehmet Duman, eşi
    Hamide Duman ile aynı adı taşıyan yengesi Hamide Duman’ın yufkacı Muammer Ay’a kaçtığını söylemişti.
    17 yıllık eşini ve 2 çocuğunu bırakarak evden kaçan Hamide Duman ise, Ay’ı
    sevdiğini söyleyerek geri dönmeyeceğini açıklamıştı.

    yeni keyword

  13. Bedava Disney Hesap 2021 | Disney Plus Hesap Girişi, Disney + veya başka bir şekilde Disney Plus olarak bilinen; Netflix, Apple TV ve HBO
    Max gibi film / dizi yayın platformlarına rakip olarak gelen bir uygulamadır.
    Bu çevrimiçi yayın platformunda, birçok Disney + Free Accounts prodüksiyonuna bir ücret
    karşılığında erişebilirsiniz. Geçtiğimiz yıl ABD,
    Kanada ve Hollanda’da piyasaya sürülen uygulama daha sonra Avustralya ve
    Yeni Zelanda’da lanse edildi. Kullanıcılar başta çok fazla sorun olduğundan şikayet etseler de, üreticiler bu kusurları
    kısa sürede giderebildiler ve şimdi kesintisiz bir akış sürdürdüklerine dair olumlu yorumlar görüyoruz.

    Bedava Disney Hesap

  14. Bedava Xbox Live Hesap | Xbox Gold Hesabı, Xbox Live nedir?
    Xbox cihazlarınızda kullanabileceğiniz Xbox Live,
    dijital bir pazar yeri olarak hareket eden çevrimiçi bir ağdır.
    Microsoft, Xbox Live’ın tüm ticari mülkiyetini bile elinde tutar.

    İlk olarak 2002 yılında Xbox markası için piyasaya sürüldü
    ve 2005 yılı gösterildiğinde Xbox 360 ile hizmet hayatına başladı.
    Daha sonra daha da geliştirilerek Xbox’ın vazgeçilmez bir parçası haline geldi.
    PlayStation’da Network olduğu gibi, Live burada devreye girmiştir.

    Bedava Xbox Live Hesap

  15. Free Fire Accounts Free While, having the information, it is possible
    that the original owner will recover the account, a degree that could be reviewed
    later. Assistance web page recommends clearing the
    sport’s cache inside their mobile phone options ahead of logging in yet
    again. Accounts that were suspended because of a “chargeback,” as Garena puts it,
    can also be recovered. This happens each time a player buys any item in the sport but would not
    purchase it. Z2U.com offers quality Low-cost Garena Free Fire accounts that you should appreciate with your gaming System of alternative.
    With around a million active consumers, you’re positive to discover the ideal account to fit
    your spending budget. The free fire sport continues to be a
    preferred match now because greater than 100 million players are still actively playing this sport each day.
    Complete the Missions – However missions received’t reward you up to ranked game titles will free fire account 2020,
    free fire account and password. Free fire battlegrounds
    account, free fire email and password, free fire guest account, free
    fire lost account.

    Free Fire Accounts Free

  16. I am really impressed with your writing talents as smartly as with the format for
    your weblog. Is that this a paid subject or did you modify it
    your self? Anyway stay up the excellent high quality writing,
    it is rare to see a great blog like this one nowadays..

  17. Thank you a bunch for sharing this with all of us you actually know what you are talking about!
    Bookmarked. Please also consult with my website =).
    We could have a link alternate arrangement among us

    Feel free to visit my site … cellulite

  18. Uygun Cami Halısı Modelleri

    Camiler Türkiye’nin dört bir yanında bulunan ibadethanelerdir.
    Cami içerisinde sağlıklı bir şekilde ibadet edebilmek için cami halılarını kullanmak gerekir.
    Kalitesiz cami halıları zamanla yıpranır ve ibadetin kalitesini düşürebilir.
    İnsanın içine huzur katan bir manzara için kaliteli
    cami halılarının üretimini gerçekleştiriyoruz.
    Biz cami halı fiyatları konusunda da en iyisini sunabiliyoruz.

    Cami halısı modellerinde beklentilerinizi karşılayacak çözümler sizleri
    bekliyor Birbirinden şık ve kaliteli ürün çeşitliliğine sahip firmamız her
    bütçeye uygun çözümler sunuyor. Uzun zamandır kalite
    ve müşteri memnuniyetini esas alarak hareket ediyoruz.
    Camilerimiz hepimiz için en özel alanlardır. Bu nedenle
    cami halısı seçerken mutlaka kaliteye dikkat etmelisiniz.

    Cami halısı fiyatları için hemen sitemizi ziyaret edebilirsiniz.

    Cami Halıları

  19. Bedava Scribd Hesap 2021 | Yeni Hesap Girişi ve Şifreleri, Böylece ücretsiz premium hesapları paylaşacağız.
    Bu içerikte sizler için ücretsiz scribd giriş bilgilerini paylaşıyoruz.
    O halde neden diye soruyorsunuz; çünkü size yardım etmek istiyoruz.
    Bu yardımı yaparken kullandığımız tüm bilgiler bize aittir.
    Kullanıcı adları ve şifreler kesinlikle doğrudur ve bize aittir.
    Ayrıca bir scribd hesabı arıyorsanız ancak bulamıyorsanız, doğru sayfadasınız.
    Bu sayfa sayesinde en güzel ve güzel kitapları gözlerinizi
    yormadan yüksek sesle okuyabilirsiniz. Ayrıca yüksek sesle okumak yerine dinleyebilirsiniz.
    Tek yapmanız gereken bir scribd hesabına sahip olmak ve oturum
    açmaktır. Yani oturum açtıktan sonra, fazla bir şey kalmadı.
    Aslında ben bile böylesine güçlü ve güzel bir siteyi
    keşfetmekten mutluyum.

    Bedava Scribd Hesap

  20. Free Roblox Accounts free old roblox accounts,
    free roblox accounts 2021. Free roblox accounts generator, free
    roblox accounts with robux. Examine This Report On Account And Passwords.

    Currently, we have been offering you free Nitroflare High quality accounts and passwords.
    For people of you that are not familiar with Nitroflare,
    don’t be concerned! We will give you several facts about this System in the following paragraphs.
    Within the function your password can’t be reset
    by using the myAccount process, you must Speak to ITS Guidance applying among the list of approaches below.

  21. Geçtiğimiz haftalarda Armağan Çağlayan’ın programına
    konuk olan uçakta cinsel organını gösterdiği için aldığı tepkilerden dolayı intihar etmeyi bile düşündüğünü söyleyen Kerimcan Durmaz,
    son videosuyla yine gündem oldu.

  22. What i don’t realize is in reality how you’re now not really a lot
    more smartly-preferred than you may be right now. You are
    so intelligent. You understand therefore considerably with regards to
    this topic, produced me in my opinion consider it from so
    many numerous angles. Its like men and women are not interested
    except it’s one thing to accomplish with Woman gaga!
    Your own stuffs outstanding. Always handle it up!

Comments are closed.