4.4.2 Combinations of multisets

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.
Inclusion-Exclusion Formula
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,
CSE115/ENGR160 Discrete Mathematics 04/19/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 04/17/12
CSE115/ENGR160 Discrete Mathematics 04/21/11 Ming-Hsuan Yang UC Merced 1.
CSE 321 Discrete Structures Winter 2008 Lecture 16 Counting.
Counting Techniques: r-combinations with
Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.
1 More Counting Techniques Possibility trees Multiplication rule Permutations Combinations.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Chapter 8 The principle of Inclusion and Exclusion Yen-Liang Chen Dept of Information Management National Central University.
1 Section 3.3 Mathematical Induction. 2 Technique used extensively to prove results about large variety of discrete objects Can only be used to prove.
1 Permutations and Combinations CS/APMA 202 Epp section 6.4 Aaron Bloomfield.
Permutations and Combinations
CS100 : Discrete Structures
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.
Combinatorics 3/15 and 3/ Counting A restaurant offers the following menu: Main CourseVegetablesBeverage BeefPotatoesMilk HamGreen BeansCoffee.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
The Basics of Counting Section 6.1.
Chapter 6 The Inclusion-Exclusion Principle and Applications
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
Binomial Coefficients, Inclusion-exclusion principle
9.3 Addition Rule. The basic rule underlying the calculation of the number of elements in a union or difference or intersection is the addition rule.
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.
4.5.2 Applications of Inclusion-Exclusion principle
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Inclusion-Exclusion Selected Exercises Powerpoint Presentation taken from Peter Cappello’s webpage
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Lecture 5 Counting 4.3, Permutations r-permutation: An ordered arrangement of r elements of a set of n distinct elements. Example: S={1,2,3}:
1 Binomial Coefficients CS 202 Epp, section ??? Aaron Bloomfield.
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.
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,
Discrete Mathematics Lecture # 25 Permutation & Combination.
Counting Principles Multiplication rule Permutations Combinations.
Counting.
4.6 Generating functions Generating functions
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
1 Chapter 2 Pigeonhole Principle. 2 Summary Pigeonhole principle –simple form Pigeonhole principle –strong form Ramsey’s theorem.
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.
3/7/20161 Now it’s time to look at… Discrete Probability.
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.
Chapter 6 With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written.
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.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Section 6.3. Section Summary Permutations Combinations.
Discrete Mathematics Counting.
CSE15 Discrete Mathematics 04/19/17
Generalized Permutations and Combinations
COCS DISCRETE STRUCTURES
Permutations and Combinations
CS 2210 Discrete Structures Counting
CS100: Discrete structures
Permutations and Combinations
Basic Counting.
2.Derangements A derangement of {1,2,…,n} is a permutation i1i2…in of {1,2,…,n} in which no integer is in its natural position: i11,i22,…,inn. We denote.
4.4 Permutations and Combinations of multisets
Presentation transcript:

4.4.2 Combinations of multisets If S is a multiset, a r-combination of S is an unordered selection of r of the objects of S. Thus an r-combination of S is a submultiset of S. If S has n objects,then there is only one n-combination of S, namely, S itself. If S contains objects of k different types, then there are k 1-combinations of S. Example If S={2•a,1•b,3•c}, then the 3-combinations of S are {2•a,1•b},{2•a,1•c}, {1•a,1•b,1•c}, {1•a,2•c},{1•b,2•c},{3•c}.

Theorem 4. 12: Let S ={·a1,·a2,…, ·ak} Theorem 4.12: Let S ={·a1,·a2,…, ·ak}. Then the number of r-combinations of S equals C(k+r-1,r)。 Proof. (1)The number of r-combinations of S equals the number of solutions of the equation where x1,x2,…,xk are non-negative integers (2)We show that the number of these solutions equals the number of permutations of the multiset T={(k-1)·0,r·1}.

Corollary 4.5: Let S={n1•a1,n2•a2,…,nk•ak},and ni r for each i=1,2,…,n. Then the number of r-combinations of S is C(k+r-1,r). Example Suppose that a cookie shop has seven different kinds of cookies. How many different ways can twelve cookies be chosen?

Example How many integer solutions does the equation x1+x2+x3=11 have, where x1,x2,and x3 are non-negative integers? Solution To count the number of solutions, we note that a solution corresponds to a way of selecting 11 items from a set with three elements.

Example How many solutions are there to the equation x1+x2+x3=11 where x13,x21, and x30? Solution We introduce new variables: y1=x1-3, y2=x2-1, y3=x3, and the equation becomes y1+y2+y3=7 where y1,y2,and y3 are non-negative integers

Corollary 4. 6 Let S={·a1,·a2,…,·ak},and rk Corollary 4.6 Let S={·a1,·a2,…,·ak},and rk . Then the number of r-combinations of S so that each of the k types of objects occurs at least once equals C(r-1,k-1). Proof: r-combinations of S so that each of the k types of objects occurs at least once, a1,a2,…,ak, r-k combinations r-k combinations, +a1,a2,…,ak,r-combinations of S so that each of the k types of objects occurs at least once

Let S={n1•a1,n2•a2,…,nk•ak}, and n=n1+n2+…+nk=|S|,then the number N of r-combinations of S equals (3) N=C(k+r-1,r) ni r for each i=1,2,…,n. (4) If r<n, and there is, in general, no simple formula for the number of r-combinations of S. Nonetheless a solution can be obtained by the inclusion-exclusion principle and technique of generating functions, and we discuss these in 4.5 and 4.6.

4.5 Inclusion-Exclusion principle and Applications Theorem 4.13:Let A and B be finite sets. Then |A∪B|=|A|+|B|-|A∩B|。 Proof:Because A∪B=A∪(B-A),and A∩(B-A)=,by theorem we obtain |A∪B|=|A|+|B-A|. |B-A|=? Theorem 4.14:Let A1,A2,…,An be finite sets. Then

Corollary 4.7: Let S be a finite set, and P1,P2,…,Pn be n properties referring to the objects in S. Let Ai={x|xS and x has property Pi}(i=1,2,…,n) be the subset of S which have property Pi (and possibly other properties). Then the number of objects of S which have none of the properties P1,P2,…,Pn is given by

Example: In a certain school, the pupils have to study France, German, or English. Each pupil must study at least one of the three. Among a group of 100 pupils, 42 are studying France, 45 are studying German, 65 are studying English, 15 are studying France and German, 20 are studying France and English, 25 are studying German and English. Find the number of pupils who are studying all the three subjects. And Find the number of pupil who are studying English only. A, France B, German C, English the number of pupil who are studying English only |C|-|A∩C|-|B∩C|+|A∩B∩C|=28

Example:How many hex strings of length r contain 0,1, and 2? Solution:Let S be the set of length r’s hex strings. Let A be the set of length r’s hex strings which do not contain 0 Let B be the set of length r’s hex strings which do not contain 1 Let C be the set of length r’s hex strings which do not contain 2.

Example:Find the number of integers between 1 to 1000, inclusive, which are divisible by none of 5,6, and 8. Solution: Let S be the set consisting of the first thousand positive integers. Let P1 be the property that an integer is divisible by 5. Let P2 be the property that an integer is divisible by 6. Let P3 be the property that an integer is divisible by 8. For i=1,2,3 let Ai be the set consisting of those integers in S with property Pi.

Integers in the set A1∩A2 are divisible by both 5 and 6(lcm{5,6}=30) Integers in the set A1∩A2 are divisible by both 5 and 6(lcm{5,6}=30). Integers in the set A1∩A3 are divisible by both 5 and 8(lcm{5,8}=40). Integers in the set A2∩A3 are divisible by both 6 and 8(lcm{6,8}=24). Integers in the set A1∩A2∩A3 are divisible by 5 , 6 and 8(lcm{5,6,8}=120). By the inclusion-exclusion principle, the number of integers between 1 to 1000 that are divisible by none of 5,6, and 8 equals

4.5.2 Applications of Inclusion-Exclusion principle The number of r-combinations of multiset S 1. The number of r-combinations of multiset S If r<n, and there is, in general, no simple formula for the number of r-combinations of S. Nonetheless a solution can be obtained by the inclusion-exclusion principle 4.5 .

Example: Determine the number of 10-combinations of multiset S={3·a,4·b,5·c}. Solution:We shall apply the inclusion-exclusion principle to the set Y of all 10-combinations of the multiset D={·a, ·b, ·c}. Let P1 be the property that a 10-combination of D has more than 3 a’s. Let P2 be the property that a 10-combination of D has mote than 4 b’s. Let P3 be the property that a 10-combination of D has mote than 5 c’s. For i=1,2,3 let Ai be the set consisting of those 10-combinations of D which have property Pi. The number of 10-combinations of S is then the number of 10-combinations of D which have none of the properties P1, P2, and P3.

The set A1 consists of all 10-combinations of D in which a occurs at least 4 time. If we take any one of these 10-combinations in A1 and remove 4 a’s, we are left with a 6-combination of D. Conversely, if we take a 6-combination of D and add 4 a’s to it, we get a 10-combination of D in which a occurs at least 4 times. Thus the number of 10-combinations in A1 equals the number of 6-combinations of D. Hence, |A1|=C(3+6-1,6)=C(8,6)=C(8,2),

Example: What is the number of integeal solutions of the equation x1+x2+x3=5 which satisfy 0x12,0x22,1x35? Solution: We introduce new variables, x3'=x3-1 and our equation becomes x1+x2+x3'=4. The inequalities on the xi and x3' are satisfied if and only if 0x12,0x22, 0x3'4. 4-combinations of multiset {2·a,2·b,4·c}

2.Derangements A derangement of {1,2,…,n} is a permutation i1i2…in of {1,2,…,n} in which no integer is in its natural position: i11,i22,…,inn. We denote by Dn the number of derangements of {1,2,…,n}. Theorem 4.15:For n1,

Proof: Let S={1,2,…,n} and X be the set of all permutations of S Proof: Let S={1,2,…,n} and X be the set of all permutations of S. Then |X|=n!. For j=1,2,…,n, let pj be the property that in a permutation, j is in its natural position. Thus the permutation i1,i2,…,in of S has property pj provided ij=j. A permutation of S is a derangement if and only if it has none of the properties p1,p2,…,pn. Let Aj denote the set of permutations of S with property pj ( j=1,2,…,n).

Example:(1)Determine the number of permutations of {1,2,3,4,5,6,7,8,9} in which no odd integer is in its natural position and all even integers are in their natural position. (2) Determine the number of permutations of {1,2,3,4,5,6,7,8,9} in which four integers are in their natural position.

3. Permutations with relative forbidden position A Permutations of {1,2,…,n} with relative forbidden position is a permutation in which none of the patterns i,i+1(i=1,2,…,n) occurs. We denote by Qn the number of the permutations of {1,2,…,n} with relative forbidden position. Theorem 4.16:For n1, Qn=n!-C(n-1,1)(n-1)!+C(n-1,2)(n-2)!-…+(-1)n-1 C(n-1,n-1)1!

Proof: Let S={1,2,…,n} and X be the set of all permutations of S Proof: Let S={1,2,…,n} and X be the set of all permutations of S. Then |X|=n!. j(j+1), pj Aj: pj Qn=Dn+Dn-1 Generating functions

Exercise P86 6,8,10,12,14,16,18,20 1.How many solutions are there to the equation x1+x2+x3+x4+x5=25,where x1,x2,x3,x4, and x5 are nonnegative integers? 2.How many strings of 20 decimal digits are there that contain two 0s,four 1s,three2s,one 3,two4s, three 5s,two 7s, and three9s? 3.How many positive integers less than 1,000,000 have the sum of their digits equal to 19? 4.A football team of 11players is to be selected from a set of 15 players, 5 of whom can only play in the backfield, 9 of whom can only play on the line, and 2 of whom can play either in the backfield or on the line. Assuming a football team has 7 men on the line and 4 in the backfield, determine the number of football teams possible. 5. Find the number of integers between 1 and 10,000 inclusive which are not divisible by 4,5, or 6. 6. Determine the number of 12-combinations of the multiset S={4·a,3·b,5·c, 4·d }. 7. Determine the number of solutions of the equation x1+x2+x3+x4=14 in nonnegative integers x1,x2,x3, and x4 not exceeding 8. 8. Determine the number of permutations of {1,2,3,4,5,6,7,8} in which no even integer is in its natural position. 9. Determine the number of permutations of {1,2,…,n} in which exactly k integers are in their natural positions. 10.Eight boys are seated around a carousel. In how many ways can they change seats so that each has a different boy in front of him?