Chapter 1 Fundamental Principles of Counting Discrete Mathematics.

Slides:



Advertisements
Similar presentations
Basic Permutations and Combinations
Advertisements

Counting Chapter 6 With Question/Answer Animations.
Permutations and Combinations Rosen 4.3. Permutations A permutation of a set of distinct objects is an ordered arrangement these objects. An ordered arrangement.
Counting Chapter 6 With Question/Answer Animations.
Recursively Defined Functions
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,
1 集合論 Chapter 3. 2 Chapter 3 Set Theory 3.1 Sets and Subsets A well-defined collection of objects (the set of outstanding people, outstanding is very.
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
CSE115/ENGR160 Discrete Mathematics 04/17/12
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 Chapter 3. 排列與組合 3.1 加法原則與乘法原則 3.2 排列 3.3 組合 3.4 Stirling’s Formula.
CSE 321 Discrete Structures Winter 2008 Lecture 16 Counting.
More Counting Lecture 16: Nov 9 A B …… f. Counting Rule: Bijection If f is a bijection from A to B, then |A| = |B| A B …… f.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
1 Permutations and Combinations CS/APMA 202 Epp section 6.4 Aaron Bloomfield.
Permutations and Combinations
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.
CS100 : Discrete Structures
Chapter 1 Fundamental principles of counting 陳彥良 中央大學資管系.
Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).
Combinatorics 3/15 and 3/ Counting A restaurant offers the following menu: Main CourseVegetablesBeverage BeefPotatoesMilk HamGreen BeansCoffee.
Discrete Mathematics CS 2610 March 26, 2009 Skip: structural induction generalized induction Skip section 4.5.
1 Permutations and Combinations CS/APMA 202 Rosen section 4.3 Aaron Bloomfield.
7 Further Topics in Algebra © 2008 Pearson Addison-Wesley. All rights reserved Sections 7.4–7.7.
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
Binomial Coefficients, Inclusion-exclusion principle
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 6 Generating Functions.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Chapter 3 Permutations and combinations
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
2. Combinatorial Methods p Introduction If the sample space is finite and furthermore sample points are all equally likely, then P(A)=N(A)/N(S)
1 Lecture 4 (part 1) Combinatorics Reading: Epp Chp 6.
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.
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 Set Theory Chapter 3. 2 Chapter 3 Set Theory 3.1 Sets and Subsets A well-defined collection of objects (the set of outstanding people, outstanding is.
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.
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 Chapter 5 Counting.
Discrete Mathematics Chapter 5 Counting 大葉大學 資訊工程系 黃鈴玲.
Discrete Mathematics Chapter 6 Advanced Counting Techniques.
Textbook: Discrete and Combinatorial Mathematics:
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science V. AdamchikCS Spring 2006 Lecture 6Feb 2, 2005Carnegie.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
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.
Binomial Coefficients and Identities
CS 104: Discrete Mathematics
1 DISCRETE STRUCTURES DISCRETE STRUCTURES SSK3003 DR. ALI MAMAT 1.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 5 Counting 歐亞書局.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
UNIT 5 Fundamental principles of counting
The Pigeonhole Principle
Permutations and Combinations
CSE15 Discrete Mathematics 04/19/17
ICS 253: Discrete Structures I
Chapter 5, Section 5.1 The Basics of Counting
A First course in Probability (8th Ed), Sheldon Ross
COCS DISCRETE STRUCTURES
Permutations and Combinations
Counting Chapter 6 With Question/Answer Animations
CS 2210 Discrete Structures Counting
CS100: Discrete structures
Permutations and Combinations
Basic Counting.
More Counting A B … f Lecture 16: Nov 9.
Basic Counting Lecture 9: Nov 5, 6.
Presentation transcript:

Chapter 1 Fundamental Principles of Counting Discrete Mathematics

2 Textbook: Discrete and Combinatorial Mathematics: An Applied Introduction 5rd edition, by Ralph P. Grimaldi Course Outlines: 1. Fundamental Principles of Counting 2. Fundamentals of Logic 3. Set Theory 4. Mathematical Induction 5. Relations and Functions 6. Languages: Finite State Machines 7. The principle of Inclusion and Exclusion 8. Generating Functions 9. Recurrence Relations 10. Graph Theory 11. Number Theory

3 Chapter 1: Fundamental Principles of Counting 1.1 The Rules of Sum and Product problem decompose combine The Rule of Sum 第一件工作 第二件工作 m ways n ways can not be done simultaneously then performing either task can be accomplished in any one of m+n ways

4 Chapter 1: Fundamental Principles of Counting 1.1 The Rules of Sum and Product E.g. 1.1: 40 textbooks on sociology 50 textbooks on anthropology to select 1 book: choices What about selecting 2 books?

5 Chapter 1: Fundamental Principles of Counting 1.1 The Rules of Sum and Product E.g. 1.2: things k ways m 1 m 2 m 3 m k select one of them: m 1 +m 2 +m m k ways

6 Chapter 1: Fundamental Principles of Counting 1.1 The Rules of Sum and Product The Rule of Product 第一階段工作 第二階段工作 m ways n ways then performing this task can be accomplished in any one of mn ways

7 Chapter 1: Fundamental Principles of Counting 1.1 The Rules of Sum and Product The Rule of Product E.g The license plate: 2 letters-4 digits (a) no letter or digit can be repeated (b) with repetitions allowed (c) same as (b), but only vowels and even digits 5252 x5 4

8 Chapter 1: Fundamental Principles of Counting 1.1 The Rules of Sum and Product BASIC variables: single letter or single letter+single digit 26+26x10=286 rule of sumrule of product

9 Chapter 1: Fundamental Principles of Counting 1.2 Permutations E.g 個學生, 選 5 個出來排隊 Def 1.1 For an integer n ≧ 0, n factorial (denoted n!) is defined by 0!=1, n!=(n)(n-1)(n-2)...(3)(2)(1), for n ≧ 1. Beware how fast n! increases. 10!= =1024

10 Chapter 1: Fundamental Principles of Counting 1.2 Permutations Def 1.2 Given a collection of n distinct objects, any (linear) arrangement of these objects is called a permutation of the collection. n 個選 r 個的排列方法 if repetitions are allowed: n r

11 Chapter 1: Fundamental Principles of Counting 1.2 Permutations E.g permutation of BALL 4!/2!=12 E.g permutation of PEPPER 6!/(3!2!)=60 E.g permutation of MASSASAUGA 10!/(4!3!)=25200 if all 4 A’s are together 7!/3!=840

12 Chapter 1: Fundamental Principles of Counting 1.2 Permutations E.g Number of Manhattan paths between two points with integer coordinated From (2,1) to (7,4): 3 Ups, 5 Rights Each permutation of UUURRRRR is a path. 8!/(5!3!)=56

13 Chapter 1: Fundamental Principles of Counting Combinatorial Proof E.g Prove that if n and k are positive integers with n=2k, then n!/2 k is an integer. Consider the n symbols x 1,x 1,x 2,x 2,...,x k,x k. Their permutation is must be an integer

14 Chapter 1: Fundamental Principles of Counting circular permutation E.g 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 rotations? ABCDEF,BCDEFA,CDEFAB,DEFABC,EFABCD,FABCDE are the same arrangements circularly. 6!/6=5! (in general, n!/n)

15 Chapter 1: Fundamental Principles of Counting circular permutation E.g couples in a round table with alternating sex F M1 F2 M2 F3 M3 3 ways 2 ways 1 way total=

16 Chapter 1: Fundamental Principles of Counting Exercise 1.1 and 1.2 on page ,22, 26, 28,30

17 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem When dealing with any counting problem, we should ask ourselves about the importance of order in the problem. When order is relevant, we think in terms of permutations and arrangements and the rule of product. When order is not relevant, combinations could play a key role in solving the problem.

18 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g (a) 考試時, 可回答十題中任七題的方法 : C(10,7) (b) 前五題答三題, 後五題答四題 : (c) 前五題至少答三題 前五題答三題 : 前五題答四題 : 前五題答五題 : 加起來

19 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g 個學生組成四隻球隊, 每隊 9 人的方法 method 1. method 2. students teams ABCD... B (9 As,9Bs,9Cs,9Ds)

20 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem Select 3 cards from a deck of playing cards without replacement: order of selection is relevant: P(52,3)= order of selection is irrelevant: P(52,3)/3!=C(52,3)

21 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g TALLAHASSEE permutation= without adjacent A: disregard A first9 positions for 3 A to be inserted Challenge: Mississippi 相同字母不相鄰的排列 ? (Write a program to verify your answer.)

22 Chapter 1: Fundamental Principles of Counting The Sigma notation For example, You will learn how to compute something like that later.

23 Chapter 1: Fundamental Principles of Counting The Sigma notation

24 Chapter 1: Fundamental Principles of Counting The Sigma notation For example,

25 Chapter 1: Fundamental Principles of Counting The Sigma notation

26 Chapter 1: Fundamental Principles of Counting The Pi notation

27 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g. 1.23alphabets: a,b,c,d,...,1,2,3,... symbols: a,b,c,ab,cde,... strings: concatenation of symbols, ababab,bcbdgfh,... languages: set of strings {0,1,00,01,10,11,000,001,010,011,100,101,...} ={all strings made up from 0 and 1}

28 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g 由 0,1,2 構成的長度為 n 的 string 有 3 n 個 if define for example, wt(000)=0, wt(1200)=3

29 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g Among the 3 10 strings of length 10, how many have even weight? Ans.: the number of 1’s must be even number of 1’s=i (i=0,2,4,6,8, or 10) number of strings= total= Select i positions for the i 1’s

30 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem Be careful not to overcount. E.g Select 5 cards which have at least 1 club. reasoning (a): all minus no-club reasoning (b): select 1 club first, then other 4 cards What went wrong?

31 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem Be careful not to overcount. E.g Select 5 cards which have at least 1 club. for reasoning (b): select C3 then C5,CK,H7,SJ select C5 then C3,CK,H7,SJ select CK then C5,C3,H7,SJ All are the same selections.

32 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem Be careful not to overcount. E.g Select 5 cards which have at least 1 club. for reasoning (b):correct computation number of clubs selected non-clubs

33 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem Try to prove it by combinatorial reasoning. Theorem 1.1 The Binomial Theorem binomial coefficient Select k x’s from (x+y) n

34 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g The coefficient of x 5 y 2 in (x+y) 7 is The coefficient of a 5 b 2 in (2a-3b) 7 is

35 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem Corollary 1.1. For any integer n>0, (a) (b) (x=y=1) (x=1,y=-1)

36 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem Theorem 1.2 The multinomial theorem For positive integer n,t, the coefficient of in the expansion ofis where

37 Chapter 1: Fundamental Principles of Counting 1.3 Combinations: The Binomial Theorem E.g The coefficient ofin is

38 Chapter 1: Fundamental Principles of Counting Exercise ,18, 20,21, Combinations with Repetition: Distributions E.g 個人買食物, 有四種食物可選擇, 有幾種買法 ? first second third fourth xxxxxxx xx x x xxx xxxxxxx for x for

39 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions In general, the number of selections, with repetitions, of r objects from n distinct objects are:

40 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions E.g Distribute $1000 to 4 persons (in unit of $100) (a) no restriction(b) at least $100 for anyone (c) at least $100 for anyone, Sam has at least $500

41 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions E.g A message: 12 different symbols+45 blanks at least 3 blanks between consecutive symbolsTransmitted through network blanks available positions

42 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions E.g Determine all integer solutions to the equation wherefor all select with repetition from7 times For example, ifis selected twice, then in the final solution. Therefore, C(4+7-1,7)=120

43 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions Equivalence of the following: (a) the number of integer solutions of the equation (b) the number of selections, with repetition, of size r from a collection of size n (c) the number of ways r identical objects can be distributed among n distinct containers

44 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions E.g How many nonnegative integer solutions are there to the inequality It is equivalent to which can be transformed to wherefo r an d C(7+9- 1,9)=5005

45 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions E.g How many terms there are in the expansion of ? Each distinct term is of the form where for and Therefore, C(4+10-1,10)=286

46 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions E.g number of compositions of an positive integer, where the order of the summands is considered relevant. 4=3+1=1+3=2+2=2+1+1=1+2+1=1+1+2= has 8 compositions. If order is irrelevant, 4 has 5 partitions.

47 Chapter 1: Fundamental Principles of Counting What about 7? How many compositions? two summands three summands four summands Ans.:

48 Chapter 1: Fundamental Principles of Counting 1.4 Combinations with Repetition: Distributions E.g For i:=1 to 20 do For j:=1 to i do For k:=1 to j do writeln(i*j+k); How many times is this writeln executed? any i,j,k satisfyingwill do That is, select 3 numbers, with repetition, from 20 numbers. C(20+3-1,3)=C(22,3)=1540

49 Chapter 1: Fundamental Principles of Counting Exercise 1.4 Supplementary Exercises 11,12,19,20,22,25,28 21,24,29

50 Chapter 1: Fundamental Principles of Counting Summary order is repetitions relevant are allowed type of result formula YES NO permutation YES YES arrangement NO NO combination combination NO YES with repetition select or order r objects from n distinct objects