CS1802 Discrete Structures Recitation Fall 2018 September 25-26, 2018 CS1802 Week 3: Counting Next Week : QUIZ 1 (30 min) Permutations and Combinations i. Evaluate the following expressions. 1. P(10, 4) ( ) 12 2. 4 ( ) 1000 3. 998 ii. You own 10 pictures. 1. In how many ways can you select and display 4 pictures side by side on a wall? 2. In how many ways can you select 4 pictures to give to your friend Alice on her birthday? 1
iii. In a certain country, license plates are strings consisting of six different characters to be selected from the vowels A, E, I, O, U and the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. For example, 3 7 E 4 A 9 is a valid license plate. 1. How many license plates are possible? 2. How many license plates would have been possible if repetitions had been allowed? 3. How many license plates are possible that have exactly one vowel? 4. How many license plates are possible that have exactly two vowels? 5. How many license plates with exactly two vowels would have been possible if repetitions had been allowed? iv. There are 10 different books on a shelf. Four of them are red and the other six are black. How many different arrangements of these books are possible if 1. all red books must be together? 2. no two red books may be next to each other? 2
Balls in Bins How many of the integers from 1 to 99,999 have the digit sum 10? For example, 34,201 is such an integer, but 34,202 is not. Binomial Theorem i. What is the coefficient of the term with x 4 in the expansion of (x + y) 7? ii. What is the coefficient of the term with x 4 in the expansion of (x + 2y) 7? iii. What is the coefficient of the term with x 4 in the expansion of (x y) 7? 3
Why is Jimmy s solution wrong? Count all passwords of exactly 8 capital letters that have a letter occurring at least 5 times. Examples: SAATARAA, TUUURUUE, ABABABBB. Jimmy s solution: - choose a letter to repeat 26 choices - choose 5 places to put it ( 8 5) choices - fill the other 3 spaces with any 3 letters 26 3 choices Product rule gives 26* ( 8 5) * 26 3. Why is this incorrect? How can one count correctly? 4
Optional, more difficult. Take these home (not to be submitted) i. If we expand the trinomial (x + y + z) 10, what is the coefficient of term x 3 y 2 z 5? ii. (difficulty ) A derangement of 1 2 3... n is a permutation that leaves none of these numbers in place. By inspection, the derangements of 123 are 312 and 231. Find the number of derangements of 1 2 3 4 5 using Inclusion-Exclusion 5
iii. (difficulty ) Prove that A + B + A B C A B + A C + B C iv. (difficulty ) In a class of 20 students, each student has at least 14 friends (friends are reciprocal). Show that there are 4 students that form a clique, that is all 4 are pairwise friends. v. (difficulty ) Why is Jimmy s solution wrong? 10 men who are pairs of brothers (a 1 b 1, a 2 b 2, a 3 b 3, a 4 b 4, a 5 b 5 ) are to blind-date 10 women who are pairs of sisters (x 1 y 1, x 2 y 2, x 3 y 3, x 4 y 4, x 5 y 5 ) such that any two brothers do not date two corresponding sisters, that is for example if (a 2, x 4 ) is a date then b 2 cannot date y 4. In how many ways can the dates be arranged? Jimmy s solution: There are 10! ways to arrange the dates without restrictions. There are 5! 2 5 ways to arrange dates that violates the restriction since it comes down to permuting the pairs and then choosing for each pair which brother dates which sister (2 possibilites per 6
pair). So the answer is 10! 5! 2 5. Why is this wrong? vi. (difficulty ) Virgil has a solution, also wrong: We need the number of derangements = permutations without fix point for n=5. Examples: 21453, 41253. Not a derangement : 52134 because 2 is in original position. For n=5 there are D 5 = 44 derangements which can be counted by brute force or by Inclusion-Exclusion (next exercise). Then the answer is 5! (choose a permutation of the 5 men a 1..a 5 ) * 2 5 (choose which sister to date) * D 5 (choose a derangement for brothers b 1..b 5 ). Why is Virgil s solution wrong? 7
vii. (difficulty ) What is the correct count for this brothers-sisters blind-date question? viii. (difficulty ) Consider an equilateral triangle of side length n, which is divided into unit triangles, as shown. A valid path runs from the triangle in the top row to the middle triangle in the bottom row, such that adjacent triangles in our path share a common edge and the path never travels up (from a lower row to a higher row) or revisits a triangle. An example of one such path is illustrated below for n = 5. Compute the number of paths. Hint: Construct a one-to-one mapping between valid paths and ordered lists of positive integers (a 1, a 2,..., a n ) with a i i. Then count the ordered lists. 8