Testing out a Roulette Strategy

A while back, I may have seen a TV show, movie or read a book about someone talking about how they gamble – where they consistently make the same bet until they win. Does anyone know what I’m talking about? (Please let me know if you do, I can’t remember for the life of me!)

In any case, this was around the time I had started working on my Automate the Boring Stuff course, and I thought I would test out the strategy while practicing IF and WHILE statements in python.

Here is the strategy:

Determine a fixed amount of money to gamble (e.g. $1,000).

Pick which color to bet on (e.g. Black)

Start by betting the minimum bet (e.g. $5)

Every round, increase your bet by $5, but continue to bet on the same color.

Stop play when either of the two events occur:

·        You’ve doubled your total cash.

·        The amount of money you have is less than your next bet.

Since Roulette has the 0 and 00, there is no way that you can ever have a positive expected outcome. However, when I ran the simulation multiple times, it was interesting to see that there were plenty of occasions where I doubled my cash – not necessarily enough times for me to be willing to spend $1000 in a casino, but close.

What’s fun about the python code is that it will let you know:

  • How much money you are going home with.

  • What your last bet was.

  • What the last outcome was.

  • What the expected value was of playing for that length of time with your bets.

Playing this in python certainly scratched a gambling itch! I encourage you to try it out for yourself – it’s in my public Github repo.

Do you have other strategies that you want to try? I’d love to run a simulation – if you tell me about it.

Also, do you want to be notified of my blog post and my other updates once a month? Subscribe to my free substack newsletter 5 on the 9.

See you next month!

Previous
Previous

What’s Luck Got to Do With It?

Next
Next

Saving to Text Files Through the Command Line (A Python Shortcut)