powerpoint presentationarielpro/15251/lectures/lecture05.pdfpascal’s triangle 17 1 1 1 1 2 1 1 3 3...
TRANSCRIPT
CMU 15-251
Counting II
Teachers:
Victor Adamchik
Ariel Procaccia (this time)
Shortest paths
2
•
1. 3003
2. 4052
3. 5027
4. 6348
Bit representation
•
•
o
o
o
o
3
Bit representation
• 525= 2,598,960
•
⌈log(2,598,960)⌉ = 22
4
0000000000000000000000
0000000000000000000001
0000000000000000000010
0000000000000000000011
Bit representation
• 221 < 525
5
⌈log 𝑛⌉
Polynomials as choice trees
•
1 + 𝑥 3
•
1 + 3𝑥 +3𝑥2 + 𝑥3
6
𝑥3 𝑥2 𝑥2 𝑥 𝑥2 𝑥 𝑥 1
1 𝑥
1 𝑥 1 𝑥
1 𝑥 1 𝑥 1 𝑥 1 𝑥
The binomial formula
• 1 + 𝑥 𝑛 = 𝑐𝑜 + 𝑐1𝑥 +⋯+ 𝑐𝑛𝑥𝑛
• 𝑐𝑘𝑘 𝑥 𝑐𝑘 =
𝑛𝑘
7
1 + 𝑥 𝑛 = 𝑛
𝑘𝑥𝑘
𝑛
𝑘=0
The binomial formula
8
1 + 𝑥 0 = 1
1 + 𝑥 1 = 1 + 1𝑥
1 + 𝑥 2 = 1 + 2𝑥 + 1𝑥2
1 + 𝑥 3 = 1 + 3𝑥 + 3𝑥2 + 1𝑥3
The binomial formula
• 𝑥 = 1:
2𝑛 = 𝑛
𝑘
𝑛
𝑘=0
•
𝑛 2𝑛
9
1 + 𝑥 𝑛 = 𝑛
𝑘𝑥𝑘
𝑛
𝑘=0
The binomial formula
• 𝑥 = −1:
0 = 𝑛
𝑘
𝑛
𝑘=0
−1 𝑘 ⇒ 𝑛
𝑘=
𝑛
𝑘𝑘 𝑘
•
10
1 + 𝑥 𝑛 = 𝑛
𝑘𝑥𝑘
𝑛
𝑘=0
A combinatorial proof
• 𝑂𝑛 𝐸𝑛𝑛
•
𝑂𝑛 = |𝐸𝑛|
•
•
11
A combinatorial proof
•
𝑓𝑛: 𝐸𝑛 → 𝑂𝑛 𝑛 ≥ 3?
12
Pascal’s triangle
13
Pascal’s triangle
14
0
0
1
0
1
1
2
0
2
1
2
2
3
0
3
1
3
2
3
3
Pascal’s triangle
15
Pascal’s triangle
16
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 6 1 15 15 20
𝑛𝑘
0
1
2
3
4
5
6
0
1
2
3
4
5
6
Pascal’s triangle
17
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 6 1 15 15 20
𝑛𝑘= 𝑛−1𝑘−1+ 𝑛−1𝑘
𝑛 = 4, 𝑘 = 2
0
1
2
3
4
5
6
0
1
2
3
4
5
6
Pascal’s triangle
18
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 6 1 15 15 20
0
1
2
3
4
5
6
0
1
2
3
4
5
6
𝑛𝑘= 2𝑛−1𝑘 𝑜𝑑𝑑 𝑛 = 4
Pascal’s triangle
19
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 6 1 15 15 20
𝑛𝑘
2𝑛𝑘=0 = 2𝑛
𝑛𝑛 = 3
𝑛, 𝑘
0
1
2
3
4
5
6
0
1
2
3
4
5
6
Pascal’s triangle
• 𝑖𝑘
𝑛𝑖=𝑘 =?
1.𝑛+1𝑘
2.𝑛𝑘+1
3.𝑛+1𝑘+1
4.2𝑛𝑘
20
1
1 1
1 2 1
1 3 3 3
1 4 6 4 1
1 5 10 10 5 1
1 6 6 1 15 15 20
0
1
2
3
4
5
6
0
1
2
3
4
5
6
𝑘 = 2, 𝑛 = 5
proofs from the book
•
•
•
•
21
What we have learned
•
o
o
•
o
o
22