53
Chapter 1. Combinatorial Analysis – Introduction • Basic principle of counting • The mathematical theory of counting is known as combinatorial analysis. – Permutations – Combinations 1

Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Embed Size (px)

Citation preview

Page 1: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Chapter 1. Combinatorial Analysis – Introduction

• Basic principle of counting

• The mathematical theory of counting is known as combinatorial analysis.– Permutations– Combinations

1

Page 2: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Introductory example

• n antennas lined up in a linear order. The system is functional as long as no two consecutive antennas are defective. If it turns out that exactly m of the n antennas are defective, what is the probability that the resulting system will be functional? For instance n = 4 and m = 2.

2

Page 3: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

3

Page 4: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

The basic principle of counting

• Suppose that two experiments are to be performed. Then if experiment 1 can result in any one of m possible outcomes and if for each outcome of experiment 1 there are n possible outcomes of experiment 2, then together there are mn possible outcomes of the two experiments.

4

Page 5: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Proof by enumeration

• A student takes two courses in a semester and each course can result in one of the five possible grades: A, B, C, D and F.

• How many different outcomes can the student get for the semester?

5

Page 6: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

A different question

• A student will take one of two possible courses in a semester and each course can result in one of the five possible grades: A, B, C, D and F.

• How many different outcomes can the student get for the semester?

6

Page 7: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 2a

A small community consists of 10 women each with 3 children. If one woman and one of her children are to be chosen as mother and child of the year, how many different choices are possible? How about if one woman and one child of any woman are to be chosen? How about if one woman or one children is to be chosen as person of the year?

10 × 3 = 30

10 × 30 = 300

10 + 30 = 407

Page 8: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Generalized basic principle of counting

• If r experiments that are to be performed are such that the first one may result in any of n1 possible outcomes, and if for each of the n1 possible outcomes there are n2 possible outcomes of the second experiment and if for each of the possible outcomes of the first two experiments there are n3 possible outcomes of the third experiments, and if …, then there is a total of n1n2 … nr-1nr possible outcomes of the r experiments.

8

Page 9: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 2b

A college planning committee consists of 3 freshmen, 4 sophomores, 5 juniors and 2 seniors. A subcommittee of 4, consisting of 1 person from each class, is to be chosen. How many different subcommittees are possible?

3 × 4 × 5 × 2 = 120

9

Page 10: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

What is the number of vehicles in US in 2009?

• A: < 100,000,000

• B: 100,000,000 – 200,000,000

• C: 200,000,000 – 300,000,000

• D: 300,000,000 – 400,000,000

• E: > 400,000,000

254,212,610 in 2009

10

Page 11: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex 2c

• How many different 7-place license plates are possible if the first 3 places are to be occupied by letters and the final 4 by numbers?

26×26×26×10×10×10×10 = 175,760,000

• How about if repetition among letters and numbers were prohibited?

26×25×24×10×9×8×7 = 78,624,000

11

Page 12: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Permutations

• Often we are interested in the different orders of some objects. – For example, people may want to rank some products, A,

B, C and their order can be ABC, ACB, BAC, BCA, CAB, CBA, totally 6 possible ranking orders. Each arrangement is called a permutation. There are totally 6 possible permutations.

– Matching a set of n distinct things to another set of n distinct things where each one in the first set need to be matched to one and only one in the second set.

• Can we come out with a formula to compute the total number of permutations? Suppose we have n objects.n(n-1)(n-2)…3·2·1 = n!

12

Page 13: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex 3a

•How many different batting orders are possible for a baseball team consisting of 9 players?

•9*8*7*6*5*4*3*2*1 = 9!

13

Page 14: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex 3b• A class in probability theory consists of 6 men

and 4 women. An examination is given, and the students are ranked according to their performance. Assume that no two students obtain the same score.

• a) how many different rankings are possible?10*9*8*7*6*5*4*3*2*1 = 10!

• b) If the men are ranked among themselves and the women among themselves, how many different rankings are possible?

Rankings for men: 6!Rankings for women: 4!Ranking for all: (6!)(4!) = (720)(24)

14

Page 15: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex 3c

• Ms Jones has 10 books that she is going to put on her bookshelf. Of there, 4 are mathematics books, 3 are chemistry books, 2 are history books, and 1 is a language book. Jones wants to arrange her books so that all the books dealing with the same subject are together on the shelf. How many different arrangement are possible?

15

Page 16: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Divide and Conquer!

• 1 Divide: Divide a complex process into several smaller, easier steps.– This step can be crucial and you need to learn to

master it.

• 2 Conquer: Solve each step separately.– This should be easier– If not, maybe you want to go back to Divide step.– put everything together

• Divide and conquer can be very useful in your work and daily life, too!

16

Page 17: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex. 3c Divide• Step 1: We can first arrange the four subjects:

math, chemistry, history and language.

• Step 2: We can then arrange 4 math books among themselves

• Step 3: We can then arrange 3 chemistry books

• Step 4: Arrange 2 history books

• Step 5: Arrange 1 language book

17

Page 18: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex. 3c Conquer

• Step 1: arrange the four subjects: math, chemistry, history and language.– 4*3*2*1 = 4!

• Step 2: arrange 4 math books among themselves– 4*3*2*1 = 4!

• Step 3: arrange 3 chemistry books– 3!

• Step 4: History books– 2!

• Step 5: Language book– 1

18

Page 19: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex. 3C Putting things together

• The total number of ways to arrange all the books is– Number of arrangements in the 1st step * # of

arrangement in the 2nd step * # of arrangement in the 3rd step * # in the 4th step * # in the 5th step.

• 4!4!3!2!1! = 6921

19

Page 20: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Number of permutations of a set of n objects when certain of them are indistinguishable from each other.

• Ex 3d

How many different letter arrangements can be formed using the letters P E P P E R?

20

Page 21: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• There are 6! permutations if the Ps and Es are different: P1E1P2P3E2R

• Look at one particular permutation: P1P2E1P3E2R, if we permute the P’s among themselves and E’s among themselves, then the arrangement would still be of the form PPEPER, and that is 3!2! permutations are of the form PPEPER.

• If X is the number of arrangement we want to compute then we haveX * 3!2! = 6!X = 6! / (3!2!)

21

Page 22: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• In general, the same reasoning as that used in Ex 3d shows that there are n!/(n1!n2!...nr!) different permutations of n objects, of which n1 are alike, n2 are alike, … nr are alike.

22

Page 23: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Ex 3e

A chess tournament has 10 competitors of which 4 are Russian, 3 are from the United States, 2 from Great Britain, and 1 from Brazil. If the tournament result lists just the nationalities of the players in the order in which they places, how many outcomes are possible?

n = 10 competitors. Among them, n1 = 4 are alike (Russian), n2 = 3 are alike (US), n3 = 2 are alike (GB), and n4 = 1 are alike (Brazil).

n!/(n1!n2!n3n4!) =10!/(4!3!2!1!) = 12,60023

Page 24: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Combinations

• The number of different groups of r objects that could be formed from a total of n objects.

• How many different groups of 3 could be selected from the 5 items A, B, C, D, and E?

• 5*4*3/(3*2*1) = 10

24

Page 25: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• In general, the number of different groups of r items that could be formed from a set of n items is

!)!(

!

!

)1()1(

rrn

n

r

rnnn

25

Page 26: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Notation and terminology

We define , for , by

!

( )! !

and say that represents

the number of possible combinations

of objects taken at a time.

nr n

r

n n

r n r r

n

r

n r

26

Page 27: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 4a

A committee of 3 is to be formed from a group of 30 people. How many different committees are possible?

30 30 29 284060

3 3 2 1

27

Page 28: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 4b

From a group of 5 women and 7 men, how many different committees consisting of 2 women and 3 men can be formed?

What if 2 of the men are feuding and refuse to serve on the committee together?

5 7 5*4 7*6*5350

2 3 2 3*2

3002

5

1

5

2

2

3

7

28

Page 29: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 4c

Consider a set of n antennas of which m are defective and n-m are functional and assume that all of the defectives and all of the functional are considered indistinguishable. How many linear orderings are there in which no two defectives are consecutive?

m

mn 1

29

Page 30: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Binomial Coefficient

knkn

k

n yxk

nyx

r

n

0

)(

:following stated as theorembinomial the

of because so is This ts.coefficien binomial

as toreferredoften are of valueThe

30

Page 31: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Combinatorial Proof• Consider (x1+y1)(x2+y2)…(xn+yn)• Its expansion consists of the sum of 2n terms, each

term being the product of n factors.• Each of the 2n terms in the sum will contain as a

factor either xi or yi for each i = 1, 2, … n.• How many of the 2n terms in the sum will have k of xi

and (n-k) of yi?• As each term consisting of k of xi and (n-k) of yi

corresponds to a choice of a group of k from the n values x1, x2, …, xn, there are n choose k such terms.

• Thus, letting xi = x, yi = y, i = 1,…, n, we see thatknk

n

k

n yxk

nyx

0

)(31

Page 32: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 4d

Expand (x+y)3

knkn

k

n yxk

nyx

0

)(

32

Page 33: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 4e

How many subsets are there of a set consisting of n elements?

nnn

k k

n2)11(

0

33

Page 34: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Multinomial coefficients

• A set of n distinct items is to be divided into r distinct groups of respective sizes n1, n2, …, nr, where summation of them equals to n. How many divisions are possible?

34

Page 35: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

35

Page 36: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Notation

.,, sizes respective of groups

distinct into objectsdistinct of divisions possible

ofnumber therepresents ,,

Thus

!!!

!

,,

by ,,

define , If

21

21

2121

2121

r

r

rr

rr

nnn

rn

nnn

n

nnn

n

nnn

n

nnn

nnnnn

36

Page 37: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 5a

A police department in a small city consists of 10 officers. If the department policy is to have 5 of the officers patrolling the streets, 2 of the officers working full time at the station, and 3 of the officers on reserve at the station, how many different divisions of the 10 officers into the 3 groups are possible?

2520!3 !2 !5

!10

37

Page 38: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex 5c

In order to play a game of basketball, 10 children at a playground divide themselves into two teams of 5 each. How many different divisions are possible?

1262!

)!5 !5/(!10

38

Page 39: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Ex. 5d• In the first round of a knockout tournament

involving n=2m players, the n players are divided into n/2 pairs, with each of these pairs then playing a game. The losers of the games are eliminated while the winners go on to the next round, where the process is repeated until only a single player remains. Suppose we have a knockout tournament of 8 players.

• (a) How many possible outcomes are there for the initial round?

• (b) How many outcomes of the tournament are possible, where an outcome gives complete information for all rounds?

39

Page 40: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

40

Page 41: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

41

Page 42: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

My journey to become a great chef

42

20 20!1140

3 3!17!

1140 / 50 22.8

Page 43: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Summary of Chapter 1• Basic principle of counting• Permutation n!

– Possible linear ordering of n items.

• Combination– Number of different subgroups of size r that can be

chosen from a set of size n.– n!/((n-r)!r!)

43

Page 44: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.2 How many outcome sequences are possible when a die is rolled four times?– Four experiments each with 6 outcomes– 6 outcome for the first rolling– For each outcome of the first rolling, there are 6

outcome for the second rolling• 6*6 for the first two

– For each outcome of the first two rolling, there are 6 outcome for the third rolling

• 6*6*6 for the first three rolling

– Total is 6*6*6*6 = 64

44

Page 45: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.4 John, Jim, Jay, and Jack have formed a band consisting of 4 instruments. If each of the boys can play all 4 instruments, how many different arrangements are possible? What if John and Jim can play all 4 instruments, but Jay and Jack can each play only piano and drums?

• 4*3*2*1 = 4! = 24

• 2!*2! = 4

45

Page 46: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.5. For years, telephone area codes in the US and Canada consisted of a sequence of three digits. The first digit was an integer between 2 and 9; the second digit was either 0 or 1; the third digit was any integer between 1 and 9. How many area codes were possible? How many area codes starting with a 4 were possible?

• 8*2*9 = 144

• 1*2*9 = 18

46

Page 47: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

Prob. 1.7. (a)In how many ways can 3 boys and 3 girls sit in a row?

6!

(b) In how many ways can 3 boys and 3 girls sit in a row if the boys and the girls are each to sit together?

2!3!3!(c) In how many ways if only the boys must sit together?

4!3!or 4*3!*3!

(d) In how many ways if no two people of the same sex are allowed to sit together?

2*3!3!

47

Page 48: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.8. How many different letter arrangements can be made from the letters

• (a) fluke;– 5!

• (b) propose;– 7!/(2!2!)

• (c) mississippi;– 11!/(4!4!2!)

• (d) arrange?– 7!/(2!2!)

48

Page 49: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.10. In how many ways can 8 people be seated in a row if

• (a) there are no restrictions on the seating arrangement;– 8!

• (b) person A and B must sit next to each other;– 7!2! Or 2!*7*6!

• (c) there are 4 men and 4 women and no 2 men and 2 women can sit next to each other;– 2*4!4!

• (d) there are 5 men and they must sit next to each other;– 4!5!

• (e) there are 4 married couples and each couple must sit together?– 4!2!2!2!2!

49

Page 50: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.13. Consider a group of 20 people. If everyone shakes hands with everyone else, how many handshakes take place?

50

2020!/(2!18!) 20*19 / 2 190

2

Page 51: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.15. A dance class consists of 22 students, 10 women and 12 men. If 5 men and 5 women are to be chosen and then paired off, how many results are possible?

51

12 105!

5 5

Page 52: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.17. A total of 7 different gifts are to be distributed among 10 children. How many distinct results are possible if no child is to receive more than one gift?

52

107! 10!/(10 7)! 10!/ 3!

7

Page 53: Chapter 1. Combinatorial Analysis – Introduction Basic principle of counting The mathematical theory of counting is known as combinatorial analysis. –Permutations

• Prob. 1.21. Consider the grid of 4*5 points shown below. Suppose that starting at point labeled A you can go one step up or one step to the right at each move. This is continued until the point labeled B is reached. How many different paths from A to B are possible?

53

A

B

7!/(3!4!)