Lecture 9 - Notes

February 1, 2016

Probability

How many people does it take before the probability that two have the same birthday is more than 50%?

Let's assume that all birthdays are equally likely, what's the probability that $n$ people have different birthdays?

So,

we could also think of this as,

let's rewrite this where $D$ is the days,

we're asking when,

Now, when $x$ is small $1 - x \approx e^x$, so if $n$ is small compared with $D$ then,

so the probability is $\frac{1}{2}$ when,

Harmonic Numbers

definition: The harmonic numbers are a series denoted,

The harmonic numbers arise in analyzing many algorithms.

Example

Consider $f(x) = \frac{1}{x}$,

Plot of 1/x

Mean Time to Failure

When do you get the first heads when flipping coins?

We can draw the outcomes,

Probability Tree

Let $p$ be the probability of a failure (a heads) and $p_k$ be the probability of a failure on the $k$-th try. We can write $p_k$ as

which we can see,

so all our probabilities sum to one (which is good).

Uniform Hashing

You're a coupon collector and you're trying to collect $n$ coupons. How many do I need to collect before I can expect to have them all?

Let $X$ be the number of trials.