MATH 174 - DISCRETE MATHEMATICS
COMBINATORICS
July 27, 2023
Basic Counting Principles
Let S be a set. A partition of S is a collection S1 , S2 , ..., Sm of subsets of 8
such that each element of S is in exactly one of those subsets:
S = S1 ∪ S2 ∪ ... ∪ Sm
Si Sj = ∅ (i ̸= j)
Thus, the sets S1 , S2 , ..., Sm are pairwise disjoint sets, and their union is S.
Addition Principle.
Suppose that a set S is partitioned into pairwise disjoint parts
S1 , S2 , ..., Sm . The number of objects in S can be determined by
finding the number of objects in each of the parts, and adding the
numbers so obtained: |S1 | + |S2 | + ... + |Sm |
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 2 / 16
Basic Counting Principles
Another formulation of the addition principle in terms of choices is
the following: If an object can be selected from one pile in p ways and
an object can be selected from a separate pile in q ways, then the
selection of one object chosen from either of the two piles can be
made in p + q ways. This formulation has an obvious generalization
to more than two piles
Example. A student wishes to take either a mathematics course or a
biology course, but not both. If there are four mathematics courses
and three biology courses, then the student can choose a course to
take in 4 + 3 = 7 ways
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 3 / 16
Basic Counting Principles
Multiplication Principle
Let S be a set of ordered pairs (a, b) of objects, where the first object
a comes from a set of size p, and for each choice of object a there are
q choices for object b. Then the size of S is p x q: |S| = p x q.
A second useful formulation of the multiplication principle is as
follows: If a first task has p outcomes and, no matter what the
outcome of the first task, a second task has q outcomes, then the two
tasks performed consecutively have p x q outcomes.
Example The number of ways a man, woman, boy, and girl can be
selected from five men, six women, two boys, and four girls is 5 x 6 x
2 x 4 = 240.
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 4 / 16
Basic Counting Principles
Division Principle.
Let 8 be a finite set that is partitioned into k parts in such a way that
each part contains the same number of objects. Then the number of
parts in the partition is given by the rule
|S|
k=
number of objects in a part
Thus, we can determine the number of parts if we know the number
of objects in 8 and the common value of the number of objects in the
parts.
ExampleThere are 740 pigeons in a collection of pigeonholes. If each
pigeonhole contains 5 pigeons, the number of pigeonholes equals
740
= 148
5
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 5 / 16
A great many counting problems can be classified as one of the following
types:
1 Count the number of ordered arrangements or ordered selections of
objects
without repeating any object,
with repetition of objects permitted
2 Count the number of unordered arrangements or unordered selections
of objects
without repeating any object,
with repetition of objects permitted .
Arrangements or selections in (1) in which order is taken into consideration
are generally called permutations, whereas arrangements or selections in
(2) in which order is irrelevant are generally called combinations.
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 6 / 16
Examples
1 How many odd numbers between 1000 and 9999 have distinct digits?
A number between 1000 and 9999 is an ordered arrangement of four
digits. Thus we are asked to count a certain collection of permutations.
We have four choices to make: a units, a tens, a hundreds, and a
thousands digit.
Since the numbers we want to count are odd, the units digit can be
anyone of 1,3,5,7,9.
The tens and the hundreds digit can be anyone of 0, 1, ... ,9, while the
thousands digit can be anyone of 1,2, ... ,9.
Thus, there are five choices for the units digit. Since the digits are to
be distinct, we have eight choices for the thousands digit. Then, there
are eight choices for the hundreds digit, and seven choices for the tens
digit.
Thus, by the multiplication principle, the answer to the question is 5 x
8 x 8 x 7 = 2240.
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 7 / 16
2 How many different five-digit numbers can be constructed out of the
digits 1, 1, 1, 3, 8?
Here we are asked to count permutations of a multiset with three
objects of one type, one of another, and one of a third.
We really have only two choices to make: which position is to be
occupied by the 3 (five choices) and then which position is to be
occupied by the 8 (four choices).
The remaining three places are occupied by 1s
By the multiplication principle, the answer is 5 x 4 = 20.
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 8 / 16
Arrangements or Permutations
Distinctly ordered sets are called arrangements or permutations.
Factorial Representation. n! = n(n − 1)(n − 2)...3x 2x 1
Note 0! = 1
The number of permutations of n objects taken r at a time is given
n!
by: P(n, r ) = n Pr =
(n − r )!
where
n = number of objects
r = number of positions
Example. The number of four-letter words that can be formed by
using each of the letters a, b, c, d, e at most once is P(5,4), and this
equals 5!/(5 - 4)! = 120.
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 9 / 16
Example. A maths debaitng team consists of 4 speakers.
In how many ways can all 4 speakers be arranged in a row for a photo?
Solution : =P(4,4) = 4! = [Link] = 24
How many ways can the captain and vice-captain be chosen?
4!
Solution : = P(4, 2) = = 4.3 = 12
2!
Arrangements with Repetitions:
If we have n elements of which x are alike of one kind, y are alike of
another kind, are alike of another kind, then the number of ordered
selections or permutations is given by:
n!
x !y !z!
Example How many different arrangements of the word PARRAMATTA
are possible?
Solution : 10 letters but note repetition (4A’s, 2R’s, 2T’s)
10!
No. of arrangements = = 37800
4!2!2!
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 10 / 16
Unordered Selections or Combinations
The number of different combinations (i.e unordered sets) of r objects
from n distinct objects is represented by:
number of permutations
No. of combinations =
arrangements of r objects
and is denoted by
nP n!
n r
Cr = =
r! r !(n − r )!
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 11 / 16
Examples
1 How many ways can a basketball team of 5 players be chosen from 8
players?
Solution : = 8 C5
2 A committee of 5 people is to be chosen from a group of 5 men and 4
women. How many committees are possible if
there are no restrictions?
Solution : = 10 C5
one particular person must be chosen on the committee?
Solution : = 1 × 9 C4
one particular woman must be excluded from the committee?
Solution : = 9 C5
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 12 / 16
Exercise
1 If 4 maths books are selected from 6 different Maths books and 3
English books are chosen from 5 different English books, how many
ways can the seven books be arranged on a shelf:
a) If there are no restrictions?
b) If the 4 Maths books remain together?
c) a Maths book is at the beginning of the shelf
d) Maths and English books alternate
2 There are 15 people enrolled in a mathematics course, but exactly 12
attend on any given day. Find the number of ways that 12 students
can be chosen
3 How many seven-digit numbers are there such that the digits are
distinct integers taken from {I, 2, ... ,9} and such that the digits 5
and 6 do not appear consecutively in either order?
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 13 / 16
Binomial Theorem
Expand the product (A1 + B1 )(A2 + B2 )(A3 + B3 )(A4 + B4 ).
16 terms correspond to 16 length-4 sequences of A’s and B’s.
A1 A2 A3 A4 + A1 A2 A3 B4 + A1 A2 B3 A4 + A1 A2 B3 B4 +
A1 B2 A3 A4 + A1 B2 A3 B4 + A1 B2 B3 A4 + A1 B2 B3 B4 +
B1 A2 A3 A4 + B1 A2 A3 B4 + B1 A2 B3 A4 + B1 A2 B3 B4 +
B1 B2 A3 A4 + B1 B2 A3 B4 + B1 B2 B3 A4 + B1 B2 B3 B4
What happens to this sum if we erase subscripts?
(A + B)4 = B 4 + 4AB 3 + 6A2 B 2 + 4A3 B + A4
Coefficient of A2 B 2 is 6 because 6 length-4 sequences have 2 A’s and
2 B’s. !
n Pn n
Generally, (A + B) = r =0 Ar B n−r because there are n Cr
r
sequences with r A’s and (n-r) B’s
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 14 / 16
Multinomial coefficients
This is a higher dimensional analog of the binomal theorem.
i.e
!
n
x1n1 x2n2 ...xrnrr
X
n
(x1 + x2 + ... + xr ) =
n1 ,...,nr :n1 +...+nr =n
n1 ...nr
The sum on the right is taken over all collections (n1 , n2 , ..., nr ) of r
non-negative integers that add up to n.
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 15 / 16
More counting problems
1 A class of 27 students needs to be divided into 9 teams of three
students each? How many ways are there to do that?
2 You teach a class with 90 students. In a rather severe effort to
combat grade inflation, your department chair insists that you assign
the students exactly 10 A’s, 20 B’s, 30 C’s, 20 D’s, and 10 F’s. How
many ways to do this?
3 You have 90 (indistinguishable) pieces of pizza to divide among the
90 (distinguishable) students. How many ways to do that (giving
each student a non-negative integer number of slices)
MATH 174 - DISCRETE MATHEMATICS July 27, 2023 16 / 16