Basic Principles of Probability
Since the dawn of civilization, the world’s greatest minds have been spent their lives seeking the answer to the question:
How do I win at back alley dice?
Ok, so that’s obviously not true. This question does hint at one that actually has plagued humanity for thousands of years:
What is going to happen?
Think about it. Pharaohs, kings, magistrates, tribal chieftains, and superstitious everyday people have sought out counsel from wisemen, soothsayers, oracles, prophets and prophetesses, priests and priestesses, palm/tarot readers, fortune tellers, and phoneline psychics to get the answer to this question. Consider the billions, if not trillions, of dollars that have been spent over the last century on stock brokers, actuaries, consultants, and developing machine learning algorithms to predict how investments will turn out.
All of that money and so many resources have been spent with the intention of predicting the future. Why? Well, because the future is unknown, and, according to H. P. Lovecraft, the oldest and strongest fear is the fear of the unknown (Little did he know that it’s actually the fear of Public Speaking, at least in America). We’re afraid that all that we’ve built today will vanish tomorrow due to some unforeseen event. Just ask a YouTube animator that was around before 2012. They’ll be happy to tell you how a change in YouTube’s algorithm took them from a modest income, to nearly unsustainable. In fact, many major YouTubers have a deep rooted anxiety that one day their channel will also become unsustainable due to a sudden change in the algorithm that doesn’t suit their platform. While this is a little off the beaten path, but it goes to show you that these fears are rooted in reality. It’s not an exaggeration to say that people can go from “rags to riches” and vice versa overnight. Just recently we had GameStop’s stock prices skyrocketing thanks to a band of people on Reddit and a few tweets from Elon Musk and a few other popular, hedge fund personalities.
So how do we go about predicting the future? Well, we first need a decent grasp of probability. To make this fun, we’ll use Back Alley Dice to provide context.
A Roll of the Dice
Let’s look at a normal, 6-sided die. It’s got six sides, each with a number value 1 through 6. The general consensus is that the probability of rolling a 6 is 1/6th. Is that always true? Not necessarily. What if it’s weighted? How would we measure the probability then? Why, through observation!
Let’s go ahead and simulate rolling a single die.
In this function, we have a dictionary whose keys are a set of all the possible outcomes. We simulate a die rolling with a
for loop and each time it rolls a number we update the dictionary (recording our observations). Then the function returns the dictionary so we can view the outcomes.
Let’s see what happens after 10 rolls.
So from 10 rolls, it would seem that you have a greater chance of rolling a 1. Let’s try this out a few more times.
As we can see, the more rolls we record, the more our possible outcomes converge. In other words, the odds for each possible outcome appear to be equal. So the die is fair! Let’s check to see if it equates to 1/6th.
To calculate the probability of an event, you need the total number of times the event occurred and divide it by the total number of observations. In our case, the event is rolling a six. The number of observations we recorded was 1 million. So in 1 million rolls we rolled six 166,889 times. When we do the math we get 0.166974, which lines up pretty close to 1/6th!
So why did I spend time proving something that you already know? To outline how you determine the probability of an event. Perform an experiment, record your observations, count the number of times the event occurred and then divide it by the total number of observations.
Now let’s get to gambling!
Back Alley Dice!
So Back Alley dice is just a less than legal way of playing Craps. You roll 2 dice at a wall or stoop and add up their values. If you roll a 7 or an 11, you win. If you roll a 2, 3, or 12, you lose. If you roll any other number, you must roll that number again before you roll a 7, 11, or 2, 3, or 12. Fail to do so, and you lose. You can also just make bets on what you’ll roll. What are the odds of rolling even rolling a 7, though? Let’s find out!
Pretty similar to our first, function. The main difference is that we have 2 dies and we add their values together. Now, let’s run our simulation.
So it appears that 7 is actually the most common outcome! But why? Well, it’s because we aren’t measuring the probability of specific sides of a die, but, rather we’re measuring how many different combinations add up to specific sums. Let’s list them out.
Important Note: We’ll list the pairs like such: (die1, die2).
- 2: (1, 1)
- 3: (1, 2) (2, 1)
- 4: (1, 3) (2, 2) (3, 1)
- 5: (1, 4) (2, 3) (3, 2) (4, 1)
- 6: (1, 5) (2, 4) (3, 3) (4, 2) (5, 1)
- 7: (1, 6) (2, 5) (3, 4) (4, 3) (5, 2) (6, 1)
- 8: (2, 6) (3, 5) (4, 4) (5, 3) (6, 2)
- 9: (3, 6) (4, 5) (5, 4) (6, 3)
- 10: (4, 3) (5, 5) (4, 1)
- 11: (5, 6) (6, 5)
- 12: (6, 6)
As we can see, there are more combinations that add up to 7 than any other number (oddly enough, 1/6th). So when it comes to Back Alley dice, choose to bet by the roll, and then bet on a 7 (6 and 8 are also pretty solid).
This does raise another question: Why choose the most common roll (7) to be a winning number in Back Alley dice and, by extension, Craps? Well, it’s to keep you gambling! You’ll lose eventually.
Always bet on 7.
But seriously, all predictions are based on understanding probabilities. The probability of an event can be expressed mathematically by taking the number of successful events and dividing it by the total number of attempts. When it comes to probabilities, you can never really have enough data. The more observations you have, the more likely you are to find the true probability of an event