Comments

You must log in or register to comment.

WraithCadmus t1_irwi1gd wrote

You did this via simulation, so you could say it was...

... the Monte Carlo method? 😎

314

nautilus_red OP t1_irx1c45 wrote

Ah I like that comment on so many levels haha Nice that sb knows the simulation and the casino ;)

69

Atillion t1_irwkxwo wrote

I'm WAY too dumb to get this joke, but I'm a sucker for a flawless delivery :D

25

nautilus_red OP t1_irx1wkd wrote

There is a "Monte Carlo simulation" used to model stochastic processes but there is also a casino called Monte Carlo. The joke is perfect because Roulette is played in a casino and I modeled a stochastic process.

63

Farsyte t1_irxkff1 wrote

The simulation method was named after the casino. Full circle!

37

Atillion t1_irxmne1 wrote

I was missing the simulation data, now it makes perfect sense! I stand by my award, thank you for clarifying!

7

nautilus_red OP t1_irxxbuv wrote

Haha the joke is pure quality, I needed to make sure everybody understands that one. Thanks!

7

RD__III t1_is0yve6 wrote

I work in engineering, and compared to stuff like CFD or FEA, Monte Carlo is fun to write. It also lets you do some really fun visuals.

1

Tiligul t1_is08uq9 wrote

They call this method Inzaghi science in my village.

1

Ghrota t1_irwd3r0 wrote

What do they bet? On a number ? On a color?

61

nautilus_red OP t1_irwdrpk wrote

Thanks for pointing out, single numbers only.

73

Nitz93 t1_irxf6hz wrote

Did you run it with a
payout of 35 or 36?
Normal table or double zero?

18

Pitiful_Paramedic895 t1_irxmnrj wrote

Can you please post the code?

15

nautilus_red OP t1_irxy8fh wrote

I am not sure if there is any good way to do that other than paste it in here but here you go.

​

FYI: I first had some serious ugly for loops to simulate it which was extremely slow so I coded it more efficiently as you can find below (probably it's a bit less intuitive though, I don't know).

######### Simulation #########

import random

import numpy as np

k = 50000000

returns = [-5 for i in range(0,36)]+[170]

return_arr = np.array(random.choices(returns, k = k)).reshape(int(k/5000),5000)

return_arr_sum = np.sum(return_arr, axis=1)

return_arr_cumsum = np.cumsum(return_arr,axis=1)

return_arr_aux = np.ones((10000,5000), dtype=int)*10000

return_path = return_arr_cumsum + return_arr_aux

​

######### Chart #########

​

import matplotlib.pyplot as plt

from matplotlib.pyplot import figure

figure(figsize=(15, 7), dpi=100)

# plot 1

plt.subplot(1, 2, 1)

plt.plot(return_path.T, linewidth = 0.2)

plt.title("Roulette Simulation of " + str(5000) + " Bets \n Start = 10'000 \$, 5 $ per Bet \n ("+str(int(k/5000))+" Player Paths Simulated)")

plt.xlabel("# Bets", fontsize=12)

plt.ylabel("Total Money Left", fontsize=12)

# plot 2

plt.subplot(1, 2, 2)

pos = [i for i in [return_path[i][-1]-10000 for i in range(0,len(return_path))] if i>=0]

neg = [i for i in [return_path[i][-1]-10000 for i in range(0,len(return_path))] if i<0]

plt.hist(pos, bins = 100, orientation="horizontal", color="green")

plt.hist( neg, bins = 100, orientation="horizontal", color= "red")

plt.title("Distribution of Player Returns After " + str(5000)+ " Bets")

plt.xlabel("# People", fontsize=12)

plt.ylabel("\n Player Profit/Loss", fontsize=12)

plt.show()

19

xElMerYx t1_iry1935 wrote

You can embed blocks of code like this

'''This code will print a lost containing numbers 1 through 10'''

import numpy as np

np_array = np.array([]) 

for i in range(1, 11) : 
    np_array = np.append(np_array, i) 

print(np_array)

&#x200B;

by using the option found here

20

UwRandom t1_is0xncj wrote

The better way to do this would be to either create a GitHub repo, or a GitHub gist. Repos are harder to work with but have lots of features for collaboration and bug tracking, gists are easy to use and only have a few features, it's meant to share code snippets and that's it.

6

nautilus_red OP t1_is0zotd wrote

I never really used GitHub but it seems that it would be a good investment to look at it if I want to do some more mini projects. Thanks!

2

UwRandom t1_is10p7y wrote

Definitely! It's what most software folks use as a portfolio so I'd highly recommend digging into it at some point :)

2

reidberk98 t1_irxcwtz wrote

It would effect the rising and falling of each player's line but the average at the end should be more or less the same.

7

WowSoWholesome t1_irybul6 wrote

Agreed! Please don’t hate me for pointing this out, but I think I you could say it would affect it or you can also say that it would have an effect on it.

8

babygrenade t1_irwga87 wrote

This is why I always bet on black.

44

HoDgePoDgeGames t1_irxf7wj wrote

I bet black or two of the dozens. 1-12, 13-24, 25-36.

Betting two of the dozens gives you just under a 64% to hit one. It makes sense to my smooth brain.

26

Atillion t1_irxn353 wrote

Well I have the advantage. For I have something no other gambler has..

^(..A SYSTEM!)

😂

35

HoDgePoDgeGames t1_irxnib9 wrote

I never said I was intelligent.

14

Atillion t1_irxoj15 wrote

Oh no! I was just adding my riduclousness to the conversation, not making a judgment about you.. I like your 2 dozens system.

10

HoDgePoDgeGames t1_irxryhs wrote

I’m up. But I don’t count the days I lose.

12

Aethenosity t1_irzn4p8 wrote

I had a friend talk about winning 20K at once (i don't know anything about gambling. But I think he said poker?), and when he went to cash out he asked what his... balance was (don't remember the wording, but winnings minus losses). They told him he almost broke even. Then he went on to say it was actually better because when you lose a lot they give you things like TVs, so really he came out ahead.

1

RenterGotNoNBN t1_irza30b wrote

That's a stupid system. The main thing is not to bet against yourself. Even if you win, you lose half your bet.

That's why you see people cluster their bets around a number - sometimes called a tower, rather than doing multiple singles for example.

5

GoodellsMandMs t1_irzdt51 wrote

You’re guaranteeing you lose at least one of your bets

Surely this isn’t close to profitable

67% of time you’ll win one and get you initial bets back (pays 2:1, and you lose the other)

33% of the time you lost both bets

This system makes no sense, best case scenario is like you didn’t play

5

Sword_Thain t1_irzikh6 wrote

You still keep your original bet, so you bet 2x, on a win, loose 1x, win 2x, so you end up with 3x.

The failure of this system is that one loss requires 2 wins just to return to even. A cascade failure is real and I've seen it.

Former roulette dealer.

6

GoodellsMandMs t1_irzitho wrote

Still dumb as fuck, just not quite as dumb as I originally thought lol

nvm, he wont lose more money, hell just lose his money faster

4

IGoUnseen t1_is0m5ry wrote

It's just an adjustment on how often you win and how much each win is. There is a wide variety in the casino on how much different bets pay out and how likely they are to win. There are bets that are very unlikely to win and pay out a lot when they do, and there are bets that pay very little but are likely to win. This particular set of bets leans heavily to the latter, it only pays 1 to 2, but wins almost 2/3s of the time. It's overall house edge is the same as any other bet on the roulette table.

It is fair to say this bet has lower variance compared to other bets, which is what most people look for in gambling, but if this guy enjoys betting that way, there is nothing wrong with it. He won't lose any more in the long run than a person betting black every spin.

1

[deleted] t1_is13s6r wrote

[deleted]

1

IGoUnseen t1_is14fre wrote

That's only because in your example he's betting twice as much. A two unit bet on black is the same house edge as two one unit bets on different dozen bets.

1

GoodellsMandMs t1_is14v1r wrote

youre right, its not a strategy to lose more money, its just a strategy to lose money faster lol

1

IGoUnseen t1_is17qg5 wrote

Not really, only if you are betting twice as much. If you're average bet would be normally 10 dollars, and you instead bet 5 dollars on each of those, it's equivalent to one 10 dollar bet.

This applies more generally to all bets in roulette. Every single bet in roulette has the exact same house edge and can often be replicated by multiple bets of a different one. I.E. one double number bet has the same odds as two single number bets of the same amount. Making two dozen number bets is equivalent to a hypothetical 24 number bet that just isn't normally offered at the table.

Basically, how much you lose at roulette is 100% based on the volume of your overall bet. Which numbers/bets you select does not matter. The only thing it matters towards is variance. Some people want to have rare large wins and frequent small losses, some people want frequent small wins and rare large losses. The selection of numbers you pick will affect that, but again not the expected amount lost.

1

IkeRoberts t1_is0dw8n wrote

It is a good system if you want to win often. It is a bad system if you want a chance to get a big win. All systems are bad if you want to make money gambling--it is entertainment you pay for.

1

[deleted] t1_irx9pn2 wrote

[deleted]

21

LarryOji t1_irxa4bq wrote

Wouldn’t you know it, so does Red!!! :-)

8

nautilus_red OP t1_irw9ctq wrote

Tool: The two charts were generated in Python using the Matplotlib library.

Source: Also generated in Python unsing the random.choices() function onto a hard coded list of the respective Roulette numbers.

Edit: The simulation was done under the assumption that all players use a single number betting strategy.

18

CalmSatisfaction9425 t1_irxqlqp wrote

What is the output of the function random.choices() based on? In excel, the random function is based on the uniform distribution, which means if you generate enough samples you'll just replicate the uniform distribution. "Truly random" random generators technically do not exist, they have to be based on something in order to be programmed. It's important to understand how it works under the hood so you know your conclusions are accurate. It might be good enough!

4

nautilus_red OP t1_irxv8pi wrote

Well in this case I do not generate a number but I chose from a predetermined list (which I defined to match the actual probabilities of roulette). random.choices() choses per default uniformely.

3

CalmSatisfaction9425 t1_is0aw2u wrote

Ok. Ultimately you are generating a random number- you're generating a random pick from a predefined list. This pick needs to follow some sort of pattern, and it sounds like your code uses the uniform distribution which makes sense for an ideal roulette wheel (a fair roulette wheel). Nice!

In the future you can repeat your entire study, say n=20 more times, and add a random bias to the roulette wheel to favor ever so slightly a section of numbers located near each other. This would simulate real world conditions as there's no such thing as a perfectly ideal roulette wheel. Combine the results together to see if the effect is significant. The results might be interesting!

Great project!!

2

NorthImpossible8906 t1_irwibxv wrote

for the figure on the right, is the x-axis title correct? Or should that be the number of people?

Frankly, I'm surprised roulette single number betting doesn't zero out faster. The odds are 37 to 1 (or perhaps 36 to 1) against winning. (Payout is 35 to 1). Still, a fairly nice profit for the house. Hundreds of people losing thousands of dollars.

13

ABigAmount t1_irwpgzu wrote

The house edge on double zero roulette is 5.26%, regardless of bet. So they expect to win $5.26 for every $100 wagered.

9

nautilus_red OP t1_irx3unt wrote

Ah it should be # of people you're absolutely correct.

I was also surprised that almost 25% walked away with a profit. Always good to run a simulation to detect such counterintuitive things.

&#x200B;

FYI: I ran the simulation with 25'000 bets per person and there is still a probability of above 6% to walk away with a positive return.

8

NorthImpossible8906 t1_iryibv7 wrote

> 25'000 bets per person and there is still a probability of above 6% to walk away with a positive return.

and that is exactly the hook. The thing that makes gambling more addictive than crack heroin.

6

CassandraVindicated t1_irzqlg1 wrote

It's not the green that fucks you up, it's the payout. Payout should be 36 to 1 for a fair(er) game. When you set it at 35 to 1, that's giving the house another advantage other than the green. Good to know.

1

CptMisterNibbles t1_irzy33m wrote

Huh. In roulette, the green spot is pretty brilliant as it’s the “reasonable” explanation for being the odd man out on of the bets (not in: thirds, half, color, parity, corner betting, etc), so it’s incorporation fixes all those bets so they can have the otherwise “expected payout”- some house edge, but it doesn’t solve the single number payout issue, so they have to lower the payout for that bet. As it’s so high it seems reasonable. Neat

3

Atillion t1_irwktcn wrote

That's the first time I've seen someone use a ceiling comma as a separator..

^(I mean, I don't hate it!)

8

TipYourDishwasher t1_irxbgk7 wrote

This is the first time I’ve seen someone call an apostrophe a ceiling comma (languages are weird)

17

nautilus_red OP t1_irx4qoq wrote

This is the standard form where I am from. I know its not that usual around the world, most of the time it's either a comma or a period.

4

Atillion t1_irxk68z wrote

I honestly just wanted to say ceiling comma. I like the notation!

3

I__Know__Stuff t1_iry6lzj wrote

It is accepted as a separator by some programming languages, because comma, period, and space already have other meanings. I didn't know there are places where it is used naturally.

1

arekniedowiarek t1_irxke6k wrote

Finally a separator that makes it clear for everyone what number it is

4

[deleted] t1_irwb5gz wrote

There's probably an analytical proof showing that we expect a kappa distribution for the left-side plot.

7

Alternative_Bid3464 t1_irxjnjd wrote

I feel like that little red dot at -8000 every time I visit the casino

6

melanthius t1_iryll4o wrote

Ever hear of the movie The Cooler?

There’s a guy in the casino who goes around to tables on big winning streaks, and by virtue of his presence and inherent luck, manages to “cool off” the table so the casino stops losing money.

That is basically me except I don’t work for the casino

2

_iam_that_iam_ t1_irx5b68 wrote

I want to see the scatter plot if I do 5000 times Russian Roulette

4

sik-kirigi-3169 t1_iryt1pi wrote

fun fact: did you know that 74% of gambling addicts quit right before their big hit?

4

Nitz93 t1_irxbi7o wrote

Cool simulation!

If you multiply the chance to win by the payout you get something like 0.97 For all bets except on numbers where it's 0.95.
Obviously this assumes a normal table not the scam double zero table.

Anyways could you please run it while they bet on red instead of numbers only?


Some roulette logic:

For every dollar you throw in (without stupid stuff like betting on 18+ numbers at once or red+black) you get 94.6 or 97.3 cents back.

(1/37) × 35 = 0.945 number
(12/37) x 3 = 0.973 one third
(18/37) x 2 = 0.973 one half (red / black / even / odd)
(2/37) x 17 = 0.97 splitting a number
... = 0.97 splitting 3 numbers
...

At 1 number the payout is only 35 instead of the 36 you should be getting. And the dealer pressures you into giving 1 bet as tip... so the average payout is only 92 cents.


Anyways could you run something else for me too?

What I wanna see is how to maximize the chance for not playing like an idiot.

Like is betting on only 1 number superior to 2? To 16? To 25? Is the switch really at 18?
Like 17 numbers at once should be the same average payout as 1, while starting at 19 it should become lower til it you go full crazy and bet on all 37.

What about number 1 + red vs #1 + black? Imo 1 n red should be better but apparently it's the same.

Is red only better than red + last 1/3

Or is #1, red, odd, first 1/3 less stupid than #1, black, even, last 1/3?


My math friend says it doesn't matter but it's so unintuitive to me.

3

Purplekeyboard t1_irxnrzf wrote

> What I wanna see is how to maximize the chance for not playing like an idiot.

Switch to blackjack. The house edge is only 0.5% instead of 5%, assuming you play proper blackjack strategy.

2

Ma1eficent t1_irxy6ak wrote

Isn't that jacked by the multiple decks they use now?

2

CptMisterNibbles t1_irzycp8 wrote

Multiple decks is an attempt to prevent card counting, which allows players to gain statistically significant information used to adjust their strategy to the point where they beat out the house edge.

2

Purplekeyboard t1_irxzu7l wrote

No. Regardless of how many decks there are, your odds are the same.

1

Ma1eficent t1_iry05e9 wrote

Time to lose my money at the blackjack table!

4

melanthius t1_irym05d wrote

While I know that is true, it just triggers me way too much to keep getting dealt 12s and 13s and then busting.

Craps is way more my game

1

nautilus_red OP t1_iry2fjj wrote

First of all thanks for acknowledging the simulation!

&#x200B;

>My math friend says it doesn't matter but it's so unintuitive to me.

I try to give you an intuitive answer for this one. if I would ask you which of the following two options has a higher probability to roll a six:

(a) Roll ten dices at the same time.
(b) Roll one dice ten times.

It would be very obvious (I hope) that (a) and (b) are exactly the same because in the end you rolled ten dice and each outcome is independent of each other no matter if rolled all at once ore one by one. Now applied to our roulette scenario (a) would be betting multiple numbers on the table and (b) would be betting only one number at the time. So, it really doesn't matter how you approach that.

&#x200B;

>What I wanna see is how to maximize the chance for not playing like an idiot.

Well if you play to win than there is no hope because you cannot win as I am quite sure you already know. What we could do is minimize our expected loss by finding the least worst strategy (we can also call it the best but you are still not winning). I am no guru when it comes to roulette but you could easily simulate that e.g. if you want to know whats your expected chance of walking away by betting on red all the time over X amount of bets.

=> If you are interested in gambling strategies read about Martingale strategy which is quite interesting but spoiler: it doesn't work either. Here is an example: Hyperlink

If you cannot simulate it yourself I might be able to do so but you find my Python code in another comment I replied to.

1

Colmarr t1_irz1ay6 wrote

>Now applied to our roulette scenario (a) would be betting multiple numbers on the table and (b) would be betting only one number at the time. So, it really doesn't matter how you approach that.

This isn't a sound analogy.

10 dice can (and probably will) return 6 different results).

One spin of the roulette wheel cannot return 6 different results.

You're probably right that betting multiple numbers doesn't change the odds (I haven't checked), but it's not for the reason you've expressed here.

Edit: I think I see what you mean. You are suggesting that placing a bet is like rolling a dice (not that spinning the wheel is like rolling a dice). In that context yes the analogy works.

1

Nitz93 t1_irznbn8 wrote

Mathematical chance vs real life

1/2 and 1/4 + 1/4 would be the same chance, as are 10 dice vs 10 rolls of 1 dice. But I am not here for math, it's about reality.
You know the guys in your simulation all had the same odds. I wanna improve the overall odds, a method where more people would win.

And if you consider real life end points;

  • like if you play til you win. This could happen on roll 11 of the singular dice, but for the 10 rolls it must be the 20. So the payout is lowered by 9 bets.

If you already won 17k you may decide to keep on playing til you win or lose 2k.

Or you start with 7k, stop playing once you hit 2k.

These situations are real, you know the overall chance to win at 50 spins is the same but you won't play exactly 50 spins.

In the simulation/real life there must be some super lucky gamblers, those win more often by pure chance and that should happen slightly more often in a group of people playing only 1 number vs people playing 2/3/../17 numbers at once.

*and of course much more often in groups playing better odds than only numbers.


Yeah one is always an idiot when playing but losing 5 bucks on a roulette table is fun. 30-100 bucks is fair price for a fun evening. I just want the most bang for my bucks.

1

IkeRoberts t1_is0efjt wrote

>30-100 bucks is fair price for a fun evening. I just want the most bang for my bucks.

Calculating a value-maximizing betting strategy for that goal would be interesting. Betting $1 every other spin would stretch the funds but not the fun.

1

Nitz93 t1_is0g3fu wrote

Should be 1 bet per game, everything but a betting directly on a number.

Splitting a number or 4 is OK, going for red or so too.

1

csk1325 t1_irxb65a wrote

Could you do the same chart for craps?

2

nautilus_red OP t1_irxbp62 wrote

I would have to look into the rules of this game but I am pretty sure I could do that. Let me know.

4

csk1325 t1_irxddzy wrote

Yes. I always hear that the Craps table gives you the best odds of winning.

1

Jayayewhy t1_irxtgym wrote

The odds bet has no house edge. If your point is the 4 or ten, there are 6 ways to lose and 3 ways to win. So you get 2 to 1 odds. It doesn't mean your more likely to win or lose, it means you're paid fairly when you win. It's only the odds bets on come or line though. Every other bet has huge house edges. For example, a one roll 12 pays 30 to 1. But it's 1 in 36 to hit, even worse than roulette.

4

devilsrotary86 t1_iry002x wrote

Without doing any real research of my own, but a 26% chance of at least breaking even feels pretty good in terms of casino odds. I would have expected it to be more tilted in favor of the house.

2

nautilus_red OP t1_iry6fag wrote

I first thought exactly the same but keep in mind that 26% winning does not mean that its a quarter of the total "pool" of money that changed hands. In the simulation the sum of all winners equals 3'195'425 $ while the sum of all losers (profit for the casino) is 16'524'025 $ which is 5x larger (despite "only" 74% of total losers). This is because there are far more large losses than large gains.

3

farroyo97 t1_iryy81m wrote

But that 26% I might be lucky

2

benthib t1_irzgi8c wrote

I played Roulette at a party after my friend build a legit table. I bet Snake Eyes( both dice showing 1's) every time. We all started with $100 in play money and by the end of the night they had to find something around the house to represent a million dollar chip for me because I had won so many time. In case you don't know Snake Eyes pays around 32 to 1. I wish I was playing with real money that night.

2

Cube-n-pedro t1_iry4jnu wrote

Wait, I would have just assumed the law of large numbers kicks in after 5k bets. I'm surprised that 1/4 of folks would still be ahead.

1

britboy4321 t1_iry9h7k wrote

Is this on a US roulette table or a European Roulette table?

Also in some casinos hitting the green means you get your stake back - was that the case here?

1

nautilus_red OP t1_irznq9s wrote

European table where you dont get your money back when hitting green.

1

Nalemag t1_irydy2r wrote

would be curious how this changes for those freaking wheels that add a '000' slot.

1

nautilus_red OP t1_irzq1m2 wrote

Fortunately the code is easy adaptable, here are the numbers from the simulations (all for 5'000 bets):

Single zero: 74%

Double zero: 83%

Tripple zero: 90%

2

ilurkcute t1_irytshc wrote

Does this sub like this stuff? I did so many of these for various casino games and blackjack card counting strategies.

1

qsdf321 t1_irzzbxl wrote

You could just plug the numbers in the Kelly formula and know right away that it has a negative expected outcome (like all casino games).

1

nautilus_red OP t1_is038it wrote

Its not about finding out that you lose when playing roulette which is absolutely obvious... You also dont need any kind of formula to conclude that, you could just look at a P&L of a casino ;)

It was about approaching a problem from a different angle and have some fun with a simulation :)

1

Tiligul t1_is08rqd wrote

Why is it always the green ones making the wins? So unfair.

1

zutonofgoth t1_is0b6ou wrote

Ah... Laundering money you don't care about a negative return, as long as it is a stable return.

1

printers_rock t1_is0hu0z wrote

Should have included me in this. I've got a system.

1