0% found this document useful (0 votes)
101 views74 pages

Discrete Mathematics: Ay Seg Ul Gen Cata Yayımlı H. Turgut Uyar

This document discusses counting and enumeration in discrete mathematics. It introduces basic counting principles like the sum rule and product rule for counting the number of possible outcomes of multi-step processes. It also covers permutations and arrangements, explaining that permutations involve ordering and arrangements involve ordering with indistinguishable objects. Examples are provided to demonstrate counting the number of permutations and arrangements in different scenarios.

Uploaded by

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

Discrete Mathematics: Ay Seg Ul Gen Cata Yayımlı H. Turgut Uyar

This document discusses counting and enumeration in discrete mathematics. It introduces basic counting principles like the sum rule and product rule for counting the number of possible outcomes of multi-step processes. It also covers permutations and arrangements, explaining that permutations involve ordering and arrangements involve ordering with indistinguishable objects. Examples are provided to demonstrate counting the number of permutations and arrangements in different scenarios.

Uploaded by

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

Discrete Mathematics

Counting

Ayşegül Gençata Yayımlı H. Turgut Uyar

2013-2016
License


c 2013-2016 A. Yayımlı, T. Uyar
You are free to:
Share – copy and redistribute the material in any medium or format
Adapt – remix, transform, and build upon the material
Under the following terms:
Attribution – You must give appropriate credit, provide a link to the license,
and indicate if changes were made.
NonCommercial – You may not use the material for commercial purposes.
ShareAlike – If you remix, transform, or build upon the material, you must
distribute your contributions under the same license as the original.
For more information:
https://creativecommons.org/licenses/by-nc-sa/4.0/
Read the full license:
https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
Topics

1 Combinatorics
Introduction
Basic Principles

2 Permutations
Introduction
Circular Arrangements

3 Combinations
Introduction
With Repetition
Topics

1 Combinatorics
Introduction
Basic Principles

2 Permutations
Introduction
Circular Arrangements

3 Combinations
Introduction
With Repetition
Combinatorics

combinatorics: study of arrangement of objects


enumeration: counting of objects with certain properties

to solve a complicated problem:


break it down into smaller problems
piece together solutions to these smaller problems
Combinatorics

combinatorics: study of arrangement of objects


enumeration: counting of objects with certain properties

to solve a complicated problem:


break it down into smaller problems
piece together solutions to these smaller problems
Topics

1 Combinatorics
Introduction
Basic Principles

2 Permutations
Introduction
Circular Arrangements

3 Combinations
Introduction
With Repetition
Sum Rule

task1 can be performed in n1 distinct ways


task2 can be performed in n2 distinct ways
task1 and task2 cannot be performed simultaneously

performing either task1 or task2 can be accomplished


in n1 + n2 ways
Sum Rule

task1 can be performed in n1 distinct ways


task2 can be performed in n2 distinct ways
task1 and task2 cannot be performed simultaneously

performing either task1 or task2 can be accomplished


in n1 + n2 ways
Sum Rule Example

a college library has 40 textbooks on sociology,


and 50 textbooks on anthropology

to learn about sociology or anthropology


a student can choose from 40 + 50 = 90 textbooks
Sum Rule Example

a computer science instructor has two colleagues


one colleague has 3 textbooks on “Introduction to Programming”
the other colleague has 5 textbooks on the same subject

n: maximum number of different books that can be borrowed


5≤n≤8
both colleagues may own copies of the same book
Product Rule

a procedure can be broken down into stage1 and stage2


n1 possible outcomes for stage1
for each of these, n2 possible outcomes for stage2

procedure can be carried out in n1 · n2 ways


Product Rule Example

drama club is holding tryouts for a play


6 men and 8 women auditioning for the leading roles

director can cast leading couple in 6 · 8 = 48 ways


Product Rule Example

license plates with 2 letters, followed by 4 digits


how many possible plates?

no letter or digit can be repeated:


26 · 25 · 10 · 9 · 8 · 7 = 3, 276, 000

repetitions allowed:
26 · 26 · 10 · 10 · 10 · 10 = 6, 760, 000

repetitions allowed, only vowels and even digits:


5 · 5 · 5 · 5 · 5 · 5 = 15, 625
Product Rule Example

license plates with 2 letters, followed by 4 digits


how many possible plates?

no letter or digit can be repeated:


26 · 25 · 10 · 9 · 8 · 7 = 3, 276, 000

repetitions allowed:
26 · 26 · 10 · 10 · 10 · 10 = 6, 760, 000

repetitions allowed, only vowels and even digits:


5 · 5 · 5 · 5 · 5 · 5 = 15, 625
Product Rule Example

license plates with 2 letters, followed by 4 digits


how many possible plates?

no letter or digit can be repeated:


26 · 25 · 10 · 9 · 8 · 7 = 3, 276, 000

repetitions allowed:
26 · 26 · 10 · 10 · 10 · 10 = 6, 760, 000

repetitions allowed, only vowels and even digits:


5 · 5 · 5 · 5 · 5 · 5 = 15, 625
Product Rule Example

license plates with 2 letters, followed by 4 digits


how many possible plates?

no letter or digit can be repeated:


26 · 25 · 10 · 9 · 8 · 7 = 3, 276, 000

repetitions allowed:
26 · 26 · 10 · 10 · 10 · 10 = 6, 760, 000

repetitions allowed, only vowels and even digits:


5 · 5 · 5 · 5 · 5 · 5 = 15, 625
Product Rule Example

a byte consists of 8 bits


a bit has two possible values: 0 or 1

number of possible values for a byte:


2 · 2 · · · 2 = 28 = 256
Counting Example

pastry shop menu:


6 kinds of muffins, 8 kinds of sandwiches
hot coffee, hot tea, icea tea, cola, orange juice

buy either a muffin and a hot beverage,


or a sandwich and a cold beverage
how many possible purchases?

muffin and hot beverage: 6 · 2 = 12


sandwich and cold beverage: 8 · 3 = 24
total: 12 + 24 = 36
Counting Example

pastry shop menu:


6 kinds of muffins, 8 kinds of sandwiches
hot coffee, hot tea, icea tea, cola, orange juice

buy either a muffin and a hot beverage,


or a sandwich and a cold beverage
how many possible purchases?

muffin and hot beverage: 6 · 2 = 12


sandwich and cold beverage: 8 · 3 = 24
total: 12 + 24 = 36
Topics

1 Combinatorics
Introduction
Basic Principles

2 Permutations
Introduction
Circular Arrangements

3 Combinations
Introduction
With Repetition
Permutation

permutation: a linear arrangement of distinct objects


order important
Permutation Example

a class has 10 students: A, B, C , . . . , I , J


4 students are to be seated in a row for a picture:
BCEF , CEFI , ABCF , . . .
how many such arrangements?

filling of a position: a stage of the counting procedure


10 · 9 · 8 · 7 = 5, 040
Permutation Example

a class has 10 students: A, B, C , . . . , I , J


4 students are to be seated in a row for a picture:
BCEF , CEFI , ABCF , . . .
how many such arrangements?

filling of a position: a stage of the counting procedure


10 · 9 · 8 · 7 = 5, 040
Permutation Example

6·5·4·3·2·1
10 · 9 · 8 · 7 = 10 · 9 · 8 · 7 ·
6·5·4·3·2·1
10!
=
6!
Permutation Example

6·5·4·3·2·1
10 · 9 · 8 · 7 = 10 · 9 · 8 · 7 ·
6·5·4·3·2·1
10!
=
6!
Permutations

n distinct objects
number of permutations of size r (where 1 ≤ r ≤ n):

P(n, r ) = n · (n − 1) · (n − 2) · · · (n − r + 1)
n!
=
(n − r )!

if repetitions are allowed: nr


Permutations

n distinct objects
number of permutations of size r (where 1 ≤ r ≤ n):

P(n, r ) = n · (n − 1) · (n − 2) · · · (n − r + 1)
n!
=
(n − r )!

if repetitions are allowed: nr


Permutations Example

if size equals number of objects: r = n


n! n!
P(n, n) = = = n!
(n − n)! 0!

example

number of permutations of the letters in “COMPUTER”:


8!
Permutations Example

if size equals number of objects: r = n


n! n!
P(n, n) = = = n!
(n − n)! 0!

example

number of permutations of the letters in “COMPUTER”:


8!
Arrangements Example

number of arrangements of the letters in “BALL”


two L’s are indistinguishable
A B L L L A B L
A L B L L A L B
A L L B L B A L
B A L L L B L A
B L A L L L A B
B L L A L L B A

4!
number of arrangements: 2 = 12
Arrangements Example

number of arrangements of the letters in “BALL”


two L’s are indistinguishable
A B L L L A B L
A L B L L A L B
A L L B L B A L
B A L L L B L A
B L A L L L A B
B L L A L L B A

4!
number of arrangements: 2 = 12
Arrangements Example

arrangements of all letters in “DATABASES“

for each arrangement where A’s are indistinguishable,


3! = 6 arrangements where A’s are distinguishable:
DA1 TA2 BA3 SES, DA1 TA3 BA2 SES, DA2 TA1 BA3 SES,
DA2 TA3 BA1 SES, DA3 TA1 BA2 SES, DA3 TA2 BA1 SES
for each of these, 2 arrangements where S’s are distinguishable:
DA1 TA2 BA3 S1 ES2 , DA1 TA2 BA3 S2 ES1
9!
number of arrangements: 2!·3! = 30, 240
Arrangements Example

arrangements of all letters in “DATABASES“

for each arrangement where A’s are indistinguishable,


3! = 6 arrangements where A’s are distinguishable:
DA1 TA2 BA3 SES, DA1 TA3 BA2 SES, DA2 TA1 BA3 SES,
DA2 TA3 BA1 SES, DA3 TA1 BA2 SES, DA3 TA2 BA1 SES
for each of these, 2 arrangements where S’s are distinguishable:
DA1 TA2 BA3 S1 ES2 , DA1 TA2 BA3 S2 ES1
9!
number of arrangements: 2!·3! = 30, 240
Arrangements Example

arrangements of all letters in “DATABASES“

for each arrangement where A’s are indistinguishable,


3! = 6 arrangements where A’s are distinguishable:
DA1 TA2 BA3 SES, DA1 TA3 BA2 SES, DA2 TA1 BA3 SES,
DA2 TA3 BA1 SES, DA3 TA1 BA2 SES, DA3 TA2 BA1 SES
for each of these, 2 arrangements where S’s are distinguishable:
DA1 TA2 BA3 S1 ES2 , DA1 TA2 BA3 S2 ES1
9!
number of arrangements: 2!·3! = 30, 240
Arrangements Example

arrangements of all letters in “DATABASES“

for each arrangement where A’s are indistinguishable,


3! = 6 arrangements where A’s are distinguishable:
DA1 TA2 BA3 SES, DA1 TA3 BA2 SES, DA2 TA1 BA3 SES,
DA2 TA3 BA1 SES, DA3 TA1 BA2 SES, DA3 TA2 BA1 SES
for each of these, 2 arrangements where S’s are distinguishable:
DA1 TA2 BA3 S1 ES2 , DA1 TA2 BA3 S2 ES1
9!
number of arrangements: 2!·3! = 30, 240
Generalized Rule

n objects
n1 indistinguishable objects of type1
n2 indistinguishable objects of type2
...
nr indistinguishable objects of typer
n1 + n2 + ... + nr = n

number of linear arrangements:


n!
n1 ! · n2 ! · · · nr !
Generalized Rule

n objects
n1 indistinguishable objects of type1
n2 indistinguishable objects of type2
...
nr indistinguishable objects of typer
n1 + n2 + ... + nr = n

number of linear arrangements:


n!
n1 ! · n2 ! · · · nr !
Arrangements Example

go from (2, 1) to (7, 4)


each step one unit to the right (R)
or one unit upwards (U)
RURRURRU, URRRUURR
how many such paths?

each path consists of 5 R’s and 3 U’s


8!
number of paths: 5!·3! = 56
Arrangements Example

go from (2, 1) to (7, 4)


each step one unit to the right (R)
or one unit upwards (U)
RURRURRU, URRRUURR
how many such paths?

each path consists of 5 R’s and 3 U’s


8!
number of paths: 5!·3! = 56
Topics

1 Combinatorics
Introduction
Basic Principles

2 Permutations
Introduction
Circular Arrangements

3 Combinations
Introduction
With Repetition
Circular Arrangements Example

6 people seated around a round table: A, B, C , D, E , F


arrangements considered to be the same
when one can be obtained from the other by rotation:
ABEFCD, DABEFC , CDABEF , FCDABE , EFCDAB, BEFCDA
how many different circular arrangements?

each circular arrangement corresponds to 6 linear arrangements


6!
number of circular arrangements: 6 = 120
Circular Arrangements Example

6 people seated around a round table: A, B, C , D, E , F


arrangements considered to be the same
when one can be obtained from the other by rotation:
ABEFCD, DABEFC , CDABEF , FCDABE , EFCDAB, BEFCDA
how many different circular arrangements?

each circular arrangement corresponds to 6 linear arrangements


6!
number of circular arrangements: 6 = 120
Topics

1 Combinatorics
Introduction
Basic Principles

2 Permutations
Introduction
Circular Arrangements

3 Combinations
Introduction
With Repetition
Combination

combination: choosing from distinct objects


order not important
Combination Example

a deck of 52 playing cards


4 suits: clubs, diamonds, hearts, spades
13 ranks in each suit: Ace, 2, 3, . . . , 10, Jack, Queen, King
draw 3 cards in succession, without replacement
how many possible draws?

52!
52 · 51 · 50 = = P(52, 3) = 132, 600
49!
Combination Example

a deck of 52 playing cards


4 suits: clubs, diamonds, hearts, spades
13 ranks in each suit: Ace, 2, 3, . . . , 10, Jack, Queen, King
draw 3 cards in succession, without replacement
how many possible draws?

52!
52 · 51 · 50 = = P(52, 3) = 132, 600
49!
Combination Example

one such draw:


AH (ace of hearts), 9C (9 of clubs), KD (king of diamonds)

if order doesn’t matter


6 permutations of (AH, 9C , KD) correspond to just one selection
52!
= 22, 100
3! · 49!
Combination Example

one such draw:


AH (ace of hearts), 9C (9 of clubs), KD (king of diamonds)

if order doesn’t matter


6 permutations of (AH, 9C , KD) correspond to just one selection
52!
= 22, 100
3! · 49!
Number of Combinations

n distinct objects
each combination of r objects: r ! permutations of size r

number of combinations of size r (where 0 ≤ r ≤ n):


 
n P(n, r ) n!
C (n, r ) = = =
r r! r ! · (n − r )!
Number of Combinations

n distinct objects
each combination of r objects: r ! permutations of size r

number of combinations of size r (where 0 ≤ r ≤ n):


 
n P(n, r ) n!
C (n, r ) = = =
r r! r ! · (n − r )!
Number of Combinations

number of combinations:
n!
C (n, r ) =
r ! · (n − r )!

note that:

C (n, 0) = 1 = C (n, n)
C (n, 1) = n = C (n, n − 1)
Number of Combinations

number of combinations:
n!
C (n, r ) =
r ! · (n − r )!

note that:

C (n, 0) = 1 = C (n, n)
C (n, 1) = n = C (n, n − 1)
Number of Combinations Example

Lynn and Patti buy a powerball ticket


match five numbers selected from 1 to 49
and then match powerball, 1 to 42
how many possible tickets?

Lynn selects five numbers from 1 to 49: C (49, 5)


Patti selects the powerball from 1 to 42: C (42, 1)
possible tickets: 49
 42
5 1 = 80, 089, 128
Number of Combinations Example

Lynn and Patti buy a powerball ticket


match five numbers selected from 1 to 49
and then match powerball, 1 to 42
how many possible tickets?

Lynn selects five numbers from 1 to 49: C (49, 5)


Patti selects the powerball from 1 to 42: C (42, 1)
possible tickets: 49
 42
5 1 = 80, 089, 128
Number of Combinations Examples

for a volleyball team, gym teacher must select nine girls


from junior and senior classes
28 junior and 25 senior candidates
how many different ways?

if no restrictions: 53

9 = 4, 431, 613, 550
if two juniors and one senior are
 best spikers
and must be on the team: 50 6 = 15, 890, 700
if there
 has to be four juniors and five seniors:
28 25
4 5 = 1, 087, 836, 750
Number of Combinations Examples

for a volleyball team, gym teacher must select nine girls


from junior and senior classes
28 junior and 25 senior candidates
how many different ways?

if no restrictions: 53

9 = 4, 431, 613, 550
if two juniors and one senior are
 best spikers
and must be on the team: 50 6 = 15, 890, 700
if there
 has to be four juniors and five seniors:
28 25
4 5 = 1, 087, 836, 750
Number of Combinations Examples

for a volleyball team, gym teacher must select nine girls


from junior and senior classes
28 junior and 25 senior candidates
how many different ways?

if no restrictions: 53

9 = 4, 431, 613, 550
if two juniors and one senior are
 best spikers
and must be on the team: 50 6 = 15, 890, 700
if there
 has to be four juniors and five seniors:
28 25
4 5 = 1, 087, 836, 750
Number of Combinations Examples

for a volleyball team, gym teacher must select nine girls


from junior and senior classes
28 junior and 25 senior candidates
how many different ways?

if no restrictions: 53

9 = 4, 431, 613, 550
if two juniors and one senior are
 best spikers
and must be on the team: 50 6 = 15, 890, 700
if there
 has to be four juniors and five seniors:
28 25
4 5 = 1, 087, 836, 750
Binomial Theorem

Theorem
if x and y are variables and n is a positive integer, then:
     
n n 0 n n 1 n−1 n 2 n−2
(x + y ) = x y + x y + x y + ···
0 1 2
   
n n n 0
+ x n−1 y 1 + x y
n−1 n
n  
X n k n−k
= x y
k
k=0

n

k : binomial coefficient
Binomial Theorem Examples

in the expansion of (x + y )7 , coefficient of x 5 y 2 :


7 7

5 = 2 = 21
Multinomial Theorem

Theorem
For positive integers n, t, the coefficient of x1n1 x2n2 x3n3 · · · xtnt
in the expansion of (x1 + x2 + x3 + · · · + xt )n is

n!
n1 ! · n2 ! · n3 ! · · · nt !
where each ni is an integer with 0 ≤ ni ≤ n, for all 1 ≤ i ≤ t, and
n1 + n2 + n3 + ... + nt = n.
Multinomial Theorem Examples

in the expansion of (x + y + z)7 , coefficient of x 2 y 2 z 3 :


 
7 7!
= = 210
2, 2, 3 2! · 2! · 3!
Topics

1 Combinatorics
Introduction
Basic Principles

2 Permutations
Introduction
Circular Arrangements

3 Combinations
Introduction
With Repetition
Combinations with Repetition Example

7 students visit a restaurant


each of them orders one of the following:
cheeseburger (c), hot dog (h), taco (t), fish sandwich (f)
how many different purchases are possible?
Combinations with Repetition Example

c c h h t t f x x | x x | x x | x
c c c c h t f x x x x | x | x | x
c c c c c c f x x x x x x | | | x
h t t f f f f | x | x x | x x x x
t t t t t t t | | x x x x x x x |
f f f f f f f | | | x x x x x x x

enumerate all arrangements of 10 symbols


consisting of seven x’s and three |’s
10!
= 10

number of different purchases: 7!·3! 7 = 120
Number of Combinations with Repetition

select, with repetition, r of n distinct objects


considering all arrangements of r x’s and n − 1 |’s
 
(n + r − 1)! n+r −1
=
r ! · (n − 1)! r
Number of Combinations with Repetition Example

distribute 7 bananas and 6 oranges among 4 children


each child receives at least one banana
how many ways?

step 1: give each child a banana


step 2: distribute 3 bananas to 4 children
1 1 1 0 b | b | b |
1 0 2 0 b | | b b |
0 0 1 2 | | b | b b
0 0 0 3 | | | b b b

C (6, 3) = 20 ways
Number of Combinations with Repetition Example

distribute 7 bananas and 6 oranges among 4 children


each child receives at least one banana
how many ways?

step 1: give each child a banana


step 2: distribute 3 bananas to 4 children
1 1 1 0 b | b | b |
1 0 2 0 b | | b b |
0 0 1 2 | | b | b b
0 0 0 3 | | | b b b

C (6, 3) = 20 ways
Number of Combinations with Repetition Example

distribute 7 bananas and 6 oranges among 4 children


each child receives at least one banana
how many ways?

step 1: give each child a banana


step 2: distribute 3 bananas to 4 children
1 1 1 0 b | b | b |
1 0 2 0 b | | b b |
0 0 1 2 | | b | b b
0 0 0 3 | | | b b b

C (6, 3) = 20 ways
Number of Combinations with Repetition Example

step 3: distribute 6 oranges to 4 children


1 2 2 1 o | o o | o o | o
1 2 0 3 o | o o | | o o o
0 3 3 0 | o o o | o o o |
0 0 0 6 | | | o o o o o o

C (9, 6) = 84 ways

step 4: by the rule of product: 20 · 84 = 1, 680 ways


Number of Combinations with Repetition Example

step 3: distribute 6 oranges to 4 children


1 2 2 1 o | o o | o o | o
1 2 0 3 o | o o | | o o o
0 3 3 0 | o o o | o o o |
0 0 0 6 | | | o o o o o o

C (9, 6) = 84 ways

step 4: by the rule of product: 20 · 84 = 1, 680 ways


Number of Combinations with Repetition Example

step 3: distribute 6 oranges to 4 children


1 2 2 1 o | o o | o o | o
1 2 0 3 o | o o | | o o o
0 3 3 0 | o o o | o o o |
0 0 0 6 | | | o o o o o o

C (9, 6) = 84 ways

step 4: by the rule of product: 20 · 84 = 1, 680 ways


References

Required Reading: Grimaldi

Chapter 1: Fundamental Principles of Counting


1.1. The Rules of Sum and Product
1.2. Permutations
1.3. Combinations
1.4. Combinations with Repetition

You might also like