Basic Permutations and Combinations

Slides:



Advertisements
Similar presentations
1 A B C
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Simplifications of Context-Free Grammars
Variations of the Turing Machine
& dding ubtracting ractions.
Chapter 1 The Study of Body Function Image PowerPoint
David Burdett May 11, 2004 Package Binding for WS CDL.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
CALENDAR.
2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt ShapesPatterns Counting Number.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 10 second questions
Solve Multi-step Equations
Break Time Remaining 10:00.
Discrete Math Recurrence Relations 1.
Factoring Quadratics — ax² + bx + c Topic
PP Test Review Sections 6-1 to 6-6
Digital Lessons on Factoring
9.5 Counting Subsets of a Set: Combinations
Copyright © 2002 by Radhika Nagpal and Charles E. Leiserson. All rights reserved. October 30, L9-2.1 Mathematics for Computer Science MIT 6.042J/18.062J.
1 Combinations & Counting II Samuel Marateck © 2009.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
VOORBLAD.
Generalized Permutations & Combinations: Selected Exercises.
Counting. Counting = Determining the number of elements of a finite set.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
© 2012 National Heart Foundation of Australia. Slide 2.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
Sets Sets © 2005 Richard A. Medeiros next Patterns.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Artificial Intelligence
Before Between After.
25 seconds left…...
Subtraction: Adding UP
: 3 00.
5 minutes.
1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
Januar MDMDFSSMDMDFSSS
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
12 System of Linear Equations Case Study
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
& dding ubtracting ractions.
Physics for Scientists & Engineers, 3rd Edition
Select a time to count down from the clock above
Copyright Tim Morris/St Stephen's School
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.
CSE115/ENGR160 Discrete Mathematics 04/17/12
CSE 321 Discrete Structures Winter 2008 Lecture 16 Counting.
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
1 Binomial Coefficients CS 202 Epp, section ??? Aaron Bloomfield.
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,
Section 6.4. Powers of Binomial Expressions Definition: A binomial expression is the sum of two terms, such as x + y. (More generally, these terms can.
Binomial Coefficients and Identities
Permutations and Combinations
Permutations and Combinations
Presentation transcript:

Basic Permutations and Combinations Discrete Math Basic Permutations and Combinations

Ordering Distinguishable Objects When we have a group of N objects that are distinguishable how can we count how many ways we can put M of them into different orders? 20 students are distinguishable, each one is unique 20 coins of the same type are not distinguishable, each one is a copy of the others

An example Consider 60 students in a classroom. The students are distinguishable, we can tell one student from another How many ways to choose an ordered line of 5 students from a class of 60? Note that order matters 1 2 4 is different from 2 1 4

Revisit example: solution Consider the 60 students in the classroom How many ways to choose an ordered row of 5 students from the class? use product rule 60*59*58*57* 56 = N OR N * (55*54*…*1) / (55*54*…*1) = 60! / 55!

Another example How many ways can we seat 30 students in a lecture hall with 80 seats. First student to sit down has 80 choices Second has 79 … 80*79*…*51 * (50*49*….*1)/(50*49*….*1) 80! / 50!

Without replacement How many 6 digit numbers are there, in which no digit is repeated and there are no digits that are 0? 9 choices for first digit (0 not permitted) 8 choices for 2nd digit … 9*8*7*6*5*4 * (3*2*1) / (3 * 2 * 1) 9!/3! We are choosing digits without replacement (we cannot choose the same digit again)

With replacement How many 6 digit numbers are there, in which no digits that are 0? 9 choices for first digit (0 not permitted) 9 choices for 2nd digit … 9*8*7*6*5*4 * (3*2*1) / (3 * 2 * 1) 9!/3! We are choosing digits with replacement (we can choose the same digit again,)

With and without replacement Consider a bag with 10 chips in it, on each chip one digit (0, 1, …, 9) is written We choose a chip from the bag, the digit on the chip is the first digit in our number If we are choosing with replacement we put the chip back in the bag before making our next choice If we are choosing without replacement we do not put the chip back in the bag before making our next choice

Permutation A permutation is a distinct ordering of distinguishable objects without replacement A k permutation is a distinct ordering of k objects chosen from N objects where N≥k. Suppose we have N distinguishable objects and we wish to order k of these objects without replacement. The number of ways we can order these k objects is

Anagrams An anagram is a permutation of the letters in a word How many anagrams can we make of a particular word. First Case: no letters in the word are repeated Second Case: one or more letters in the word are repeated

No repeated letters Try a 4 letter word For any anagram have 4 choices for the first character Have 3 choices for the second character Have 2 choices for the third character Have 1 choice for the final character So there are 4! Anagrams of a 4 letter word In general there are N! anagrams of an N letter word

With repeated letters (1) When the word has repeated letters we cannot distinguish the anagrams with those repeated letters in the same locations Consider the word SPITS The anagram SSITP and SSITP (the two s’s in different orders) are not distinguishable

With repeated letters (2) For a word with one letter appearing twice SPITS Every distinguishable anagram will have two S’s. We cannot distinguish if we change the order of those S’s So 5! /2 possible distinguishable anagrams

With repeated letters (3) PINEAPPLE For a letter that repeats 3 times in the word we have 3*2*1 ways that the P’s can be arranged in each distinguishable anagram We also have 2 E’s with 2*1 ways to arrange the E’s in each distinguishable anagram 9! / (3! *2!) anagrams

Selecting students We used permutations to count how many ways we could make an orderly row of 5 students from a class of 60 students. What if our orderly row forms a cluster instead of a row, we no longer have order we have a mob not a line. How many 5 persons mobs can be formed from a class of 60 students. 60 ! / 55! Lines, 5! Possible lines for each mob 60! / (55! * 5!) mobs

Selecting students Select a k student mob from a class of N students. Number of mobs you can select is Number of ways of choosing k objects from a group of N objects read N choose k also known as a binomial coefficient

Combinations Consider the set of N objects from which we are selecting a group of k objects We are counting the subsets of the set of N objects that have k elements Each subset of k elements can be considered an k combination, a subset or unordered group of k elements chosen from the set of N elements The number of k combinations of the set of N elements is denoted C(N,k)

Example: Combinations How many bit strings of length 8 have exactly 3 1’s? Choose 3 of 8 positions for the 1’s 8 choose 3 ways OR Choose 5 of 8 positions for the 0’s 8 choose 5 ways 8!/(5!3!)=8*7*6/(2*3) =56

Combinations with replacement There are C(n+r-1,r)=C(n+r-1,n-1) r combinations from a set with n elements when repetition is allowed. Each r-combination of a set with n elements when repetition is allowed can be represented by a list of n-1 bars (dividers) and r stars (items) N=4, r=6 one combination **|**|*|*

Combinations with replacement Each possible combination can be represented by a list of bars and stars So count the number of ways n-1 bars and r stars can be arranged in a list The number of ways n-1 bars can be placed into n-1+r positions C(n-1+r,n-1) The number of ways r stars can be placed into n-1+r positions C(n-1+r,r)

Combinatorial Proof A combinatorical proof of an identity is a proof that uses counting arguments to prove that both sides of the identity count the same objects but in different ways Many identities involving the binomial theorem can be proved using combinatorial proofs

The Binomial Theorem Let x an y be variables, and let n be a nonnegative integer Then

Binomial Theorem Proof The terms in the product are of the form xn-jyj for j=0,…,n Count the number of terms Must choose n-j x’s from x terms so the other j terms are y’s Therefore the coefficient will be n choose n-j

Seating students How many ways to seat 30 students in a lecture hall with 80 seats. Choose the occupied seats 80 choose 30 Then permute the students in those seats 30! Ways

Binomial coefficients Let n be a nonnegative integer Then Combinatorial Proof: Using the binomial theorem

Why? Binomial Theorem The binomial theorem tells us how to determine the coefficients in the expansion of (x+y)n n=0 1 coefficients (1) n=1 x + y coefficients (1, 1) N=2 x2 + 2xy + y2 coefficients (1,2,1)

Pascal’s triangle Represents the binomial coefficients 1 n=0 1 1 n=1 1 2 1 n=2 1 3 3 1 n=3 1 4 6 4 1 n=4 For n=4 x4+4x3y+6x2y2+4xy3+1

Pascal’s triangle Can also be represented n=0 n=1 n=2 n=3 n=4

Pascal’s Identity Pascal’s triangle is based on Pascal’s identity Each row is the values of for a given n and for k=0,1, …, n

Proving Pascal’s Identity Combinatorial Proof Let T be a set containing n+1 elements There are subsets of T with k elements Let S be a subset of T with n elements S=T-{a} where a is an arbitrary element of T There are subsets of S with k elements Any subset of T with n elements either contains element a or does not contain element a

Proving Pascal’s Identity Combinatorial Proof Any subset of T with k elements either contains element a or does not contain element a S does not contain a so a subset of T with k elements that does not contain element a is also an subset S. Therefore there are subsets of T with k elements do not contain a A k element subset of T that does contain a, contains a and k-1 elements of S. There are subsets of S with k-1 elements. Therefore there are k element subsets of T that contain a Therefore the number of k element subsets of T is