Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

30
Probability

Transcript of Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Page 1: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Probability

Page 2: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Pierre de Fermat (1601 - 1665)

Blaise Pascal (1623 - 1662)

Page 3: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Much of the original discussion was framed in terms of gambling, especially cards and dice.

Page 4: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Experiment

• Take a coin.

• Flip it five times.

• Record the outcomes (e.g., HHTTH)

Page 5: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Outcomes

The possible outcomes are

5H4H 1T3H 2T2H 3T1H 4T5T

But they do not seem to be equally likely.

Page 6: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Another way to list the possible outcomes:

HHHHH HHHTT THHHT HTTHT TTHTH TTTTHHHHHT HHTHT THHTH HTTTH TTTHH TTTTTHHHTH HHTTH THTHH THHTT HTTTTHHTHH HTHHT TTHHH THTHT THTTTHTHHH HTHTH HHTTT THTTH TTHTTTHHHH HTTHH HTHTT TTHHT TTTHT

Another way to list the possible outcomes:

5H 14H 1T 53H 2T 102H 3T 101H 4T 55T 1

If each of the outcomes at the top of the page is equally likely, we see why the extreme outcomes at left are much less likely than the more “balanced” ones.

Page 7: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

The basic idea is not too complicated, but we need a way to systematize it.

Clearly it has something to do with the different orders in which the events can happen.

So suppose we have 3 objects, 1, 2, 3. How many different orders are there for these three?

123132213231312321

6 ways

Page 8: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Now suppose we have n objects, 1, 2, 3, …, n. How many different orders are there for them?

First, let’s pick which will be the first object. There are n ways to do this.

Then, let’s pick which will be the second object. There are n-1 ways to do this (since the first object is already chosen).

Altogether, there are n(n-1) ways to choose the first two objects.

Then, there are n-2 ways to choose the third object, n-3 ways to choose the fourth object, n-4 ways to choose the fifth object,

1 way to choose the nth object.

: :

Page 9: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Altogether, there are n(n-1)(n-2) … 3 . 2 . 1 ways to choose the n objects.

n-2 ways to choose the third object, n-3 ways to choose the fourth object,

n-4 ways to choose the fifth object,

1 way to choose the nth object.

: :

n-1 ways to choose the second object, There are n ways to choose the first object,

Page 10: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

This number,

n(n-1)(n-2) … 3 . 2 . 1 ,

is so important that it has a special name. It is called

“n factorial”

and it is abbreviated n!

So, for example, 3! = 3.2.1 = 6 4! = 4.3.2.1 = 24 5! = 5.4.3.2.1 = 120

Page 11: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

10! = 3,628,800

20! = 2,432,902,008,176,640,000

30! = 265,252,859,812,191,058,636,308,480,000,000

100! = 93,326,215,443,944,152,681,699,238,856,266,700,490,715, 968,264,381,621,468,592,963,895,217,599,993,229,915,608,941, 463,976,156,518,286,253,697,920,827,223,758,251,185,210,916, 864,000,000,000,000,000,000,000,000~ 9.332621544 x 10157

number of ways for 20 people to shuffle chairs.

Page 12: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

n! is the number of ways of arranging n objects, so it is often called the number of “rearrangements” of n objects,or the number of “permutations” of n objects.

For reasons which are not clear yet, but which will be clearer soon, we simply define

0! = 1

Page 13: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Note that 4! = 4.3.2.1 = 4.(3.2.1)= 4 . 3!

Similarly, n! = n(n-1)(n-2) . … . 4.3.2.1

= n . (n-1)!

= n((n-1)(n-2) . … . 4.3.2.1)

Page 14: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Suppose we have n objects and want to pick k of them, for some k ≤ n.

How many ways are there of doing this?

In other words, how many different subsets are there containing exactly k elements?

Page 15: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

There are n choices for the first element of the set.

Then there are n-1 choices for the second element of the set.

Then there are n-2 choices for the third element of the set.

: :

How many choices are there for the kth element of the set?

n-k+1

Then there are n-3 choices for the fourth element of the set.

So the number of ways of choosing all k elements of the set is n(n-1)(n-2)(n-3) . … . (n-k+2).(n-k+1)

Page 16: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

The number of ways of choosing all k elements of the set is n(n-1)(n-2)(n-3) . … . (n-k+2).(n-k+1)But we have overcounted.

After all, we have counted each possible set of k elements in every possible order.

And the number of different orders in which k elements can be written is k!

So the number of subsets containing exactly k elements is

n(n-1)(n-2)(n-3) . … . (n-k+2).(n-k+1) k!

Page 17: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

The number of subsets containing exactly k elements is

n(n-1)(n-2)(n-3) . … . (n-k+2).(n-k+1) k!

n(n-1)(n-2)(n-3) . … . (n-k+2).(n-k+1) k!

(n-k).(n-k-1) .(n-k-2) . … . 3.2.1 (n-k).(n-k-1) .(n-k-2) . … . 3.2.1

( ) It is pronounced: “n choose k”.

Page 18: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

( )

( )

Page 19: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

( )

is exactly what we should expect, since there are n ways of choosing a single object out of n objects.

Page 20: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

( )

This too is exactly what we should expect, since there is only 1 way of choosing all n objects out of n objects.

It also demonstrates that letting 0! = 1 was not so crazy after all….

Page 21: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

( ) Noting that the two numbers in the denominator add up to n, we see that this also equals

( )

( ) ( )

Page 22: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

( )

( )

( )

( )

20

10

26

15

Page 23: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Coincident Birthdays

Page 24: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

There are 365 possible birthdays (ignoring for the moment the complications presented by February 29).

If you consider a roomful of people, what is the chance that two or more of them have the same birthday?

On the face of it, it seems unlikely, unless the number of people is fairly large compared to 365.

Page 25: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

We might try to work out the probability.

But unfortunately, the situation is complicated.

There are many ways birthdays can coincide. Counting them is a nightmare.

Page 26: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Doing it backwards…

Strangely, it is far better to figure out how likely it is not to happen.

This amounts to asking how likely it is that everybody has different birthdays.

How do we work this out?

Page 27: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

The first person to be born can be born on any of the 365 days without risking a conflict.

But the second person born must avoid the first one’s birthday if the birthdays are to be all distinct. The second person has a chance of 364/365 of having a birthday different from that of the first person.

Then the third person has a chance of 363/365 of having a birthday different from those of the first two people.

And so on….

Page 28: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

Suppose there are n people (with n < 365).

The probability that they will have n distinct birthdays is

365 . 364 . 363 . 362 . … . (366-n)365 . 365 . 365 . 365 . … . 365

This can be written as

365 . 364 . 363 . 362 . … . (366-n) . (365-n) . (364-n) . … . 3 . 2 . 1

365 . 365 . 365 . 365 . … . 365 . (365-n) . (364-n) . … . 3 . 2 . 1

365!365n . (365-n)!=

Page 29: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

The probability that n people have distinct birthdays is

365!365n . (365-n)!

The probability that n people do not have distinct birthdays is

365!365n . (365-n)!

1 -

Page 30: Probability. Pierre de Fermat (1601 - 1665) Blaise Pascal (1623 - 1662)

When n = 23, this probability is slightly over 50%.

When n = 40, this probability is nearly 90%.

When n = 50, this probability is over 97%.

In a room of 23 people, the odds are better than even that two of them will have the same birthday.