Discrete Math: Counting Techniques Guide
Discrete Math: Counting Techniques Guide
November 6, 2017
1
Preface
i
Acknowledgments
ii
Dedication
iii
TABLE OF CONTENTS TABLE OF CONTENTS
Table of Contents
Preface i
Acknowledgments ii
Dedication iii
iv
1 UNIT 1 : COUNTING TECHNIQUES
Introduction
Counting of things is what we always do on daily basis. Different things are counted differently
based on the context on which they do exist. One of the general context is that of Set Theory
you covered in College Algebra. This unit reviews some of the principals of counting elements in
a set. These techniques will bring us to understanding “Combination Principle” which explores
more on determining the number of possible outcomes of a particular experiment or event.
Objectives/Learning Outcomes
By the end of this Unit, you should be able to:
Key Terms
Counting, Binomial coefficient, Permutation, Combination, multinomial coefficient.
1
1.1 Lesson 1: Counting Principles 1 UNIT 1 : COUNTING TECHNIQUES
The product rule involves a possibility of two events occurring at the same time. Consider the
following Figure:
How many ways can we switch on the bulb? Obviously the answer is 6. Thus, we have multiplied
the number of switches in A and number of switches in B.
In other words, if we let set A = {a, b, c} and set B = {1, 2}, then the number of ways of
choosing a pair of members such that one is from A and another from set B is 6. Thus,
(a, 1), (a, 2), (b, 1), (b, 2), (c, 3), (c, 4) = 3 × 2 = 6
We can now generalize the problem above with the following Theorem.
Let A and B be two finite sets. Then the number of ways of choosing one member from A and
another from B is
n(A) × n(B)
Example 1.1
a) How many two digit positive integers are there such that 2 does not appear on the units
(ones)?
Solution
There are nine positive integers:{1, 2, 3, 4, 5, 6, 7, 8, 9} from where two sets of integers; the
tens and the units (one) are to be generated. We are restricted that 2 cannot appear on
the units(ones). Hence, there remains 8 options of generating a unit integer. There is no
restriction on the tens integers set hence there are 9 integers. By product rule, there are
9 × 8 = 72 two positive integers such that 2 does not appear on the units.
b) In Malawi, each automobile license plate number consists of two letters followed by a four-
digit number. How many distinct license plate numbers can be formed in Malawi?
Solution
2
1.1 Lesson 1: Counting Principles 1 UNIT 1 : COUNTING TECHNIQUES
We are choosing 2 letters from 26 letters of English alphabet. In the ordered arrangement,
a letter may be repeated. Thus, we have 26 × 26 = 262 = 676 possible letters.
Similarly, we are choosing 4 digits from 10 digits which are 0, 1, 2, 3, 4, 5, 6, 7, 8 ,9. In the
ordered arrangement, a digit may be repeated. Thus, we have 10×10×10×10 = 104 = 10, 000
possible digits.
The product rule is not just restricted to two sets, we can have as many sets as possible. The
idea is now generalized in the following theorem.
Let A1 , A2 , A3 , · · · , Ak be finite sets. Then the number of ways of choosing k members one from
each set is
n(A1 ) × n(A2 ) × n(A3 ) × · · · × n(Ak )
Example 1.2
a) How many rows of T and F can one have for the statement (proposition)
q1 ∨ q2 ∨ q3 ∨ · · · ∨ qn ?
Solution
Each of the proposition can be evaluated to be T or F . Putting the responses on the rows,
we end up having two rows. Thus,
T
F
for n times. Hence, we have 2n rows.
b) How many 4 digit positive integers are there using the digits 1, 2, 3, · · · , 9 such that no digit
is repeated.
Solution
3
1.2 Lesson 2: Permutation 1 UNIT 1 : COUNTING TECHNIQUES
There are respectively 9, 8, 7 and 6 options, in the first, second, third and fourth digits for
them to be filled. Therefore by generalized product rule we have 9 × 8 × 6 = 3024.
Activity 1.1
Q.1. A senior control inspector has to visit five factories P, Q, R, S and T every week. She visits
a different factory each day, from Monday to Friday, but she chooses the order of her visits
at random each week. In how many different ways can she order her week’s visit?
Q.3. In the morning, I have a number of different possible ways to travel from my home to my
office. I could walk all the way, travel by school bus, or take any of three different bicycles.
In how many ways could I have possible of such moves?
Q.4. In Zambia, each automobile license plate number consists of three letters of English alpha-
bet followed by a two-digit number then finish with two letters of English alphabet. To
avoid confusion between “O” and “zero” and between “I” and “one”, the letters “O” and
“I” are not used. How many distinct license plate numbers can be formed in Zambia?
4
1.2 Lesson 2: Permutation 1 UNIT 1 : COUNTING TECHNIQUES
Permutation is denoted by n Pr or n Pr or P (n, r). They are all equivalent to saying “n permute
r ”.
Investigation: 5 P2
Let A, B, C, D, E be different items. For instance, the first selection of the two objects would
be to place item A in the first position and item B on the second position making AB. The
second selection would be to put item B on the first position and item A on the second, BA.
Thus, there are two possibilities of positioning a pair of items A and B. In the same way, there
are two possibilities for each of the pairs : AC, AD, AE, BC, BD, BE, CD, CE, DE. In total,
there are 20 possibilities of choosing two items from A, B, C, D, E and placing them in two fixed
positions. Thus, 5 P2 = 5 × 4 = 20.
Example 1.3
a) Nicholas, Jeremot and Ellen were all born in the same ordinary year. In how many ways can
these three persons have different birthdays?
Solution
An ordinary year has 365 days (different dates). Three birth dates are selected from a
possible 365 days and assigned to three distinct persons. No, birth date may repeat itself
within each year. The number of ways that this can occur is
b) How many 9-digit positive integers are there that use the digit 1, 2, 3, · · · , 9 where no digit
is repeated?
Solution
Factorial Notation
We were introduced to factorial notation in College Algebra as the product of integers from 1 to
n inclusive occurring in n factorial ways, denoted n!. Thus, n! = n×(n−1)×(n−2)×· · ·×3×2×1
For instance, 5! = 5 × 4 × 3 × 2 × 1 ≡ 5 × 4! and 9! = 9 × 8 × 7 × 6 × 5 × 4 × 3 × ×1
Notice that 9 P9 = 9!. Therefore, n Pn = n! read “n factorial”.
n n!
Pr = (n−r)!
Investigation of n Pr
5
1.2 Lesson 2: Permutation 1 UNIT 1 : COUNTING TECHNIQUES
n
Pr = n × (n − 1) × (n − 2) × · · · × n − r + 1 × 1
(n − r) (n − r − 1) 3 2 1
= n × (n − 1) × (n − 2) × · · · × (n − r + 1) × × × ··· × × ×
(n − r) (n − r − 1) 3 2 1
n!
=
(n − r)!
5! 5×4×3!
Thus, 5 P2 = (5−2)!
= 3!
= 20.
Permutations that have been performed so far are under the assumption that items are not re-
peated at any of the positions. However, in some scenarios, permutation may involve repetition.
Permutation with Repetition
Suppose we are asked to find the distinct permutations from the word CHANCELLOR. How
would you go about it?
We are interested with number of permutations of a multiset, that is a set of objects some
which are alike. We observe that the word CHANCELLOR has 10 letters where the letters
C and L appear twice, letters H, A, N, E, OR appear once.
Let P (n; n1 , n2 , · · · , nr ) denote the number of permutations of n objects of which n1 are alike,
n2 are alike, · · ·, nr are alike. Then the total permutations are calculated using the following
theorem:
Example 1.4
6
1.2 Lesson 2: Permutation 1 UNIT 1 : COUNTING TECHNIQUES
Solution
How many shortest routes are there between two most distant corners, such that one moves
along edges of 1 × 1 × 1 cube?
Solution
Each shortest route can UNIQUELY be represented as a sequence of 3x’s, 2y’s and 4z’s
where x means moving an edge to the right, y means moving an edge at perpendicular to x
motion horizontally and z means moving an edge [Link] the theorem, we have:
9!
P (3 + 2 + 4; 3, 2, 4) = = 1, 260
3! × 2! × 4!
Activity 1.2
Q.1. Three cards are chosen in succession from a deck of 52 cards. Find the number of ways
this can be done
7
1.3 Lesson 3: Combination 1 UNIT 1 : COUNTING TECHNIQUES
Q.2. Three hungry Eagles are flying in the sky in search for the food. They suddenly see 200
Chambo fish being sun-dried in preparation for the market. In how many possible ways
would these Eagles take away the fish?
Q.3. A row of six seats in a classroom is to be filled by selecting individuals from a group of
ten students
5
C 2 × 2 P2 = P25
5
5 P2
∴ C2 = 2
P2
20
= = 10
2
Notation
Combination is denoted, n Cr or n Cr or Crn to mean number of ways of choosing r items from n.
NB: If the chosen r are to be placed into r fixed positions, then r Pr = r! possible permutations.
Therefore,
n n
Pr = C r × r Pr
8
1.3 Lesson 3: Combination 1 UNIT 1 : COUNTING TECHNIQUES
n n
Pr = Cr × r!
n
n Pr n!
∴ Cr = = /r!
r! (n − r)!
n n!
∴ Cr =
r!(n − r)!
n!
i. n Cr = r!(n−r)!
ii. n Cr ≡ n
Cn−r
Proof
n!
i. n Cr = r!(n−r)!
already proved.
Example 1.5
a) A class has 6 girls and four boys. How many ways can we choose 2 girls and 2 boys from
this class?
Solution
Number of ways of choosing 2 girls from 6 is 6 C2 . Number of ways of choosing 2 boys from 4
is 4 C2 . By product rule, the number of ways of choosing 2 girls and 2 boys is 6 C2 ×4 C2 = 90
b) Five (5) points lie on a circumference of a circle. How many chords can we have by joining
any two points?
Solution
Each chord requires two points. Therefore, number of chords are 5 C2 = 10 chords.
c) Find the total number of triangles that can be drawn using points in (b) above as the corners
(vertices) of a triangle?
Solution
For us to draw a triangle, there is need of joining three points. Thus, we are choosing
three points out of five. On the other hand, we are choosing 2 points out of five to discard.
Therefore, the total number of triangles are: 5 C3 =6 C2 = 10 triangles.
9
1.4 Lesson 4: Binomial Coefficients 1 UNIT 1 : COUNTING TECHNIQUES
Activity 1.3
Q.1. How many different committees of 3 people can be formed from a pool of 7 people?
Q.2. In how many ways can a committee consisting of 2 faculty members and 3 students be
formed if 6 faculty members and 10 students are eligible to serve on the committee?
Q.3. The University of Malawi Senate has 100 members. Suppose that it is desired to place each
senator on exactly 1 of 7 possible committees. The first committee has 22 members, the
second has 13, the third has 10, the fourth has 5, the fifth has 16, and sixth and seventh
have 17 apiece. In how many ways can these committees be formed?
Q.4. Let x represent a horizontal movement from A to the right and y be the vertical movement
from A upwards in the following Figure.
Find:
Example 1.6
10
1.4 Lesson 4: Binomial Coefficients 1 UNIT 1 : COUNTING TECHNIQUES
a) How many strictly increasing sequences of 3 numbers can you form from the set {3, 1, 2, 9, 7}.
For instance, the choice of {3, 1, 3} gives 1, 2, 3 as a strictly increasing sequence.
Solution
In here, we observe that any choice of 3 different numbers give one unique strictly increas-
ing sequences. Therefore, the number of sequences required is the same as number of ways
of choosing 3 numbers from 5 numbers which is also equivalent to choosing 2 numbers from
5 to discard. Thus,
5
C3 ≡ 5 C2 = 10
b) Figure1 shows roads intersecting at right angle. How many shortest routes are there from A
to B?
Solution
Let x be the horizontal movement and y be a vertical movement as labeled above. Then,
every route from A to B is uniquely expressed as the sequence of 3x’s and 2y’s. Therefore,
the number of possible shortest routes is equivalent to number of sequences of 3x’s and 2y’s.
Thus we have:
5
C3 = 10 =5 C2
Recall: b + b = 2b. This implies that (x + y) + (x + y) = 2(x + y) = 2x + 2y. Thus, we can now
generalize for c = constat that c(x + y) = cx + cy.
Suppose we are multiplying three brackets, (x1 +x2 )(y1 +y2 )(z1 +z2 ). We can choose to multiply
out the first and the second brackets and finish with the third bracket as:
Each term has a member of first second and third brackets. Therefore, expansion is a choice of
one member from each bracket without repeating a choice.
11
1.4 Lesson 4: Binomial Coefficients 1 UNIT 1 : COUNTING TECHNIQUES
For instance, the coefficient of x3 y 2 in the expansion of (x + 5)5 will be 5 C2 ≡ 5 C2 = 10. Thus,
(x + 5)5 is a product of five brackets.
In other words (x + 5)5 has 5 C2 x3 y 2 = 10x3 y 2 as one term and x3 y 2 has a coefficient of 10.
In College Algebra, you learnt the Binomial Expansion as the expansion of the form (x+y)n =
n
C0 x0 y n +n C1 x1 y n−1 +n C2 x2 y n−2 + · · · + n Cn xn y 0 from which the following formula is derived.
Notation
n
The notation n Cp ≡ p
n
!
X n
(x + y)n = xp y n−p
p=0 p
To find the coefficient of the expansion, it does not matter the letter you use.
Example 1.7
Activity 1.4
Q.1 The term and its coefficient that contains x in the expansion of 2 + x)9 .
5
Q.2 Find the coefficient of the term that contains x8 y 18 in the expansion of (3x + 2y 2 )17 .
Q.3 The middle term in the expansion of (2x − 3y)50 . What is its coefficient?
2
Q.4 Find the coefficient of x10 in the expansion of (2 − x 5 )200 .
12
1.5 Lesson 5: Multinomial Theorem 1 UNIT 1 : COUNTING TECHNIQUES
Example 1.8
Solution
Solution
We could regard this problem as requiring to find the number of ways of placing 10 iden-
tical (indistinguishable) pencils in 3 containers XY Z. One way of doing this could be to
place the 10 pencils on the straight line and split them in 3 groups by two spliters into
x = 4, y = 5, z = 1.
| {z }
possible solution
13
1.5 Lesson 5: Multinomial Theorem 1 UNIT 1 : COUNTING TECHNIQUES
Alternatively, regard the two splitters as pencils, to have 10 + 2 = 12 pencils and choose any
two pencils to be splitters. Each choice of 2 pencils from 12 gives a unique solution to
12 12!
x + y + z. The total number of non-negative integer solutions is C2 = 2!10!
= 66
Solution
The solution to this follows the reasoning applied in (b) above. Just add three spitters to 10
13 13!
pencils and consider them as pencils altogether. Thus, we will have C3 = 3!10!
= 286
The last two parts in Example1.8 gives us the generalization stated in this Theorem about
non-negative integer solutions.
n+p−1
i. Number of non-negative integer solutions to x1 + x2 + x3 + · · · + xp is Cp−1
n+k−1
ii. Number of ways of placing n− indistinguishable items in k boxes is Ck−1
Example 1.9
w + x2 + x3 + x4 = 50 ⇒ 2 + x1 + x2 + x3 + x4 = 50
⇒ x1 + x2 + x3 + x4 = 50 − 2
⇒ x1 + x2 + x3 + x4 = 48
| {z }
non-negative integers
48+3 53
Therefore, applying Theorem1.8, the solution is C3 = C3 = 20825
Activity 1.5
14
1.6 Lesson 6: Sum Rule 1 UNIT 1 : COUNTING TECHNIQUES
Example 1.10
a) Suppose there are 10 football coaches and 7 netball coaches participating in certificate of
fitness test under AFCON trials at Bingu International Stadium. If you are part of the
10
trainers and are asked to choose the best three coaches, any coach can be chosen in C3 +
7
C3 = 155 ways.
b) If a bookshelf in the departmental library has 5 calculus texts, 3 algebra texts, 6 differential
equations texts and 4 statistics texts. Find the number of ways a student can select one of
the texts. Here again, using the sum rule, a text book can be chosen in 5 + 3 + 6 + 4 + 9 = 18
ways.
Nevertheless, using same principals, the rule can be extended to three or more disjoint events
as shown in Example1.10(b).
15
1.6 Lesson 6: Sum Rule 1 UNIT 1 : COUNTING TECHNIQUES
Case (i)
If we want to include x, we choose item x−first. Since we want to choose r− items and x is
already chosen, then we only need to choose r − 1 items from the remaining n − 1 items. Thus,
n−1
we can do this in Cr−1 ways.
Case (ii)
If we want to exclude item x, then we want to discard item x and choose all r items from the
n−1
remaining n − 1 items. Thus, we can do this in Cr ways of doing this. Since one can choose
r−items from n via case(i) or case(ii), then the number of ways of choosing r−items will be
n n−1
Cr = Cr or n−1 Cr−1
n n−1 n−1
Cr = Cr + Cr−1
n
n
X n p n−p
Recall: (x + y) = xy .
p=0
p
Example 1.11
16
1.6 Lesson 6: Sum Rule 1 UNIT 1 : COUNTING TECHNIQUES
m m m
m members in it. Therefore, number of ways of having these subsets is C0 + C1 + C3 +
m
···+ Cm . Since both of these figures count number of subjects of {1, 2, 3, 4, · · · , m} and hence
2m = m
C0 + m
C1 + m
C3 + · · · + m
Cm .
Example 1.12
Figure 1.6 depicts streets intersecting at right angles. How many shortest routes are there from
A to B via junction C or junction D?
Solution
Let A1 be a set of shortest routes from A to B via junction C.
Let A2 be a set of shortest routes from A to B via junction D.
We want number of members in A1 ∪ A2 . Thus, |A1 ∪ A2 |.
Since A1 ∩ A2 = ∅, then:
Example 1.13
17
1.6 Lesson 6: Sum Rule 1 UNIT 1 : COUNTING TECHNIQUES
2n n 2 n 2 n 2 n 2
Show that n
= 0
+ 1
+ 2
+ ··· + n
.
Solution
2n
n
means number of ways of choosing n items from 2n items. Visually,
Let Ai be the set of choices of n items from 2n items, so that i items come from the left where
{i = 0, 1, 2, 3, 4, · · · , n}.
NB: Ai ∩ Aj = ∅
n
X
2n
Therefore, by sum rule we get n
= |A1 ∪ A2 ∪ A3 ∪ · · · ∪ An | = |Ai |, since Ai ∩ Aj = ∅.
i=1
Activity 1.6
Q.1 You need to travel in between Blantyre and Lilongwe. You can either fly, hire a car from
car rentals, or go by public transport like a bus. There are 8 different flights in between
Blantyre and Lilongwe, 20 different cars to hire and 10 buses. How many options do you
have to get from Blantyre to Lilongwe?
Q.2 A student dance committee is to be formed consisting of 2 boys and 3 girls. If the member-
ship is to be chosen from 4 boys and 8 girls, how many different committees are possible?
Q.3 The minimum password length is 6 and the maximum is 8. The password can consist of
either an uppercase letter or a digit. There must be at least one digit in the password.
How many passwords are possible?
Q.4 Figure12 depicts streets intersecting at right angles. How many shortest routes are there
from A to B via junction D or junction C? How do you compare the result found here and
the one found in Example1.12?
18
1.7 Lesson 7: Inclusion-Exclusion Principle 1 UNIT 1 : COUNTING TECHNIQUES
We would observe that in A ∪ B, x is counted once, z is also counted once, and y is counted
twice. Then, there is need to consider taking away (excluding) the number that has been
counted twice. It is from this background of exclusion that the following Theorem is deduced.
Example 1.14
19
1.7 Lesson 7: Inclusion-Exclusion Principle 1 UNIT 1 : COUNTING TECHNIQUES
Example 1.15
How many non-negative integer solution has the equation x + y + z + w = 10 got if x ≥ 2 or
w ≥ 3?.
Solution
Let A1 be a set of all solutions to the equation x + y + z + w = 10 where x ≥ 2. For instance,
A1 = {(x = 2, y = 3, z = 2, w = 3) · · ·}.
Let A2 be a set of all solutions to the equation x + y + z + w = 10 where w ≥ 3.
We want number of members that are in A1 and A2 . Thus, A1 ∪ A2 . Since members in
|A1 ∪ A2 | = |A1 | + |A2 | − |A1 ∩ A2 |, then we can look at each of the sets separately.
For |A1 |:
Let x = 2 + x1 , x1 ∈ {0} ∪ N. Therefore;
x + y + z + w = 10 ⇒ 2 + x1 + y + z + w = 10
⇒ x1 + y + z + w = 8
8+4−1 11
∴ Number of solutions required = C4−1 = = 165
3
For |A2 |:
Let w = 3 + w1 , w1 ∈ {0} ∪ N. Therefore;
x + y + z + w = 10 ⇒ x + y + z + 3 + w1 = 10
⇒ x + y + z + w1 = 7
7+4−1 10
∴ Number of solutions required = C4−1 = = 120
3
For |A1 ∩ A2 |:
A1 ∩ A2 is a set of solutions where x ≥ 2 AND x ≥ 3. Let x = 2 + s and w = 3 + t where
s, t ∈ {0} ∪ N. The equation now becomes
x + y + z + w = 10 ⇒ 2 + s + y + z + 3 + t|A1 | = 10
⇒ s+y+z+t=5
5+4−1 8
∴ Number of solutions required = C4−1 = = 56
3
20
1.7 Lesson 7: Inclusion-Exclusion Principle 1 UNIT 1 : COUNTING TECHNIQUES
From the Figure, any member of the regions a, b and c is correctly counted once by the formula.
So are members of the regions d, e and f . Members of the region g have not been counted at
all or counted 1 + 1 + 1 − 1 − 1 − 1 = 0. This leads us to the following extended Theorem on
the inclusion-exclusion principle
line 1
z }| { line 2 line 3
Xk zX }| { zX }| {
|A1 ∪ A2 ∪ · · · ∪ Ak | = |Ai | − |Ai1 ∩ Ai2 | + |Ai1 ∩ Ai2 ∩ Ai3 | + · · · +
i=1 i1 <i2 i1 <i2 <i3
line N
z X }| {
(−1)k+1 |Ai1 ∩ Ai2 ∩ · · · ∩ Ak |
i1 <i2 <···<ik
21
1.7 Lesson 7: Inclusion-Exclusion Principle 1 UNIT 1 : COUNTING TECHNIQUES
Consider RHS:
Let x appear in r of the k sets. Thus, r = 1, 2, 3, 4, · · · , k. We are assuming that:
k
X
Line 1: |Ai |
i=1
Here x has been counted r times since x− appears in r of the k sets.
X
Line 2: − |Ai1 ∩ Ai2 |
i1 <i2
There are two situations for x in this second line. The first is when x is in both sets Ai1 and
Ai2 while the other is when x is in either set Ai1 or set Ai2 .
Suppose x ∈ Ai1 and x ∈ Ai2 . Then |Ai1 ∩ Ai2 | contains x once. Suppose x ∈ Ai1 and x 6∈ Ai2 ,
then |Ai1 ∩ Ai2 | has counted x zero times. This means that the number of times x has been
subtracted is xr from choosing two sets among sets with x’s to intersect. Thus, in lines 1 and
2, x is counted r − 2r
X
Line 3: + |Ai1 ∩ Ai2 ∩ Ai3 |
i1 <i2 <i3
r
Applying the same line of arguments as in line 2, x is included 3
times.
Continuing with same arguments for the intermediate sets, the last line will have the following:
r sets
X z }| {
Line r: | Ai1 ∩ Ai2 ∩ · · · ∩ Air |
i1 <i2 <···<ir
r
In this line, x is counted (−1)r+1 r
Recall: 1 ≤ r ≤ k .
This implies that all intersections of more than r sets do not have x in them, since x appears
in only r sets. Therefore, the RHS of the theorem has counted x in:
r r r r+1 r
r− + − + · · · + (−1)
2 3 4 r
NB: n Pn = n!, 0 P0 = 0! = 1.
The RHS of the theorem counts x in:
r r r r r+1 r r
= − + − + · · · + (−1) since = r.
1 2 3 4 r 1
r r r r r+1 r
= 1+ − + − + · · · + (−1) −1 introducing a zero
1 2 3 4 r
r r r r r r+1 r r
= + − + − + · · · + (−1) −1 since = 1.
0 1 2 3 4 r 0
r r r r r r+1 r
= + −1 + − + − + · · · + (−1) grouping
0 1 2 3 4 r
22
1.7 Lesson 7: Inclusion-Exclusion Principle 1 UNIT 1 : COUNTING TECHNIQUES
r r r r r r+1 r
= −1 1− + − + − · · · + (−1) factoring -1
0 1 2 3 4 r
r
X r
= 1− (−1)k
k=0
k
r
X r
= 1− (−1)k 1r−k
k=0
k
= 1 − (−1 + 1)r Binomial expansion
= 1−0
= 1
Activity 1.7
Q.1 How many bitstrings of length 8 start either with a bit 1 or end with 00?
Q.2 What is the number of bit strings of length 4 that do not have two consecutive ones? [Hint:
You can visualize using a tree diagram beginning with empty string ]
Q.3 How many integers are divisible by 5 or 7 or 10 in the list {1, 2, 3, 4, 5, · · · , 12000}?
Q.4 How many non-negative integer solution has the equation x + y + z + w = 15 got if x ≤ 6
or w ≥ 3?
23
2 UNIT 2 : DIFFERENCE EQUATIONS
Introduction
Many problems in Probability give rise to difference equations. Difference equations also called
recurrence equations relate to differential equations as discrete mathematics relates to continu-
ous mathematics. Anyone who has made a study of differential equations will know that even
supposedly elementary examples can be hard to solve. By contrast, elementary difference equa-
tions are relatively easy to deal with. A difference equation defines a sequence recursively: each
term of the sequence is defined as a function of the previous terms of the sequence.
Objectives/Learning Outcomes
By the end of this Unit, you should be able to:
Key Terms
Iteration, Relation, Differencing, Recurrent relation, Root of a function, Generating a function.
24
2.1 Lesson 1: Generating Functions 2 UNIT 2 : DIFFERENCE EQUATIONS
This module considers only ordinary generating functions, despite have non-ordinary ones. A
generating function is a “formal” power series in the sense that x is usually regarded a place-
holder rather than a number. Only in rare cases will x be evaluated in generating function as a
real number value, so as to ignore the issues of convergence. Throughout the module, indication
of the correspondence between a sequence and its generating function will be indicated by a
double-sided arrow as follows:
hg0 , g1 , g2 , g3 · · ·i ←→ g0 + g1 x + g2 x2 + g3 x3 + · · ·
For instance, here are some sequences and their generating functions:
The pattern observed is simple: the ith term in the sequence (indexing from 0) is the coefficient
of xi in the generation function.
Revision: Geometric Progression
Let Sn = a + ar + ar2 + · · · + arn−1 be the sum of the geometric series. Then the nth term of
the series is found by the formulae:
a(rn − 1) a(1 − rn )
Sn = ,
r−1 1−r
| {z } | {z }
r>0 r<0
where a is the first term, r is the common ratio and n is the number of terms in the series.
25
2.1 Lesson 1: Generating Functions 2 UNIT 2 : DIFFERENCE EQUATIONS
Suppose g(x) = 1+x+x2 +· · ·+xn−1 be our geometric series, then a = 1, r = x and n = nterms.
Then, the sum of the nth term of this geometric series will be
1 − xn
f (x) =
1−x
Suppose |x| < 1, eg : x = 17 , then xn → as n → ∞. Thus 1
7
→ as n → ∞. The generating
function of h1, 1, 1, 1 · · ·i ←→ 1 + 1x + 1x2 + 1x3 + · · · without end. This is equivalent to
Generating functions are particularly useful for solving counting problems. In particular, prob-
lems involving choosing items from a set often lead to nice generating functions by letting the
coefficient of xn be the number of ways to choose n items.
The generating function for binomial coefficients for instance, follows directly from the Binomial
Theorem:
k k k k k k k 2 k k
, , ,···, , 0, 0, 0, · · · ←→ + x+ x + ··· + x
0 1 2 k 0 1 2 k
= (1 + x)k
Thus, the coefficient of xn in (1 + x)k is the number of ways to choose n distinct items from
a set of size k. For example, the coefficient of x2 is k2 , the number of ways to 2 choose items
from a set k elements. In a similarly way, the coefficient of xk+1 is the number of ways to choose
k + 1 items from size k set, which is zero.
Example 2.1
26
2.1 Lesson 1: Generating Functions 2 UNIT 2 : DIFFERENCE EQUATIONS
Theorem 2.2
x2 x3 x4 xn
ex =1+x+ + + + ··· + ···.
|{z} 2! 3! {z 4! n!
Closed f orm | }
Series f orm
1
Let k ∈ N. Let f (x) = (1−x)k
. What is the series form of f (x)
27
2.1 Lesson 1: Generating Functions 2 UNIT 2 : DIFFERENCE EQUATIONS
Solution
Let f (x) = 1
(1−x)k
= (1 − x)−k = a0 + a1 x + a2 x2 + · · · + an xn + · · ·. Therefore, f (0) = 1
(1−0)k
=
1 = a0 ⇒ a0 = 1. The interest is the find the coefficient an of our function. Before we handle
the problem, recall the following stated Theorem. Proof is left as an exercise to the learner.
Theorem 2.4
∞
1 X n+k−1 n
= x
(1 − x)k n=0
k−1
Example 2.2
z0 + z1 + z2 + z3 z0 + z1 + z2 + · · · z0 + z1 + z2 + · · ·
0 1 2 3
1 1
= z +z +z +z
1−z 1−z
2
1 z z z4
= + + +
(1 − z)2 (1 − z)2 (1 − z)2 (1 − z)2
28
2.1 Lesson 1: Generating Functions 2 UNIT 2 : DIFFERENCE EQUATIONS
1 z z2 z4
Let g(z) = (1−z)2
+ (1−z)2
+ (1−z)2
+ (1−z)2
. Then number of solutions to x + y + z∗ = 10 is the
10
coefficient of z in the series expansion of g(z).
Notation
C[xn ] means “Coefficient of xn of”
For example, C[x2 ](1 − 3x2 + 4x3 ) = −3 and C[x2 ](1 + 3x2 + 7x3 + 5x2 ) = 8
We want C[z 2 ]g(x). Therefore,
(∞ ∞ ∞
X n + 2 − 1 X
n+2−1 n X n+2−1 n
10 10 n 2
C[z ]g(z) = C[z ] z +z z +z z
n=0
2−1 n=0
2−1 n=0
2−1
∞ )
3
X n+2−1 n
+ z z
n=0
2−1
10 + 2 − 1 9+2−1 8+2−1 7+2−1
= + + n decreases due to outside z’s
2−1 2−1 2−1 2−1
= 38
Example 2.3
How many non-negative integer solutions has the equation x + y + z = 10 got if x is an even
number?
Solution
x is generated by w0 + w2 + w4 + w6 · · ·.
y and z are generated by w0 + w1 + w3 + w4 · · ·.
Therefore, x + y + z is generated by, |w| < 1 :
0 2 4 6 1 1 2 2 2 2 3
1 1
(w + w + w + w · · ·) = 1 + [w ] + [w ] + [w ] + · · ·
1−w 1−w 1−w 1−w
2
1 1
= × = h(w) say
1 − w2 1−w
∴ Number of solutions = C[w10 ]h(w)
2
10 1 1
= C[w ] ×
1 − w2 1−w
X∞ ∞
X n − 2 − 1
10 2 k
= C[w ] (w ) × wn
k=0 n=0
2 − 1
∞
X n
X n
X
0 2 4 6 0 2 4 6 1 k
w + w + w + w ··· = p + p + p + p ··· = 1−p2
= p . Since Cai = C ai , then
k=0 i=1 i=1
∞ X ∞
X n + 2 − 1 2k+n
h(w) = w
k=0 n=0
2 − 1
29
2.1 Lesson 1: Generating Functions 2 UNIT 2 : DIFFERENCE EQUATIONS
Since (w2 )k = w2k and (w2 )k wn = w2k+n . Therefore, number of solutions these coefficients of
w10 have will be
2k + n = 10 ⇒ n = 10 − 2k ≡ C[w10 ]h(w)
k n = 10 − 2k
0 10
1 8
2 6
3 4
4 2
5 0
Example 2.4
Recall:
∞
−k
X n+k−1 n n+k−1
(n+k−1)(n+k−2)(n+k−3)···(k+1)k
1. (1−x) = x , k ∈ R; |k| < 1. And k−1
= n!
.
n=0
k−1
30
2.1 Lesson 1: Generating Functions 2 UNIT 2 : DIFFERENCE EQUATIONS
∞
X
x 0 1 2
2. e
|{z} = x /0! + x /1! + x /2! + · · · = xk /k!. If we looking at ex × ex × ex × · · · × ex
Closed f orm k=0
| {z }
Serie f orm
(k times) we get the following product in series form
∞ ∞
X X xn1 +n2 +n3 +n4 +···nk
···
n1 =0
n !n !n n ! · · · nk !
n =0 1 2 3 4
k
Now,
en
Thus, C n!
= k n ways of partitioning an integer n.
Activity 2.1
Q.1 What is the sequence and closed form of the following 1, 1, 2!1 , 3!1 , · · · , r!1
Q.3 How many non-negative solutions has the equation x + y + z = 10 got if x ≥ 5 and z is an
even number?
Q.4 How many ways can one color n circles (each circle with a single color) using 2 colors?
31
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
∴ a(2) = 2a(1) = 2 × 2 = 22
a(3) = 2a(2) = 2 × 22 = 23
a(4) = 2a(3) = 2 × 23 = 24
..
.
a(n) = 2a(n − 1) = 2 × 2n−1 = 2n reading pattern
Other examples
i) 0! = 1
ii) n! = n(n-1)!, (n ≥ 1)
i) a0 = 1
ii) an = n(n−1) , (n ≥ 1)
a) A Basis, where the function is explicitly evaluated for one or more values of its argument.
b) A Recursive Step, stating how to compute the function from its previous values.
32
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
Recurrence equation can be solved using different approaches. Among them, we will look at
iteration method,generating function, and root method .
ITERATIVE METHOD
Iteration approach has has been uterized in the beginning example of circle coloring in this unit.
Here are some further example of iteration method and how it works:
Example 2.5
The game of Hanoi Tower is to play with a set of disks of graduated size with holes in their
centers and a playing board having three spokes for holding the disks.
The object of the game is to transfer all the disks from spoke A to spoke C by moving one disk
at a time without placing a larger disk on top of a smaller one. What is the minimal number
of moves required when there are n disks?
Solution
Let an be the minimum number of moves to transfer n disks from one spoke to another. In
order to move n disks from spoke A to spoke C, one must move the first n − 1 disks from spoke
A to spoke B by an−1 moves, then move the last (also the largest) disk from spoke to spoke C
by one move, and then remove the n − 1 disks again from spoke B to spoke C by an−1 moves.
Thus the total number of moves should be
This means that the sequence {an |n ≥ 1} satisfies the recurrence relation
an = 2an−1 + 1, n ≥ 1; a1 = 1
a1 = 2a0 + 1
a2 = 2a1 + 1 = 2(2a0 + 1) + 1
= 2 2 a0 + 2 + 1
a3 = a2 + 1 = 2(22 a0 + 2 + 1) + 1
= 2 3 a0 + 2 2 + 2 + 1
33
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
a4 = 2a3 + 1 = 2(23 a0 + 22 + 2 + 1) + 1
= 2 4 a0 + 2 3 + 2 2 + 2 + 1
..
.
an = 2n a0 + 2n−1 + 2n−2 + · · · + 2 + 1
= 2 n a0 + 2 n − 1
an = 2n − 1, n ≥ 1
Given a recurrence relation for a sequence with initial conditions. Solving the recurrence relation
means to find a formula to express the general term an of the sequence.
Example 2.6
an − 2a(n−1) ≡ C[xn ]f (x) − 2C[xn ]xf (x) ≡ C[xn ]{f (x) − 2xf (x)}
f (x) = a0 + a1 x1 + a2 x2 + · · · + an xn + · · ·
−2xf (x) = −2a0 x − · · · − 2an(n−1) and then
f (x) − 2xf (x) = a0 + 0| +{z
0 + 0} , n ≥ 1
an −2an−1 =0
an = C[xn ]2k z k = 2n
34
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
Example 2.7
g(y) = a0 + ay + a2 y 2 + a3 y 3 + · · · + an y n + · · ·
−5yg(y) = −5a0 − 5ay 2 − · · · − 5an−1 y n + · · ·
+6y 2 g(y) = +6a0 + 6ay 2 + · · · + 6an−1 y n + · · ·
∴ g(y) − 5yg(y) + 6y 2 g(y) = a0 + (a1 − 5a0 y) + 0 + 0 + 0
Since an − 5an−1 + 6an−2 = 0 for n ≥ 2
∴ g(y)(1 − 5y + 6y 2 ) = 2 + (9 − 5(2)y)
g(y)(1 − 5y + 6y 2 ) = 2 − y
2−y 2−y A B
∴ g(y) 2
= = + ; for some A, B.
1 − 5y + 6y (1 − 3y)(1 − 2y) 1 − 3y 1 − 2y
1 1
⇒ 2 − y = A(1 − 2y) + B(1 − 3y), ∀y ⇒ B = −3, when y = andA = 5 when y =
2 3
5 3
∴ g(y) = −
1 − 3y 1 − 2y
∞
X X∞
k
= 5 (3y) − 3 (2y)l
k=0 l=0
= C[y ]g(y) = 5 × 3n − 3 × 2n , making k and l = n
n
Homogeneous Equations
The recurrence relation a(n) = C1 a(n − 1) + C2 a(n − 2) + · · · + Ck a(n − k); C1 6= 0 is said to
be homogeneous if a(n) = 0 otherwise it is called non-homogeneous.
The coefficients Ci may depend on n, but here we will assume that they are constant unless
stated otherwise. The basis of the recursive definition is also called initial conditions of the
recurrence.
For instance, in the recursive definition of the Fibonacci sequence,
Fn = Fn−1 + Fn−2
or
Fn − Fn−1 − Fn−2 = 0
35
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
bn = 4bn−1 − 4bn−2
am = (m + 1)am−1
is not homogeneous.
A solution of a recurrence relation is a sequence xn that verifies the recurrence. An important
property of homogeneous linear recurrences (an = 0) is that given two solutions xn and yn of
the recurrence, any linear combination of them zn = rxn + syn , where r, s are constant, is also
a solution of the same recurrence, because
k
X k
X k
X
Ci rxn−i + syn−i = r Ci xn−i + s Ci yn−i = r · 0 + s · 0 = 0.
i=0 i=0 i=0
an = kan−1 , k is a constant
Recall:
For an = 2an−1 , we had an = 2n .
For an = 5aa−1 − 6an−2 , we had an = C1 3n + C2 2n
For bn = 4bn−1 − 4bn−2 , we will have bn = 2n .
From these scenarios, the following Theorem follows:
Theorem 2.5
36
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
Let an = Aan−1 + Ban−2 have an = λn1 and an = λn2 as solution. Then an = C1 λ21 + C2 λ21 is
another solution, C1 and C2 constants.
Proof
Since an = λn1 and an = λn2 are solutions, then an−1 = λn−1
1 and an−1 = λn−1
2 as solution. So is
true for an−2 = λn−2
1 and an−2 = λn−2
2 as a solution to the relation an = Aan−1 + Ban−2 . Thus,
the solutions will be:
an = C1 λn1 + C2 λn2
∴ an−1 = C1 λ1n−1 + C2 λn−1
2 and
an−2 = C1 λ1n−2 + C2 λn−2
2
Example 2.8
∴ λn = 5λn−1 − 6λn−2
∴ λn − 5λn−1 − 6λn−2 = 0
λn−2 λ2 − 5λ + 6 = 0
∴ Either λn−2 = 0 or λ2 − 5λ + 6 = 0
∴ Either λn−2 = 0 or (λ − 3)(λ − 2) = 0
λ = 0 or λ = 3 or λ = 2
∴ an = 2n or 3n
∴ an = C1 2n + C2 3n is a general solution
Example 2.9
37
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
Solve in terms of m
am = 5am−1 − 6am−2 m = 1, 2, 3, 4, · · · a0 = 1; a1 = 0
Solution
Let an = λn
∴ λm = 5λm−1 − 6λm−2
∴ λn − 5λm−1 − 6λm−2 = 0
λm−2 λ2 − 5λ + 6 = 0
∴ Either λm−2 = 0 or λ2 − 5λ + 6 = 0
∴ Either λm−2 = 0 or (λ − 3)(λ − 2) = 0
∴ λ = 0 or λ = 3 or λ = 2
But a0 = 1 6= 0 ∴ λm−2 = 0 does not hold
So that, an = 2m or 3m
∴ am = C1 2n + C2 3n is a general solution
Check
If am = 3m ⇒ a0 = 30 = 1 and a1 = 31 = 3 6= 0. Therefore, am = 3m is not a solution.
Likewise am = 2m ⇒ a1 = 2 6= 0. Therefore, am = 3m is not a solution and 2m is not a
solution as well.
Consider now the general solution am = C1 2m + C2 3m :
a0 = 1 = C 1 + C 2 (30 = 20 = 1)
a1 = 0 = 3C1 + 2C2 (31 = 3, 21 = 2)
⇒ 3 = 3C1 + 3C2 multiplying eqn 1 by 3
∴ 3 − 0 = C2 ⇒ C2 = 3
∴ 1 = C1 + C2 becomes 1 = C1 + 3 ⇒ C1 = −2
am = C1 λm m m
1 + C 2 λ2 + · · · + C p λp
38
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
is a general solution.
The equation λp = A1 λp−1 + A2 λp−2 + · · · + Ap λ + Am−p of the roots of a relation am =
A1 am−1 + A2 am−2 + · · · + Ap am−p is called a Characteristic equation
The generalization of the relation ushers into the following Theorem:
Theorem 2.6
Let am = Aam−1 + Bam−2 be such that λ2 = Aλ + B has one repeated root λ = λ1 = λ2 . Then
the general solution is
am = C1 λm + C2 mλm
Example 2.10
λn − 4λn−1 − 4λn−2 = 0
λn−2 (λ2 − 4λ + 4) = 0
λn−2 = 0 or λ2 − 4λ + 4 = 0
∴ λ2 − 4λ + 4 = 0 ⇒ (λ − 2)2 = 0
∴ λ = 2 repeated
∴ The general solution is an = k1 2n + k1 n2n
Activity 2.2
Q.1 Find an explicit formula for each of the sequences defined by the recurrence relations with
initial conditions.
i. xn = 5xn−1 + 3, x1 = 3
ii. xn = 2xn−1 + 15xn−2 , x1 = 2, x2 = 4.
iii. xn = 3xn−1 − 2xn−2 , x0 = 2, x1 = 4.
Q.2 Find an explicit formula for each of the sequences defined by the non-homogeneous recur-
rence relations with initial conditions.
39
2.2 Lesson 2: Formulating Relations 2 UNIT 2 : DIFFERENCE EQUATIONS
i. xn = 2xn−1 + 15xn−2 + 2n 3, x1 = 2, x2 = 4.
ii. xn = 4xn−1 + 5xn−2 + 3, x1 = 3, x2 = 5.
iii. xn = 6xn−1 − 9xn−2 + 3n+2 , x0 = 3, x1 = 9.
Q.3 Find an explicit formula of the following sequence defined by the recurrence relations with
its initial condition
x2n = 2xn + 5 − 7n, x1 = 0.
40
3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Introduction
Pigeonhole principle is a fundamental but powerful tool in combinatorics. Unlike many other
strong theorems, the principle itself is exceptionally simple. Unless you have looked into it
thoroughly, it is hard to have a glimpse of its elegance and useful applications in mathematics.
Objectives/Learning Outcomes
By the end of this Unit, you should be able to:
Key Terms
Simple form, Regular form, Extended form.
41
3.2 Lesson 2: Simple Form of PHP 3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Activity 3.1
Q.1 In your own terms, how can you describe pigeon-hole principle.
Q.2 Give 3 practical examples that can be modeled using pigeon-hole principle.
If there are k + 1 objects and k bins. Then there is at least one bin with two or more objects.
Proof
We prove by contradiction. Suppose we have k + 1 objects and every bin has at most one
element. Then the total number of elements is k which contradicts our Theorem. Hence, the
theorem is true.
Example 3.1
In Malawi, there exists atleast 2 persons with the same bank pin number.
Solution
Bank in Malawi use four-digit sequence of numbers,
and by product rule we have 10,000 possible pin-codes. Common judgment is that all banks in
Malawi must issue more than 10,000 ATM cards. Taking any 10, 001 = 10, 000 + 1 customers
as objects and the n = 10, 000 pin-codes as pigeon-holes. By pigeon-hole principle, there exists
atleast a pair with same pin numbers.
Example 3.2
Let A be set of numbers: A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Given that 6 different numbers are
chosen from this set. Show that:
42
3.2 Lesson 2: Simple Form of PHP 3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Solution
a) Let 1, 2, 3, 4 and 5 be five pairing to stand for n = 5 pigeon-holes. Thus, 1 is a pairing (1,2),
2 is a pairing (3,4), 3 is a pairing (4, 5) and so on. Regard the 6 = n + 1 chosen numbers
as letters. By pigeon-hole principle, there exists atleast two numbers to be chosen from the
same block (pairing). Therefore, The pair chosen from the same block is consecutive (by
design).
b) Let 1, 2, 3, 4, 5 be a pairing that gives us a sum of 11. For instance, 1 is a pairing (10, 1), 2
is a pairing (5, 6) and so on. Regard the 6 = n + 1 chosen numbers as letters. By pigeon-
hole principle, there exists atleast two numbers whose sum add up to 11 and they are not
consecutive.
Example 3.3
Let M = 9 and N = 7. Show that there exists an integer of the form 999 · · · 900 · · · 0 that is
divisible by N = 71.
Solution
Let a1 , a2 , a3 , · · · be such that a1 = 9, a2 = 99, a3 = 999, · · · , a71 = 999
| {z· · · 9} , · · ·. When any
71 of them
positive integer is devided by 71 we have the possible remainders as 0, 1, 2, 3, · · · , 70 with 0 as
minimum remainder and 70 as a maximum remainder.
Let R1 be a remainder when a = 9 is divided by 71.
R2 be a remainder when a2 = 99 is divided by 71
R3 be a remainder when a3 = 999 is divided by 71
..
.
R71 be a remainder when a71 is divided by 71
Therefore, R1 , R2 , R3 ·R71 ∈ {0, 1, 2, 3, · · · , 70}. Likewise R1 , R2 , R3 · · · R71 , R72 ∈ {0, 1, 2, 3, · · · , 70}.
| {z } | {z }
72 numbers 71 numbers
By pigeon-hole principle, there exists 2 remainders that get the same value, say, Ri = Rj , (i < j).
| · · ·{z
999 999 · · · 9} = aj = 71n + Rj , n ∈ {0} ∪ N
j times
999
| {z· · · 9} = ai = 71n + Rj , m ∈ {0} ∪ N i<j
i times
i of them
z }| {
∴ 999 · · · 9 000 · · · 0 = 71n − 71m
i of them
z }| {
999 · · · 9 000 · · · 0 = 71(n − m) since n ≥ m, aj > ai
43
3.3 Lesson 3: Regular Form of PHP 3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Activity 3.2
Q.1 Show that if one choose five points from a 2 × 2 square, there will be two points that will
√
lie no more that 2 apart.
Q.2 Show that atleast 2 people in a class of 367 students share the same birth date.
Q.3 Let a1 , a2 , a3 , · · · , an+1 be a sequence of non-negative integers. Prove that either a term in
the sequence or sum consecutive terms in the sequence is divisible by n.
Q.4 There are some people (more than 1 person) in a party. Prove that 2 of them have the
same number of friends in the party. (It is assumed that friendship is mutual. That is if A
is a friend of B, then B is a friend of A.)
If rk + 1 objects are placed in k pigeon-holes, then there exists a pigeon-hole with more than
r objects
Proof
We prove by contradiction. Suppose the Theorem does not hold, thus, Theorem is false. Then
each of the n pigeon-holes has at most r objects. Therefore, the total number of objects in the
n pigeon-holes is less than or equal to rk . This contradicts that the total number of objects
was rk + 1 .Therefore, the Theorem is true.
Example 3.4
In a group of 49 people, show that more than four people were born in the same month.
Solution
Regard 49 persons as blocks. Let the 12 months of the year be regarded as pigeon-holes.
Therefore49 = 12 × 4 + 1 where k = 12 and r = 4. Therefore, by regular form of pigeon-hole
principle, there exist a month with more than r = 4 people born in it among the 49 persons.
Therefore, atleast 5 persons are born in that month because number of persons is an integer.
44
3.3 Lesson 3: Regular Form of PHP 3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Example 3.5
Prove that among any group of six persons; there exists 3 persons who are mutual friends or
non-mutual friends. Mutual friends are people who know each other well.
Solution
Consider the following visual aid:
Let a solid line represent mutual friend connection and a dotted be the non-mutual friends.
Isolate the 6th person and consider his or her mutual and non-mutual friends. We have that
5 = 2 × 2 + 1, where k = 2 and r = 2.
Dropping the 5 lines in the 2 boxes, then by regular form form of pigeon principle, there exists
a box with more than 2 lines in it. We would observe that if any two persons, e.g 5 and 4 are
joined by a solid line with respect to the 6th person, we have 3 mutual friends. The opposite
happens when any two persons are joined by a dotted line to have non-mutual friends.
Activity 3.3
Q.1 There are 17 mathematicians and 3 official languages. Every pair of mathematicians com-
municate in one of the official languages. Prove that there are 3 mathematicians commu-
nicating in the same language pairwise.
45
3.4 Lesson 4: Extended Regular Form of PHP3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Q.2 A child drinks at least 1 bottle of milk a day. Given that he has drunk 700 bottles of milk
in a year of 365 days, prove that for he has drunk exactly 29 bottles in some consecutive
days.
Q.3 27 points are aligned so that each row has 9 points and each column has 3 points. (A
column is perpendicular to a row.) Each point is painted in red or blue. Prove that there
exists a monochromatic rectangle (i.e. 4 vertices are of the same colour) with its sides
parallel to the rows and columns.
If m objects are placed in the k pigeon-holes, then there exists a pigeon-hole with more than
b m−1
k
c objects.
Proof
Suppose the Theorem is false, thus all the k pigeon-holes have ≤ b m−1
k
c. Therefore, the total
number of objects in all the pigeon-holes will be ≤ b m−1
k
ck ≤ m − 1. This contradicts the fact
that we had m letters in total.
Proof
a) Assume that part (a) is not true. Therefore, x1 > x̄, x2 > x̄, x3 > x̄, · · ·, xn > x̄
46
3.5 Lesson 5: Generalized PHP 3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Example 3.6
Solution
a) Let m = 401, k = 4 forms. By extended regular form, there exists a form with more than
401 students take away 4 forms. Thus, ∃ a form with > b 401−1
4
c = b 400
4
c = 100 students in
it.
Because the number of the students is an integer, it follows that the nest digit is 101 as per
meaning of atleast.
OR
By applying the corollary:
Activity 3.4
Q.1 Suppose 51 keys are randomly dropped in a boxes labeled {1, 2, 3, 4, · · · , 10}. Let yk
be the keys dropped into boxes {1, 2, 3, 4, · · · 10}. Find the minimum and maximum
{y1 , y2 , y3 , · · · y10 }.
47
3.5 Lesson 5: Generalized PHP 3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Proof
Suppose the Theorem was false. Remember that ∼ (p ∨ Q) = ∼ P ∧ ∼ Q. Therefore,
The first pigeon-hole has < q1 objects and
The second pigeon-hole has < q2 objects and
The third pigeon-hole has < q3 objects and
..
.
The rth pigeon-hole has < qr objects
But < q1 ≡ ≤ q1 − 1, thus, pigeon-hole i has at most qi − 1 objects in it. Similarly,
< q2 ≡ ≤ q2 − 1 (i > 1, 2, 3, · · · , r)
Therefore, r pigeon-holes will have at most (q1 − 1) + (q2 − 1) + · · · + (qr − 1) = q1 + q2 +
q3 + · · · + qr − r. This contradicts the fact that we had q1 + q2 + q3 + · · · + qr − r + 1 objects.
Therefore, the Theorem cannot be false. Hence the Theorem is true.
Example 3.7
Suppose 10 mangoes are placed in a basket, carton and a basin. Deduce that the basket has
atleast three mangoes or the carton has atleast four mangoes or the basin has atleast five
mangoes.
Solution
Lets regard the basket, the carton and the basin as our three pigeon-holes, thus r = 3. Let
q1 = 3, q2 = 4 and q3 = 5. We see that q1 + q2 + q3 − 3 + 1 = 10. Hence, by generalized
pigeon-hole principal, the result follows.
Example 3.8
A basket of fruit is being arranged out of apples, bananas, and oranges. What is the smallest
number of pieces of fruit that should be put in the basket in order to guarantee that either there
are at least 8 apples or atleast 6 bananas or at least 9 oranges?
Solution
By generalized pigeon-hole principle, the answer is 8 + 6 + 9 − 3 + 1 = 21
48
3.5 Lesson 5: Generalized PHP 3 UNIT 3 : PIGEON-HOLE PRINCIPLE
Activity 3.5
1. A football match is being arranged out of Chanco FC, Mzuni FC, Big Bullets FC, Won-
drous FC and Chitipa FC. What is the smallest number of goals that should be scored
in order to guarantee that either there are at least 5 goals for Chanco FC or 2 goals for
Mzuni FC or 1 goal for Big Bullets FC or 9 goals for Wondrous FC or 20 goals for Chitipa
FC?
49
4 UNIT 4: GRAPH THEORY BASICS
Introduction
The field of graph theory began to blossom in the twentieth century as more and more modeling
possibilities were recognized and the growth continues. It is interesting to note that as specific
applications have increased in number and in scope, the theory itself has developed beautifully
as well. In this Unit we investigate some of the major concepts and applications of graph theory.
Objectives/Learning Outcomes
By the end of this Unit, you should be able to define:
Key Terms
Vertex, Edge, Path, Trail, Cycle, Tree, Valency, Chains
50
4.1 Lesson 1: Vertex, Edge and Valence 4 UNIT 4: GRAPH THEORY BASICS
Graph (G) consists of two finite sets, V and E. Each element of V is called a vertex (plural
vertices). The elements of E, called edges, are unordered pairs of vertices. For instance, the
set V might be {A, B, C, D, E} and E might be {{A, B}, {B, C}, {C, D}, {A, E}}. Together V
and E are a Graph, denoted G(V, E).
Valency/Degree of vertex v a graph, denoted deg(v), is the number of edges incident with v.
For instance, in Figure 5, the degree of Vertex A is 3 while the degree of vertex E is 1.
The maximum degree of a graph G, denoted by 4(G), is defined to be
For instance, the graph of Figure10 has 4G = 2 and δG = 1. Consequently we have the
following Theorem which is referred to as the First Theorem of Graph Theory.
In a graph G, the sum of the degrees of the vertices is equal to twice the number of edges.
Consequently, the number of vertices with odd degree is even.
Proof
X
Let S = deg(V ). Take note that in counting S, we count each edge exactly twice. Thus,
v∈V
S = 2|E| (the sum of the degrees is twice the number of edges). Since S is even, it must be
that the number of vertices with odd degree is even. This concludes the proof.
51
4.1 Lesson 1: Vertex, Edge and Valence 4 UNIT 4: GRAPH THEORY BASICS
Graphs have natural visual representations. Look at the diagram in Figure 5. Notice that each
element of V is represented by a small circle and that each element of E is represented by a line
drawn between the corresponding two elements of V .
In simple terms, we can just as easily define a graph to be a diagram consisting of small circles,
called vertices, and curves, called edges, where each curve connects two of the circles together.
When we speak of a graph in this chapter, we will almost always refer to such a diagram. We
can obtain similar structures by altering our definition in various ways. Here are some examples
I. By replacing our set E with a set of ordered pairs of vertices, we obtain a directed graph
or digraph. Each edge of a digraph has a specific orientation.
II. if we allow repeated elements in our set of edges, technically replacing our set E with a
multiset, we obtain a multigraph.
Figure 7: Multigraph
52
4.1 Lesson 1: Vertex, Edge and Valence 4 UNIT 4: GRAPH THEORY BASICS
Figure 8: Pseudograph
IV. Allowing our edges to be arbitrary subsets of vertices (rather than just pairs) gives us
hypergraphs
Activity 4.1
Q.1 Ten people are seated around a circular table. Each person shakes hands with everyone
at the table except the person sitting directly across the table. Draw a graph that models
this situation.
Q.2 Six colleagues (Adam, Masoambeta, Chimwemwe , Dave, Ken,and Frank) need to pair off
as roommates for the upcoming school year. Each person has compiled a list of the people
with whom he would be willing to share a room.
53
4.2 Lesson 2: Walks, Paths’s, Trails 4 UNIT 4: GRAPH THEORY BASICS
W ≡ v0 e1 v1 e2 · · · vk−1 ek vk
whose terms are alternately vertices and edges such that for 1 ≤ i ≤ k, the edge ei has ends
vi−1 and vi .
Thus, each edge ei is immediately preceded and succeeded by the two vertices with which it is
incident. We say that W is a v0 − vk walk or a walk from v0 to vk .
Origin and terminus: The vertex V0 is the origin of the walk W , while vk is called the terminus
of W . v0 and vk are not distinct. The vertices v1 , v2 , · · · , vk−1 in the above walk W are called
its internal vertices. The integer k, the number of edges in the walk, is called the length of W ,
denoted by |W |.
Repetition of vertices and edges in a walk W is applicable. Oftentimes, we may meet trivial
walks.
Trivial walk : A trivial walk is one that does not contain any edge. Thus, for any vertex v of
G, W ≡ v gives a trivial walk. Its length is 0.
54
4.2 Lesson 2: Walks, Paths’s, Trails 4 UNIT 4: GRAPH THEORY BASICS
Given two vertices u and v of a graph G, a u − v walk is closed or open depending on whether
u = v or u 6= v. The walks W1 and W2 above are both open while W3 ≡ v1 v5 v2 v4 v3 v1 is closed
in Figure10
Trail : If the edges e1 , e2 , · · · , ek of the walk W ≡ v0 e1 v1 e2 v2 · · · · · · ek vk are distinct then W is
called a trail. In other words, a trail is a walk in which no edge is repeated. W1 and W2 are
not trails, since for instance e5 is repeated in W1 , while e1 is repeated in W2 . However, W3 is
a trail.
A trail that begins and ends at the same vertex is called a closed trail , or circuit
Path: If vertices v0 , v1 , · · · vk of the walk W ≡ v0 e1 v1 e2 v2 · · · · · · ek vk are distinct then W is
called a path. Any two paths with the same number of vertices are said to be isomorphic paths.
A path with n vertices is sometimes denoted as Pn . Realize that Pn has length n − 1. In other
words, a path is a walk in which no vertex is repeated . Thus, in a path no edge can be repeated
either, so a every path is a trail. This is not true for the trails. Thus, not every trail is a path.
For instance, W3 is not a path since v1 is repeated. However, W4 ≡ v2 v4 v3 v5 v1 is a path in the
graph G as shown in Figure 10
A closed path, or cycle is a path v1 , · · · · · · vk (where k ≥ 3) together with the edge vk v1 .
Activity 4.2
Q.2 Prove that for any graph G of order at least 2, the degree sequence has atleast one pair of
repeated entries.
Figure 11:
55
4.3 Lesson 3: Disconnectedness of Graphs 4 UNIT 4: GRAPH THEORY BASICS
Having paid attention to operations on the graph, lets turn our focus on this unit.
A graph is connected if every pair of vertices can be joined by a path. Informally, if one can pick
up an entire graph by grabbing just one vertex, then the graph is connected. On contrary, if the
graph is not connected, then it is disconnected . Figure13 shows connected and disconnected
graphs.
56
4.3 Lesson 3: Disconnectedness of Graphs 4 UNIT 4: GRAPH THEORY BASICS
In Figure13, G1 is connected, and both G2 and G3 are disconnected. Each maximal connected
piece of a graph is called a connected component. In Figure 13, G1 has one component, G2 has
three components, and G3 has two components.
If the deletion of a vertex v from G causes the number of components to increase, then v is
called a cut vertex . In the graph G of Figure 12, vertex d is a cut vertex and vertex c is not.
Similarly, an edge e in G is said to be a bridge if the graph G − e has more components than
G. In Figure12, the edge ab is the only bridge.
A proper subset S of vertices of a graph G is called a vertex cut set (or simply, a cut set) if the
graph G − S is disconnected. A graph is said to be complete if every vertex is adjacent to every
other vertex. Consequently, if a graph contains atleast one nonadjacent pair of vertices, then
that graph is not complete. Complete graphs do not have any cut sets, since G − S is connected
for all proper subsets S of the vertex set. Every non-complete graph has a cut set, though, and
this leads us to another definition.
For a graph G which is not complete, the connectivity of G, denoted k(G), is the minimum size
of a cut set of G. If G is a connected, non-complete graph of order n, then 1 ≤ k(G) ≤ n − 2. If
G is disconnected, then k(G) = 0. If G is complete of order n, then we say that k(G) = n − 1.
Further, for a positive integer k, we say that a graph is k − connected if k ≤ k(G). You will
realize that “1-connected” simply means “connected”.
Here are several facts that follow from these definitions. You will get to prove a couple of them
in the exercises.
57
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
Activity 4.3
Q.1 Draw a connected graph having at most 10 vertices that has at least one cycle of each
length from 5 through 9, but has no cycles of any other length.
Q.2 Let P1 and P2 be two paths of maximum length in a connected graph G. Prove that P1
and P2 have a common vertex.
Q.3 Let G be a graph of order n that is not connected. What is the maximum size of G?
Q.4 Let G be a graph of order n and size strictly less than n − 1. Prove that G is not connected.
Q.6 Prove or disprove: If every vertex of a connected graph G lies on at least one cycle, then
G is 2-connected.
Q.7 Prove that every 2-connected graph contains at least one cycle.
i. k(G) ≤ δ(G);
ii. if δ(G) ≥ n − 2, then k(G) = δ(G)
58
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
From the Figure 14, Graph A is a null graph whose χ(D) = 1, Graph B by definition has no
chromatic number while Graph C has χ(D) = 2.
If all colours have been assigned to the vertices of a graph so that no two adjacent vertices have
the same 1- color, the graph is said to be properly coloured . A k −coloring of a graph is a proper
coloring involving a total of k colors. A graph that has a k−coloring is said to be k − colorable.
In other words, the graph G is k − chromatic if χ(G) = k.
In a proper colouring, each colour class is a stable set. Hence a k − colouring may also be seen
as a partition of the vertex set of G into k disjoint stable sets Si = {v|c(v) = i} for 1 ≤ i ≤ k.
Therefore k−colourable are also called k-partite graphs. Moreover, 2−colourable graphs are
very often called bipartite. It is clear now that if H is a subgraph of G then any proper colouring
of G is a proper colouring of H.
Let G = (V, E) be any simple graph. Let χ(G) be the chromatic number and 4(G) be the
valency in G, then:
χ(G) ≤ 4(G) + 1
Proof
The proof for this is done via induction approach. Let G = (V, E) be such that |v| = n. We
consider first case where the color is 1.
Case 1: n = 1
This gives us a degree say X such that x = 0 = 4(G). Thus
χ(G) = 1 ≤ 0 + 1 = 1.
59
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
Figure 15:
When the graph is not connected, the 4(G) = 0 and χ(G) = 1. Hence χ(G) ≤ 4(G) + 1. This
is true.
When the graph is not connected, the 4(G) = 1 and χ(G) = 2. Hence χ(G) ≤ 4(G) + [Link]
is also true.
Therefore, case 2 also holds.
Case 3: For Pn true ⇒ Pn+1 true
This is an inductive stage. Let Pn be the statement that “for a simple graph of n vertices one
has χ(G) ≤ 4(G) + 1”. There is need to show that for Pn true ⇒ Pn+1 is also true.
Let G have n + 1 vertices.
Figure 16:
Let G∗ be the graph after removal of some vertex x together with its adjacent edges. Therefore
G∗ has n vertices. If Pn is true, then χ(G) ≤ 4(G) + 1.
Figure 17:
The number of edges connected (adjacent to x) is ≤ 4(G). This means that we will vertex
colour G∗ with χ(G) colours. Hence χ(G∗ ) ≤ 4(G) + 1. Since Pn is true, it implies ≤ 4(G) + 1
is true. Thus G∗ ≤ G.
60
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
Since we can vertex G∗ with χ(G∗ ), take 4(G) + 1 colours. Remove vertex colouring of G∗ and
re-vertex colour G∗ using 4(G) + 1 colours. Then there exists a colour not adjacent to x (by
pigeon-hole principle). Hence use that colour on x. This means that G has been coloured with
4(G) + 1 colours. Therefore χ(G) ≤ 4(G) + 1. Thus Pn+1 is also true.
The Theorem is so powerful and most useful in our daily lives especially when it comes to
time-tabling.
Example 4.1
Suppose that you are responsible for scheduling times for lectures in a university. You want
to make sure that any two lectures with a common student occur at different times to avoid a
conflict.
Solution
We could put the various lectures on a chart and mark with an X any pair that has students in
common:
A more convenient representation of this information is a graph with one vertex for each lecture
and in which two vertices are joined if there is a conflict between them:
61
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
Now, we cannot schedule two lectures at the same time if there is a conflict, but we would like
to use as few separate times as possible, subject to this constraint. How many different times
are necessary?
We can code each time with a color, for example 08:00-09:00 might be given the color green,
and those lectures that meet at this time will be colored green. The no-conflict rule then means
that we need to color the vertices of our graph in such a way that no two adjacent vertices
(representing courses which conflict with each other) have the same color. So what we seek is
a k − coloring of our graph with k as small as possible. Here is a 4 − coloring of the graph:
Question: Is there a proper coloring that uses less than four colors? Clearly we cannot get by
with less than three colors, since G, H, and L are all adjacent to each other. So the question
becomes: Can we find a 3-coloring? The answer is negative. We shall suppose that we can
properly color the graph with only three colors, and show that this leads to a contradiction. We
start by coloring G, H, and L three different colors, as we must. We might as well assume they
are the colors as shown above. Then M must be the same color as H, since M is adjacent to G
and L and there are only three colors available. So we color M blue as shown above. In a like
manner, I must be colored green since it is adjacent to L and M , which we have determined
to be red and blue. Now S is adjacent to G, H, and L, and so it must be a different color from
them all. So we cannot make do with only three colors. So four colors are needed to properly
color the graph. This means that we need to have at least four different times for lectures in
our school.
How do we determine the chromatic number of a graph? In example4.1 , we did it by first finding
a 4-coloring, and then making an intricate argument that a 3-coloring would be impossible. It
may be quite difficult to compute the chromatic number of more complicated graphs. Can we
at least make an upper bound on the number of colors we need, even if we cannot find the
minimum number? There is an algorithm (procedure) for properly coloring vertices that does
not always use as few colors as possible, but at least gives us an upper bound on the number of
colors needed.
62
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
The algorithm is called greedy because it is a rather short-sighted way of trying to make a proper
colouring with as few colors as possible. It does not always succeed in finding the minimum
number (the chromatic number), but at least provides some proper coloring. The procedure
requires us to number consecutively the colors that we use, so each time we introduce a new
color, we number it also. Here is the procedure:
2. Pick an uncolored vertex v. Color it with the lowest-numbered color that has not been used
on any previously-colored vertices adjacent to v. (If all previously-used colors appear on
vertices adjacent to v, this means that we must introduce a new color and number it.)
Clearly, this produces a proper coloring, since we are careful to avoid conflicts each time we
color a new vertex. How many colors will be used? It is hard to say in advance, and it depends
on what order we choose to color the vertices.
Example 4.2
Suppose we decide to color the course conflict graph using the Greedy Coloring. Algorithm, and
we decide to color the vertices in order G, L, H, P, M, A, I, S, C. Then we would color G with
color 1 (green), L with color 2 (red) since adjacency with G prevents it from receiving color
1 (green), and we color H with color 3 (blue) since adjacency with G and L prevents it from
receiving colors 1 and 2 (green and red). So we have
P and M also cannot receive colors 1 and 2 (green and red), so they are given color 3 (blue):
63
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
Then A cannot receive colors 1 and 3 (green and blue), so we give it color 2 (red), while I
cannot receive colors 2 and 3 (red and blue), so we give it color 1 (green).
Vertex S cannot receive color 1, 2, or 3, and so we give it color 4 (say, yellow). Vertex C cannot
receive color 2 or 4 (red or yellow), so we give it color 1 (green). We obtain the same coloring
we had proposed earlier:
On the other hand, we could imagine choosing a different order. Suppose we chose to color the
vertices in the order A, I, P, M, S, C, H, L, G. First we color A with color 1 (green) and also I
and P color 1.
64
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
Then we color M and S with color 2 (red), because they cannot be colored green.
Then we color C and H with color 3 (blue), because they cannot be colored green or red.
We color L with color 4 (yellow), because it cannot be colored with green, red, or blue.
65
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
We color G with color 5 (light blue), because it cannot be colored with any of the four other
colors.
So we see that the quality of our coloring (with fewer colors being considered better) from the
Greedy Coloring Algorithm is dependent on the order in which we color the vertices.
Nonetheless, there is a certain minimum quality we get, which we can determine by the following
theoretical argument: Suppose that d is the largest degree of any vertex in our graph, i.e., all
vertices have d or fewer edges attached, and at least one vertex has precisely d edges attached.
As we go about coloring, when we color any particular vertex v, it is attached to at most d
other vertices, of which some may already be colored. Then there are at most d colors that we
must avoid using. We use the lowest-numbered color not prohibited.
That means that we use some color numbered d + 1 or lower, because at least one of the colors
1, 2, · · · , d + 1 is not prohibited. So we never need to use any color numbered higher than d + 1.
This gives us the following Theorem:
If d is the largest of the degrees of the vertices in a graph G, then G has a proper coloring with
d + 1 or fewer colors, i.e., the chromatic number of G is at most d + 1.
Proof
The proof to this is discussed already.
This gives an upper bound on the chromatic number, but the real chromatic number may be
below this upper bound. For example, in our course conflict graph above, the highest degree
is d = 6 (vertex L has this degree), so the Greedy Coloring Theorem states that the chromatic
number is no more than 7.
In fact, the chromatic number is 4, and a 4-coloring can be obtained by employing the Greedy
Coloring Algorithm (as we saw above) if one is not too unlucky in picking the order to color
vertices.
66
4.4 lesson 4: Vertex Colouring & Time Tabling 4 UNIT 4: GRAPH THEORY BASICS
A difficult problem that was addressed by graph theorists is the answer to the following question:
Question: What is the maximum number of colors you need to color a map so that adjacent
territories are given different colors?
67
A cut vertex is a vertex whose removal increases the number of connected components in a graph, indicating its critical role in maintaining graph connectivity. For instance, if the removal of vertex d from a graph causes a split into more disconnected components, it is a cut vertex, indicating its structural importance .
The inclusion-exclusion principle is used to find the size of the union of overlapping sets by adding the sizes of the sets and subtracting the sizes of their pairwise intersections. For example, to find how many integers are divisible by 4 or 6 within the set {1, 2, ..., 7000}, calculate the number divisible by 4 (1750), those by 6 (1167), and subtract the number divisible by both (583), which are the multiples of LCM(4,6). Applying inclusion-exclusion gives |A1 ∪ A2| = |A1| + |A2| - |A1 ∩ A2| = 1750 + 1167 - 583 = 2334 .
The Sum Rule states that if you have two disjoint sets, the total number of elements in the union of the sets is the sum of the number of elements in each set. It differs from the Product Rule, which multiplies the number of options in independent scenarios. An example of the Sum Rule is choosing two fruits of the same type from two different boxes. If box 1 has 10 mangoes and box 2 has 15 oranges, the total ways to pick a pair of the same fruit is the sum of the combinations from each box, i.e., 10C2 + 15C2 = 150 ways .
The Product Rule of Counting is applied by determining the number of choices available for each part of the license plate and then multiplying these numbers. For example, if forming a license plate requires choosing characters from different sets and each choice is independent, the total number of plates is the product of the number of choices for each part. For instance, if a license plate consists of 4 digits where each digit can be any from 0 to 9, the total combinations possible are 10x10x10x10 = 10,000 .
To find integer solutions for equations with constraints, such as x + y + z + w = 10 with x ≥2 or w ≥3, use partitioning and adjust variables to meet conditions. For w ≥ 3, redefine w as w' + 3; solve x + y + z + w' = 7 using combinations, leveraging the inclusion-exclusion principle where needed .
The chromatic number χ(G) of a graph G is the smallest number of colors needed to color the vertices so that adjacent vertices have different colors. It's crucial in scheduling problems to ensure that conflicting events (represented by adjacent vertices) do not overlap. For example, in scheduling lectures where certain lectures share students, vertices represent lectures, edges represent student conflicts, and coloring the graph shows the minimum timeslots needed .
The Generalized Product Rule states that if you have k independent sets, the total number of ways to choose one element from each set is the product of the sizes of each set. For instance, if each set represents possible choices for each component in a scenario, and if set A1 has n(A1) elements, set A2 has n(A2) elements, and so on up to set Ak, the total number of combinations is n(A1) x n(A2) x ... x n(Ak). An example is determining the number of rows possible for a statement q1 ∨ q2 ∨ q3 ∨ ... ∨ qn, which can be done in 2^n rows by evaluating each proposition independently as true or false .
Permutation concerns the arrangement of objects, considering order as significant. The number of ways to permute n objects taken r at a time is denoted by nPr. It differs from a combination, where the order of selection does not matter. For instance, arranging 4 objects out of 9, the number of permutations is 9P4, whereas choosing without regard to order would involve combinations .
The pigeonhole principle states that if n items are put into m containers, with n > m, at least one container must contain more than one item. For example, in graph coloring, when coloring n vertices with at most △(G) + 1 you still have colors left. This principle ensures at least one color on a vertex is free from conflict, helping to solve vertex coloring problems .
Vertex deletion impacts graph structure by potentially increasing disconnectedness if a cut vertex is removed, or shortening paths if crucial vertices in paths are deleted. This operation can split connected components, altering the connectivity and limiting possible paths in the graph, as demonstrated by changes in component numbers .