Chapter 1 Fundamental principles of counting 陳彥良 中央大學資管系.

Slides:



Advertisements
Similar presentations
Permutations and Combinations Rosen 4.3. Permutations A permutation of a set of distinct objects is an ordered arrangement these objects. An ordered arrangement.
Advertisements

Counting Chapter 6 With Question/Answer Animations.
Permutation and Combination
THE BASIC OF COUNTING Discrete mathematics KNURE, Software department, Ph , N.V. Bilous.
Counting and Probability The outcome of a random process is sure to occur, but impossible to predict. Examples: fair coin tossing, rolling a pair of dice,
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
CSE115/ENGR160 Discrete Mathematics 04/17/12
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
Permutations r-permutation (AKA “ordered r-selection”) An ordered arrangement of r elements of a set of n distinct elements. permutation of a set of n.
4/5/05Tucker, Sec Applied Combinatorics, 4rth Ed. Alan Tucker Section 5.4 Distributions Prepared by Jo Ellis-Monaghan.
Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Tucker, Section 5.41 Section 5.4 Distributions By Colleen Raimondi.
How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments.
4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is.
Counting and Probability Sets and Counting Permutations & Combinations Probability.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
More Counting Lecture 16: Nov 9 A B …… f. This Lecture We will study how to define mappings to count. There will be many examples shown. Bijection rule.
Counting Unit Review Sheet. 1. There are five choices of ice cream AND three choices of cookies. a)How many different desserts are there if you have one.
Chapter 1 Fundamental Principles of Counting Discrete Mathematics.
Counting. Product Rule Example Sum Rule Pigeonhole principle If there are more pigeons than pigeonholes, then there must be at least one pigeonhole.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
Generalized Permutations and Combinations
Permutations and Combinations
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Permutations and Combinations
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Chapter 3 Permutations and combinations
March 10, 2015Applied Discrete Mathematics Week 6: Counting 1 Permutations and Combinations How many different sets of 3 people can we pick from a group.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
1 Chapter 1 Fundamental Principles of Counting Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004.
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.1.2 Pigeonhole principle:Strong Form  Theorem 4.2: Let q 1,q 2,…,q n be positive integers. If q 1 +q 2 +…+q n -n+1 objects are put into n boxes, then.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 12.8 The Counting Principle and Permutations.
Ch Counting Principles. Example 1  Eight pieces of paper are numbered from 1-8 and placed in a box. One piece of paper is drawn from the box, its.
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of.
Discrete Mathematics Lecture # 25 Permutation & Combination.
Textbook: Discrete and Combinatorial Mathematics:
Counting.
5.5 Generalized Permutations and Combinations
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
Introduction Suppose that a password on a computer system consists of 6, 7, or 8 characters. Each of these characters must be a digit or a letter of the.
Section Basic Counting Principles: The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n 1.
CS 104: Discrete Mathematics
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
1 DISCRETE STRUCTURES DISCRETE STRUCTURES SSK3003 DR. ALI MAMAT 1.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 5 Counting 歐亞書局.
Section The Product Rule  Example: How many different license plates can be made if each plate contains a sequence of three uppercase English letters.
Section 6.3. Section Summary Permutations Combinations.
Example A standard deck of 52 cards has 13 kinds of cards, with four cards of each of kind, one in each of the four suits, hearts, diamonds, spades, and.
UNIT 5 Fundamental principles of counting
The Pigeonhole Principle
CSE15 Discrete Mathematics 04/19/17
ICS 253: Discrete Structures I
Chapter 5, Section 5.1 The Basics of Counting
Permutations and Combinations
Generalized Permutations and Combinations
COCS DISCRETE STRUCTURES
Permutations and Combinations
CS100: Discrete structures
Permutations and Combinations
Basic Counting.
Section 12.8 The Counting Principle and Permutations
More Counting A B … f Lecture 16: Nov 9.
Counting, Permutations, & Combinations
Presentation transcript:

Chapter 1 Fundamental principles of counting 陳彥良 中央大學資管系

1.1. The rules of sum and product  The rule of sum: If a first task can be performed in m ways, while a second task can be performed in n ways, and the tasks cannot be performed simultaneously, then performing either task can be accomplished in any one of m+n ways.

Ex 1.4  The boss assigns 12 employees to two committees.  Committee A consists of five members.  Committee B consists of seven members.  If the boss speak to just one member before making a decision, …?  If he speak to one member of committee A on the first day, and another member of committee B on the second day, …?

The rule of product  If a procedure can be broken down into first and second stages, and if there are m possible outcomes for the first stage and if, for each of these outcomes, there are n possible outcomes for the second stage, then the total procedure can be carried out, in the designated order, in mn ways.

Ex 1.6  A license plate consists of two letters followed by four digits.  If no letter or digit can be repeated?  If repetitions of letters and digits are allowed?  If repetitions of letters and digits are allowed, how many of the plates have only vowels (A, E, I, O, U) and even digits?

Ex 1.7  In some simple computers, one-byte address is used to identify the cells in main memory.  Some uses two-byte address.  Some uses four-byte address.  Some even uses eight-byte address.

1.2 Permutations  Definition 1.1. n factorial is defined by (a) 0!=1; n!=n(n-1)(n-2)…(2)(1)  Definition 1.2. Given a collection of n distinct objects, any (linear) arrangement of these objects is called a permutation of the collection  The number of permutations of size r from a collection of n distinct objects is P(n, r)=n!/(n-r)!.

Examples  Ex 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?  Ex If five letters are to be chosen from COMPUTER, how many arrangements are there?

Ex 1.11  The number of arrangements of the four letters in BALL is 12, not 24.  2  (number of arrangements of the letters B, A, L, L) = (number of arrangements of the letters B, A, L 1, L 2 )

Ex 1.12  How many of arrangements are there in all nine letters in DATABASES.  2!  3!  (number of arrangements of the letters DATABASES) = (number of arrangements of the letters D, A 1, T, A 2, B, A 3, S 1, E, S 2 )

Permutation with repetition  If there are n objects with n 1 indistinguishable objects of a first type, n 2 indistinguishable objects of a second type,…, and n r indistinguishable objects of an rth type, where n 1 +n 2 +…+n r =n, then there are arrangements of the given n objects.

Ex 1.14  Determine the number of staircase paths from (2,1) to (7,4), where each path is made up of individual steps going one unit to the right (R) or one unit upward (U).  What does RURRURRU stands for?  What does URRRUURR stands for?  There are 8!/5!3!=56 possible paths.

Ex 1.16  If six people are seated about a round table, how many different circular arrangements are possible, if arrangements are considered the same when one can be obtained from the other by rotation.  6  (number of circular arrangements) = (number of linear arrangements)  Consequently, there are 6!/6=5! arrangements.

Ex 1.17  Suppose that the six people are three married couples.  We want to arrange the six people around the table so that the sexes alternate.  A female is placed first.  The next position can be placed in three ways.  The answer is 3  2  2  1  1=12.

1.3. Combinations : The binomial theorem  We start with 52 cards, and how many ways are there that we can select three of these cards, with no reference to order?  (3!)  (number of selections of size 3 from a deck of 52 cards) = number of permutations of size 3 for the 52 cards  C(n, r)=P(n, r)/r!=n! / r!  (n-r)!  C(n, r)= C(n, n-r)

Ex 1.19  To win the grand prize for PowerBall one must match five numbers selected from 1 to 49 inclusive and then must also match the powerball, an integer from 1 to 42 inclusive.  There are totally C(49,5)  C(42, 1) = combinations we can select the six balls.

Ex 1.20  If the student must answer any seven of ten questions….  If the student must answer three questions from the first five and four questions from the last five….  If the student must answer seven of ten questions, where at least three are selected from the first five…..

Ex 1.23  The number of arrangements of the letters in TALLAHASSEE is 11!/ 3! 2! 2! 2! 1! 1!=  How many of them have no adjacent A’s?  The answer is C(9, 3)  (8!/ 2! 2! 2! 1! 1!)=84  5040= (Why)

Ex 1.24  alphabet ={0, 1, 2},  A string x=x 1 x 2 …x n is made up from a prescribed alphabet symbols  the weight of a string wt(x)= x 1 +x 2 +…+x n  Among the 3 10 strings of length 10, how many have even weight?  A string has even weight if and only if the number of 1’s in the string is even.  Number of 1’s can be 0, 2, 4, 6, 8, 10  C(10, 2)2 8 +C(10, 4)2 6 +C(10, 6)2 4 +C(10, 8)2 2 +C(10, 10)

Ex 1.25  Suppose that we draw five cards from a standard deck of 52 cards. a) In how many ways can we have a hand with no clubs? C(39, 5) b) In how many ways can we have a hand with at least one club? C(52, 5)-C(39, 5) c) The same question as in (b), but we compute in another way. C(13, 1)  C(51, 4) d) an over-counting problem occurs in part (c), why over- counting? e) Another way to get the result of (b): C(13, 1)C(39, 4) + C(13,2)C(39, 3) + C(13, 3)C(39, 2) + C(13, 4)C(39, 1) + C(13,5)

The Binomial Theorem  If x and y are variables and n is a positive integers, then we have  the coefficient of x 5 y 2 in (x+y) 7 is C(7, 5)=21  the coefficient of x 5 y 2 in (2x-3y) 7 is C(7, 5)  2 5  (- 3) 2 =6048

Multinomial Theorem

Ex 1.27  what is coefficient of x 2 y 2 z 3 in the expression of (x+y+z) 7 ?  what is coefficient of x 2 y 3 z 2 w 5 in the expression of (x+2y-3z+2w+5) 16 ?

1.4. Combinations with repetition  Ex: seven students are to buy one of the following c, h, t, f.

Observation  When we wish to select, with repetition, r of n distinct objects, we find that we are considering all arrangements of r x’s and n-1 |’s and that their number is  Consequently, the number of combinations of n objects taken r at a time, with repetition, is C(n+r-1, r).

Examples  A donut shop offers 20 kinds of donut. How many ways can we select a dozen donuts? C( , 12)=C(31, 12)  In how many ways can we distribute seven bananas and six oranges among four children so that each child receives at least one banana? C(6,3)  C(9, 6)

Ex 1.33  Determine all integer solutions to the equation x 1 +x 2 +x 3 +x 4 =7 where x i  0 for i=1~4  Each nonnegative integer solution corresponds to a selection, with repetition, of size 7 from a collection of size 4.  So, there are C(4+7-1, 7)=120 solutions.

observation  The following are equivalent The number of integer solutions of the equation x 1 +x 2 +…+x n =r, x i  0, 1  i  n The number of selections, with repetition, of size r from a collection of size n The number of ways r identical objects can be distributed among n distinct containers

Examples  In how many ways can we distribute 10 white marbles among six distinct containers? C(6+10-1, 10)=3003  How many nonnegative solutions are there to the equation x 1 +x 2 +x 3 +x 4 +x 5 +x 6 <10. x 1 +x 2 +x 3 +x 4 +x 5 +x 6 +x 7 =10, where x 7 >0 and x i  0. y 1 +y 2 +y 3 +y 4 +y 5 +y 6 +y 7 =9, where y i  0 C(7+9-1, 9)=5005

Ex 1.37  Determine the number of compositions of m, where m is a positive integer.  Let m be 7.  For one summand, there is only one C(6, 6).  For two summands, w 1 +w 2 =7 where w i >0  x 1 +x 2 =5 where x i  0  C(2+5-1, 5)=C(6,5)  For three summands, w 1 +w 2 +w 3 =7 where w i >0  x 1 +x 2 +x 3 =4 where x i  0  C(3+4-1, 4)=C(6,4)  For each positive m, there are 2 m-1 compositions.

Ex 1.39  Analyze the number of iterations in the loops  The print statement is executed for 1  k  j  i  20.  Any selection a, b, c (a  b  c) of size 3, with repetitions allowed, from the list of 1~20 results in one correct solution.  The answer is C(20+3-1, 3) = C(22, 3) = 1540.

1.5. The Catalan numbers  The number of ways we can go from (0, 0) to (5, 5) through rectangles without passing through line y=x  The path must start with an R, end with a U, and the number of R’s at any point must equal or exceed the number of U’s.  A bad path with 5 R’s and 5 U’s can be transformed to a path with 4 R’s and 6 U’s. RUU*URRRUUR  RUU*RUUURRU  Any arrangement of 4 R’s and 6 U’s can be mapped to a bad path RURRUUU*UUR  RURRUUU*RRU

The Catalan numbers

Ex 1.43  In how many ways can one arrange three - 1’s and three 1’s so that all six partial sums are nonnegative? b 3  Given four 1’s and four 0’s, there are b 4 ways to list eight symbols so that in each list the number of 0’s never exceeds the number of 1’s.  There are b 3 ways to parenthesize x 1 x 2 x 3 x 4