12 april 2009instructor: tasneem darwish1 university of palestine faculty of applied engineering and...

21
12 April 2009 Instructor: Tasneem Darwi sh 1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction to Discrete Mathematics More About Counting Techniques

Upload: orlando-oswald

Post on 14-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

12 April 2009 Instructor: Tasneem Darwish 1

University of PalestineFaculty of Applied Engineering and Urban Planning

Software Engineering Department

Introduction to Discrete Mathematics

More About Counting Techniques

12 April 2009 Instructor: Tasneem Darwish 2

Outlines

The three fundamental principles.Permutations and Combinations.Probability

12 April 2009 Instructor: Tasneem Darwish 3

Theorem 1.1 The Pigeonhole PrincipleIf a set of pigeons is placed into pigeonholes and there are more

pigeons than pigeonholes, then some pigeonholes must contain at least two pigeons.

Example 1.1Among any group of 367 people, there must be at least two with the

same birthday, because there are only 366 possible birthday.

The three fundamental principles

12 April 2009 Instructor: Tasneem Darwish 4

Example 1.3How many students must be in a class to guarantee that at least two

students receive the same score on the final exam, if the exam score is graded on a scale from 0 to 100 points?

There are 101 possible scores on the final. The pigeonhole principle shows that among any 102 students there must be at least 2 students with the same score.

Example 1.4What is the minimum number of students required in a discrete

mathematics class to be sure that at least six will receive the same grade, if there are five possible grades, A, B, C, D and F?

The smallest number is 26, 26= 5*5 +1

The three fundamental principles

12 April 2009 Instructor: Tasneem Darwish 5

Theorem 1.2 The Multiplication PrincipleConsider a procedure that is composed of a sequence of k steps.

Suppose that the first step can be preformed in n1 ways, the second step can be performed in n2 ways and each step can be performed in ni ways where i= 1,2,3…..k.

Procedure{Step 1 can be performed in n1 waysStep 2 can be performed in n2 ways..Step k can be performed in nk ways}

The number of different ways in which the entire procedure can be performed is n1*n2*…..*nk

The three fundamental principles

12 April 2009 Instructor: Tasneem Darwish 6

Example 1.5How many different license plates are available if each plate

contains a sequence of three letters followed by three digits?

There are 26 choices for each of the three letters and 10 choices for each of the digits.

By the product rule there are a total of 26*26*26*10*10*10=17576000 possible license plates.

The three fundamental principles

12 April 2009 Instructor: Tasneem Darwish 7

Example 1.6Consider an Id card number of the form (ID: XYZ) Where

X can be any letter except D and F, Y can be any number except 3 and 5, and Z can be any of the symbols (µ,α,β,ω),

what is the number of the possible Id cards?

There are 24 choices for X, eight choices for Y and four choices for Z. hence, the possible number of Id cards is: 24*8*4=768 card.

The three fundamental principles

12 April 2009 Instructor: Tasneem Darwish 8

Theorem 1.3 The Addition PrincipleSuppose that there are k sets of elements with n1 elements in the

first set, n2 elements in the second set, etc. if all of the elements are distinct, then the number of elements in the union of the sets is n1+n2+…..+nk

Example 1.7A student can choose a computer project from one of three lists. The

three project lists contain 23, 15, 19 possible projects, respectively.

How many possible projects are there to choose from??

There are: 23+15+19= 57.

The three fundamental principles

12 April 2009 Instructor: Tasneem Darwish 9

Example 1.8How many 8 bit strings begin with 1011 or 01?

The 8 bit strings that begin with 1011 has the form of 1011_ _ _ _,

The number of eight bit strings that begin with 1011 is equal to the number of ways that the four unknown bits can be chosen.

By the product rule we have 2*2*2*2= 16 ways. Likewise, the number of 8 bit strings that begin with 01 is

2*2*2*2*2*2= 64.

Since the set of strings beginning with 01 is disjoint from the set of strings beginning with 1011, the addition principle shows that the number of strings beginning with 1011 or 01 is : 16+64=80.

The three fundamental principles

12 April 2009 Instructor: Tasneem Darwish 10

Two types of counting problems occur so frequently These problems are:

1) How many arrangements (ordered lists) of r objects can be formed from a set of n distinct objects?

2) How many different selections (unordered lists) of r objects can be made from a set of n distinct objects?

Permutations and Combinations

12 April 2009 Instructor: Tasneem Darwish 11

An arrangement of n distinct objects is called a permutation of the objects.

If r ≤ n, then an arrangement using r of the n distinct objects is called an r-permutation.

3124 is a permutation of the digits 1,2,3 and 4, and 412 is a 3-permutation of these digits.

The number of different r-permutations of a set of n distinct elements is denoted by P(n,r), this number can be found using the formula:

Permutations

)!(

!),(

rn

nrnP

12 April 2009 Instructor: Tasneem Darwish 12

Example 2.1How many different three-digit numbers can be formed using the

digits 5,6,7,8 and 9 without repetition?

We need to find the number of 3-permutation from a set of 5 digits. This number is P(5,3)

Example 2.2In how many different orders can 4 persons be seated in a row of 4

chairs??

The answer is the number of permutations of a set of 4 elements.

Permutations

60!2

!5)3,5( P

241

24

!0

!4)4,4( P

12 April 2009 Instructor: Tasneem Darwish 13

if r ≤ n, then an unordered selection of r objects chosen from of a set of n distinct objects is called r-combination of the objects.

Thus {1,4}and{2,3} are both 2-combinations of the digits 1,2,3 and 4.

Note that since the combinations are unordered selections, the 2-combination {1,4} and {4,1} are the same.

The number of different r-combinations of a set of n distinct elements is C(n.r):

Combination

)!(!

!),(

rnr

nrnC

12 April 2009 Instructor: Tasneem Darwish 14

Example 2.3How many different 4-member committees can be formed from a

delegation of 7 member?

Since a 4-member committee is just a selection of 4 members from the delegation of 7, the answer is:

Combination

35)!3(!4

!7)4,7( C

12 April 2009 Instructor: Tasneem Darwish 15

Example 2.4 An investor is going to invest $16000 in four stocks chosen from a list of twelve prepared by her secretary. How many different investments are possible if:

(a) $4000 is to be invested in each stock?(b) $6000 is to be invested in one stock, $5000 in another, $3000 in

the third, and $2000 in the fourth?

(a) Since each stock is to be treated the same, we need an unordered list of four stocks. Hence the number of investments in this case is

(b) Since each stock is to be treated differently, we need an ordered list of four stocks. Hence the number of investments in this case is

Combination

495!8!4

!12)4,12( C

11880!8

!12)4,12( P

12 April 2009 Instructor: Tasneem Darwish 16

Probability is the ratio of the number of favourable cases to the total number of cases, assuming that all the various cases are equally possible.An experiment: is any procedure that results in an observable outcome. Thus, we may speak of the experiment of flipping a coin or the experiment of tossing a die.

A sample space: is a set containing all the possible outcome of an experiment.

An event: is any subset of a sample space. Thus, in the die-tossing experiment with sample space {1, 2, 3, 4, 5, 6}, the following sets are events:

A= {1, 2, 4, 6} B= {n: n is an even positive integer less than 7}

Probability

12 April 2009 Instructor: Tasneem Darwish 17

The probability of E: where E is any event in a finite sample space S consisting of equally likely outcomes

Example 3.1In the experiment of flipping a probably balanced coin what is the

probability of obtaining a head?

Since there is only two possible results head (H) or tail (T)The sample space is S= {H, T}The event of obtaining a head E= {H}The probability of obtaining head is

Probability

||

||)(

S

EEP

2

1

||

||)(

S

EEP

12 April 2009 Instructor: Tasneem Darwish 18

Example 3.2In the experiment of flipping a probably balanced coin three times,

what is the probability of obtaining exactly two heads?

The sample space is S= {HHH, HHT, HTH, THH, TTH, THT, HTT, TTT}

The event of obtaining exactly two heads E= {HHT, HTH, THH}The probability of obtaining exactly two heads is

Probability

8

3

||

||)(

S

EEP

12 April 2009 Instructor: Tasneem Darwish 19

Example 3.3 Suppose that there are six applicants for a particular job, four men

and two women, who are to be interviewed in a random order.

What is the probability that the four men are interviewed before any of the women?

Since the ordering of the interviews is important, the set S of all possible arrangements of the six interviews is P(6,6).

Let E denote the subset of S in which the men are interviewed before women.

The six interviews is going to be a procedure of interviewing the four men and then the two women which can be found out by using the multiplication principle

Probability

15

1

)6,6(

)2,2()4,4(

||

||)(

P

PP

S

EEP

12 April 2009 Instructor: Tasneem Darwish 20

Example 3.4 Suppose that there are two defective pens in a box of 12 pens. If we

choose three pens at random, what is the probability that we do not select a defective pen?

In this problem the set of selections of three pens chosen from among the 12 in the box will be our sample space S.

The set of all selections of three pens chosen from among the 10 nondefective pens is the event E in which we are interested. Thus, the probability is:

Probability

11

6

)3,12(

)3,10(

||

||)(

C

C

S

EEP

12 April 2009 Instructor: Tasneem Darwish 21