Archive

Posts Tagged ‘probability’

Visualizing Probability: Roulette

March 6, 2012 15 comments

I wrote a post over on the Society of Information Risk Analysts blog and I was having so much fun, I just had to continue.  I focused this work on the American version of Roulette, which has “0” and “00” (European version only has “0” producing odds less in favor of the house).  The American versions also have “Five Numbers” option to bet, which the European version doesn’t have. 

According to this site, the American version of roulette could do about 60-100 spins in an hour, I figured maybe 4 hours in the casino and being conservative, I decided to model 250 iterations of roulette.  I then chose $5 bets, which isn’t significant, changing the bet would only change the scale on the left, not the visuals produced.  I then ran 20,000 simulations of 250 roulette spins and recorded the loss or gains from the bets along the way.  One way to think of this is like watching 20,000 people play 250 spins of roulette and recording and plotting the outcomes. 

I present this as a way to understand the probabilities of the different betting options in roulette.  I leveraged the names and payout information from fastodds.com.  The main graphic represents the progression of the 20,000 players through the spins.  Everyone starts at zero and either goes up or down depending on lady luck.  The distribution at the end shows the relative frequency of the outcomes.

Enough talking, let’s get to the pictures.

Betting on a single number

single

What’s interesting is the patterns forming from the slow steady march of losing money punctuated by large (35 to 1) wins.  Notice there would be a few unlucky runs with no wins at all (the red line starts at zero and proceeds straight down to 1250).  Also notice in the distribution on the right that just over half of the distribution occurs under zero (the horizontal line).  The benefit will always go to the house.

Betting on a pair of numbers

twonumbersplit

Same type of pattern, but we see the scale changing, the highs aren’t as high and the lows aren’t as low.  None of the 20,000 simulations lost the whole time.

Betting on Three Numbers

threenumberstreet

Betting on Four Number Squares

fournumbersquare

Betting on Five Numbers

fivenumbers

Betting on Six Numbers

sixnumberline

Betting on Dozen Numbers or a Column

 

columnordozen

Betting on Even/Odd, Red/Green, High/Low

oddevenredgreen

And by this point, when we have 1 to 1 payout odds, the pattern is gone along with the extreme highs and lows.

Mixing it Up

Because it is possible to simulate most any pattern of betting, I decided to try random betting. During any individual round, the bet would be on any one of the eight possible bets, all for $5.  The output isn’t really that surprising.

scatter

Rolling it up into one

Pun intended.  While these graphics help us understand the individual strategy, it doesn’t really help us compare between them.  In order to do that I created a violin plot (the red line represents the mean across the strategies).

boxplots

Looking at the red line, they all have about the same mean with the exception of Five Numbers (6-1).  Meaning overtime, the gambler should average to just over a 5% loss (or a 7% loss with five number bets).  We can see that larger odds stretch the range out, which smaller odds cluster much more around a slight loss.  The “scatter” strategy does not improve the outcome and is just a combination of the other distributions.  As mentioned, the 6-1 odds (Five Numbers) bet does stick out here as a slightly worse bet than the others.

Lastly, I want to turn back to a comment on the fastodds.com website:

image

While I may disagree that the only bets to avoid are limited to those (had to get that in), I also disagree with the blanket statement.  Since they all lose more often than they win, trying to get less-sucky-odds seems a bit, well, counter-intuitive.  I would argue that the bets to avoid are not the same for every gambler.  The bets should align with the tolerance of the gambler.  For example, if someone is risk-averse, staying with the 2-1 or 1-1 payouts would limit the exposure to loss, while those more risk-seeking, may go for the 17-1 or 35-1 payout – the bigger the risk, the bigger the reward.  Another thing to consider is that the smaller odds win more often.  If the thrill of winning is important, perhaps staying away from the bigger odds is a good strategy.

Now that you’re armed with this information, if you still have questions, the Roulette Guru is available to advise based on his years of experience.

Categories: Risk, Visualizations Tags: ,

A Matter of Probability

November 21, 2010 3 comments

I was reading an article in Information Week on some scary security thing, and I got to the one and only comment on the post:

Most Individuals and Orgs Enjoy "Security" as a Matter of Luck

Comment by janice33rpm Nov 16, 2010, 13:24 PM EST

I know the perception, there are so many opportunities to well, improve our security, that people think it’s a miracle that a TJX style breach hasn’t occurred to them a hundred times over and it’s only a matter of imagetime.  But the breech data paints a different story than “luck”. 

As I thought about it, that word “luck” got stuck in my brain like some bad 80’s tune mentioned on twitter.  I started to question, what did “lucky” really mean?  People who win while gambling could be “lucky”, lottery winners are certainly “lucky”.  Let’s assume that lucky then means beating the odds for some favorable outcome, and unlucky means unfavorable, but still defying the odds.  If my definition is correct then the statement in the comment is a paradox.  “Most” of anything cannot be lucky, if most people who played poker won then it wouldn’t be lucky to win, it would just be unlucky to lose.  But I digress. 

I wanted to understand just how “lucky” or “unlucky” companies are as far as security, so I did some research.  According to Wolfram Alpha there are just over 23 Million businesses in the 50 United States and I consider being listed in something like datalossDB.org would indicate a measurement of “not enjoying security” (security fail).  Using three years from 2007-2009, I pulled the number of unique businesses from the year-end reports on datalossDB.org (321, 431 and 251).  Which means that a registered US company has about a 1 in 68,000 chance of ending up on datalossDB.org.  I would not call those not listed as “lucky”, that would be like saying someone is “lucky” if they don’t get a straight flush dealt to them in 5-card poker (1 in 65,000 chance of that)

But this didn’t sit right with me.  That was a whole lot of companies and most of them could just be a company on paper and not be on the internet.  I turned to the IRS tax stats, they showed that in 2007, 5.8 million companies filed returns.  Of those about 1 million listed zero assets, meaning they are probably not on the internet in any measurable way.  Now we have a much more realistic number, 4,852,748 businesses in 2007 listed some assets to the IRS.  If we assume that all the companies in dataloss DB file a return, that there is a 1 in 14,471 chance for a US company to suffer a PII breach in a year (and be listed in the dataloss DB).

Let’s put this in perspective, based on the odds in a year of a US company with assets appearing on dataloss DB being 1 in 14,471:

Aside from being really curious what constitutes as a grooming device, I didn’t want to stop there, so let’s remove a major chunk of companies whose reported assets were under $500,000. 3.8 million companies listed less then $500k in their returns to the IRS in 2007, so that leaves 982,123 companies in the US with assets over $500k.  I am just going to assume that those “small” companies aren’t showing in the dataloss stats.

Based on being a US Company with over $500,000 in assets and appearing in dataloss DB at least once (1 in 2,928):

Therefore, I think it’s paradoxically safe to say:

Most Individuals do not participate in a non-traditional triathlon as a Matter of Luck.

Truth is, it all goes down to probability, specifically the probability of a targeted threat event occurring.  In spite of that threat event being driven by an adaptive adversary, the actions of people occur with some measurable frequency.   The examples here are pretty good at explaining this point.  Crimes are committed by adaptive adversaries as well, and we can see that about one out of every 2,500 Hispanic females 12 or older, will experience a loss event from purse-snatching or pickpocketing per year.  In spite of being able to make conscious decisions, those adversaries commit these actions with astonishing predictability.  Let’s face it, while there appears to be randomness on why everyone hasn’t has been pwned to the bone, the truth is in the numbers and it’s all about understanding the probability.