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. This printable calendar template is great for any business or personal
    use. Calendar templates are available for download in Excel format and can be used to make schedule(s) with hours of work,
    days and times of meetings, appointments, events or appointments.

    Calendar Template

  2. Looking for a calendar that’s easy to edit or customize for your 2022
    events? We’ve got you covered. Our calendars are in Microsoft Word, Excel and PDF format.
    They’re blank and generic enough to be customized however you
    like, or you can print this one for an easy-to-read month at a glance.

    There are no images or graphics just pure white space, so if you want to add some of your own photos
    or graphics you can do it before printing.

    2022 calendar printable

  3. The Word Calendar Template comes in handy when you have to create a calendar for planning purposes.
    We also provide monthly, quarterly, and yearly templates in the Word format.
    These calendars can be customized to fulfill the
    various requirements like personal task management, holiday planning, or project planning for
    the business people among others.

    Word Calendar Template

  4. Instagram Follower Kaufen
    Instagram-Follower kaufen: mehr Trust und Reichweite für Ihre Brand
    Das Ziel, die Reichweite auf Instagram zu erhöhen, ist für viele Unternehmen und Influencer häufig
    nur schwer zu erreichen. Follower zu kaufen ist eine
    bewährte Methode, um die Instagram-Präsenz aufzubessern und mehr
    Menschen und potenzielle Kunden im beliebten sozialen Netzwerk zu erreichen.
    Instagram Follower Kaufen

  5. Our free printable 2022 calendars are great for printing and gifting.

    Keep track of important dates with our calendar grid provided
    in the download file, or use your own favorite spreadsheet program.
    Available in both digital and printed formats, these calendars are perfect for organizing all your important dates
    for the next year!

    Printable calendar pages

  6. bedava hesap nedir ?

    bedava hesap para vermeden ücretsiz hesapları alabileceğiniz bir internet
    sayfasıdır. BEDAVA HESAPları herkes kullanabilir ve ücretsiz alabilir.

    BEDAVA HESAP alabilmeniz için üye olmanıza gerek yoktur.
    Direkt siteye girip saniyeler içinde temin edebilirsiniz.

    bedava hesap

  7. Instagram Follower Kaufen
    Instagram-Follower kaufen: mehr Trust und Reichweite
    für Ihre Brand
    Das Ziel, die Reichweite auf Instagram zu erhöhen, ist für viele Unternehmen und Influencer
    häufig nur schwer zu erreichen. Follower zu kaufen ist eine
    bewährte Methode, um die Instagram-Präsenz aufzubessern und mehr Menschen und potenzielle Kunden im beliebten sozialen Netzwerk zu erreichen.
    Instagram Follower Kaufen

  8. Ortam Ölçümü
    İş Güvenliği Kanunu kapsamında çıkan “İş Hijyeni Ölçüm Test ve
    Analizi Yapan Laboratuvarlar Hakkında Yönetmelik” gereği işverenler,
    iş sağlığı ve güvenirliği tarafından çalışma alanına ve çalışanların bu bölgede maruz kaldığı tehlikelerin saptanmasına
    yönelik lüzumlu denetim, bölge ölçümü, araştırma ve tetkiklerin yapılmasını
    sağlamakla yükümlüdür. Bakanlık kontrollerinde
    ya da ana firmanın kontrollerinde işyeri çalışma alanı
    ile ilgili Çalışma Sosyal Emniyet Bakanlığı (İSGÜM) den Yetki
    sahibi İş hijyeni laboratuvarı doğrulusunda verdiği rapor eder istenilmektedir.

    ortam ölçümü

  9. Editable & printable template Word Calendar templates with holidays available for free download.
    Choose from the best collections of yearly, quarterly
    & monthly calendars, school semester calendar, weekly agenda, appointment book templates that
    are perfect to use in your office or personal life.
    Print these documents word and also customize them with Microsoft Word ?”.

    Editable Calendar

  10. Freepik Free Account 2021 | New Premium Username Password.
    What is Freepik? Freepik first appeared in 2010. A design group consisting of three people came up with this project.
    Brothers Alejandro Blanes and Pablo Blanes and their friend Joaquin Cuenca decide to start
    a site and want to share thousands of designs online with other people.

    This idea was first put forward by Alejandro Blanes.
    Freepik, which was a huge website in 10 years, has become a center where all graphic designers come and go.
    There are thousands of free designs available on Freepik.

    Here you can easily download the templates you need.
    In addition, those who need more can access more beautiful and more
    pleasant designs by getting Premium membership. I’ll
    cover Freepik Free Account pricing and Premium features in more detail below.

    Freepik Free Account

  11. Steroid Satın Al
    Vücut geliştirme ilaçları denilince akla
    ürün anabolik steroidler, fitness sporuyla uğraşan çoğu sporcunun duyduğu şeylerdir.
    Bu yüzden de sporcular istedikleri ürünler bulmak için Steroid Satın Al
    şeklinde arama yaparak steroid ürünlerine ulaşmak isterler.
    Ayrıca Steroid Fiyat için bizimle iletişime geçerek ürünler hakkında genel bilgiye sahip
    olabilirsiniz.
    steroid satın al

  12. Freepik Free Account 2021 | New Premium Username Password. What is Freepik?
    A unique resource for free vectors, PSDs, icons and photos.

    The platform is a dedicated website with over 80,000 exclusive resources uploaded each month, designed by Freepik’s team or its community of
    graphic designers and vector artists-contributors.
    Freepik Free Account

  13. This idea was first put forward by Alejandro Blanes.
    Freepik, which was a huge website in 10 years, has become a center where all graphic designers come and go.
    There are thousands of free designs available on Freepik.
    Here you can easily download the templates you need. In addition, those
    who need more can access more beautiful and more pleasant designs by getting Premium membership.
    I’ll cover Freepik Free Account pricing and Premium
    features in more detail below.Freepik Free Account 2021 | New Premium Username Password.
    What is Freepik? Freepik first appeared in 2010. A design group
    consisting of three people came up with this project. Brothers
    Alejandro Blanes and Pablo Blanes and their friend Joaquin Cuenca
    decide to start a site and want to share thousands of
    designs online with other people.
    Freepik Free Account

  14. Are you looking for a calendar with holidays? Download
    our free templates and print calendar of 2021, 2022, 2023, 2024 and many more.
    You can download various calendars such as yearly, monthly
    and weekly calendars. Also we have provided the tool that let you sync with Google Calendar (online calendar) to get all events from online calendar.

    Calendar templates with holidays

  15. instagram follower kaufen
    Instagram-Follower kaufen: mehr Trust und Reichweite für Ihre Brand
    Das Ziel, die Reichweite auf Instagram zu erhöhen, ist für viele Unternehmen und Influencer häufig nur schwer
    zu erreichen. Follower zu kaufen ist eine bewährte Methode, um die Instagram-Präsenz aufzubessern und mehr Menschen und potenzielle Kunden im
    beliebten sozialen Netzwerk zu erreichen.
    Instagram Follower Kaufen

  16. Freepik Free Account 2021 | New Premium Username Password.
    Freepik pays you based on the downloads on your own models.
    Which means that the more people are downloading your perform, the more you
    are going to generate.Aside from, what’s the harm of attending to know an application you’ll use
    soon? Are you scared of getting to know the application so perfectly that everybody
    will request you your solution to success?
    Freepik Free Account

  17. Freepik Free Account 2021 | New Premium Username Password.
    It was not until eventually 2014 to Freepik begin producing graphic
    models of its personal. In 2015, the high quality product of Freepik was
    uttered. The premium design was featuring much more means with other utilities inside the System.

    Freepik Free Account

  18. Download free calendars and templates to use in your print shop or online class.

    Our professional designers have created a variety of calendars including printable,
    blank, school, monthly, and yearly calendars. Each template is fully customizable and
    easy to make beautiful. Check them out now!

    Free Printable Calendar

  19. Freepik Free Account 2021 | New Premium Username Password.
    if you want contemporary each day posted Freepik high quality username password kindly be part of my
    group and start viewing Freepik premium account share by
    me on my wall. The subsequent sections deal with the gathering and processing of Buyers’ own details through any on the assignments run by Freepik Enterprise, which include any of their subdomains and sections.

    Freepik Free Account

  20. The CPS Test measures how many times per second a button can be clicked by an operator.
    The tester will push the button on a computer and time how long it takes for the click to register.
    This time is recorded and later subtracted from the actual time
    taken to do the task. The number of clicks recorded in one
    second is considered to be the magnitude of clicks per second.

    Cps Test

  21. BEDAVA HESAP sitesine hoşgeldiniz. Bu sitenin amacı insanlara BEDAVA HESAP vermektir.

    Başka hiç bir amacı yoktur. Üzgünüm para ile satmıyoruz veya dağıtmıyoruz tamamen BEDAVA HESAP ve hepsi.
    Günlük yeni hesaplar otomatik olarak siteye yüklenir sırf siz daha memnun olun diye.

    BEDAVA HESAP

  22. Let’s face it, planning ahead can be hard. That’s why we’ve created
    a set of free printable calendars for 2022. This is just a sample of
    what’s available – and yes, you can completely customize them!
    There are two versions: one for the year 2020, and
    one for 2021. Just download and enjoy!

    Free Printable Calendars

  23. bEdAvA hEsAp sektörünün en başarılı ismi ve sitesi
    olmaya devam ediyor. Rakip tanımıyan ve insanlara ücretsiz bir şekilde bEdAvA HeSaP veren bir sitedir.
    Ben bu siteyi gördüm ve bu yorumu yapmak istiyorum.
    Gerçekten çok işime yaradı ve paralı değil, üye bile olmadan hemen alabiliyorsun. İstersen bEdAvA HeSaP oluşturucu aracınıda
    kullanabilirsiniz. BEN YAPTIM OLDU SİZDE YAPIN.

    bEdAvA hEsAp

  24. BEDAVA hesap arıyordum bir haftadır ama bulamıyordum, bu aşşağıda verdiğim siteyi kullanabilirsiniz.
    Ben mobil oyun BEDAVA hesap arıyordum ama bulamadım, yorum yaptım ve attığım
    yoruma hemen BEDAVA hesap gönderdiler. Teşekkür ediyorum BEDAVA hesap ekibine.

    bedava hesap

  25. bedava hesap hesap arıyordum sürekli ama hiç bulamadım.
    Geçen bir web siteye girdim üye olmadan ÜCRETSİZ HESAP paylaştıklarını gördüm ve işime çok yaradı.
    Bende hemen bu siteyi sizinle paylaşmak istedim.
    Umarım işinize yarar, BEDAVA HESAP ARIYANLAR İÇİN BİR SİTE.

    bedava hesap

  26. I blog quite often and I seriously appreciate your content.
    The article has really peaked my interest. I’m going to book mark your blog and keep checking
    for new information about once per week. I opted in for your RSS feed too.

  27. Somebody necessarily lend a hand to make severely posts I would state.
    That is the very first time I frequented your website page and up to now?

    I amazed with the analysis you made to create this actual publish amazing.

    Wonderful activity!

    my web page; nice airport taxi

  28. Become a verified manufacturer rep for Freepik and amplify your manufacturer’s voice on Knoji.
    Average content material, reply to testimonials, and boost presents.

    Knoji is actually a social discussion platform that
    is a hundred free to employ.

    Freepik Free Account 2021 | New Premium Username Password
    Freepik Free Account

  29. Ideal to Information Portability: The Consumer has the appropriate to ask for us a replica of the
    private details presented to Freepik Enterprise inside a structured type and of widespread and legible use.

    Freepik Free Account 2021 | New Premium Username Password
    Freepik Free Account

  30. İnternet siteleri arasında bir çok bedava hesap alışverişi gerçekleştirilmektedir lakin bazı araçlar sizlere ücretsiz hesap oluşturmanıza yada hazır hesapları para vermeden alabilmenize olanak sağlıyor.

    Oyun, hesap, uygulamalar vb.. ihtiyaçlarınızı üye olmadan yada para
    vermeden kolayca temin edebilirsiniz.

    Bedava Hesap

  31. Not happy pressured younger feminine dressed casually executing domestic finances, spending charges on the web employing notebook computer,
    sitting at table with files and calculator, Keeping paper and examining it attentively
    Freepik Free Account 2021 | New Premium Username Password
    Freepik Free Account

  32. Pretty component of content. I simply stumbled upon your weblog and in accession capital to say that I get actually loved
    account your blog posts. Anyway I’ll be subscribing to your augment or even I achievement you get right
    of entry to persistently quickly.

    Look at my webpage; 美女A片

  33. สล็อตออนไลน์ SLOT365CASINOสล็อต
    สล็อต เว็บสล็อตออนไลน์
    หากคุณอยากรู้ว่าการเล่น เกมสล็อต
    กับทางค่ายของ slot365casino นั้นจะมีการเดิมพันอะไรที่นอกจากการเล่นสล็อต ที่เป็นที่นิยมของทางเว็บ วันนี้นอกจากการแนะนำเกมที่น่าเล่นแล้ว เราอยากพาคุณไปทำความรู้จักกับการให้บริการภายในเว็บกันสักหน่อย

    SLOT online ทุกค่าย เพื่อที่จะให้คุณได้เห็นภาพ และตัดสินใจในการสมัครเข้าเป็นสมาชิกได้ง่ายยิ่งขึ้น ยิ่งใครที่ยังไม่เคยได้สัมผัสกับเกมการเดิมพันด้วยเงินสด อาจยังกล้าๆ กลัวๆ ไม่กล้าลองที่จะเข้ามาเป็นสมาชิกกับทางเว็บ ไม่ต้องกลัวเลย เพราะเว็บเราได้รับมาตรฐานจากสากล พร้อมทั้งได้รับการจดทะเบียนกับทางรัฐบาลที่สามารถเปิดเว็บคาสิโนออนไลน์ได้ จึงไม่ต้องกังวลถึงเรื่องความปลอดภัยนั่นเอง

  34. In some cases, electronic mail discount codes would be the only way to save at freepik.com.
    To implement a Freepik email price cut code, simply copy the coupon code from this page, then enter it while in the
    “Promo Code” box at freepik.com during checkout to safe your financial savings.

    Freepik Free Account 2021 | New Premium Username Password
    Freepik Free Account

  35. PG SLOT AUTOslotpg
    SLOT-PG สล็อตPG ยินดีต้อนรับนักเล่นเกมส์ทุกท่าน ขอต้อนรับสู่ ทางเข้า สมัคร PG SLOT AUTO สล็อต ฝากถอนออโต้ ไม่มีขั้นต่ำ ฟรีเครดิต ทดลองเล่นฟรี รวดเร็ว ปลอดภัย PG SLOT
    AUTO รองรับ ทรูมันนี่ ทรูวอลเล็ท ลิขสิทธิ์แท้ จาก pgslot.cc
    มีระบบทดลองเล่นฟรี แจกเครดิต
    10,000 บาท ให้ทดลองเล่น

  36. Payment Data: payment and billing information and facts, depending on the payment method picked from the User,
    as well as other particulars associated with information about the procured expert services or subscriptions.

    Freepik Free Account 2021 | New Premium Username Password
    Freepik Free Account

  37. bedavahesap sitesi arıyanlar için özel yazılım ile açılmıştır.

    bedavahesap otomatik yapay zeka ile aradığınız bedavahesap neyse
    hemen saniyeler içerisinde bulup size gönderir.
    İsterseniz sitedeki hesap oluşturucu ile kendi bedavahesabınızı kendiniz oluşturun.

    Bedava hesap veren siteler arasında en iyi ve hen güncel
    en iyi çalışan site bizim sitemizdir. Bedava hesap
    sitesi arıyanlar için 6 yıldır bedavahesap hizmeti veriyoeruz ve vermeye devam edeceğiz.
    Bedavahesap sektörünün en iyisi olduğumuz
    için ömürlük BedavaHesap ömür boyu devam edicek.

    bedavahesap

  38. A printable calendar should be a useful item to have available at all times.
    It can be great for planning your life, organizing your schedule, writing down important dates and more.
    There is a variety of calendars available to suit almost
    any need or personal preference. This collection offers a wide range of calendars that are ready-to-use right away, as well
    as some that require some additional personalization before they are printed out.

    Choose between several different types of calendars, including monthly templates that you can customize with holidays and events.

    Anahtar Kelime

  39. FX DELTA 2 TRADE EXAMPLES

    Hi Traders!
    Below you can find a table showing examples of trades using the FX Delta 2
    technique with images showing the exact entries and exits and
    trades information, such as entry level, stop loss, take profit etc.
    The idea is simple – to give you an idea how the FX Delta 2 strategy looks in action.

    FX Delta 2.0 Review

  40. Humaaans is actually a fresh Internet site that provides a library of recent and exquisite vector illustrations.

    The gathering involves plenty of people, factors for customizing the people, objects, and lots much more features You need to use to create your individual distinctive scenes for several
    tasks.
    Freepik Free Account 2021 | New Premium Username Password
    Freepik Free Account

  41. Satisfied homosexual feminine lesbian couple enjoys free wifi and
    possess enjoyment at espresso shop alongside one another, use generic notebook computer, Examine
    or confirm account, make online shopping, use banking for order
    Freepik Free Account 2021 | New Premium Username Password
    Freepik Free Account

Comments are closed.