Permutations and Combinations

Similar documents
Discrete Structures Lecture Permutations and Combinations

The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n ways to do the first task and n

Section Summary. Permutations Combinations Combinatorial Proofs

Topics to be covered

7.4 Permutations and Combinations

Sec$on Summary. Permutations Combinations Combinatorial Proofs

Discrete Mathematics with Applications MATH236

Permutations and Combinations. MATH 107: Finite Mathematics University of Louisville. March 3, 2014

CIS 2033 Lecture 6, Spring 2017

Elementary Combinatorics CE 311S

Math 3012 Applied Combinatorics Lecture 2

Compound Probability. Set Theory. Basic Definitions

DISCRETE STRUCTURES COUNTING

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

Finite Math - Fall 2016

Poker: Further Issues in Probability. Poker I 1/29

CSE 312: Foundations of Computing II Quiz Section #2: Combinations, Counting Tricks (solutions)

CSCI 2200 Foundations of Computer Science (FoCS) Solutions for Homework 7

Probability Theory. Mohamed I. Riffi. Islamic University of Gaza

8.2 Union, Intersection, and Complement of Events; Odds

Math 166: Topics in Contemporary Mathematics II

ACTIVITY 6.7 Selecting and Rearranging Things

n! = n(n 1)(n 2) 3 2 1

Fundamental. If one event can occur m ways and another event can occur n ways, then the number of ways both events can occur is:.

Permutations and Combinations Section

Week 3-4: Permutations and Combinations

MAT104: Fundamentals of Mathematics II Summary of Counting Techniques and Probability. Preliminary Concepts, Formulas, and Terminology

November 6, Chapter 8: Probability: The Mathematics of Chance

Block 1 - Sets and Basic Combinatorics. Main Topics in Block 1:

6.4 Permutations and Combinations

Counting. Chapter 6. With Question/Answer Animations

Question 1: How do you count choices using the multiplication principle?

Counting Methods and Probability

Mixed Counting Problems

Lecture 18 - Counting

Multiple Choice Questions for Review

11.3B Warmup. 1. Expand: 2x. 2. Express the expansion of 2x. using combinations. 3. Simplify: a 2b a 2b

HOMEWORK ASSIGNMENT 5

Theory of Probability - Brett Bernstein

Student Exploration: Permutations and Combinations

With Question/Answer Animations. Chapter 6

Chapter Permutations and Combinations. Section 4 Permutations and Combinations. Example. Definition of n Factorial (n!)

Mat 344F challenge set #2 Solutions

Learning Objectives for Section 7.4 Permutations and Combinations. 7.4 Permutations and Combinations

Counting in Algorithms

Discrete mathematics

2. Combinatorics: the systematic study of counting. The Basic Principle of Counting (BPC)

Well, there are 6 possible pairs: AB, AC, AD, BC, BD, and CD. This is the binomial coefficient s job. The answer we want is abbreviated ( 4

10-1. Combinations. Vocabulary. Lesson. Mental Math. able to compute the number of subsets of size r.

Simple Counting Problems

Applications of Fermat s Little Theorem and Congruences

CS 237: Probability in Computing

Solutions to Exercises Chapter 6: Latin squares and SDRs

Counting and Probability Math 2320

Problem Set 8 Solutions R Y G R R G

1 Permutations. 1.1 Example 1. Lisa Yan CS 109 Combinatorics. Lecture Notes #2 June 27, 2018

COUNTING AND PROBABILITY

CISC-102 Fall 2017 Week 8

Chapter 7. Intro to Counting

Discrete Structures for Computer Science

Sets. Definition A set is an unordered collection of objects called elements or members of the set.

Combinatorial Proofs

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability (solutions)

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:

CSE 21 Mathematics for Algorithm and System Analysis

Unit 5 Radical Functions & Combinatorics

FOURTH LECTURE : SEPTEMBER 18, 2014

Permutations and Combinations

Sec 5.1 The Basics of Counting

Finite Math Section 6_4 Solutions and Hints

Elementary Combinatorics

Finite Mathematics MAT 141: Chapter 8 Notes

Probability. The MEnTe Program Math Enrichment through Technology. Title V East Los Angeles College

MATH 351 Fall 2009 Homework 1 Due: Wednesday, September 30

Math 42, Discrete Mathematics

Section : Combinations and Permutations

Permutations And Combinations Questions Answers

Counting integral solutions

It is important that you show your work. The total value of this test is 220 points.

PERMUTATIONS AND COMBINATIONS

Math 454 Summer 2005 Due Wednesday 7/13/05 Homework #2. Counting problems:

CSCI FOUNDATIONS OF COMPUTER SCIENCE

Math 475, Problem Set #3: Solutions

2. How many bit strings of length 10 begin with 1101? a b. 2 6 c. 2 4 d. None of the above.

Permutations: The number of arrangements of n objects taken r at a time is. P (n, r) = n (n 1) (n r + 1) =

Combinations AMC AMS AMR ACS ACR ASR MSR MCR MCS CRS

Chapter 5 - Elementary Probability Theory

CSE 312 Midterm Exam May 7, 2014

Unit 2 Lesson 2 Permutations and Combinations

Probability MAT230. Fall Discrete Mathematics. MAT230 (Discrete Math) Probability Fall / 37

Section The Multiplication Principle and Permutations

What is counting? (how many ways of doing things) how many possible ways to choose 4 people from 10?

Poker: Probabilities of the Various Hands

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability

Discrete Mathematics: Logic. Discrete Mathematics: Lecture 15: Counting

CHAPTER 5 BASIC CONCEPTS OF PERMUTATIONS AND COMBINATIONS

Jong C. Park Computer Science Division, KAIST

STATISTICAL COUNTING TECHNIQUES

Problem Set 8 Solutions R Y G R R G

Foundations of Computing Discrete Mathematics Solutions to exercises for week 12

Transcription:

Permutations and Combinations

Introduction Permutations and combinations refer to number of ways of selecting a number of distinct objects from a set of distinct objects. Permutations are ordered selections; combinations are unordered selections. Example: S = {1,2,3}. Ordered selections of two objects from S: 1,2; 1,3; 2,1; 2,3; 3,1; 3,2 Unordered selections of two objects from S: {1,2}, {1,3}, {2,3} Observe that there are twice as many permutations as combinations in this case, because each permutation corresponds to two combinations. The general rule for the ratio of permutations and combinations is more complicated. We will discuss it in this presentation. We write P n, k for the number of permutations of k objects from n objects; and C n, k or n ( n choose k ) for the number of combinations of k k objects from n objects. We also refer to the numbers C n, k as binomial coefficients. The reason for this will become clear in the presentation on the binomial theorem.

Permutations Suppose you have n objects and wish to make an ordered selection of k objects from them. We refer to these ordered selections as permutations and write n P k or P n, k for their number. There are n choices for the first object. Once that one has been chosen, there are only n 1 choices for the second object, then only n 2 choices for the third object, and so on. For the kth object, there are n k + 1 choices. By the product rule, the number of ways of making this ordered selection is np k = P n, k = n n 1 n 2 n k + 1 A special case is n = k. In this case, we are selecting all available objects, and the number of ways of making that (ordered) selection is n n 1 n 2 3 2 1 You may already be familiar with this type of expression. It is called n factorial and written n!.

A formula for permutations Using the factorial, we can rewrite as P n, k = n n 1 n 2 n k + 1 n! P n, k = n k! This formula is theoretically useful, for proving formulas involving permutations (and combinations), but it is of no computational relevance. P n, k is most efficiently computed in a for loop where k goes from n down to n k + 1, and where all these k values are multiplied together. Computing two factorials, only to cancel out most of the factors by division afterwards, is inefficient at best, impossible at worst. The latter is the case when n! is so large, it goes beyond the available integer data types.

Example 1 Problem: a head of state wishes to receive 5 diplomats. The order of reception is important for diplomatic protocol. In how many different orders can the 5 diplomats be received? Solution: the question asks for the number of permutations of 5 out of 5 elements. There are 5! = 5 4 3 2 1 = 120 many such permutations.

Example 2 Problem: a department has 30 professors. Four need to be selected for a committee. The committee has a chair, a vice chair, a secretary, and a fourth member without special privileges or duties. In how many ways can this committee be chosen? Solution: selecting this committee means making an ordered selection of 4 out of 30 people. Therefore, the number of ways of doing that is P 30,4 = 30 29 28 27 = 657720

Example 3 Problem: How many 3 letter words (that includes nonsense words) can you create from the 26 letters of the alphabet if there is no repetition of letters? Solution: the number of such letters is P 26,3 = 26 25 24 = 15600.

Combinations Suppose you have n objects and wish to make an unordered selection of k objects from them. We refer to these selections as combinations and write n C k or C n, k for their number. Let s not try to re-invent the wheel here. We already know that the number of ways of making an ordered selection is P n, k. So now all we need is a relationship between the number of combinations and permutations for k objects chosen from n objects. An example will explain this relationship. Let s say we have 4 objects: 1,2,3,4, and we are selecting 3 of them. Then each unordered selection, like {1, 3, 4} corresponds to several ordered selections: 1, 3, 4; 1, 4,3; 3,1,4; 3,4,1; 4,1,3; 4,3,1. Since each unordered selection has 3 objects, there are 3! ordered selections (permutations) of those 3 objects. This means that the number of ordered selections (permutations) is equal to k! times the number of unordered selections (combinations): P n, k = C n, k k!

Combinations, Continued The formula P n, k = C n, k k! can be solved for the number of combinations C n, k : C n, k = P(n, k) k! = n! n k! k! Again, the formula involving factorials is of purely theoretical value. It is not efficient for computing combinations in practice. In practice, we compute combinations by using the middle formula. We compute the corresponding number of permutations and then divide by k!. Combinations usually involve a large number of cancellations that can be exploited for computing them without a calculator. Example: C 5,3 = 5 4 3 3 2 1 = 5 2 = 10

Example 1 How many 3 card hands can you be dealt from a standard deck of 52 playing cards? A hand of cards is by definition an unordered selection. Therefore, the answer to the question is C 52,3 = 52 51 50 3 2 1 = 26 17 50 = 22100

Example 2 How many committees of 4 senators can be selected from 100 senators? Without additional requirements, these committees correspond to unordered selections. Therefore, the answer is C 100,4 = 100 99 98 97 4 3 2 1 = 25 33 49 97 = 3,921,225 If there was the additional requirement that a committee has a chair, then the answer would be, according to the product rule, 100 C 99,3 = 15,684,900

Example 3 Problem: There are 193 diplomats at a meeting, each representing one nation. In how many ways can a committee of 20 diplomats be selected so that exactly 4 of them are from the 55 African countries? Give the answer purely in terms of combinations. Answer: C(138,16) C(55,4)

The symmetry of combinations Combinations have an important symmetry. Observe that when you replace k by n k in the formula n! C n, k = n k! k!, the two factors in the denominator just switch places. Therefore, C n, k = C n, n k. This formula leads to a computational advantage. When we compute a combination, we need to evaluate a product of k factors in the numerator, and k factors in the denominator. Therefore, the computational expense grows with k. Using C n, k = C n, n k, we can effectively replace a k which is bigger than one-half of n by one that is smaller than that. Example: C 10,8 = 10 9 8 7 6 5 4 3 8 7 6 5 4 3 2 1 = C 10,2 = 10 9 2 1 = 5 9 = 45.

Another perspective on combinations An unordered selection of objects from a set S is a subset of S. Therefore, C n, k is the number of subsets of size k of a set of size n. Example: How many subsets containing 3 members are there of a set of 6 members? Answers: There are C 6,3 = 6 5 4 3 2 1 = 5 4 = 20 such subsets. This perspective leads to an effortless explanation of the symmetry of combinations. Picking a subset of size k of a set of size n is equivalent to picking its complement, which is of size n k. Deciding what is included in your set is equivalent to deciding what is excluded, so the number of ways to pick the excluded set must be equal to the number of ways to pick the included set. Therefore, C n, n k must be equal to C n, k.

Distinguishable Permutations An important application of combinations is to compute numbers of distinguishable permutations. We speak of distinguishable permutations when we consider rearrangements of objects where identical copies are present. The following example illustrates that. How many distinguishable rearrangements are there of the string TTTFF? The string contains 3 identical T s, and 2 identical F s. A unique, distinguishable rearrangement of the string is completely determined by the positions of the 3 T s, which is a set of 3 numbers. For example, TTTFF above corresponds to the position set {1,2,3}. TTFTF corresponds to the position set {1,2,4}. Therefore, the number of distinguishable rearrangements of TTTFF is equal to the number of ways we can pick a subset of 3 numbers out of the set {1,2,3,4,5}. By what we just learned, that can be done in exactly C 5,3 ways. [We could also define each distinguishable rearrangement by the set of positions of the F s. By the same logic we just used, the number of distinguishable rearrangements of TTTFF is then C 5,2. Due to the symmetry of combinations, C 5,3 and C 5,2 are equal.]