CS 211 Autumn 2006 Homework 2 Solutions Matousek 2.1.2 Induction: - - PDF document

cs 211 autumn 2006 homework 2 solutions matousek
SMART_READER_LITE
LIVE PREVIEW

CS 211 Autumn 2006 Homework 2 Solutions Matousek 2.1.2 Induction: - - PDF document

CS 211 Autumn 2006 Homework 2 Solutions Matousek 2.1.2 Induction: By induction on n: Assume number of ordered pairs (A, B) where {1,2,3,,n-1} are 3 n-1 Then, by adding a new element n, each ordered pair (A,B), {1,2,3,,n- 1} can


slide-1
SLIDE 1
slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5

CS 211 Autumn 2006 Homework 2 Solutions Matousek

2.1.2 Induction: By induction on n: Assume number of ordered pairs (A, B) where {1,2,3,…,n-1} are 3n-1 Then, by adding a new element ‘n’, each ordered pair (A,B), {1,2,3,…,n- 1} can give rise to three new sets: 1) (A,B) as before 2) (A,B U {n}) 3) (A U {n}, B U {n}) Therefore, the number of sets are 3n-1 .3 = 3n Algebra: Fix a subset B first and the number of ways to fix B is 2n = ∑ni=0 (ni) Now for a fixed B, find the number of subsets A. If |B| = k, then there are 2k

  • subsets. Therefore, the total number of ordered pairs:

= ∑ni=0 (ni). 2k = 3k 2.1.4 Numbers: 1010 -1 Numbers with no 9: 9x9x9…x9 = 910 Number with 9: (1010 -1) - 910 + 1 = 1010 - 910 As 1010 - 910 > 910 Hence there are more numbers having 9 in the decimal notation as compared to those with no 9.

slide-6
SLIDE 6

2.2.5 a) Prove: f(n, k) = f(n, n+1-k) Take any permutation with k increasing segments. We show that its reverse permutation has exactly (n-k+1) increasing segments. This proves what we want, since there is a bijection between a permutation and its inverse. Thus if there are x permutations with increasing segments k, then the x corresponding reverse permutations have increasing segments (n-k+1). So take a permutation p with k increasing segments. n 1 n 2 n 3 n 4 n 5 k increasing segments WITHIN each segment, if you look at the reverse permutation, a segment of length ni breaks up into i segments, eg. Original p: 2 9 20 50 51 one segment Reverse of p: 51 50 20 9 2 five different segments So when p is 4 5 7 2 6 8 3 1 [n = 8, k=4] The reverse is : 1 3 8 6 2 7 5 4 [n-k+1 = 5] However, in the reverse permutation, the numbers at the end of neighboring segments of the original permutation get put into the same segment, eg. 2 and 7,

  • riginally in different segments, end up in the same segment [shown]. The same

happens to 3 and 8. Therefore, the increasing segments of the reverse permutation become n-k+1 as follows:

k k

∑ (ni - 1) + 1 = ∑ ni – k +1 = n – k + 1

i=1 i=1

slide-7
SLIDE 7
slide-8
SLIDE 8

Therefore f(n,k) = k . f(n-1, k) + (n + 1 - k) . f(n-1, k-1)

slide-9
SLIDE 9

2.7.2 General Bonferroni inequality: It follows the counting proof of the inclusion-exclusion principle (p.89). Fix an element, say a. Let’s count how many times a is counted. Let the sets that contain a be A1, A2… Aj. Then, in the inclusion-exclusion formula, a is added exactly times. We prove that if you add up till an even index, you undercount, and if you add up till an odd index, you overcount. This then proves the Bonferroni inequalities. So take Using Pascal’s identity, See a pattern? So if you add up until an even index l, you get and if you add up till an odd index,

slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20