MAT3707. Tutorial letter 202/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/202/1/2017

Similar documents
Mat 344F challenge set #2 Solutions

CONTENTS CONTENTS PAGES 11.0 CONCEPT MAP A. PERMUTATIONS a EXERCISE A B. COMBINATIONS a EXERCISE B PAST YEAR SPM

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

LEVEL I. 3. In how many ways 4 identical white balls and 6 identical black balls be arranged in a row so that no two white balls are together?

CSCI 2200 Foundations of Computer Science (FoCS) Solutions for Homework 7

Exercises Exercises. 1. List all the permutations of {a, b, c}. 2. How many different permutations are there of the set {a, b, c, d, e, f, g}?

Created by T. Madas COMBINATORICS. Created by T. Madas

MA 524 Midterm Solutions October 16, 2018

MAT104: Fundamentals of Mathematics II Summary of Counting Techniques and Probability. Preliminary Concepts, Formulas, and Terminology

Week 3-4: Permutations and Combinations

Discrete Mathematics with Applications MATH236

CHAPTER 5 BASIC CONCEPTS OF PERMUTATIONS AND COMBINATIONS

Discrete Mathematics: Logic. Discrete Mathematics: Lecture 15: Counting

HOMEWORK ASSIGNMENT 5

Elementary Combinatorics

2. Nine points are distributed around a circle in such a way that when all ( )

NON-OVERLAPPING PERMUTATION PATTERNS. To Doron Zeilberger, for his Sixtieth Birthday

Mathematics Competition Practice Session 6. Hagerstown Community College: STEM Club November 20, :00 pm - 1:00 pm STC-170

Chapter 7. Intro to Counting

Rosen, Discrete Mathematics and Its Applications, 6th edition Extra Examples

Question No: 1 If you join all the vertices of a heptagon, how many quadrilaterals will you get?

Foundations of Computing Discrete Mathematics Solutions to exercises for week 12

MAT 243 Final Exam SOLUTIONS, FORM A

MATH 351 Fall 2009 Homework 1 Due: Wednesday, September 30

Introduction. Firstly however we must look at the Fundamental Principle of Counting (sometimes referred to as the multiplication rule) which states:

Jong C. Park Computer Science Division, KAIST

Math Fall 2011 Exam 2 Solutions - November 1, 2011

Contents 2.1 Basic Concepts of Probability Methods of Assigning Probabilities Principle of Counting - Permutation and Combination 39

PERMUTATIONS AND COMBINATIONS

Topics to be covered

Mathematical Foundations of Computer Science Lecture Outline August 30, 2018

Permutation and Combination

Solutions for Exam I, Math 10120, Fall 2016

Review I. October 14, 2008

COMBINATORIAL PROBABILITY

Combinatorics: The Fine Art of Counting

Probability and Counting Techniques

Math236 Discrete Maths with Applications

Twenty-sixth Annual UNC Math Contest First Round Fall, 2017

Combinatorics and Intuitive Probability

Combinatorics (Part II)

Introduction to Mathematical Reasoning, Saylor 111

# 1. As shown, the figure has been divided into three identical parts: red, blue, and green. The figures are identical because the blue and red

Non-overlapping permutation patterns

Chapter 1. Probability

COUNTING TECHNIQUES. Prepared by Engr. JP Timola Reference: Discrete Math by Kenneth H. Rosen

Finite Math - Fall 2016

Block 1 - Sets and Basic Combinatorics. Main Topics in Block 1:

code V(n,k) := words module

Counting Things Solutions

Week 6: Advance applications of the PIE. 17 and 19 of October, 2018

Compound Probability. Set Theory. Basic Definitions

IB HL Mathematics Homework 2014

Reading 14 : Counting

Olympiad Combinatorics. Pranav A. Sriram

Solutions to Exercises on Page 86

The Pigeonhole Principle

6.1.1 The multiplication rule

Counting Subsets with Repetitions. ICS 6C Sandy Irani

(1). We have n different elements, and we would like to arrange r of these elements with no repetition, where 1 r n.

Counting in Algorithms

Chapter 2. Permutations and Combinations

MGF 1106: Exam 2 Solutions

MAT 115: Finite Math for Computer Science Problem Set 5

11 + Entrance Examination Sample Paper 2 Mathematics Total Marks: 100 Time allowed:1 hour

Solutions to Exercises Chapter 6: Latin squares and SDRs

RANDOM EXPERIMENTS AND EVENTS

50 Counting Questions

Ivan Guo. Broken bridges There are thirteen bridges connecting the banks of River Pluvia and its six piers, as shown in the diagram below:

Simple Counting Problems

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Combinatorics. PIE and Binomial Coefficients. Misha Lavrov. ARML Practice 10/20/2013

COUNTING AND PROBABILITY

Problem Set 8 Solutions R Y G R R G

Permutations and Combinations. Quantitative Aptitude & Business Statistics

MAT104: Fundamentals of Mathematics II Counting Techniques Class Exercises Solutions

Chapter 1. Probability

CISC 1400 Discrete Structures

Mathematics. Programming

Mathematics. ( (Chapter 7) (Permutations and Combinations) (Class XI) Exercise 7.3

Permutations and codes:

Lecture 18 - Counting

There are three types of mathematicians. Those who can count and those who can t.

12. 6 jokes are minimal.

Discrete Structures for Computer Science

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

PRMO Official Test / Solutions

Combinatorics: The Fine Art of Counting

Chapter 3 PRINCIPLE OF INCLUSION AND EXCLUSION

PHYSICS 140A : STATISTICAL PHYSICS HW ASSIGNMENT #1 SOLUTIONS

5. (1-25 M) How many ways can 4 women and 4 men be seated around a circular table so that no two women are seated next to each other.

Math 3012 Applied Combinatorics Lecture 2

Math 475, Problem Set #3: Solutions

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

STAT 430/510 Probability Lecture 3: Space and Event; Sample Spaces with Equally Likely Outcomes

UNIVERSITY OF NORTHERN COLORADO MATHEMATICS CONTEST

Chapter 2 Math

Permutations and Combinations

With Question/Answer Animations. Chapter 6

Solutions to Problem Set 7

Transcription:

MAT3707/0//07 Tutorial letter 0//07 DISCRETE MATHEMATICS: COMBINATORICS MAT3707 Semester Department of Mathematical Sciences SOLUTIONS TO ASSIGNMENT 0 BARCODE Define tomorrow university of south africa

SOLUTIONS TO ASSIGNMENT 0 (SEMESTER ) CLOSING DATE: April 07 UNIQUE NR: 8676 The answers to only some of the questions will be marked How many different -letter words (sequences) are there with no repeated letters, formed from the 6-letter alphabet? (3) This is just the number of ways of choosing objects from 6 different objects where order matters which is P (6, ) 6 5 5 (a) How many ways are there to seat six different boys and six different girls along one side of a long table with seats? () This is the same as the number of permutations of distinct objects:! (b) How many ways if the boys and girls alternate? () There are two types of seating arrangements: BGBGBGBGBGBG and GBGBGBGBGBGB For each of these types of arrangements there are 6! ways of arranging the boys, and 6! ways for arranging the girls By the Multiplication Rule there are then 6! 6! (6!) ways of making an arrangement in each of the cases Thus in total there are (6!) + (6!) (6!) ways 3 How many ways are there to pick a subset of different letters from the 6-letter alphabet? (3) This is just the number of ways of choosing objects from 6 different objects where order does not 6 matter, which is There are white balls and 6 red balls in a container (a) How many different ways are there to select a subset of 6 balls, assuming the 8 balls are all different? (3) Order does not matter, so the answer is colours are irrelevant) 8 (Note that since the balls are all different, their 6

MAT3707/0//07 (b) What is the probability that the selection has whites and reds? (3) 6 There are ways of choosing the white balls and ways of choosing the red balls By 6 the Multiplication Principle there are ways of choosing Thus the probability is )( 6 ) ( ( 8 6 ) 5 There are women and 6 men who will split up into five-person teams How many ways are there to do this so that there is (at least) one women on each team? () Note that it is sufficient to choose the first team, since the second team is then fixed There are exactly three possible disjoint cases to consider: Case A woman and men on the first team Case B women and 3 men on the first team Case C 3 women and men on the first team (Note that women on the first team would imply no women on the second team, which is not allowed) 6 In Case A there are ways of choosing the woman and ways of choosing the men By 6 the Multiplication Principle there are ways in case A 6 Similarly, in Case B there are ways 3 6 And in Case C there are ways 3 6 6 6 By the Addition Principle there are + + ways in total 3 3 6 (a) What is the probability that a five-card hand has at least one card of each suit? (3) A five-card hand with at least one card of each suit, must have two cards of one suit, and one card of each of the three remaining suits, ie it must be one of,,, 3 For each of these four cases, we choose the two cards of the repeating suit in ways (order 3 does not matter in a hand), and then each of the remaining three cards in ways (recall that 3 3 3 there are 3 cards of each suit) By the Multiplication Principle there are ways of choosing a hand with at least one cared of each suit 3

In total there are 5 ways of choosing a 5-card hand (order does not matter) Thus the proba- 5 bility is ) 3 ( 3 3 ( 5 ) 5 (b) What is the probability that a six-card hand has at least one card of each suit? (5) The possibilities for a 6-card hand with at least one card of each suit is somewhat more complicated There are two main possibilities: Case A Three cards of one suit and one card of each of the remaining three suits (this is four possibilities, one for each of the suits that occurs three times, eg ), Case B Two cards of one suit, two cards of another suit, and one card of each of the remaining two suits ( possibilities, one for each pair of suits occurring twice, eg ) In Case A we build a 6-card hand as follows: Choose which suit occurs three times: possibilities (as already mentioned) 3 Choose the 3 cards for the triply occurring suit: Choose a card for each of the remaining three suits: 3 ( 3 )( 3 )( 3 3 3 3 The Multiplication Principle gives 3 In Case B we build a 6-card hand as follows: Choose which two suits occurs twice: possibilities (as already mentioned) 3 3 For each of these two suits, choose the two cards: 3 3 Choose a card for each of the remaining two suits: 3 3 The Multiplication Principle gives The Addition Principle then gives (adding up Cases A and B) that there are in total 3 3 3 + 3 ( )( 3 ) ( 3 six-card hands with at least one card of each suit Thus the probability is ( 3 3 ) 3 ( 3 + 3 ) ( 3 ) )( ( 5 ) 6 ) )

MAT3707/0//07 7 What fraction of all arrangements of GRACEFUL have (a) F and G appearing side by side? () We combine F and G as one letter and call it X Now X together with R, A, C, E, U and L are 7 distinct letters which has can be arranged in 7! ways But X can be FG or GF which gives 7! different arrangements The total number of arrangements of the 8 distinct letters of GRACEFUL is 8!, so the fraction in which F and G appears side by side is 7! 8! (b) no pair of consecutive vowels? (5) First we arrange the five consonants G, R, C, F, L in 5! ways Think of them now as C, C, C 3, C, C 5 Since the vowels are not allowed to appear consecutively we can think of the consonants as separating the vowels So there are six possible places where we can put the vowels: before, in between and after the five consonants: C C C 3 C C 5 6 So first we pick three of these six possible places: ways 3 Then we arrange the three vowels: 3! ways 6 So by the Multiplication Principle there are 5! 3! ways in which to do this 3 The fraction of arrangements with no pair of consecutive vowels therefore is 8 Find the number of integer solutions to the inequality 5! ( 6 3) 3! 8! x + y + z 5 under the constraints x, y, z 5 (5) An inequality like this can always be converted into an equation by introducing an extra variable t 5 x y z Thus we have that x + y + z + t 5, where t is also an integer and it follows from the given inequality that t 0 Thus the constrains to this equation are x, y, z 5, t 0 We can model this situation as placing 5 identical objects into distinct containers, with at least 5 objects in each of the first three containers First place 5 objects into each of( the first three ) containers 0 + 3 Then 5 5 3 5 5 0 objects still have to be placed This gives 0 0 5

9 How many ways are there to pick a group of n people from 00 people (each of a different height) and then pick a second group of m other people such that all people in the first group are taller that the people in the second group? (6) Since the people have different heights, they are different objects, so they can be numbered from short to tall by {,, 3,, 00} We now have to find the number of ways of choosing a subset of n numbers and a second subset of m numbers from this set such that the numbers in the first subset are all smaller than the numbers in the second subset Note the following important observation: If we choose a subset of n + m numbers, then the n smallest numbers are already fixed, as are the largest m Thus choosing the two subsets ( is) exactly the same as choosing a single subset of n + m numbers 00 Thus the number of ways is n + m 0 How many ways are there to invite one of three different friends over for dinner on six successive nights such that no friend is invited more than three times? (6) If we let the 6 nights be 6 objects and the friends three types,,3 with a night being of type i if friend i is invited over for that night, then a way of inviting the 3 friends for the 6 nights is the same as the number of arrangements of these 6 objects, with say r of type, r of type, and r 3 of type 3 So we are counting arrangements with repetition The only problem is that r, r, r 3 do not have fixed values, since nothing specifies the number of nights r i on which friend i is invited So we just list all the possible values for the r i, keeping in mind that r + r + r 3 6 First note that if we don t take order into account, there are essentially only three solutions to r + r + r 3 6, namely 0 + 3 + 3 6, + + 3 6, + + 6, and by Theorem on page 96 of the Tucker there are A 6! ways of arranging 6 objects, 0 of type, 3 of type and 3 of type 3, 0!3!3! 6! B ways of arranging 6 objects, of type, of type and 3 of type 3,!!3! 6! C ways of arranging 6 objects, of type, of type and of type 3!!! But since the three terms on the left-hand side can be permuted, we really have 3 solutions as in Case A (one for each of 0 + 3 + 3 6, 3 + 0 + 3 6, 3 + 3 + 0 6), 3! solutions as in Case B (one for each permutation of,, 3), and just solution as in Case C (there is just one way of writing + + ) Thus the answer is 3 6! 0!3!3! + 3! 6!!!3! + 6!!!! 6

MAT3707/0//07 How many arrangements of six 0 s, five s and four s are there in which (a) the first 0 precedes the first? () 5 First we position the four s among the 5 positions: ways Then we put a 0 in the first of the remaining positions: way 0 Finally we pick five other positions for the remaining 0 s: ways 5 Thus the answer is ( 5 )( 0 5 (b) the first 0 precedes the first, which precedes the first? (6) Put a 0 in the first position: way Next we pick five other positions for the remaining 0 s: ways 5 Now we put a in the first of the remaining positions: way And finally we pick four other positions for the remaining s: Thus there are 8 5 ways to do this ) 8 ways How many ways are there to distribute 5 (identical) apples, 6 (identical) oranges and 7 (identical) pears amongst people (a) without restriction? (3) 5 + 6 + We can distribute 5 apples among persons in ways, 6 oranges in 5 6 7 + ways and 7 pears in ways By the multiplication Principle there are 7 8 9 0 5 6 7 ways to distribute them together (b) with each person getting at least one pear? () We first give each of the persons a pear (so that each one can have at least one pear; this can be done in one way), and then distribute the 5 apples, 6 oranges and the remaining 7 3 pears as in the previous question to obtain 8 9 3 + 8 9 6 5 6 3 5 6 3 7

3 Build a generating function for a r, the number of distributions of r identical objects into (a) five different boxes with at most objects in each box (3) Since the objects are identical, we use ordinary generating functions We model the problem as the number of integer solutions to e + e + e 3 + e + e 5 r, 0 e i Here e i is the number of objects going into box i We want to construct a product of polynomial factors such that when multiplied out, we obtain all the products x e x e x e 3 x e x e 5 with each e i satisfying the inequalities 0 e i Since such a product has five factors, we need five polynomial factors Each such polynomial needs to have all the x e i with e i in the admissable range of 0,,, 3, ie each polynomial must be x 0 + x + x + x 3 + x Thus the generating functions is (x 0 + x + x + x 3 + x ) 5 (b) four different boxes with between 3 and 8 objects in each box (3) We want the know the number of integer solutions to e + e + e 3 + e r, 3 e i 8 Now we need four polynomial factors, each of which is of the form x 3 + x + x 5 + x 6 + x 7 + x 8 Thus the generating function is (x 3 + x + x 5 + x 6 + x 7 + x 8 ) (c) seven different boxes with at least object in each box (3) We want the know the number of integer solutions to e + e + e 3 + e + e 5 + e 6 + e 7 r, e i Thus we need seven factors Note that now e i has no upper bound: it can be any one of,, 3, Thus each factor is strictly speaking not a polynomial anymore, but rather a power series, as there are infinitely many terms: x + x + x 3 + x + Thus the generating function is (x + x + x 3 + x + ) 7 (d) three different boxes with at most 5 objects in the first box (3) We want the know the number of integer solutions to e + e + e 3 r, e i 0, e 5 Thus we need three factors For the first factor we see that the possible values of e are 0,,, 3,, 5, thus the factor is x 0 + x + x + x 3 + x + x 5 For the other two factors e i has no restriction except e i 0, thus both are x 0 + x + x + x 3 + Thus the generating function is (x 0 + x + x + x 3 + x + x 5 )(x 0 + x + x + x 3 + ) 8

MAT3707/0//07 Use generating functions to find the number of ways to distribute r jelly beans among eight children if (a) each child gets at least one jelly bean (5) We model it as an equation e + e + + e 8 r, e i Thus there are 8 factors in the generating function, each equal to x + x + x 3 + Thus the generating function is (x + x + x 3 + ) 8 x 8 ( + x + x + ) 8 x 8 ( x) 8 and we want the coefficient of x r This is the same as the coefficient of x r 8 in is r 8 + 8 r 8 r r 8 ( x) 8, which (b) each child gets an even number of beans (5) We still have the above equation e + e + + e 8 r, but now the constraints are that each e i must be even Thus each of the 8 factors now must be + x + x + x 6 + Thus the generating function is ( + x + x + x 6 + ) 8 8 x ( x ) ( 8 ) + 8 + 8 s + 8 + x + x + + x s + s and we want the coefficient of x r If r is odd, then there is no power x r occurring, thus the coefficient is 0 Thus the number of ways of distributing an odd number of r jelly beans with each child getting an even number is 0, which agrees with common sense ( s + 8 If r is even, then r s for some s, and then the coefficient is r + 7 ) s r Thus the number of ways of distributing an even number of r jelly beans with each child getting an even number is ( r + 7 5 Use generating functions to find the number of ways there are to distribute 8 different toys among children if the first child gets at least toys (6) r ) 9

The toys are different, so we may model each distribution as an arrangement of length 8 of objects, with the first object occurring at least twice The exponential generating function of the number of arrangements of length r of objects, with the first object occurring at least twice, is ( x! + x3 3! + ) ( + x + x! + x3 3! + (e x x)(e x ) 3 (e x x)e 3x e x e 3x xe 3x and we determine the coefficient of x r /r! term by term The coefficient of x r /r! in ) 3 e x + x + (x)! + (x)3 3! + + (x)r r! + is r The coefficient of x r /r! in is 3 r The coefficient of x r /r! in e 3x + 3x + (3x)! xe 3x x ( + 3x + (3x)! x + 3x + 3 x 3! + (3x)3 3! + (3x)3 3! + 33 x! + + (3x)r r! + + (3x)r r! + + + 3r x r+ + r! ) + is not so simple to see, so we first find the coefficient of x r+ This is 3r Thus the coefficient of r! xr is 3 r (we just replace r + by r) Finally, to find the coefficient of (r )! xr /r!, we have to multiply by r! and we find 3r r! (r )! 3r r Adding the coefficients up we obtain that the coefficient of x r /r! in e x e 3x xe 3x is r 3 r 3 r r Don t stop here: this is not the answer! Recall that the original question asked for 8 toys, not r toys So we substitute 8 into r and the answer is 8 3 8 3 7 8 6 (a) Find a recurrence relation for the number of ways the elf in Example in Section 7 of Tucker can climb n stairs if each step covers either or or 3 stairs () 0

MAT3707/0//07 Let the number of ways to climb n stairs be a n Thus a (only one way), a (either + or ) and a 3 ( + + or + or + or 3) We now find the recurrence relation Consider the last step taken The number of ways n stairs can be climbed if the last step covers stair is exactly the number of ways n stairs can be climbed (just ignore the last step), which is a n Similarly, the number of ways n stairs can be climbed if the last step covers stairs is exactly the number of ways n stairs can be climbed, which is a n And similarly, the number of ways n stairs can be climbed if the last step covers 3 stairs is exactly the number of ways n 3 stairs can be climbed, which is a n 3 These three cases are disjoint and cover all possibilities (the last step must cover either, or 3 stairs) Thus by the addition principle, the total number of ways to climb n stairs is a n +a n + a n 3 Thus the recurrence relation is a n a n + a n + a n 3 (b) How many ways are there for the elf to climb 5 stairs? () We now use the recurrence relation and the first few values that we calculated in (a) a 5 a + a 3 + a (by the recurrence relation applied to n 5) (a 3 + a + a ) + a 3 + a (applied to n ) a 3 + a + a + + 3 (by values found in (a)) 7 (a) Find a recurrence relation (with initial conditions) for the number of n-digit binary sequences (sequences of {0, }) with no pair of consecutive s (6) Call the number of such n-digit sequences a n There are two disjoint cases: either such an n-digit sequence begins with a 0 or it begins with a If it begins with a 0, then the remaining (n )-digit sequence following the 0 is just an arbitrary (n )-digit sequence with no pair of consecutive s Thus there are a n such sequences If it begins with a, we have to be careful: since the first digit is a and consecutive s are not allowed, the second digit is forced to be 0 Thus we have a sequence starting with 0 Then, exactly as the case of a sequence starting with 0, the remaining (n )-digit sequence is an arbitrary sequence of length n with no pair of consecutive s Thus there are a n such sequences The addition principle then gives that the recurrence relation is a n a n + a n, n 3 The first two values that are not covered by the recurrence relation is a (the two -digit sequences obviously have no pair of consecutive s) and a 3 (of the four -digit sequences only has a pair of consecutive s)

(b) Find a recurrence relation (with initial conditions) for the number of n-digit ternary sequences (sequences of {0,, }) with no pair of consecutive s or consecutive s (6) Call the number of such n-digit sequences a n Not allowing consecutive s or s implies that if you take such an n -digit sequence and if it ends in a 0, then you can add any one of 0, and to it, but if it ends in a, you can only add 0 or to it, and similarly, if it ends in a, you can only add 0 or to it So the only possibility where the last two digits are the same, is when they are 00 Thus the first n digits can be arbitrary, as long as no pair of consecutive s or s occur Thus there are a n such sequences In the remaining cases, the last two digits of the n-digit sequences are not the same This means that if you take any arbitrary n -digit sequence with no pair of consecutive s or s, you can add one of two different digits to the end of it (If it ends in a 0 you can add or to it, if it ends in you can add 0 or to it and if it ends in a you can add 0 or to it) Thus there are a n such sequences Thus in total there are a n + a n ternary sequences without consecutive s or s Thus the recurrence relation is a n a n + a n You can also calculate the first two values not covered by the recurrence relation: a 3 (the three -digit sequences obviously have no pair of consecutive s or s) and a 7 (of the nine -digit sequences only the sequences and have a pair of consecutive s or s) 8 Solve the recurrence relation a n 3a n + n, a (5) This is an inhomogeneous linear recurrence relation The corresponding homogeneous recurrence relation is a n 3a n with general solution a n A3 n We have f(n) n, thus a particular solution to the inhomogeneous relation is A n B n + B 0 Substitute into the recurrence relation: B n + B 0 3(B (n ) + B 0 ) + (n ) 3(B n B + B 0 ) + n (3B )n 3B + 3B 0 + n The equation is true for all values of n On both sides we have a polynomial Thus the coefficients on n must be equal: B 3B + and the constant coefficients must be equal: B 0 3B + 3B 0 From the first equation we obtain B From the second equation we then have B 0 3( ) + 3B 0 which gives B 0

MAT3707/0//07 Thus A n n Thus the general solution is a n A3 n n We determine A from the initial value a : A3, thus A 7 6 The solution is therefore a n 7 6 3n n 9 Use inclusion-exclusion to determine the number of 9-digit sequences of the digits,, 3, with each of the digits occurring at least once (6) Let A be the set of 9-digit sequences not using, A the set not using, A 3 the set not using 3 and A the set not using We want N(A A A 3 A ), ie the number of 9-digit sequences of,, 3, with each digit occurring at least once Then N 9 (all sequences) N(A A A 3 A ) N N(A ) N(A ) N(A 3 ) N(A ) +N(A A ) + N(A A 3 ) + N(A A ) +N(A A 3 ) + N(A A ) + N(A 3 A ) N(A A A 3 ) N(A A A ) N(A A 3 A ) N(A A 3 A ) +N(A A A 3 A ) N(A ) N(A ) N(A 3 ) N(A ) 3 9 (sequences using 3 digits) N(A A ) N(A 3 A ) 9 (sequences using digits) N(A A A 3 ) N(A A 3 A ) (only one sequence using only one digit) N(A A A 3 A ) 0 (no sequence using no digits) Hence N(A A A 3 A ) 9 3 9 + 9 + 0 3 0 Use inclusion-exclusion to determine how many ways there are to choose 8 balloons from a collection of blue, red and green balloons (that are identical apart from their colour) if there must be at most seven balloons of each colour (6) Call the colours,, 3, and let A i be the set of selections with more than 7 of colour i (ie at least 8 balls of colour i) Now 8 + N 8 (total number of selections without any restriction), 8 3

and for each i,, 3,, 0 + N(A i ) 0 Then 3 (number of selections with at least 8 of colour i) 0 N(A A A 3 A ) N N(A ) N(A ) N(A 3 ) N(A ) + + For any two i, j, N(A i A j ) colour i and at least 8 of colour j) N(A A ) + N(A A 3 ) + N(A A ) +N(A A 3 ) + N(A A ) + N(A 3 A ) N(A A A 3 ) N(A A A ) N(A A 3 A ) N(A A 3 A ) +N(A A A 3 A ) 5 ( the number of selections with at least 8 of For any three i, j, k, N(A i A j A k ) 0 ( it is impossible to choose only 8 with at least 8 of each of the colours i, j, k) Similarly N(A A A 3 A ) 0 Hence N(A A A 3 A ) 3 8 0 5 +