discrete-chapter 06 counting

11
1 มหาวิทยาลัยราชภัฏสวนสุนันทา (ภาคการศึกษาที2/2555) เรียบเรียงโดย .วงศ์ยศ เกิดศรี CSC1001 Discrete Mathematics Counting - 06 1. Basic Counting Principles Two basic counting principles are the product rule and the sum rule. Example 1 (2 points) Suppose that there are 56 male students come to class today and 54 female students come to class today. How many students come to class today? Example 2 (2 points) Suppose that either a member of the mathematics faculty or a student who is a mathe- matics major is chosen as a representative to a university committee. How many different choices are there for this representative if there are 37 members of the mathematics faculty and 83 mathematics students and no one is both a faculty member and a student? Example 3 (2 points) A student can choose a computer project from one of three lists. The three lists contain 23, 15, and 19 possible projects, respectively. No project is on more than one list. How many possible projects are there to choose from? CHAPTER 6 การนับ (Counting) THE SUM RULE If a task can be done either in one of n 1 ways or in one of n 2 ways, where none of the set of n 1 ways is the same as any of the set of n 2 ways, then there are n 1 + n 2 ways to do the task. Definition 1 Basics of Counting 1 THE PRODUCT RULE Suppose that a procedure can be broken down into a sequence of two tasks. If there are n 1 ways to do the first task and for each of these ways of doing the first task, there are n 2 ways to do the second task, then there are n 1 n 2 ways to do the procedure. Definition 2

Upload: wongyos-keardsri

Post on 15-Jan-2015

241 views

Category:

Documents


4 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Discrete-Chapter 06 Counting

1

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Counting - 06

1. Basic Counting Principles

Two basic counting principles are the product rule and the sum rule.

Example 1 (2 points) Suppose that there are 56 male students come to class today and 54 female students come to class today. How many students come to class today?

Example 2 (2 points) Suppose that either a member of the mathematics faculty or a student who is a mathe-matics major is chosen as a representative to a university committee. How many different choices are there for this representative if there are 37 members of the mathematics faculty and 83 mathematics students and no one is both a faculty member and a student?

Example 3 (2 points) A student can choose a computer project from one of three lists. The three lists contain 23, 15, and 19 possible projects, respectively. No project is on more than one list. How many possible projects are there to choose from?

CHAPTER

6

การนบั

(Counting)

THE SUM RULE If a task can be done either in one of n1 ways or in one of n2 ways, where none of the set of n1 ways is the same as any of the set of n2 ways, then there are n1 + n2 ways to do the task.

Definition 1

Basics of Counting 1

THE PRODUCT RULE Suppose that a procedure can be broken down into a sequence of two tasks. If there are n1 ways to do the first task and for each of these ways of doing the first task, there are n2 ways to do the second task, then there are n1n2 ways to do the procedure.

Definition 2

Page 2: Discrete-Chapter 06 Counting

2

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 06 - Counting

Example 4 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positive integers, has been executed?

Example 5 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positive integers, has been executed?

Example 6 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positive integers, has been executed?

Example 7 (2 points) If the faculty in your university has 12 departments and each department has 9 teachers and 50 students. How many people are there in this faculty?

Example 8 (2 points) A new company with just two employees, Paint and Tong, rents a floor of a building with 12 offices. How many ways are there to assign different offices to these two employees?

k := 0 for i1 := 1 to n1 k := k + 1 for i2 := 1 to n2 k := k + 1 . . . for im := 1 to nm k := k + 1

k := 0 for i1 := 1 to n1 k := k + 2 for i2 := 1 to n2 k := k + 2 . . . for im := 1 to nm k := k + 2

k := 0 for i1 := 1 to n1 k := k + 1 for i2 := 1 to n2 k := k + 2 . . . for i10 := 1 to n10 k := k + 10

Page 3: Discrete-Chapter 06 Counting

3

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Counting - 06

Example 9 (2 points) The chairs of an auditorium are to be labeled with an uppercase English letter followed by a positive integer not exceeding 100. What is the largest number of chairs that can be labeled differently?

Example 10 (2 points) There are 32 microcomputers in a computer center. Each microcomputer has 24 ports. How many different ports to a microcomputer in the center are there?

Example 11 (2 points) Suppose that Thailand has 5 regions and each region has 8 cities and each city has 100 males and 150 females. How many people are there in Thailand?

Example 12 (2 points) How many different bit strings of length seven are there?

Example 13 (2 points) How many different license plates can be made if each plate contains a sequence of three uppercase English letters followed by three digits (and no sequences of letters are prohibited, even if they are obscene)?

Example 14 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positive integers, has been executed?

Example 15 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positive integers, has been executed?

k := 0 for i1 := 1 to n1 for i2 := 1 to n2 for i3 := 1 to n3 ··· for im := 1 to nm k := k + 1

Page 4: Discrete-Chapter 06 Counting

4

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 06 - Counting

Example 16 (2 points) A computer company receives 350 applications from computer graduates for a job planning a line of new Web servers. Suppose that 220 of these applicants majored in computer science, 147 majored in business, and 51 majored both in computer science and in business. How many of these applicants majored neither in computer science nor in business?

Example 17 (2 points) How many bit strings of length eight either start with a 1 bit or end with the two bits 00? (1XXXXXXX, XXXXXX00, 1XXXXX00)

1. The Pigeonhole Principle

k := 0 for i1 := 1 to n1 k := k + 1 for i2 := 1 to n2 k := k + 1 for i3 := 1 to n3 k := k + 1 for i4 := 1 to n4 k := k + 1

THE SUBTRACTION RULE If a task can be done in either n1 ways or n2 ways, then the number of ways to do the task is n1 + n2 minus the number of ways to do the task that are common to the two different ways.

Definition 3

THE PIGEONHOLE PRINCIPLE If k is a positive integer and k + 1 or more objects are placed into k boxes, then there is at least one box containing two or more of the objects.

Definition 1

Pigeonhole Principle 2

Page 5: Discrete-Chapter 06 Counting

5

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Counting - 06

Example 18 (2 points) Among any group of 367 people. How many people which at least must be the same birthday?

Example 19 (2 points) In any group of 27 English words, there must be at least x that begin with the same letter. Find x?

Example 20 (2 points) How 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 is graded on a scale from 0 to 100 points?

Example 21 (2 points) How many students must be in a class that at least two students receive the same grade on discrete mathematics course, if possible grade are A, B, C, D, F?

2. The Generalized Pigeonhole Principle

Example 22 (2 points) How many at least people among 100 people who were born in the same month.

Example 23 (2 points) How many at least students among 107 student who have the same grade, given possible grade are A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F?

THE GENERALIZED PIGEONHOLE PRINCIPLE If N objects are placed into k boxes, then there is at least one box containing at least ⎡ ⎤kN / objects.

Definition 2

Page 6: Discrete-Chapter 06 Counting

6

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 06 - Counting

Example 24 (2 points) What 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?

Example 25 (2 points) What is the minimum number of students required in a discrete mathematics class to be sure that at least 8 will receive the same grade, given the possible grade are A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F?

Example 26 (2 points) How many cards must be selected from a standard deck of 52 cards to guarantee that at least three cards of the same suit are chosen?

Example 27 (2 points) How many words at your dictionary that at least 10 words will be started the same uppercase letter in English?

1. Permutations

Example 28 (2 points) (1) How many ways can we select three students from a group of five students to stand in line for a picture? (2) How many ways can we arrange all five of these students in a line for a picture?

A permutation of a set of distinct objects is an ordered arrangement of these objects. We also are interested in ordered arrangements of some of the elements of a set. An ordered arrangement of r elements of a set is called an r-permutation.

Definition 1

Permutations and Combinations 3

Page 7: Discrete-Chapter 06 Counting

7

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Counting - 06

Example 29 (2 points) Let S = {1, 2, 3}. Find the number of solutions for 2-permutation of S.

Example 30 (2 points) How many ways are there to select a first-prize winner, a second-prize winner, and a third-prize winner from 100 different people who have entered a contest?

Example 31 (2 points) Suppose that there 11 students in this room. How many ways to select 7 students for rearranging in line?

Example 32 (2 points) Suppose that there are eight runners in a race. The winner receives a gold medal, the second place receives a silver medal, and the third-place receives a bronze medal. How many different ways are there to award these medals, if all possible outcomes of the race can occur?

Example 33 (2 points) Suppose that a saleswoman has to visit eight different cities. How many ways the she will go to visit selected three cities possible orders?

Example 34 (2 points) Find P(6, 5)?

If n is a positive integer and r is an integer with 1 ≤ r ≤ n, then there are P(n, r) = n(n – 1)(n – 2) · · · (n – r + 1)

P(n, r) = )!(

!rn

n−

r-permutations of a set with n distinct elements.

Definition 2

Page 8: Discrete-Chapter 06 Counting

8

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 06 - Counting

Example 35 (2 points) Find P(8, 2)?

Example 36 (2 points) Find P(10, 8)?

Example 37 (2 points) Find P(6, 1)?

Example 38 (2 points) Find P(5, 5)?

2. Combinations

Example 39 (2 points) How many different committees of three students can be formed from a group of four students?

Example 40 (2 points) Let S be the set {1, 2, 3, 4}. Find 3-combination from S. (Note that {4, 1, 3} is the same 3-combination as {1, 3, 4}, because the order in which the elements of a set are listed does not matter.)

An r-combination of elements of a set is an unordered selection of r elements from the set. Thus, an r-combination is simply a subset of the set with r elements.

Definition 3

Page 9: Discrete-Chapter 06 Counting

9

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Counting - 06

Example 41 (2 points) How many poker hands of five cards can be dealt from a standard deck of 52 cards? Also, how many ways are there to select the cards from a standard deck of 52 cards?

Example 42 (2 points) How many ways are there to select five players from a 10-member tennis team to make a trip to a match at another school?

Example 43 (2 points) A group of 20 people have been trained as astronauts to go on the first mission to Mars. How many ways are there to select a crew of six people to go on this mission (assuming that all crew members have the same job)?

Example 44 (2 points) Find C(5, 1)?

Example 45 (2 points) Find C(5, 3)?

The number of r-combinations of a set with n elements, where n is a nonnegative integer and r is an integer with 0 ≤ r ≤ n, equals

C(n, r) = )!(!

!rnr

n−

= ⎟⎟⎠

⎞⎜⎜⎝

⎛rn

Definition 4

Page 10: Discrete-Chapter 06 Counting

10

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics 06 - Counting

Example 46 (2 points) Find C(8, 4)?

Example 47 (2 points) Find C(8, 8)?

Example 48 (2 points) Find C(8, 0)?

Example 49 (2 points) Find C(12, 6)?

Example 50 (2 points) There are 10 different cats in your home. How many way to select 5 cats to classify a new group and for each way of each new group can be rearrange with 5-permutations?

Example 51 (2 points) There are 12 different cases of iPhone in your mobile shop. How many way to select 6 cases in to one group and for each group can be rearrange with 6-permutations?

1. The Binomial Theorem

The binomial theorem gives the coefficients of the expansion of powers of binomial expressions. A binomial expression is simply the sum of two terms, such as x + y. (The terms can be products of constants and variables)

Binomial Coefficients 3

Page 11: Discrete-Chapter 06 Counting

11

มหาวิทยาลยัราชภฏัสวนสนุนัทา (ภาคการศึกษาท่ี 2/2555) เรยีบเรยีงโดย อ.วงศย์ศ เกิดศร ี

CSC1001 Discrete Mathematics Counting - 06

Example 52 (2 points) What is the expansion of (x + y)4?

Example 53 (2 points) What is the expansion of (2x + 3y)4?

Example 54 (2 points) What is the coefficient of x12y13 in the expansion of (x + y)25?

Example 55 (2 points) What is the coefficient of x12y13 in the expansion of (2x – 3y)25?

THEBINOMIALTHEOREM Let x and y be variables, and let n be a nonnegative integer. Then

nnnn

j

nnjjnn ynn

xynn

yxn

yxn

xn

yxjn

yx ⎟⎟⎠

⎞⎜⎜⎝

⎛+⎟⎟

⎞⎜⎜⎝

⎛−

++⎟⎟⎠

⎞⎜⎜⎝

⎛+⎟⎟

⎞⎜⎜⎝

⎛+⎟⎟

⎞⎜⎜⎝

⎛=⎟⎟

⎞⎜⎜⎝

⎛=+ −−

=

−−∑ 122

0

1

1210)( L

Definition 1