SlideShare a Scribd company logo
Counting - 06                                                           CSC1001 Discrete Mathematics            1

 CHAPTER
                                                            การนับ
      6                                                   (Counting)

  1      Basics of Counting
1. 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 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?




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


Example 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 + 2


Example 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 + 10


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?




มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                                เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
Counting - 06                                                          CSC1001 Discrete Mathematics            3
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?
 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


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

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




    2       Pigeonhole Principle
1. 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)                               เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
Counting - 06                                                        CSC1001 Discrete Mathematics           5
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
 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, given
possible grade are A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F?




มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                           เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
6         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?




    3       Permutations and Combinations
1. 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 stand
in line for a picture? (2) How many ways can we arrange all five of these students in a line for a picture?




มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                              เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
Counting - 06                                                                  CSC1001 Discrete Mathematics           7
Example 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 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)?

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

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




มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                             เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
10      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?




  3      Binomial Coefficients
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)

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

More Related Content

PDF
Discrete-Chapter 07 Probability
PDF
Discrete-Chapter 01 Sets
PDF
Discrete-Chapter 12 Modeling Computation
DOC
Inequality and absolute value
PDF
Module on Relations in a function
DOCX
Arithmatic & algebra
PPTX
Aieee mathematics- 2010
DOCX
Matrices
Discrete-Chapter 07 Probability
Discrete-Chapter 01 Sets
Discrete-Chapter 12 Modeling Computation
Inequality and absolute value
Module on Relations in a function
Arithmatic & algebra
Aieee mathematics- 2010
Matrices

What's hot (20)

PDF
linear_equations_in_two_variables
PPTX
Counting, pigeonhole, permuntation, Permutations and Combination ,Binomial T...
PPT
Linear equation in 2 variable class 10
PDF
Grade 9: Mathematics Unit 2 Quadratic Functions.
PDF
Module 4 exponential and logarithmic functions
PPTX
Probabilistic Systems Analysis Homework Help
PDF
K to 12 - Grade 8 Math Learners Module Quarter 2
PPT
Chapter 6 - Matrix Algebra
PDF
Rbsc class-9-maths-chapter-4
PPTX
Mathematical Statistics Homework Help
PDF
Module 2 exponential functions
PDF
IIT JAM MATH 2019 Question Paper | Sourav Sir's Classes
PDF
Nbhm m. a. and m.sc. scholarship test 2007
PPTX
IITJEE - Mathematics 2008-i
PDF
K TO 12 GRADE 7 LEARNING MODULE IN MATHEMATICS (Quarter 3)
PDF
Math grade 7 learner's module
PPT
Introductory maths analysis chapter 03 official
PDF
Nbhm m. a. and m.sc. scholarship test 2005
PDF
Module 1 polynomial functions
linear_equations_in_two_variables
Counting, pigeonhole, permuntation, Permutations and Combination ,Binomial T...
Linear equation in 2 variable class 10
Grade 9: Mathematics Unit 2 Quadratic Functions.
Module 4 exponential and logarithmic functions
Probabilistic Systems Analysis Homework Help
K to 12 - Grade 8 Math Learners Module Quarter 2
Chapter 6 - Matrix Algebra
Rbsc class-9-maths-chapter-4
Mathematical Statistics Homework Help
Module 2 exponential functions
IIT JAM MATH 2019 Question Paper | Sourav Sir's Classes
Nbhm m. a. and m.sc. scholarship test 2007
IITJEE - Mathematics 2008-i
K TO 12 GRADE 7 LEARNING MODULE IN MATHEMATICS (Quarter 3)
Math grade 7 learner's module
Introductory maths analysis chapter 03 official
Nbhm m. a. and m.sc. scholarship test 2005
Module 1 polynomial functions
Ad

Viewers also liked (20)

PPT
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
PDF
Counting i (slides)
PDF
Math 1300: Section 7- 3 Basic Counting Principles
PPTX
Pigeonhole Principle,Cardinality,Countability
PPTX
Pigeonhole Principle
PPTX
Introduction to management
PDF
Discrete-Chapter 02 Functions and Sequences
PDF
Discrete-Chapter 04 Logic Part I
PDF
Discrete-Chapter 03 Matrices
PDF
Discrete-Chapter 08 Relations
PDF
Discrete-Chapter 04 Logic Part II
PDF
Discrete-Chapter 09 Algorithms
PPTX
Tenerife airport disaster klm flight 4805 and pan
PDF
Discrete-Chapter 05 Inference and Proofs
PPT
Set Operations
PDF
Chapter 1 Logic of Compound Statements
PPTX
Set Theory Presentation
PPTX
PDF
Discrete Structures. Lecture 1
PPTX
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Counting i (slides)
Math 1300: Section 7- 3 Basic Counting Principles
Pigeonhole Principle,Cardinality,Countability
Pigeonhole Principle
Introduction to management
Discrete-Chapter 02 Functions and Sequences
Discrete-Chapter 04 Logic Part I
Discrete-Chapter 03 Matrices
Discrete-Chapter 08 Relations
Discrete-Chapter 04 Logic Part II
Discrete-Chapter 09 Algorithms
Tenerife airport disaster klm flight 4805 and pan
Discrete-Chapter 05 Inference and Proofs
Set Operations
Chapter 1 Logic of Compound Statements
Set Theory Presentation
Discrete Structures. Lecture 1
Ad

Similar to Discrete-Chapter 06 Counting (20)

PPT
Algorithms
PPT
discrete mathematics counting for bachelor in information technology and comp...
PPT
COMBINATORICS.ppt
PDF
Me gate-15-paper-02 new2
PDF
Me gate-15-paper-02
PPT
tutorial5.ppt
PPT
Two-sample Hypothesis Tests
PDF
JEE1_This_section_contains_FOUR_ questions
PPTX
CAT- 2007
PPTX
MATH 6 Q2 WEEK 6 - Shared to DTC by Ma'am Helen D. Canono.pptx
PDF
Chapter 1_Sets. Operation sets, Principle of inclusion and exclusion etc.
PDF
Ee693 sept2014quizgt2
PDF
Ee693 sept2014midsem
PPTX
Counting DM
PDF
sdfsdf
PDF
Q33_LE_Mathematics 8_Lesson 7_Week 7.pdf
PDF
exam1 unsolved
PDF
Lecture #2: Algorithmic Combinatorics I "#FOSCS301"
PDF
Module 1 number systems and code1
PPTX
Generating Patterns and arithmetic sequence.pptx
Algorithms
discrete mathematics counting for bachelor in information technology and comp...
COMBINATORICS.ppt
Me gate-15-paper-02 new2
Me gate-15-paper-02
tutorial5.ppt
Two-sample Hypothesis Tests
JEE1_This_section_contains_FOUR_ questions
CAT- 2007
MATH 6 Q2 WEEK 6 - Shared to DTC by Ma'am Helen D. Canono.pptx
Chapter 1_Sets. Operation sets, Principle of inclusion and exclusion etc.
Ee693 sept2014quizgt2
Ee693 sept2014midsem
Counting DM
sdfsdf
Q33_LE_Mathematics 8_Lesson 7_Week 7.pdf
exam1 unsolved
Lecture #2: Algorithmic Combinatorics I "#FOSCS301"
Module 1 number systems and code1
Generating Patterns and arithmetic sequence.pptx

More from Wongyos Keardsri (20)

PDF
How to Study and Research in Computer-related Master Program
PPT
The next generation intelligent transport systems: standards and applications
PPT
IP address anonymization
PDF
SysProg-Tutor 03 Unix Shell Script Programming
PDF
SysProg-Tutor 02 Introduction to Unix Operating System
PDF
SysProg-Tutor 01 Introduction to C Programming Language
PDF
Discrete-Chapter 11 Graphs Part III
PDF
Discrete-Chapter 11 Graphs Part II
PDF
Discrete-Chapter 11 Graphs Part I
PDF
Discrete-Chapter 10 Trees
PDF
Java-Chapter 14 Creating Graphics with DWindow
PDF
Java-Chapter 13 Advanced Classes and Objects
PDF
Java-Chapter 11 Recursions
PDF
Java-Chapter 10 Two Dimensional Arrays
PDF
Java-Chapter 09 Advanced Statements and Applications
PDF
Java-Chapter 08 Methods
PDF
Java-Chapter 07 One Dimensional Arrays
PDF
Java-Chapter 06 File Operations
PDF
Java-Chapter 05 String Operations
PDF
Java-Chapter 04 Iteration Statements
How to Study and Research in Computer-related Master Program
The next generation intelligent transport systems: standards and applications
IP address anonymization
SysProg-Tutor 03 Unix Shell Script Programming
SysProg-Tutor 02 Introduction to Unix Operating System
SysProg-Tutor 01 Introduction to C Programming Language
Discrete-Chapter 11 Graphs Part III
Discrete-Chapter 11 Graphs Part II
Discrete-Chapter 11 Graphs Part I
Discrete-Chapter 10 Trees
Java-Chapter 14 Creating Graphics with DWindow
Java-Chapter 13 Advanced Classes and Objects
Java-Chapter 11 Recursions
Java-Chapter 10 Two Dimensional Arrays
Java-Chapter 09 Advanced Statements and Applications
Java-Chapter 08 Methods
Java-Chapter 07 One Dimensional Arrays
Java-Chapter 06 File Operations
Java-Chapter 05 String Operations
Java-Chapter 04 Iteration Statements

Discrete-Chapter 06 Counting

  • 1. Counting - 06 CSC1001 Discrete Mathematics 1 CHAPTER การนับ 6 (Counting) 1 Basics of Counting 1. 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 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? มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 2. 2 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? 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 Example 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 + 2 Example 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 + 10 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? มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 3. Counting - 06 CSC1001 Discrete Mathematics 3 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? 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 Example 15 (2 points) What is the value of k after the following code, where n1, n2, … , nm are positive integers, 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 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) 2 Pigeonhole Principle 1. 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 5 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 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, given possible grade are A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F? มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 6. 6 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? 3 Permutations and Combinations 1. 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 stand in 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 7 Example 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 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)? มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 8. 8 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 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 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.) มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 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 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)? มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 10. 10 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? 3 Binomial Coefficients 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) มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 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) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี