0% found this document useful (0 votes)
28 views45 pages

Disc-1-Ch-1 lectureDZ Final

chapter 1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views45 pages

Disc-1-Ch-1 lectureDZ Final

chapter 1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 45

Discrete mathematics

Chapter-1

1. Elementary counting principles


Motivation
• Combinatorics is the study of collections of
objects. Specifically, counting objects,
arrangement, derangement, etc. along with
their mathematical properties
• Counting objects is important in order to
analyze algorithms and compute discrete
probabilities
• Originally, combinatorics was motivated by
gambling: counting configurations is essential to
elementary probability 2
12/23/24 2
• In addition, combinatorics can be used as a proof
technique
– A combinatorial proof is a proof method that uses
counting arguments to prove a statement

12/23/24 3
Outline
• Introduction
• Basic Counting principles:
– Product rule, sum rule, Principal of Inclusion Exclusion (PIE)
• Permutations
• Combinations
• Pigeonhole principle
– Generalized forms
• Binomial Coefficients
• Binomial Theorems
• More Examples

12/23/24 4
Introduction
• This chapter develops some techniques for
determing, with out direct enumeration, the
number of possible outcomes of a particular
event or the number of elements in a set.
1.1 Basic counting principle
There are two basic counting principle such as sum
rule principle and product rule principle

12/23/24 5
Sum Rule principle: Suppose some event E can
occur in m ways and a second event F can
occur in n ways, and suppose both events can
not occur simultaneously. Then E or F can
occur in m+n ways.
Product rule principle: Suppose some event E
can occur in m ways and independent of this
event, there is a second event F which can
occur in n ways. Then the combination of E
and F can occur in m*n ways
12/23/24 6
• The above principles can be extended to three or
more events. That is , Suppose an event E1 can
occur in n1 ways, a second event E2 can occur in
n2 ways, and so on. Then:
• sum rule: If no two events can occur at the same
time, then one of the events occur in
n1 + n2 + … + nm-1 + nm
• Product rule: If the events occur one after the
other, then all the events can occur in the order
indicated in n1 * n2 * … * nm-1 * nm
• ways.
12/23/24 7
Example
Suppose a college has 3 different history courses, 4
different literature courses, and 2 different
sociology courses . Find the number of way a
A.Student can choose one of each kind of courses
B.Student can choose just one of the courses

12/23/24 8
1.2 Permutation & Combination
1.2.1: Factorial Function
The product of the positive integers from 1 to n
inclusive is denoted by n!,
read as “n factorial”
n!=n*(n-1)*(n-2)*…3*2*1
Example: 4!=4*3*2*1=24
Note: 0!=1 and 1!=1

12/23/24 9
Example
Compute and simplify the following:
1.6!, 7!,8!&9!

2.

12/23/24 10
1.2.2 Permutation
Defn: Any arrangement of a set of n objects in a
given order is called a permutation of the objects
[taken all at a time]
• Any arrangement of a set of r n objects in a
given order is called r-permutation of the objects
or a permutation the n objects taken r at a time

12/23/24 11
Example
• Consider the set of letters A,B,C&D. Then
1.BDCA,DCBA & ACDB are permutation of 4 letters
taken all at a time
2.BAD,ACB,DBC are permutation of the 4 letters
taken 3 at a time
3.AD, BC, CA are permutation of the 4 Letters taken
2 at a time.
The number of permutation of n objects taken r at
a time is denoted by P(n, r),given by
12/23/24 12
Example
Find the number of permutation of six objects, say
A,B,C,D,E,F, taken 3 at a time.
Ans:
Corollary: There are n! permutation of n objects
taken all at a time.[prove class work]
For example: There are 3!=6 permutation of the
letters A,B &C. These are ABC,ACB,CAB,CBA,BAC
& BCA

12/23/24 13
Permutations: Example
Example
In how many ways can six pupils stand in a line or linearly
arranged to pay their college fees at the finance office
counter? Ans: 6P6 = 6!

Evaluate: (a) 8p5 (b) 6p4


Ans: a. = 6720 b. = 360
Proposition 4 (Circular permutations)
The number of permutations of n objects around a circle, taken altogether, is given by: C=
(n-1)!
Note here that the order is important. It is necessary to distinguish
when the order matters and it does not
12/23/24 14
1.2.3 Permutation with repetitions
• We want to know the number of permutations of
a multiset, that is , a set of objects some of which
are a like

• Denote the number of permutations of n objects


of which n1 are alike ,n2 are like,… nr are alike.
Example: Find the number of seven letters words
that can be formed using the letters of the word
“BENZENE”
12/23/24 15
Example
• How many permutations of the word Mississipi are
there?
‘Mississipi’ has
– 4 distinct letters: m,i,s,p
– with 1,4,4,2 occurrences respectively
– Therefore, the number of permutations is

• Theorem: The number of r-permutations of a set of n


objects with repetition allowed is nr
…which is easily obtained by the product rule
12/23/24 16
1.2.4 Combinations
Let S be a set with n elements. A combination of
these n element where order doesn’t count.
Such selection is called an r-combination.
The number of such combination is donted by
given by
Example: Find the number of combination of 4
objects A,B,C,D taken 3 at a time
Q: What is the relation between combination and
permutation? P(n,r)=r!*c(n,r)
12/23/24 17
Example
A farmer buys 3 cows, 2 pigs ,and 4 hens from a
man who has 6 cows,5 pigs and 8 hens. Find the
number of choices the farmer has?
Soln: The farmer can choose the cows in c(6,3) ways
the pigs in c(5,2) ways and the hens in c(8,4)
ways. Thus the number of choices he has
c(6,3)* c(5,2)* c(8,4)=14000

12/23/24 18
Combinations: Example
• How many committees of 5 people can be chosen from 20 men and 12 women
– If exactly 3men must be on each committee?
– If at least 4 women must be on each committee?

• If exactly three men must be on each committee?


– We must choose 3 men and 2 women. The choices are not mutually exclusive, we use
the product rule

• If at least 4 women must be on each committee?


– We consider 2 cases: 4 women are chosen and 5 women are chosen. Theses choices
are mutually exclusive, we use the addition rule:

12/23/24 19
Combinations
• A useful fact about combinations is that they
are symmetric

• Corollary: Let n, k be nonnegative integers


with k  n, then

12/23/24 20
Combination with repetition
• Assume that A with n elements .Any selection
of r objects from A, where each object can be
selected more than once, is called a
combination of n objects taken r at a time
with repetition.
• Example: The combinations of the letters
a,b,c,d taken 3 at a time with repetition are:
aaa,aab,aac,abb,…,ddd

12/23/24 21
Note: The following are
equivalent

12/23/24 22
Example

12/23/24 23
1.3 The inclusion-exclusion
principles
Let A and B be any sets. Then

i.e to find n(AUB) of elements in the union of A and


B, we add n(A) and n(B) and then we subtract
n(AnB) or we include n(A) and n(B) and we
exclude n(AnB).
• Let A ,B and C be any sets

12/23/24 24
We include n(A),n(B),n(C),We exclude n(AnB),
n(AnC), n(BnC) and finally include n(AnBnC)
Example: Find the number of mathematics student
at a college taking at least one of the
languages ,French, German and Russian given
the following data:
65 study french,45 study german,42 study
Russian,20 study French and German,25 study
French and Russian,15 study German and Russian,8
study all three languages
12/23/24 25
General form of inclusion-
exclusion
• We can give another formulation in terms of sets.
Let A1, A2, …, Am be pairwise disjoint sets. Then
|A1  A2  …  Am | = |A1|  |A2|  …  |Am|

(In fact, this is a special case of the general Principal of


Inclusion-Exclusion (PIE))

12/23/24 26
• More generally, we have the following
• Lemma: Let A, B, be subsets of a finite set U. Then
1. |AB| = |A| + |B| - |AB|
2. |A  B|  min {|A|, |B|}
3. |A\B| = |A| - |AB|  |A|-|B|
4. |A| = |U| - |A|
5. |AB| =|AB|-|AB|= |A|+|B|-2|AB|= |A\B|+ |B\
A|
6. |A  B| = |A||B|

12/23/24 27
• Theorem: Let A1,A2, …,An be finite sets, then
|A1 A2 ...An|= i|Ai|
- i<j|Ai  Aj|
+ i<j<k|Ai  Aj  Ak|
-…
+(-1)n+1 |A1A2...An|
Each summation is over
• all i,
• pairs i,j with i<j,
• triples with i<j<k, etc.

12/23/24 28
PIE Theorem: Example 1
• To illustrate, when n=3, we have
|A1 A2 A3|= |A1|+ |A2| +|A3|
- [|A1A2|+|A1A3|+|A2A3|]
+|A1  A2  A3|

12/23/24 29
PIE Theorem: Example 2
• To illustrate, when n=4, we have
|A1A2A3A4|= |A1|+|A2|+|A3|+|A4|
- [|A1A2|+|A1A3|+|A1A4|
+|A2A3|+|A2A4|+|A3A4|]
+ [|A1A2A3|+|A1A2A4|
+|A1A3A4|+|A2A3A4|]
- |A1 A2 A3 A4|

12/23/24 30
Application of PIE: Example A (1)
• How many integers between 1 and 300 (inclusive) are
– Divisible by at least one of 3,5,7?
– Divisible by 3 and by 5 but not by 7?
– Divisible by 5 but by neither 3 or 7?
• Let
A = {nZ | (1  n  300) (3|n)}
B = {nZ | (1  n  300) (5|n)}
C = {nZ | (1  n  300) (7|n)}
• How big are these sets? We use the floor function
|A| = 300/3 = 100
|B| = 300/5 = 60
|C| = 300/7 = 42
12/23/24 31
Application of PIE: Example A (2)
• How many integers between 1 and 300 (inclusive) are divisible by at least
one of 3,5,7?
Answer: |AB C|
• By the principle of inclusion-exclusion
|AB C|= |A|+|B|+|C|-[|AB|+|AC|+|BC|]+|ABC|
• How big are these sets? We use the floor function
|A| = 300/3 = 100 |AB| = 300/15 = 20
|B| = 300/5 = 60 |AC| = 300/21 = 100
|C| = 300/7 = 42 |BC| = 300/35 = 8
|ABC| = 300/105 = 2
• Therefore:
|AB C| = 100 + 60 + 42 - (20+14+8) + 2 = 162

12/23/24 32
Application of PIE: Example A (3)
• How many integers between 1 and 300 (inclusive) are divisible by 3 and
by 5 but not by 7?
Answer: |(A  B)\C|
• By the definition of set-minus
|(A  B)\C| = |A  B| - |A  B  C| = 20 – 2 = 18

• Knowing that
|A| = 300/3 = 100 |AB| = 300/15 = 20
|B| = 300/5 = 60 |AC| = 300/21 = 100
|C| = 300/7 = 42 |BC| = 300/35 = 8
|ABC| = 300/105 = 2

12/23/24 33
Application of PIE: Example A (4)
• How many integers between 1 and 300 (inclusive) are divisible by 5 but by
neither 3 or 7?
Answer: |B\(A C)| = |B| - |B  (A C)|
• Distributing B over the intersection
|B  (A  C)| = |(B  A)  (B  C)|
= |B  A| + |B  C| - | (B  A)  (B  C) |
= |B  A| + |B  C| - | B  A  C |
= 20 + 8 – 2 = 26

• Knowing that
|A| = 300/3 = 100 |AB| = 300/15 = 20
|B| = 300/5 = 60 |AC| = 300/21 = 100
|C| = 300/7 = 42 |BC| = 300/35 = 8
|ABC| = 300/105 = 2

12/23/24 34
1.4 Pigeonhole Principle
• If n pigeonholes are occupied by n+1 or more
pigeons, then at least one pigeonhole is occupied by
more than one pigeon
• Theorem: If k+1 or more objects are placed in k
boxes, then there is at least one box containing two
or more objects
• This principal is a fundamental tool of elementary
discrete mathematics.
• It is also known as the Dirichlet Drawer Principle or
Dirichlet Box Pinciple
12/23/24 35
Pigeonhole Principle (2)
• It is seemingly simple but very powerful
• The difficulty comes in where and how to apply it
• Some simple applications in Computer Science
– Calculating the probability of hash functions having a
collision
– Proving that there can be no lossless compression
algorithm compressing all files to within a certain ration

12/23/24 36
Generalized Pigeonhole Principle (1)
• Theorem: If N objects are placed into k boxes then
there is at least one box containing at least

• Example: In any group of 367 or more people, at


least two of them must have been born on the same
date.

12/23/24 37
Example
Find the minimum number of students in a class to
be sure that three of them are born in the same
month.
Solution: n = 12, number of months in a year
(pigeonholes) k+1 = 3 → k= 2.
Hence k*n+1 = 2*12+1=25
• Therefore the minimum number of students in a
class to be sure that three of them are in the
same class is 25.
12/23/24 38
1.5 Binomial Theorem
• The number of r-combinations is also called the
binomial coefficient

• The binomial coefficients are the coefficients in the


expansion of the expression, (multivariate
polynomial),
(x+y)n

• A binomial is a sum of two terms

12/23/24 39
Binomial Coefficients
• Theorem: Binomial Theorem
Let x, y, be variables and let n be a nonnegative integer. Then

Expanding the summation we have

Example

12/23/24 40
Binomial Coefficients: Example
• What is the coefficient of the term x8y12 in the
expansion of (3x+4y)20?
– By the binomial theorem, we have

– When j=12, we have

– The coefficient is

12/23/24 41
Binomial Coefficients (3)
• Many useful identities and facts come from the
Binomial Theorem
• Corollary:

Equalities are based on (1+1)n=2n, ((-1)+1)n=0n, (1+2)n=3n

12/23/24 42
Binomial Coefficients (4)
• Theorem: Vandermonde’s Identity
Let m,n,r be nonnegative integers with r not exceeding either
m or n. Then

• Corollary: If n is a nonnegative integer then

• Corollary: Let n,r be nonnegative integers, rn, then

12/23/24 43
Binomial Coefficients: Pascal’s Identity & Triangle

• The following is known as Pascal’s identity which gives a


useful identity for efficiently computing binomial coefficients
• Theorem: Pascal’s Identity
Let n,k Z+ with nk, then

Pascal’s Identity forms the basis of a geometric object known


as Pascal’s Triangle

12/23/24 44
Pascal’s Triangle

12/23/24 45

You might also like