Your SlideShare is downloading. ×

Discrete-Chapter 06 Counting

270

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
270
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Counting - 06 CSC1001 Discrete Mathematics 1 CHAPTER การนับ 6 (Counting) 1 Basics of Counting1. Basic Counting Principles Two basic counting principles are the product rule and the sum rule. Definition 1 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 2 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.Example 1 (2 points) Suppose that there are 56 male students come to class today and 54 female studentscome 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 forthis representative if there are 37 members of the mathematics faculty and 83 mathematics students and noone 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 contain23, 15, and 19 possible projects, respectively. No project is on more than one list. How many possible projectsare there to choose from?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 2. 2 CSC1001 Discrete Mathematics 06 - CountingExample 4 (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 k := k + 1 for i2 := 1 to n2 k := k + 1 . . . for im := 1 to nm k := k + 1Example 5 (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 k := k + 2 for i2 := 1 to n2 k := k + 2 . . . for im := 1 to nm k := k + 2Example 6 (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 k := k + 1 for i2 := 1 to n2 k := k + 2 . . . for i10 := 1 to n10 k := k + 10Example 7 (2 points) If the faculty in your university has 12 departments and each department has 9 teachersand 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 with12 offices. How many ways are there to assign different offices to these two employees?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 3. Counting - 06 CSC1001 Discrete Mathematics 3Example 9 (2 points) The chairs of an auditorium are to be labeled with an uppercase English letter followedby 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 has100 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 ofthree uppercase English letters followed by three digits (and no sequences of letters are prohibited, even ifthey are obscene)?Example 14 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positiveintegers, 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 + 1Example 15 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positiveintegers, has been executed?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 4. 4 CSC1001 Discrete Mathematics 06 - Counting 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 Definition 3 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.Example 16 (2 points) A computer company receives 350 applications from computer graduates for a jobplanning a line of new Web servers. Suppose that 220 of these applicants majored in computer science, 147majored in business, and 51 majored both in computer science and in business. How many of these applicantsmajored 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 bits00? (1XXXXXXX, XXXXXX00, 1XXXXX00) 2 Pigeonhole Principle1. The Pigeonhole Principle Definition 1 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.มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 5. Counting - 06 CSC1001 Discrete Mathematics 5Example 18 (2 points) Among any group of 367 people. How many people which at least must be the samebirthday?Example 19 (2 points) In any group of 27 English words, there must be at least x that begin with the sameletter. Find x?Example 20 (2 points) How many students must be in a class to guarantee that at least two students receivethe 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 samegrade on discrete mathematics course, if possible grade are A, B, C, D, F?2. The Generalized Pigeonhole Principle Definition 2 THE GENERALIZED PIGEONHOLE PRINCIPLE If N objects are placed into k boxes, then there is at least one box containing at least ⎡N / k ⎤ objects.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, givenpossible grade are A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 6. 6 CSC1001 Discrete Mathematics 06 - CountingExample 24 (2 points) What is the minimum number of students required in a discrete mathematics class tobe 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 tobe 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 thatat 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 sameuppercase letter in English? 3 Permutations and Combinations1. Permutations Definition 1 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.Example 28 (2 points) (1) How many ways can we select three students from a group of five students to standin line for a picture? (2) How many ways can we arrange all five of these students in a line for a picture?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 7. Counting - 06 CSC1001 Discrete Mathematics 7Example 29 (2 points) Let S = {1, 2, 3}. Find the number of solutions for 2-permutation of S. Definition 2 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) n! P(n, r) = (n − r )! r-permutations of a set with n distinct elements.Example 30 (2 points) How many ways are there to select a first-prize winner, a second-prize winner, and athird-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 forrearranging in line?Example 32 (2 points) Suppose that there are eight runners in a race. The winner receives a gold medal, thesecond place receives a silver medal, and the third-place receives a bronze medal. How many different waysare 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 shewill go to visit selected three cities possible orders?Example 34 (2 points) Find P(6, 5)?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 8. 8 CSC1001 Discrete Mathematics 06 - CountingExample 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 Definition 3 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.Example 39 (2 points) How many different committees of three students can be formed from a group of fourstudents?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 same3-combination as {1, 3, 4}, because the order in which the elements of a set are listed does not matter.)มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 9. Counting - 06 CSC1001 Discrete Mathematics 9 Definition 4 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 n! ⎛n⎞ C(n, r) = = ⎜ ⎟ ⎜r ⎟ r!(n − r )! ⎝ ⎠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 tomake 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 toMars. How many ways are there to select a crew of six people to go on this mission (assuming that all crewmembers have the same job)?Example 44 (2 points) Find C(5, 1)?Example 45 (2 points) Find C(5, 3)?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 10. 10 CSC1001 Discrete Mathematics 06 - CountingExample 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 anew 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 6cases in to one group and for each group can be rearrange with 6-permutations? 3 Binomial Coefficients1. The Binomial Theorem The binomial theorem gives the coefficients of the expansion of powers of binomial expressions. Abinomial expression is simply the sum of two terms, such as x + y. (The terms can be products of constantsand variables)มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 11. Counting - 06 CSC1001 Discrete Mathematics 11 Definition 1 THEBINOMIALTHEOREM Let x and y be variables, and let n be a nonnegative integer. Then n ⎛n⎞ ⎛n⎞ ⎛n⎞ ⎛n⎞ ⎛ n ⎞ n −1 ⎛ n ⎞ n ( x + y ) n = ∑ ⎜ ⎟ x n − j y j = ⎜ ⎟ x n + ⎜ ⎟ x n −1 y + ⎜ ⎟ x n − 2 y 2 + L + ⎜ ⎜ ⎟ ⎜0⎟ ⎜ ⎟ ⎜ ⎟ ⎜ n − 1⎟ xy + ⎜ n ⎟ y ⎟ ⎜ ⎟ j =0 ⎝ j ⎠ ⎝ ⎠ ⎝1 ⎠ ⎝2⎠ ⎝ ⎠ ⎝ ⎠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?มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี

×