Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method...

13
The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Transcript of Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method...

Page 1: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

The Probabilistic Method

Joshua BrodyCS49/Math59

Fall 2015

Week 2: Independence, Random Variables, Asymptopia

Page 2: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Clicker Question

(A) f(n) = O(g(n))

(B) f(n) = Ω(g(n))

(C) f(n) = Ɵ(g(n))

(D) A and B

(E) B and C

Suppose that f(n) = n2/10 and g(n) = 100n.Which of the following hold?

Page 3: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Clicker Question

(A) f(n) = O(g(n))

(B) f(n) = Ω(g(n))

(C) f(n) = Ɵ(g(n))

(D) A and B

(E) B and C

Suppose that f(n) = n2/10 and g(n) = 100n.Which of the following hold?

Page 4: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Clicker Question

(A) f, h, g

(B) f, g, h

(C) g, f, h

(D) g, h, f

(E) h, g, f

Let f(n) = n2/10, g(n) = 100n, and h(n) = n/log(n).Order f,g,h in increasing rates of growth.

Page 5: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Clicker Question

(A) f, h, g

(B) f, g, h

(C) g, f, h

(D) g, h, f

(E) h, g, f

Let f(n) = n2/10, g(n) = 100n, and h(n) = n/log(n).Order f,g,h in increasing rates of growth.

Page 6: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Asymptotic Notation

• f(n) = O(g(n)) if there exists constants c,n0>0 such that for all n≥n0,

f(n) ≤ cg(n)

• f(n) = Ω(g(n)) if there exists constants c,n0>0 such that for all n≥n0,

f(n) ≥ cg(n)

• f(n) = Ɵ(g(n)) if there are constants c1,c2,n0>0 such that for all n≥n0,

c1g(n) ≤ f(n) ≤ c2g(n)

Page 7: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Asymptotic Notation

Page 8: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Asymptotic Notation

• f(n) = O(g(n)) if there exists constants c,n0>0 such that for all n≥n0,

f(n) ≤ cg(n)

• f(n) = Ω(g(n)) if there exists constants c,n0>0 such that for all n≥n0,

f(n) ≥ cg(n)

• f(n) = Ɵ(g(n)) if there are constants c1,c2,n0>0 such that for all n≥n0,

c1g(n) ≤ f(n) ≤ c2g(n)

Page 9: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Clicker Question

(A) (c,n0) = (10, -1)

(B) (c,n0) = (1, 10)

(C) (c,n0) = (4, 4)

(D) (c,n0) = (60, 3)

(E) (c,n0) = (100, 1)

Let f(n) = 15n+3, and g(n) = n2/10.Which values for (c,n0) would be valid choices for showing f = O(g)?

Page 10: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Clicker Question

(A) (c,n0) = (10, -1)

(B) (c,n0) = (1, 10)

(C) (c,n0) = (4, 4)

(D) (c,n0) = (60, 3)

(E) (c,n0) = (100, 1)

Let f(n) = 15n+3, and g(n) = n2/10.Which values for (c,n0) would be valid choices for showing f = O(g)?

Page 11: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Asymptotic Notation

Page 12: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

Alternate Facts/Definitions

(1) f(n) = Ɵ(g(n)) iff f(n) = O(g(n)) and f(n) = Ω(g(n))

(2) f(n) = o(g(n)) iff f(n) = O(g(n)) but not f(n) = Ω(g(n))

(3) f(n) = w(g(n)) iff f(n) = Ω(g(n)) but not f(n) = O(g(n))

Facts:

(1) f(n) = Ɵ(g(n)) iff limn→∞ f(n)/g(n) = c for some c>0

(2) f(n) = o(g(n)) iff limn→∞ f(n)/g(n) = 0

(3) f(n) = w(g(n)) iff limn→∞ f(n)/g(n) = ∞

(4) f ~ g iff limn→∞ f(n)/g(n) = 1

Limit-based definitions: if limn→∞ f(n)/g(n) exists:

Page 13: Week 2: Independence, Random Variables, Asymptopiabrody/cs49/f15/... · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 2: Independence, Random Variables, Asymptopia

The Probabilistic Method