Lecture 14 MTL180
Lecture 14 MTL180
Lecture 14 — 19/09/2024
Lecturer: Prof Minati De Scribe:
Scribed by:
Why is counting important: Counting is essential for determining the number of possible
outcomes in various scenarios. Permutation and combination problems help solve arrangements
and selections, providing a foundation for probability and decision-making.
|A ∪ B| = |A| + |B|
|A − B| = |A| − |B|
1
1.1.3 Rule of Product
Let X and Y be two finite sets. Then the number of pairs (a, b), where a ∈ X and b ∈ Y , is:
|X| × |Y |
Let X and Y be two sets. Let f : X → Y be a d-to-1 function (i.e., for each element in Y , there
are exactly d pre-images in X). Then:
|X|
|Y | =
d
2 Examples
Problem: Find the number of positive integers less than 1000 that have at least two different
digits.
Solution: We can solve this using the rule of subtraction (i.e., total cases minus the non-favorable
cases).
• The total number of integers less than 1000 is 999 (since we are counting from 1 to 999).
• The non-favorable cases are the integers that have all digits the same. These include numbers
like 1,2, 11, 22, 111, 222, and 999 etc. Total non-favorable cases = 9 + 9 + 9 = 27.
Therefore, there are 972 positive integers less than 1000 that have at least two different digits.
A permutation of a set of distinct objects is an ordered arrangement of these objects. The number
of ways to arrange r objects from a set of n distinct objects is given by:
n!
P (n, r) = n(n − 1)(n − 2) . . . (n − r + 1) =
(n − r)!
2
3.2 Example 2: Counting Functions f : X → Y
Problem: Count the number of one-to-one functions from X → Y , where m ≥ n (i.e., the
codomain has at least as many elements as the domain).
Solution: A one-to-one function is a function in which each element of X is mapped to a unique
element of Y . To count the number of such functions, we can use the following logic:
• For the second element, there are m − 1 choices (since the function is one-to-one and we
cannot repeat the previous value).
• For the third element, there are m − 2 choices, and so on, until there are m − (n − 1) choices
for the last element.
The number of ways to select r elements from a set of n distinct elements is denoted as C(n, r),
and is given by:
P (n, r) n!
C(n, r) = =
r! r!(n − r)!
The values of C(n, r) are known as binomial coefficients, and they appear in the expansion of
(1 + x)n as:
Xn
(1 + x)n = C(n, r)xr
r=0
3
4.2 Example: The Identity C(n + 1, r) = C(n, r) + C(n, r − 1)
Proof: Consider a set of n + 1 elements, and we want to select r elements. We can divide the
selections into two cases:
• Case 1: The (n + 1)-th element is not selected. In this case, we are left to select r elements
from the first n elements. This can be done in C(n, r) ways.
• Case 2: The (n + 1)-th element is selected. In this case, we need to select r − 1 elements from
the first n elements, which can be done in C(n, r − 1) ways.
Therefore, by considering both cases, the total number of ways to select r elements from n + 1
elements is:
C(n + 1, r) = C(n, r) + C(n, r − 1)
This proves the identity combinatorially.
Proof: Consider a set of m + n elements, where the first m elements are of one type and the
remaining n elements are of another type. We want to select r elements from this set.
To do so, we can split the selection into two parts:
• First, select k elements from the m elements. This can be done in C(m, k) ways.
• Then, select the remaining r−k elements from the n elements. This can be done in C(n, r−k)
ways.
By summing over all possible values of k (i.e., from 0 to r), we account for all possible ways to
select r elements from the total m + n elements. Thus:
r
X
C(m + n, r) = C(m, k)C(n, r − k)
k=0
4
Solution:
10
D(10) = − 10
2
Exercise: If no 3 lines intersect at a common point and we have n lines, then find the number of
points of intersection.