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 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 3 n-1 .3 = 3 n Algebra: Fix a subset B first and the number of ways to fix B is 2 n = ∑ ni=0 ( ni ) Now for a fixed B, find the number of subsets A. If |B| = k, then there are 2 k subsets. Therefore, the total number of ordered pairs: = ∑ ni=0 ( ni ). 2 k = 3 k 2.1.4 Numbers: 10 10 -1 Numbers with no 9: 9x9x9…x9 = 9 10 Number with 9: (10 10 -1) - 9 10 + 1 = 10 10 - 9 10 As 10 10 - 9 10 > 9 10 Hence there are more numbers having 9 in the decimal notation as compared to those with no 9.
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 n i 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, originally 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 ∑ (n i - 1) + 1 = ∑ n i – k +1 = n – k + 1 i=1 i=1
Therefore f(n,k) = k . f(n-1, k) + (n + 1 - k) . f(n-1, k-1)
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 A 1 , A 2 … A j . 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,
Recommend
More recommend