29
Lecture 1: Probability & Counting Ziyu Shao School of Information Science and Technology ShanghaiTech University September 19, 2016 Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 1 / 57 Outline 1 Naive Definition of Probability 2 Counting 3 Definition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 2 / 57

Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Lecture 1: Probability & Counting

Ziyu Shao

School of Information Science and TechnologyShanghaiTech University

September 19, 2016

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 1 / 57

Outline

1 Naive Definition of Probability

2 Counting

3 Definition of Probability

4 Advanced Part

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 2 / 57

Page 2: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Outline

1 Naive Definition of Probability

2 Counting

3 Definition of Probability

4 Advanced Part

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 3 / 57

Set

A set is a collection of objects. Given two sets A,B, key concepts include

empty set: ∅A is a subset of B: A ⊆ B

union of A and B: A ∪ B

intersection of A and B: A ∩ B

complement of A: Ac

De Morgan’s laws:

(A ∪ B)c = Ac ∩ Bc

(A ∩ B)c = Ac ∪ Bc

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 4 / 57

Page 3: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Venn Diagram

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 5 / 57

Sample Space & Event

The sample space S of an experiment: the set of all possibleoutcomes of the experiment.

An event A is a subset of the sample space S .

A occurred if the actual outcome is in A.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 6 / 57

Page 4: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Example: Coin flips

A coin is flipped 10 times. Writing Heads as 1 and Tails as 0. Then

An outcome is a sequence (s1, s2, . . . , s10) with sj ∈ {0, 1}.The sample space: the set of all such sequences.

Aj : the event that the jth flip is Head.

B: the event that at least one flip was Head. (B = ∪10j=1Aj)

C : the event that all the flips were Heads. (C = ∩10j=1Aj)

D: the event that there were at least two consecutive Heads.(D = ∪9j=1(Aj ∩ Aj+1))

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 7 / 57

Translation Between English & Sets

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 8 / 57

Page 5: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Naive Definition of Probability

Assumption 1: finite sample space

Assumption 2: all outcomes occur equally likely

Definition

Let A be an event for an experiment with a finite sample space S. Thenaive probability of A is

Pnaive(A) =|A||S |

=number of outcomes favorable to A

total number of outcomes in S.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 9 / 57

Outline

1 Naive Definition of Probability

2 Counting

3 Definition of Probability

4 Advanced Part

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 10 / 57

Page 6: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Multiplication Rule

You buy an ice cream cone with several choices:

cone: cake or waffle

flavor: chocolate, vanilla, or strawberry

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 11 / 57

Multiplication Rule in General

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 12 / 57

Page 7: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Sampling With Replacement

Theorem

Consider n objects and making k choices from them, one at a time withreplacement (i.e., choosing a certain object does not preclude it frombeing chosen again). Then there are nk possible outcomes.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 13 / 57

Sampling Without Replacement

Theorem

Consider n objects and making k choices from them, one at a timewithout replacement (i.e., choosing a certain object preclude it from beingchosen again). Then there are n(n − 1) · · · (n − k + 1) possible outcomesfor k ≤ n (and 0 possibilities for k > n).

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 14 / 57

Page 8: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Example: Birthday Problem

There are k people in a room. Assume each person’s birthday is equallylikely to be any of the 365 days of the year (we exclude February 29), andthat people’s birthdays are independent (we assume there are no twins inthe room). What is the probability that two or more people in the grouphave the same birthday?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 15 / 57

Solution of Birthday Problem

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 16 / 57

Page 9: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Solution of Birthday Problem

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 17 / 57

Extension of Birthday Problem

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 18 / 57

Page 10: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Adjusting for Overcounting

It is not easy to directly count each possibility once and only once.

If we are able to count each possibility exactly c times for some c ,then we can adjust by dividing by c .

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 19 / 57

Example: Committees and Teams

Consider a group of four people.

(a) How many ways are there to choose a two-person committee?

(b) How many ways are there to break the people into two teams oftwo?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 20 / 57

Page 11: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Binomial Coefficient

Definition

For any nonnegative integers k and n, the binomial coefficient(nk

), read as

“n choose k”, is the number of subsets of size k for a set of size n.

Theorem

For k ≤ n, we have(n

k

)=

n(n − 1) · · · (n − k + 1)

k!=

n!

k!(n − k)!

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 21 / 57

Example: Permutations of A Word

How many ways are there to permute the letters in the word STATISTICS?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 22 / 57

Page 12: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Example: Bose-Einstein

How many ways are there to choose k times from a set of n objects withreplacement, if order doesn’t matter (we only care about how many timeseach object was chosen, not the order in which they were chosen)?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 23 / 57

Example: Bose-Einstein

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 24 / 57

Page 13: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Summary of Counting

Choose k objects out of n objects, the number of possible ways:

Order Matters Order Not Matter

with replacement nk(n+k−1

k

)without replacement n(n − 1) · · · (n − k + 1)

(nk

)

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 25 / 57

Story Proof: The Team Captain

For any positive integers n and k with k ≤ n,

n

(n − 1

k − 1

)= k

(n

k

)

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 26 / 57

Page 14: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Story Proof: Vandermonde’s Identity

A famous relationship between binomial coefficients, called Vandermonde’sidentity, says that (

m + n

k

)=

k∑j=0

(m

j

)(n

k − j

)

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 27 / 57

Hash Table

A commonly used data structure for fast information retrieval

Example: store people’s name. For each people x , a hash function his computed.

h(x): the location that will be used to store x ′ name.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 28 / 57

Page 15: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Hash Collision

Collision: x 6= y , but h(x) = h(y) (≥ 1 locations has ≥ 2 namesstored there)

Given k people (different names) and n locations, what is theprobability of occurrence of hash collision?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 29 / 57

Revisit The Birthday Problem

In the Generalized Birthday Problem, each of k people has a randomnumber (“birthday”) drawn from n values (“days”).

If the probability that at least two people have the same number is50%, then k ≈ 1.18

√n.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 30 / 57

Page 16: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Cryptographic Hash Function

A map which “scrambles” long strings into m-bit “hashes”.

A good cryptographic Hash Function f has two properties:I Given the hash f (M) of a message string M, it’s computationally

infeasible to recover M.I It’s computationally infeasible to find a “collision”, meaning a pair of

distinct messages M1 6= M2 such that f (M1) = f (M2).

Example 1: MD (Message-Digest Algorithm) 5 (bittorrent) withm = 128.

Example 2: SHA(Secure Hash Algorithm)-1 (SSL,PGP) withm = 160.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 31 / 57

The Birthday Attack

Suppose we try to “break” a hash function by finding a collision(forged digital signature).

One method: take a huge number of messages M, hash them all, andhope to find two with the same hash value.

Now how many messages would you have to try before there was atleast a 50% chance of finding two with the same hash?

n = 2m and k ≈√n = 2m/2. For SHA-1, k ≈ 280.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 32 / 57

Page 17: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

The Birthday Attack

The birthday attack: trying to find collisions by testing many randommessages.

A cryptographic hash function is broken: when there is a way offinding collisions much faster than the Birthday Attack method.

SHA-1 is now broken: Xiaoyun Wang find a SHA-1 collision with 269

tests in 2005, then 263 tests later (compared to 280 tests by thebirthday attack).

Now SHA-2 (m=256) and SHA-3 (m=512) are on the way.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 33 / 57

Revisit of Bose-Einstein Counting

Theorem

There are(n−1r−1)distinct positive integer-valued vectors (x1, x2, . . . , xr )

satisfying the equation

x1 + x2 + · · ·+ xr = n, xi > 0, i = 1, 2, . . . , r .

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 34 / 57

Page 18: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Revisit of Bose-Einstein Counting

Theorem

There are(n+r−1

r−1)distinct nonnegative integer-valued vectors

(x1, x2, . . . , xr ) satisfying the equation

x1 + x2 + · · ·+ xr = n, xi ≥ 0, i = 1, 2, . . . , r .

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 35 / 57

Example: Multinomial Expansion

How many terms are there in the multinomial expansion of(x1 + x2 + . . . + xr )n?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 36 / 57

Page 19: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Example: Antennas

Consider a set of n antennas of which m are defective and n −m arefunctional and assume that all of the defectives and all of the functionalsare considered indistinguishable. How many linear orderings are there inwhich no two defectives are consecutive?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 37 / 57

Example: Norepeatword

A norepeatword is a sequence of at least one (and possibly all) of the usual26 letters a, b, c , . . . , z , with repetitions not allowed. For example,“course” is a norepeatword, but “statistics” is not. Order matters, e.g.,“course” is not the same as “source”. A norepeatword is chosen randomly,with all norepeatwords equally likely. Show that the probability that it usesall 26 letters is very close to 1/e.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 38 / 57

Page 20: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Outline

1 Naive Definition of Probability

2 Counting

3 Definition of Probability

4 Advanced Part

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 39 / 57

General Definition of Probability

Definition

A probability space consists of a sample space S and a probability functionP which takes an event A ⊆ S as input and returns P(A), a real numberbetween 0 and 1, as output. The function P must satisfy the followingaxioms:

1 P(∅) = 0, P(S) = 1.

2 If A1,A2, . . . are disjoint events, then

P(∪∞j=1Aj) =∞∑j=1

P(Aj)

(Saying that these events are disjoint means that they are mutuallyexclusive: Ai ∩ Aj = ∅ for i 6= j .

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 40 / 57

Page 21: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Interpretation of Probability

Complementary views:

The frequentist view : probability represents a long-run frequency overa large number of repetitions of an experiment.

I if we say a coin has probability 1/2 of Heads, that means the coinwould land Heads 50% of the time if we tossed it over and over andover.

The Bayesian view : probability represents a degree of belief about theevent in question.

I So we can assign probabilities to hypotheses like “candidate A will winthe election” or “the defendant is guilty” even if it isn’t possible torepeat the same election or the same crime over and over again.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 41 / 57

Properties of Probability

Probability has the following properties, for any events A and B:

1 P(Ac) = 1− P(A).

2 If A ⊆ B, then P(A) ≤ P(B).

3 P(A ∪ B) = P(A) + P(B)− P(A ∩ B).

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 42 / 57

Page 22: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Example: Bonferroni’s Inequality

Theorem

For any n events A1, . . . ,An, we have

P(A1 ∩ A2 ∩ · · · ∩ An) ≥ P(A1) + P(A2) + · · ·+ P(An)− (n − 1).

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 43 / 57

Inclusion-Exclusion Formula

For any events A1, . . . ,An:

P(∪ni=1Ai ) =∑i

P(Ai )−∑i<j

P(Ai ∩ Aj) +∑

i<j<k

P(Ai ∩ Aj ∩ Ak)

+ . . . + (−1)n+1P(A1 ∩ · · · ∩ An).

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 44 / 57

Page 23: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Example: De Montmort’s Matching Problem

Consider a well-shuffled deck of n cards, labeled 1 through n. You flip overthe cards one by one, saying the numbers 1 through n as you do so. Youwin the game if, at some point, the number you say aloud is the same asthe number on the card being flipped over (for example, if the 7th card inthe deck has the label 7). What is the probability of winning?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 45 / 57

Solution to De Montmort’s Matching Problem

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 46 / 57

Page 24: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Example: Another Matching Problem

Suppose that each of n men at a party throws his hat into the center of theroom. The hats are first mixed up, and then each man randomly selects ahat. What is the probability that none of the men selects his own hat?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 47 / 57

Example: Card Address

Alvin’s database of friends contains n entries, but due to a software bug,the addresses correspond to the names in a totally random fashion. Alvinwrites a holiday card to each of his friends and sends it to the(software-corrupted) address. What is the probability that at least one ofhis friends will get the correct card?

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 48 / 57

Page 25: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Summary 1: Events & Numbers

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 49 / 57

Summary 2: Probability Space

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 50 / 57

Page 26: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Summary 3: The Role of Probability Theory

A framework for analyzing phenomena with uncertain outcomes:

Rules for consistent reasoning

Used for predictions and decisions

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 51 / 57

Outline

1 Naive Definition of Probability

2 Counting

3 Definition of Probability

4 Advanced Part

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 52 / 57

Page 27: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Monotonic Sequence of Events

A sequence of events An is increasing: An ⊆ An+1.

limn→∞

An = ∪∞i=1An

A sequence of events An is decreasing: An ⊇ An+1.

limn→∞

An = ∩∞i=1An

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 53 / 57

Limiting Events

If An, n ≥ 1 is either an increasing or decreasing sequence of events:

limn→∞

P(An) = P( limn→∞

An).

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 54 / 57

Page 28: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

The Borel-Cantelli Lemma

If An, n ≥ 1 is a sequence of events and

∞∑n=1

P(An) <∞,

then

P(an infinite number of the An occurs) = 0.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 55 / 57

Example

Let X1,X2, . . . be such that

P(Xn = 0) =1

n2= 1− P(Xn = 1),

then limn→∞ Xn = 1 with probability 1.

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 56 / 57

Page 29: Lecture 1: Probability & Counting€¦ · Outline 1 Naive De nition of Probability 2 Counting 3 De nition of Probability 4 Advanced Part Ziyu Shao (ShanghaiTech) Lecture 1: Probability

Reading Assignment

Next lecture we will review conditional probability. Please readcorresponding chapters in required textbooks:

Chapter 2 of BH

Chapter 1 of BT

Ziyu Shao (ShanghaiTech) Lecture 1: Probability & Counting September 19, 2016 57 / 57