Notes

Search

Search IconIcon to open search

Probability and Counting

Last updated Jan 11, 2023

Statistics is the logic of uncertainty.

Sample Space

A sample space is the set of all possible outcomes of an experiment. You should interpret the word experiment extremely broadly.

An event is a subset of the sample space.

One of the big breakthrough’s that made probability a mathematical subject instead of something like astrology was the idea of using sets. We’ll need to be familiar with unions, intersections, etc.

Isaac Newton

There were gamblers asking Newton gambling questions because at the time, no one knew probability.

Newton did the calculations correctly, but sometimes his intuition was wrong. Similarly, we’ll be doing extremely unintuitive things in this class.

In a Calculus class.. I’ve never seen anyone shocked, by anything.

Statistics is full of counter-intuitive stuff, so that’s why we need to make it more mathematical (set theory).

Naive Definition of Probability (very naive)

You can only use this definition when you have strong justification for doing so.

Definition: $P(A) = \dfrac{ \textnormal{\# Favorable Outcomes}}{\textnormal{\# Possible outcomes}}$

This means that the probability of $A$ is the number of favorable outcomes divided by the size of the sample space.

This definition makes the huge assumption that

  1. All outcomes are equally likely
  2. We have a finite simple space

This is a reasonable assumption in some problems with symmetry (coin flips, rolling dice).

Life on Neptune

But what if we asked: What’s the probablity of life on neptune?

Using the naive definition we’d get an answer of $\dfrac{1}{2}$.

Moreover, what if we asked: What’s the probability of intelligent life on neptune?

Still, we’d get $\dfrac{1}{2}$. But there’s something weird about that, notably because you’d think that the probability is strictly less likely that there is intelligent life than if there was life at all!

Counting

We’ll need to learn how to count.

Multiplication Rule

If we have an experiment with $n_1$ possible outcomes, and for each outcome of the 1st experiment there are tShen $n_2$ outcomes for the 2nd experiment, $\cdots$, for each $n_r$ outcomes for $r$ experiments, then $n_1 n_2 \cdots n_r$ overall possible outcomes.

Ice Cream: Suppose you walk into an ice cream shop and need to choose between 2 kinds of cones (cake and waffle), and then 3 types of flavors (chocolate, vanilla, strawberry). How many possible outcomes are there?

Using our definition, we’ll see that there are 2 outcomes for $n_1$ (cake or waffle), and 3 outcomes for $n_2$ (chocolate, vanilla, strawberry). Therefore the number of possible outcomes is $n_1 \cdot n_2 = (2) * (3) = 6$. There are 6 possible outcomes. Note you can draw this in a tree structure.

Note that the number of outcomes grow very fast! That’s why it’s impossible to hope to count them by hand except for the simplest problems.

Find the probability of a full house in poker

A standard deck of cards contains 52 cards, we’re assuming the deck is shuffled, and you get a 5 card hand.

What’s the number of possible hands? It’s

$${{52}\choose{5}}$$

See Binomial Coefficient if you’re not familiar with this notation.

A full house is a hand with 3 cards of the same rank and 2 cards of the same rank. For example, 3 aces and 2 kings.

So the number of favorable outcomes is the number of ways to choose 3 cards of the same rank, times the number of ways to choose 2 cards of the same rank.

$$\dfrac{13\cdot{{4}\choose{3}} \cdot 12 \cdot {{4}\choose{2}} }{{52}\choose{5}}$$

Prefer this tree structured way of thinking about it.

Sampling

Sampling means we have some population, and we want to draw a sample from it.

We’re choosing $k$ elements from a population of size $n$, and we’re wondering how many ways there are to do this.

We either sample with replacement (can we choose the same element twice?) or without replacement. And we either care about the order of the elements or don’t.

Order MattersOrder Doesn’t Matter
With Replacement$$n^k$$$${n+k-1}\choose{k}$$
Without Replacement$$n(n-1)(n-2)\cdots(n-k+1)$$$${n}\choose{k}$$