# Arrangements Selections with Repetition Arrangements with Unlimited Repetition

• Slides: 17

Arrangements & Selections with Repetition

Arrangements with Unlimited Repetition • Enumerating r-permutations from a set of n objects with repetition, denoted, U(n, r) = nr. • What does this number remind you of? • Example: • There are 25 true/false questions on an examination. • How many different ways can a student fill in answers, if she can also leave the answer blank?

Arrangements with Limited Repetition • Generalizing the MISSISSIPPI example: • Theorem 1: If there are r 1 objects of type 1, r 2 of type 2, …, rm of type m, where r 1 + r 2 +. . . + rm = n, then the # of arrangements of these n objects, denoted P(n; r 1 , r 2 , …, rm ) , is

• We have n positions to distribute the objects. • Select r 1 of them to position the objects of type 1. • n - r 1 positions remain with rm-1 types of objects. Repeat. (Use an induction argument)

Proof Use the product rule: • Phase 1: pick the positions for the type 1 objects There are n. Cr 1 ways to do that. • Phase 2: pick the positions for the type 2 objects There are (n - r 1)Cr 2 ways to do that. And so on … • Phase m: pick the positions for the type m objects There are (n - r 1 - r 2 - …- rm-1)Crm ways to do that.

Example How many ways can 23 different books be given to 5 students so that 2 students get 4 books each, and the other 3 get 5 books each? • Use the product rule: 1. Pick the 2 students of 5 who receive 4 books. 2. Distribute the books to the students. I. e. , pick the 4 books for student 1, pick the 4 books for student 2, pick the 5 books for student 3, … The answer thus is 5 C 2 P(23; 4, 4, 5, 5, 5).

Example How many 8 -digit sequences are there involving exactly 6 different digits? • Use the product rule: 1. Pick the 6 digits to be used. 2. For any given 6 digits, count the sequences

• For a given 6 digits, count the sequences • Use the sum rule • Partition the answers according to the 2 possible distribution of the 6 digits. • 1 digit is used 3 times; the other 5 are used once • 2 digits are used twice; the other 4 are used once • Count the solutions for each distribution. • Pick the digit to be used 3 times; arrange the digits. • Pick the digits to be used twice; arrange the digits.

Selections with Unlimited Repetition • Key to this kind of problem: Knowing how to count the number of n-bit binary strings with exactly r 1 s: n. Cr. • We want to count the number of distinct selections of 12 items from identical: • • Palm Pilots Nokia cell phones IBM Think Pads Uzi machine guns.

• For example, 1 possible such selection is: 1 Palm Pilot 0 Nokia cell phones 10 IBM Think Pads 1 Uzi machine gun As a string, we could represent this selection as: P//IIIII/U

• How would we represent as a string the selection: 2 Palm Pilot 3 Nokia cell phones 6 IBM Think Pads 1 Uzi machine gun • If we agree on an order of item types, we could represent this selection as 00/000000/0

• Each string with 12 0 s and 3 /s corresponds to 1 selection. • Each such selection corresponds to 1 such string. • Thus, the problem is equivalent to asking “How many (12 + 4 - 1)-bit binary strings are there with exactly 3 1 s? ” • There are (12 + 4 - 1)C 3 = (12 + 4 - 1)C 12 such strings.

Selection with Unlimited Repetition: Equivalent Formulations The number of • r-combinations of n distinct objects with unlimited repetition. • nonnegative integer solutions to x 2 +. . . + xr = n. x 1 + • ways to distribute n balls into r numbered boxes. • (n + r - 1)-bit binary strings with exactly r-1 1 s. (n + r - 1)C(r -1) = (n + r - 1)Cn

Example How many ways are there to pick 10 balls from unlimited piles of identical red, blue, and black balls, and 1 green, 1 orange, and 1 yellow ball?

Example How many ways are there to pick 10 balls from unlimited piles of identical red, blue, and black balls, and 1 green, 1 orange, and 1 yellow ball? • Partition the solution set into those that use 1, 2, or 3 of the “limited edition (LE)” balls. • For a given part, use the product rule: • count the ways to pick the LE ball[s] • count the ways to pick the rest of the balls.

Example How many ways are there to pick 20 recreational drug items from: • • beers, joints, jolts, original bottles of coke (which contained cocaine) • If you must have at least 2 beers, 3 joints, 1 jolt, & 3 cokes?

• This is equivalent to asking how many different selections are there of 20 - 2 - 3 - 1 - 3 = 11 items: (11 + 4 - 1)C(4 - 1).