No history yet

Introduction to Probability

What Are the Odds

Probability is simply a way to measure uncertainty. It tells us the likelihood of something happening. Think about flipping a coin. There are two possible outcomes: heads or tails. If the coin is fair, each outcome is equally likely. We say the probability of getting heads is 1/2, or 0.5.

Every probability is a number between 0 and 1.

  • A probability of 0 means an event is impossible. The probability of a standard die landing on the number 7 is 0.
  • A probability of 1 means an event is certain. The probability that the sun will rise tomorrow is very, very close to 1.
  • A probability of 0.5 means an event is just as likely to happen as it is not to happen, like our coin flip.

The closer the probability is to 1, the more likely the event. The closer it is to 0, the less likely.

Random Variables

In probability, we often deal with numbers. A random variable is a variable whose value is a numerical outcome of a random event. It's a way of attaching a number to each possible result.

Imagine rolling a single six-sided die. The outcome could be 1, 2, 3, 4, 5, or 6. We can define a random variable, let's call it XX, to be the number that shows on the die. So, XX can take on any of those six values.

There are two main types of random variables: discrete and continuous.

TypeDescriptionExamples
DiscreteCan only take on a finite or countable number of distinct values.The number on a rolled die (1, 2, 3, 4, 5, 6). The number of emails you get in an hour (0, 1, 2, ...).
ContinuousCan take on any value within a given range.A person's exact height. The temperature of a room. The time it takes to run a race.

The key difference is counting versus measuring. You count discrete variables, but you measure continuous ones.

Mapping Outcomes with Distributions

A probability distribution describes the likelihood of all possible values a random variable can take. It’s like a map that shows which outcomes are more likely and which are less likely.

For a discrete random variable, the distribution is often just a table or a function that lists the probability for each outcome. For a fair six-sided die, the distribution is simple:

Outcome (x)Probability P(X=x)
11/6
21/6
31/6
41/6
51/6
61/6

Notice that if you add up all the probabilities, you get 1. This is always true for any probability distribution, because one of the possible outcomes must occur.

For continuous random variables, things are a bit different. Since there are infinitely many possible values, the probability of any single exact value is zero. Instead, we look at the probability of a value falling within a range. This is described by a curve called a probability density function (PDF). The area under the curve between two points gives the probability for that range.

Just like with discrete distributions, the total area under the curve of a continuous distribution is always 1.

What to Expect

The expected value of a random variable is the long-run average value we would expect to see if we repeated the random event many, many times. It's a weighted average of all possible outcomes, with the weights being their probabilities.

For a discrete random variable XX, the formula is:

E[X]=xP(X=x)E[X] = \sum x \cdot P(X=x)

This means you multiply each possible value (xx) by its probability (P(X=x)P(X=x)) and then add up all those products.

Let's calculate the expected value for our six-sided die roll:

E[X]=(116)+(216)+(316)+(416)+(516)+(616)=1+2+3+4+5+66=216=3.5\begin{aligned} E[X] &= (1 \cdot \frac{1}{6}) + (2 \cdot \frac{1}{6}) + (3 \cdot \frac{1}{6}) \\ &\quad + (4 \cdot \frac{1}{6}) + (5 \cdot \frac{1}{6}) + (6 \cdot \frac{1}{6}) \\ &= \frac{1+2+3+4+5+6}{6} = \frac{21}{6} = 3.5 \end{aligned}

The expected value is 3.5. Interestingly, 3.5 is not an outcome you can get on a single roll. Instead, it tells us that if you were to roll the die thousands of times and average all the results, your average would be very close to 3.5.

This is a key idea. Expected value isn't about predicting a single event, but about understanding the central tendency of a random process over time.

And with that, you have the foundational concepts of probability. These ideas—of measuring chance, classifying random outcomes, and calculating what to expect on average—are the building blocks for modeling more complex, uncertain situations.