1 fundamental principles of counting objectives: at the end of this chapter, students should be able...

24
1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement) and combination (selection) 2. apply permutation and combination in problem solving

Upload: winifred-black

Post on 03-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

1

Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be

able to: 1. describe the concepts of permutation

(arrangement) and combination (selection) 2. apply permutation and combination in

problem solving

Page 2: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

2

CONTENTS

i. Rules of Sum and Product ii. Permutations iii. Combinations iv. Combinations with Repetition

Page 3: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

3

Preamble - Permutation

Page 4: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

4

Rule of Sum

Task 1 can be performed in m ways Task 2 can be performed in n ways, the two tasks cannot be performed

simultaneously, then performing either task can be

accomplished in any one of m + n ways.

Page 5: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

5

Rule of Sum More formally, the rule of sum is a fact

about set theory. It states that sum of the sizes of a finite

collection of pairwise disjoint sets is the size of the union of these sets.

That is, if S1,S2,...,Sn are pairwise disjoint sets, then we have:

|S1|+|S2| + … +|Sn| = |S1U S2 U …U Sn|

Page 6: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

6

Example 1.1

A college library has 40 textbooks on Databases and 50 textbooks dealing with Calculus. By the rule of sum, a student can select among 40 + 50

= 90 textbooks to learn more about one or the other of these two languages.

Page 7: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

7

Example 1.2

A computer science instructor has 7 different introductory books each on C++, Java, and Perl

He can recommend any one of these 21 books to a student who is interested in learning a first programming language.

Page 8: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

8

Example 1.3 A lady has decided to shop at one store

today, either in the north part of PJ or the south part of PJ.

If she visits the north part of PJ, she will either shop at a mall, a furniture store, or a jewelry store (3 ways).

If she visits the south part of PJ then she will either shop at a clothing store or a shoe store (2 ways).

Thus there are 3+2=5 possible shops the woman could end up shopping at today.

Page 9: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

9

Rule of product Suppose a computer installation has 4

I/O unit (A,B,C,D) and 3 CPU (X,Y,Z). Any I/O can be paired with any CPU. How ways to pair an I/O with a CPU. Pairing the two types of units as a two-

step operation: Step 1: Choose the I/O unit Step 2: Choose the CPU unit There are 12 ways (e.g AX,AY,AZ,…)

Page 10: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

10

Rule of Product If an operation consists of k steps and the step 1 can be performed in n1 ways the step 2 can be performed in n2

the step k can be performed in nk ways

Then the entire operation can be performed in n1n2…nk ways.

Page 11: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

11

Rule of Product (cont.)

Example 1.5 The drama club of Central

University is holding tryouts for a spring play. With six men and eight women auditioning for the leading male and female roles, by the rule of product the director can cast his leading couple in 6 x 8 = 48 ways.

Page 12: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

12

Rule of Product (cont.)Example 1.6Consider the manufacture of license plates

consisting of 2 letters followed by 4 digits. (e.g. AM1234)

If no letter or digit can be repeated, there are 26 x 25 x 10 x 9 x 8 x 7 = 3,276,000 different

possible plates.With repetitions of letters and digits,26 x 26 x 10 x 10 x 10 x 10 = 6,760,000 different

plates are possible.If repetitions are allowed, as in part (b), how many

of the plates have only vowels (A,E,I,O,U) and even digits? (0 is an even integer.)

Page 13: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

13

Example 1.7

An address is represented by an ordered list of eight bits, collectively referred to as a byte. Using the rule of product, there are

2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 = 28 = 256 such bytes.

So we have 256 addresses

Page 14: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

14

Permutation

Continuing to examine applications of the rule of product, we turn now to counting linear arrangements of objects.

These arrangements are often called permutation when the objects are distinct.

Page 15: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

15

Permutation (cont.)

Example 1.9 In a class of 10 students, five are

to be chosen and seated in a row for a picture. How many such linear arrangements are possible?

10 x 9 x 8 x 7 x 6 1st 2nd 3rd 4th 5th

= 10!/5! = 30,240 arrangements.

Page 16: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

16

Question

?????

Page 17: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

17

Permutation In general, if there are n distinct

objects, denoted a1, a2, …, an, and r is an integer, with 1 ≤ r ≤ n, then by the rule of product, the number of permutations of size r for the n objects is

n x (n-1) x (n-2) x … x (n-r+1) = n!/(n-r)!

Page 18: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

18

Permutation (cont.) We denote this number by P (n, r). For r = 0, P(n, 0) = 1 = n !/(n - 0)!, so P(n, r ) = n!/(n-r )! 0≤ r ≤n

NoteP(n, r) counts (linear) arrangements in

which the objects cannot be repeated. However, if repetitions are allowed, then by the rule of product there are nr possible arrangements with r ≥ 0.

Page 19: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

19

Example 1.10

The number of permutations of the letters in the word COMPUTER is 8!.

If only four of the letters are used, the number of permutations (of size 4) is

P(8, 4) = 8! = 8! (8 - 4)! 4! = 1680

Page 20: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

20

Permutation (cont.) Example 1.11 Unlike Example 1.10, the number of

(linear) arrangements of the four letters in BALL is 12, not 4! or 24.

If the two L’s are distinguished as L1,L2, then we can use our previous ideas; with the four distinct symbols B, A, L1, L2, we have 4! = 24 permutations, including

A B L1 L2 and A B L2 L1

Page 21: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

21

Permutation (cont.)

Example 1.12Now consider the arrangements of

all six letters in PEPPER.the number of arrangements of the

six letters in PEPPER is6!/(3!x2!) = 60

Page 22: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

22

General Permutation

In general, if there are n objects with n1 of a first type, n2 of a second type, …, and nr of an r th type, where n1 + n2 + … + nr = n, then there are n! __

n1! n2! … nr!

arrangements of the given n objects. (Objects of the same type are indistinguishable).

Page 23: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

23

Example 1.13

The MASSASAUGA is a brown and white venomous snake. Arranging all of the letters in MASSASAUGA,

we find that there are 10! = 25,200

arrangements. 4! 3! 1! 1! 1!

Arrangements in which all four A’s are together are 7! = 840 3! 1! 1! 1! 1!To get this last result, we considered all arrangements of

the seven symbols AAAA (one symbol), S, S, S, M, U, G.

Page 24: 1 Fundamental Principles of Counting OBJECTIVES: At the end of this chapter, students should be able to: 1. describe the concepts of permutation (arrangement)

24

THANK YOU