+ All Categories
Home > Documents > Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf ·...

Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf ·...

Date post: 30-Jan-2018
Category:
Upload: vukien
View: 215 times
Download: 0 times
Share this document with a friend
22
Combinatorics M. Salomone November 14, 2011
Transcript
Page 1: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics

M. Salomone

November 14, 2011

Page 2: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Contents

Page 3: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

1What is Combinatorics?

Page 4: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

2 Chapter 1. What is Combinatorics? Combinatorics

1.1 Counting subsets and k-element permutations

Monday, September 19: #15

15. A roller coaster car has n rows of seats, each of which has room for two people. If nmen and n women get into the car with a man and a woman in each row, in how manyways may they choose their seats?

MH There are two choices in each of n rows, so the number of choices is 2n.

Dr. S What are these two choices?

MR Two is the number getting seated in each row — the independent variable — and n thedependent variable.

MS That doesn’t account for repetition; doesn’t seem like it works.

MR You’re going to have a man and a woman in each row.

Dr. S But the n men are all different — so I have fewer choices for how to seat the second guyafter the first is seated. Try solving a simple case? Try sketching out the roller coasterand asking how many choices I have for each seat.

GU I tried n = 3 and got 8 possibilities, which agrees with 2n. Let me try n = 4.

JT But what about different orders?

MS For n = 1 there are two ways:M1W1, W1M1

For n = 2... [lists out eight ways]

Dr. S What if you start by assuming the men always sit on the left?

MS I did that: if the men are numbered 1,2 and the women A,B we have[1 A2 B

][1 B2 A

][2 A1 B

][2 B1 A

][

A 1B 2

][A 2B 1

][B 1A 2

][B 2A 1

]a total of eight ways.

SY But in all your possibilities, men sit behind men and women behind women. So thereare still some missing.

Dr. S If you’re listing all possibilities, you’re going to appreciate why combinatorics is aninteresting subject.

KS Is 144 the right number for n = 3?

Page 5: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 3

Dr. S I think you may be short by half.

SG What about 48 for n = 2?

Dr. S Seems too high to me.

GU [with a list of 16] I think I have them all for n = 2. So how does this generalize? Is it(2n)2?

KS [begins a list for n = 3]

SY Here’s what I have:In the first row you have n choices of man and n choices of woman n nIn the second you have (n−1) choices of each (n−1) (n−1)And so forth. (n−2) (n−2)

......

KS If the first row? is A1, then there are 16 possibilities. Then A2, A3, 1A, 1B, and so on This is a very interestingmethod — that wouldtranslate into a niceproof by induction.(Can you supply thedetails?)

all have 16 choices. There are then 18 choices for the first row, so the total number forn = 3 is

18 ·16 = 288.

SY Wait, I forgot something: you need to multiply by two to acknowledge that there aretwo different possibilities for man/woman on left/right.

In the first row you have n choices of man and n choices of woman 2 n nIn the second you have (n−1) choices of each 2 (n−1) (n−1)And so forth. 2 (n−2) (n−2)

......

So would those all add? Multiply?

Dr. S So what does this all multiply up to?

SY A quadratic equation?

Dr. S What does the product down the left row look like? What’s it called?

MS n factorial.

SY We have2(n2 · (n2−2n+2) · (n2−4n+4) · (n2−6n+9) · · ·)

Dr. S How far out does this go?

SY Until we get down to 1.

Dr. S Multiplying all the 2’s, then both rows of factorials, what does it look like?

SG 2n times n factorial times n factorial:

2n ·n! ·n!

or2n(n!)2.

Page 6: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

4 Chapter 1. What is Combinatorics? Combinatorics

SY Looks so easy to see it that way.

Wednesday—Friday, September 21—23: #18—2118. How many subsets does a set S with n elements have?

KS That one’s easy — it’s 2n.

JT I’m always suspicious when things look that easy.

MR Does the null set count as a subset?

Dr. S Remember what “subset” means: if A ⊂ B, then every element of A also belongs to B.Does every element of /0 also belong to /0?

MR Yes.? So we’ll conjecture this number isThis is an example of avacuously true

implication. ∣∣S×n∣∣+1.

We took the Cartesian product S×n, giving all the subsets of S with n elements. Thenwe added 1 to include /0.

Dr. S But n is a number of elements.

KS We got 2n, by listing out all subsets for n = 3 and n = 4.

SG We did the same.

Dr. S Can we be certain that pattern continues? Try turning the question into a “choices”problem.

SY What about the ways of ordering the elements?

MS Sets don’t care about order: {a,b,c} and {c,b,a} are the same set. Anyway, they allseem to be powers of 2 when you start listing them.

Dr. S And what — according to the correspondence of set theory and arithmetic — does that“power” suggest? And where does the 2 come from?

JT It’s a set of functions, like MN .

SY We did:?Another method whichbegins by listing

elements in a creativeway, that suggests a

proof by induction.

2 a /0Double elements of set (4) a, /0,a, /0

Add bs to new elements a, /0,ab,bDouble elements again a, /0,ab,b,a /0,ab,b

Add cs to new elements a, /0,ab,b,ac,c,abc,bcDouble elements again a, /0,ab,b,ac,c,abc,bc a, /0,ab,b,ac,c,abc,bc

Add ds to new elements a, /0,ab,b,ac,c,abc,bc,ad,d,abd,bd,acd,abcd,bcd

As the set grows, make a carbon copy and add your new element to one of the copies.

Page 7: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 5

MS This looks like it has something to do with the binomial theorem, maybe? The next setincludes all the sets prior to it, but then again with the new element.

Dr. S So you’re saying: every time you add an element to a set, its number of subsets doublesinto those subsets from before that didn’t include the element, and exactly as many newsubsets that do include it. Are you sure that accounts for them all?

SY Yes: each subset either includes the new element, or it doesn’t.

Dr. S That’s a recursive definition: each answer is double the previous answer. It’s based onmultiplication. But how do we get to the explicit formula with a power? How is a subsetof S like a function from S→{1,2}?

MR Choosing {a,b,c} out of the set S = {a,b,c,d} is like sending the elements {a,b,c} toone taMRet, and {d} to the other.

SY It’s a bit like a series of switches.

Dr. S If you consider the elements of S to be like a series of light switches, then choosing asubset of S is...

JT To turn some switches on and other switches off.

Dr. S And the two choices?

MH Is it in the subset, or out?

Dr. S So {subsets of S

}={

functions S→{1,2}}

= 2S.

MR Each function actually represents two subsets. If A,B→ 1 and C,D→ 2, this can repre-sent either the set {A,B} or its complement {C,D}. By counting all these possibilities,we got 2n.

For the null set, we can send all of A,B,C,D→ 1. Then, nothing ( /0) is being sent to 2.

Dr. S So we’re pretty happy with2n

as the solution to this problem.

19. Assuming k ≤ n, in how many ways can we pass out k distinct pieces of fruit to nchildren if each child may get at most one? What is the number if k > n? Assume forboth questions that we pass out all the fruit.

20. Another name for a list, in a specific order, of k distinct things chosen from a set S isa k-element permutation of S. We can also think of a k-element permutation of S asa one-to-one function from [k] = {1,2, . . . ,k} to S. How many k-element permutationsdoes an n-element set have? What does your answer predict if k > n?

21. Express? nk as a quotient of factorials. ? The quantity nk is youranswer to #20, thenumber of k-elementpermutations in a setof n.Note: All three of theseproblems wereanswered at once inthe work that follows.

JT Are you sure we can’t cut the pieces of fruit?

Page 8: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

6 Chapter 1. What is Combinatorics? Combinatorics

MH If every piece of fruit and every child is different —

Dr. S Then passing out this fruit sounds like a function. What are its domain and range?

SY If you have less fruit than children, how could everyone get fruit?

MS It just says that each child may get at most one. They don’t all have to get fruit.

JT You could give one piece to one kid, another to another, and so on, so that’s n amounts.But then it gets exponentially bigger.

SY If you have one less fruit than children, you’ll have n possibilities since you have to skipone. But then if you have two, it starts to get tricky.

MH But what if k > n? If each child gets at most one, that’s not going to work.

Dr. S So how many ways are there to pass out the fruit if k > n?

MH Zero.

RG You can’t have two fruit and one kid; the number of kids dictates how much fruit willwork. There has to be at least as many fruit as kids.

KS Say k = 3 and n = 3. Then I count six ways.

MH Maybe it’s something like kn?

SY I think it’s got to have a factorial somehow.

MH A factorial, right.

JT This is a combination.?“Combination” is oftenthe word used for a

sequence ofunordered choices.

Does that apply to thisproblem?

Dr. S Put yourself into the position of the fruit distributor. What choices will you have tomake?

KS Every time k = 1, there’s always n ways. Maybe the number of ways is kn?

MH The first fruit, you pass out n ways.

JT But on the second piece, one kid already has fruit so there are n−1 ways for that piece.

SY I’m going to say our answer is k!(n!− k!). On your first choice, you choose which kidswill get no fruit. Then with the kids left (there’s exactly as many pieces of fruit as kidsnow), your second choice is to pick how to distribute the fruit among them, which is k!.

MS How many subsets of n elements can we make? If there’s 5 kids and 3 pieces of fruit,how many different subsets of 3 can we make out of those 5 pieces of fruit??See above note.

KS I didn’t think about it that way.

SY In this formula:

k!︸︷︷︸Choose how to distribute among remaining children

(n!− k!

)︸ ︷︷ ︸Choose which children to leave out

Page 9: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 7

MS I feel like this is a permutation question. If I had a calculator I’d just use nPr.

MR I don’t agree with that equation. Say you had k = 1 piece of candy and n = 3 children.Then there are only 3 ways to do that: the candy goes to either of A, B, or C. But

1!(3!−1!) = 5 6= 3.

SY My life’s work has been thwarted.

MS I think I have something else: I remember the formula? for nPr is... Really, this would benPk, right?

n!(n− k)!

Dr. S And what does that mean?

SY I thought you only divided when order doesn’t matter.

MS But in this problem, {1,2,3} and {3,2,1} are considered different “subsets.”

Dr. S Maybe not every division “means” something combinatorial?

KS It goes back to the n-element subset question.

SY If you don’t have enough fruit for each kid, you have 5 choices, times 4 choices, times3 choices. Then you’re subtracting off 2.

KS Two options, “in” — you get fruit — or ”out” — you don’t. But I don’t know where the−k part comes in.

JT n− k is going to give you the amount of n that doesn’t get k. (Kids that don’t get fruit.)

KS Does it work when k = n?

MS Sure it does.

MH Because 0! is 1.

KS So (n−k)! tells you how many ways kids can “not” get fruit. Once one kid gets a pieceof fruit, he can’t get another piece, so your number of choices goes down.

SY You have to divide in order to get rid of the “rest” of the factorial, then. What you’redoing is taking the number of kids (n!), the number of ways of giving fruit to everysingle kid, then dividing because if you don’t have enough fruit to give one to everyone,you have (n− k)! ways of leaving some kids out.

n!(n− k)!

=Ways to distribute one piece to every child

If you run out of candy, you have to stop after k pieces.

Dr. S Now think about how this problem is related to the problem? of choosing k-element Remember, we definethis number to becalled

(nk

).

subsets of S = [n]. What’s the connection?

KS It looks the same when k = 0 and k = 1. But then things start to break down after that.

Page 10: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

8 Chapter 1. What is Combinatorics? Combinatorics

Wednesday, September 29: #28—29

28. The binary representation of a number m is a list, or string, a1a2, . . . ,ak of zeroes andones such that

m = a12k−1 +a22k−2 + · · ·+ak20.

Describe a bijection between the binary representations of the integers between 0 and2n−1, and the subsets of an n-element set. What does this tell you about the number ofsubsets of [n]?

Dr. S Try starting with a small n, like n = 3, to get the pattern. How can we associate to asubset of [3] = {1,2,3} a binary number a1a2a3 having three digits? For example, howwould you associate

1012↔{ ? } ⊂ [3]

Our old metaphors might be helpful.

SY The binary notation they’re using is confusing. What’s behind the 2n−1?

Dr. S 2n−1 is the laMRest integer you can represent with n binary digits.

SY Does every integer have a unique binary representation?

Dr. S Yes — that’s one facet of the Chinese Remainder Theorem, which we’ll preserve for therecord.

GU Is this like the on/off switch metaphor?

MR List the elements of [3] in order? , like {A,B,C}. Then associate each digit a1→A, a2→This step is invisible butcrucial! Question: doesit matter how we order

the elements?

B, a3→C. Each 1 digit corresponds to being “in” the subset and each 0 corresponds tobeing “out” of the subset.

SG So for example,1012 = 5↔{A,C}.

RG We looked at it as, for the null set, none of the switches are on: 000. Then for theone-element subsets {A} and so on, there is one 1 digit and the rest zero, so {A}↔ 100.

In total, for each element there are two choices, 0 or 1, and so 2n possibilities.

MR Each subset is being related to only one number — so this is one-to-one.

Dr. S How do you know that different subsets give different numbers?

MR Because different subsets give different digits, and different digits are a different num-ber.

Then, to show it’s onto, I can tell you how to “go backward” and turn a number into asubset. For instance,

10102 means to choose elements A and C, but not B and D, so {A,C}.

Page 11: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 9

Dr. S That proves this correspondence is a bijection. In fact, what you have is an enumerationof the set P(S), a bijection

e : [n]→P(S).

SY So what was the point of using binary? Why not just associate 5→{A,C}?

Dr. S Binary provides us with a way of ”unpacking” a number like 5 to systematically choosewhich elements to include/exclude.

Notice what we got here that was “new:” instead of counting P(S) by a series ofchoices, we’ve explicitly enumerated this set now, since each subset of S now has aunique integer between 0 and 2n−1.

29. Let C be the set of k-element subsets of [n] that contain the number n, and let D be theset of k-element subsets of [n] that don’t contain n.

Class Begin by looking at the example where k = 3 and n = 4. Then all in all we are countingA = { 3-element subsets of [4]}, i.e.

A

C

{{1,2,3} ↔ {1,2,3}

}C′

D

{1,2,4}{1,3,4}{2,3,4}

↔{1,2}{1,3}{2,3}

D′

Noting that C∩D = /0 and A =C∪D, we know that |A|= |C|+ |D| by the sum principle.But how do we count C and D?

[A] Let C′ be the set of (k−1)-element subsets of [n−1]. Describe a bijection from Cto C′.

Class Looking at the example above, this bijection is just “identity:” each subset whichbelongs to C also belongs to C′, since by assumption it does not include n —therefore it is a subset of [n−1] — and it has k elements.

[B] Let D′ be the set of k-element subsets of [n−1]. Describe a bijection from D to D′.

Class Looking at the example, this bijection just “adds or deletes” the element n. Forinstance, in the direction f : D′→ D we’d define

f (S) = S∪{n}.

Since by assumption subsets belonging to D include n, this is well defined, andit’s invertible via the operation which removes the n from the subset.

[C] Based on the two previous parts, express the sizes of C and D in terms of binomialcoefficients involving n−1 instead of n.

RG Would we also need to use k−1 to find out how to count C′?

SG Should we use the factorial formula for(n

k

)?

Dr. S Stick to the(n

k

)notation — it’s easier on the eyes.

MR By our bijection, |C′| and |D′| are equal to |C| and |D|.RG Since D and D′ are basically the same thing, that one is obvious.

Page 12: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

10 Chapter 1. What is Combinatorics? Combinatorics

MR So

|C′|= |C|= (n−1)![(n−1)− (k−1)

]!(k−1)!

=(

n−1k−1

)|D′|= |D|= (n−1)![

(n−1)− k]!k!

=(

n−1k

)with the first equal sign because of the bijection.

Dr. S How did you come up with these counts?

MR We used the binomial coefficient with the new n and k to get the sizes of C′ andD′, and after staring at it for a few minutes realized they were bijective.

Dr. S And binomial coefficients were relevant here because:

MS We’re counting k-element subsets.

[D] Apply the sum principle to C and D to obtain a formula that expresses(n

k

)in terms

of two binomial coefficients involving n− 1. You have just derived the PascalEquation that is the basis for Pascal’s Triangle.

SG So one side of the equation, |A|, is just(n

k

).

KS And so

|A|=(

nk

)=(

n−1k−1

)︸ ︷︷ ︸|C|

+(

n−1k

)︸ ︷︷ ︸|D|

.

Dr. S That’s Pascal’s Equation. Just think about how difficult it would have been toprove it using algebra:

n!(n− k)!k!

=(n−1)!

(n− k)!(k−1)!+

(n−1)!(n− k−1)!k!

Friday, October 7: #47—48

47. In part of a city, all streets run either north-south or east-west, and there are no deadends. Suppose we are standing on a street corner. In how many ways may we walk to acorner that is four blocks north and six blocks east, using as few blocks as possible?

Class The shortest path is definitely 10 blocks long: 6 easts and 4 norths.

SY If you can choose(10

4

)to determine where to place the ”norths” and

(106

)to determine

where to place the ”easts,” and you get different numbers, how is that possible?

Dr. S Are you sure those are different numbers?

KS So 104 = 10 ·9 ·8 ·7 and I get 10·9·8·72 . But I get a different number when I try 106

2 .

JT But maybe we’re not dividing by the right thing there — maybe it should be 4 or 6 inthe denominator? Maybe 10?

Page 13: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 11

SG I’m counting 210 different ways:(104

)=(

106

)= 210.

Dr. S What did you end up dividing by in the denominator, if the numerator is nk?

SG Interchanging k = 4 and k = 6 in the combination formula, for instance,(104

)=

10!6!4!

(106

)=

10!4!6!

Dr. S And where is the falling factorial in each of those?

KS Highlighted here: (104

)=

10!

6! 4!

(106

)=

10!

4! 6!

Dr. S And why are we dividing by, say, 4! here?

KS It’s how many “same” functions there are.

SG It takes away the order of the “different” norths.

48. A lattice path is a “curve” made up of line segments that either go from a point (i, j) tothe point (i + 1, j) or to (i, j + 1), where i and j are integers. The length of the path isthe number of line segments.

[A] What is the length of a lattice path from (0,0) to (m,n)?

SG That’s just m+n.

MR It’s the least amount possible, since you have to go m over and n up or vice versa.

[B] How many such lattice paths are there?

SG That’s either(m+n

m

)or(m+n

n

).

Dr. S Can you give a combinatorial reason those two are the same? See Question 36.? In #36, you are askedto furnish acombinatorial proof(i.e., a bijection) whichjustifies why

(nk

)=( n

n−k

).

[C] How many lattice paths are there from (i, j) to (m,n), assuming i, j,m,n are inte-gers?

SG That’s either(m−i+n− j

m−i

)or(m−i+n− j

n− j

).

Dr. S And — again — why are those two the same? See Question 36.

Wednesday, October 12: #51—52

51. A lattice path from (0,0) to (n,n) which rises no higher than the line y = x is called aCatalan path. The number of Catalan paths is denoted Cn, the nth Catalan number.

Page 14: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

12 Chapter 1. What is Combinatorics? Combinatorics

[A] Explain why the number of lattice paths from (0,0) to (n,n) that fail to be Catalanis equal to the number of lattice paths from (0,0) to (n,n) that either touch orcross the line y = x+1.

GU We could start finding Cn by counting the total number of lattice paths, which is(2nn

), and then subtracting the “bad” paths — i.e., those that are not Catalan.

Dr. S So we just need a good way of counting the “bad” paths. This problem is givingus a description of those bad paths.

SY Either a non-Catalan path starts immediately as non-Catalan (by moving upwardfirst), or it starts as a Catalan path and then “goes wrong” somewhere.

KS If a path touches or crosses y = x+1, then it has to cross y = x, and therefore be a“bad” path.

KS, SG, GU The formula Cn = 1n+1

(2nn

)matches the pattern shown in Figure 1.7.?Here, either a process

of pattern matchingwith the first 5 Catalan

numbers, or thediscovery of a formula

from outside theclassroom, actuallyhinders our learningprocess. A formula

should not be the endof a discussion, but

rather the beginning!

SY I thought we would be getting a formula to play around with.

Dr. S That’s not mathematics; it’s accounting. As a mathematician, it’s your job todiscover formulas of your own, not merely to manipulate formulas other peoplehave discovered.Don’t lose the point of this problem: instead of spending your time calculating, ormatching patterns, focus on how you can count this set in a way that illuminatesits size. In this problem, you begin with the set of all lattice paths, L, which in #49you found has size

(2nn

). You want the size of the subset C ⊂ L consisting of the

Catalan paths.This problem then invites you to instead count its complement, D = {all non-Catalan paths},by setting up a succession of two bijections:

D = {all non-Catalan paths} (a)←→ D′ = {all paths touching y = x+1}

(b)←→ D′′ = {lattice paths from (−1,1) to (n,n)}.

We then have a formula from #49 to count D′′. But the work you’re doing in thisproblem is explaining the bijections shown above. Why do the sets D and D′ havethe same size, and likewise D′ and D′′?

SG For a Catalan path, the first move always has to be to the right, and the last movealways has to be up.

KS Every non-Catalan path has to touch or pass through y = x+1

RG If a lattice path crosses y = x, then it must at least touch y = x+1.

Dr. S What are non-Catalan paths doing when they cross y = x?

MR They’re going upwards, and touching y = x+1.

MH So D and D′ are the same set. Every non-Catalan path will itself touch or crossthe line y = x+1.

Dr. S Can’t get a much stronger form of bijection than that. Not only are D and D′

bijective, they are equal as sets.

[B] Find a bijection between lattice paths from (0,0) to (n,n) that touch or crossy = x+1, and lattice paths from (−1,1) to (n,n).

Page 15: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 13

Dr. S Hint: It’s probably easiest to start by finding a map D′′→ D′ first.SY You could exchange just the first step from vertical to horizontal, or vice versa.

The shape of the path has to change, at least.KS We were thinking about symmetry, somehow, but I don’t think symmetry works.

Dr. S Think about how you might “fix the starting point.”MS Every path in D′′ will have to cross y = x + 1. It starts to the left of that line, and

ends on the right. I don’t know whether that helps.MH We want to switch vertical for horizontal somehow.KS But it seems like there would be a lot of different ways to do that.RG The shape of the path has to change in D′′, because otherwise it won’t connect

(−1,1) to (n,n).MR In D′′ you have n + 1 ”over” steps to take and n−1 ”up” steps, compared with n

and n before.SY So you need more ”rights” and less ”ups.”SG For each path in D′, we can replace any one vertical step with a horizontal step.

That will give it the right starting and ending point.Dr. S Does it matter which vertical step we replace?

SG No, as long as there’s only one vertical step replaced. Then going from D′′ to D′,we do the opposite: take away any horizontal step and replace it with a vertical. Inthe path RUUR in D′, change the first U to a R to get RRUR in D′′. But we couldalso have chosen RURR in D′′ instead.

Dr. S So there’s more than one possibility.SG Let’s just choose to replace the first U with an R, then.

Dr. S Does that give you a bijection, though? After all, this replacement might not beone-to-one:

RRURUU → RRRRUU and RRRUUU → RRRRUU,

so two different paths in D′ have the same image.

SG I’ve got an idea: first, interchange every R for a U . Then, change the first U yousee to an R. The same process done twice will get you back where you started:

D′ 3 RRUUUR 7→UURRRU 7→ RURRRU︸ ︷︷ ︸∈D′′

7→URUUUR 7→ RRUUUR ∈ D′.

Page 16: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

14 Chapter 1. What is Combinatorics? Combinatorics

Dr. S What does that do to a path, geometrically?

SG Reflects it, over the line y = x. Then swaps the direction of the first move.

Dr. S But if you start with a path in D′′, you may not end up with a path in D′ in thismethod. For instance:

D′′ 3UURRRR 7→ RRUUUU 7→ RRRUUU 6∈ D′

since that path is Catalan — it doesn’t meet the line y = x+1.

SG So that can’t be a bijection onto D′.

Dr. S What does reflection do for you in this problem?

SG It turns a Catalan path into a non-Catalan path. But paths which begin non-Catalanare still non-Catalan after you reflect them over y = x.

Dr. S Is there a way of turning the point (0,0) into the point (−1,1)? Is there a way todo that without making a choice of which R we switch with U?

MH Does it have to do with how the path in D′ meets y = x + 1? We could keep the“end” of the path the same.

KS You could invert everything beneath the liney = x + 1. Or, fold over everything that hap-pens before you touch y = x+1.

Dr. S And what does that do for you?KS It fixed the starting point to (−1,1) instead of

(0,0).Dr. S Do we know the new path has the right number

of U and R steps?KS It worked in this example:

Dr. S And how do we undo that?RG Reflect back over the line y = x+1.MH So to go from D′ to D′′, take the inverse of the

path up until its first intersection with y = x+1,then keep the remainder of the path the same.To go back, repeat the process again.

Dr. S Why doesn’t this work for a Catalan path?KS Because it would never meet the line y = x+1.

And if you reflected the whole path, then theendpoint would no longer be at (n,n).

Dr. S How does everyone feel about that?

Page 17: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 15

[C] Find a formula for the nth Catalan number Cn, using your answers from (a) and(b).

SG When you count D′′ you’ll have, according to the lattice path counting formulafrom #49, (

2nn−1

)or

(2n

n+1

)MS So in total,

Cn =(

2nn

)−(

2nn+1

).

Dr. S So what are we to make of the conjecture from before: Cn =1

n+1(2n

n

)? Might

one or both results be wrong? This is probably more of an algebra problem nowthan a combinatorics problem.

SG If we divide the left side by(2n

n

), we get(2n

n

)−( 2n

n+1

)(2nn

) = 1−( 2n

n+1

)(2nn

)and maybe we can simplify that quotient somehow.

Dr. S Is there a way to handle the denominator in( 2n

n+1

)=

(2n)!(n−1)!(n+1)!

MR But (n + 1)! = n!(n + 1), since all you’re doing? is adding an extra factor at the This seems to be “allyou need to know”about factorials tocomplete thisargument.

end.MH And (n−1)! = n! · 1

n .KS And (n−1)! is just included as part of n!.SG If you factor out

(2nn

)you have(

2nn

)−(

2nn+1

)=

(2n)!n!n!

− (2n)!(n−1)!(n+1)!

=(2n)!n!n!

(1− n!n!

(n+1)!(n−1)!)

=(

2nn

)(1− n

n+1)

=(

2nn

)1

n+1

MH We got another way:(2nn

)−(

2nn+1

)=

(2n)!n!n!

− (2n)!n!(1

n)(n+1)n!

=(2n)!n!n!

− (2n)!n!n!

( nn+1

)=

(2n)!n!n!

(1− n

n+1)

=(

2nn

)1

n+1

We just factored last, instead of right away.

Page 18: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

16 Chapter 1. What is Combinatorics? Combinatorics

October 24—27: Review Problems

1. How many different n-letter sequences can be made from the letters A, B, C, and D, ifthe sequence cannot include the word ”BAD” in it?

SY Our conjecture: the number of ”bad” words — that is, the words containing BAD — is(n−2) ·4n−3. Then the amount of ”good” words:

4n− (n−2) ·4n−3. QE D

MR The 4n describes the set of all n-letter words as a whole.

SG Then (n−2) is the number of different options of where “BAD” is included in the word,and n−3 is the number of empty slots once “BAD” is included.

SY For instance, the four-letter words including “BAD” are of two types:

xBAD and BADx.

The five-letter words are of three types:

BADxx xBADx xxBAD.

Dr. S About all the arithmetic in this expression: what does it mean combinatorially?

MR The 4n corresponds to a set of all functions, in this case functions {1,2, . . . ,n} = N→K = {A,B,C,D}. So every n-letter sequence corresponds to a function from N to K, ofwhich there are |K||N| = 4n.

SY n−2 is the number of choices for placing ”BAD” in a sequence

MR, MS Because the B needs to be at least three spaces over from the right end. You can’t placethe B in the last two spaces if you need to include ”BAD” in the sequence.

SY Then 4n−3 is the number of choices raised to the number of x’s. Since we took out thethree spaces for B, A, and D, this is n−3.

Dr. S Why are we multiplying (n−2) by 4n−3?

SY For each value of n, you have both a choice of where to put BAD, and then a choice ofwhat letters to put in the free slots. Something like that.

MS That “feels” right.

2. A fruit basket contains a different apples and b different bananas. How many ways arethere for Jack to pick a piece of fruit, and then Jill to pick a piece of fruit?

SY Jack has a+b choices, then Jill has a+b−1.

MS Do a and b have to be greater than one? It seems like that’s implied.

Page 19: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 17

MR Not necessarily; it’s not stated in the problem.

SG Jack has(a+b

1

)= a+b choices. Then Jill has

(a+b−11

)= a+b−1 choices.

MS Is it really important that the apples and bananas are different? If all the pieces of fruitare unique to begin with, why not just let C be the set of all fruit, and |C|= c = a+b.? An expert observation.

Then Jack has c choices, and Jill has c−1 choices, and we have a total of c(c−1).

SG Or is it c +(c−1)? Because there are c ways for Jack to choose, and (c−1) ways forJill to choose.

RG This is similar to the rollercoaster problem (#15).

JT For a = 2 and b = 2 we got 12 possibilities.

RG We got that, too.

SY Then that’s 4×3, agreeing with our answer: (2+2)(2+2−1) = (4)(3) = 12.

MS So we can write |A∪B|= a+b = c, since every fruit in unique in a and b. Then

(c)︸︷︷︸Jack’s choices

· (c−1)︸ ︷︷ ︸Jill’s remaining choices

SG And |A∪B|= |A|+ |B|= a+b because A and B are disjoint sets.

MR Because one set’s elements are apples and the other’s are bananas, and no fruit is both.So c = a+b and we have

(a+b)(a+b−1).

3. If all numbers from 1 to 10n are listed, how many times is the digit 5 written?

GU It seems like you pick up an additional 10% each time n increases by 1.

RG But then you’d eventually get to more than 100%, so it has to level off somewhere.

SY This might be one of the trickier ones so far. If I were approaching this, I might find away of counting all the numbers that don’t include the digit 5.

SG Then count the numbers that include the digit 5.

Dr. S But each of them might have different number of 5s. What do the simple cases looklike?

MR For n = 3 I got 260.

KS We got 300, and then 4000 for n = 4. In general, this pattern follows n ·10n−1.

SG For example, in the n = 3 case you have

Page 20: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

18 Chapter 1. What is Combinatorics? Combinatorics

Numbers Five digits0—99 20

100—199 20200—299 20300—399 20400—499 20500—599 120600—699 20700—799 20800—899 20900—999 20

Total 200

MR If we presume that for n = 3 there are 300 fives, then each range of thousands which donot begin with 5 will have the digit 5 300 times:

1—1000 3001001—2000 3002001—3000 3003001—4000 3004001—5000 3006001—7000 3007001—8000 3008001—9000 3009001—9999 300

Total 2700

But in the range where the numbers begin with 5, we have a five in the thousands place,and then 300 fives in the remaining places, for a total of 5001—6000 1000+300=1300

So in total, there is 2700+1300 = 4000.

MH We understood where the 10n−1 came from: when you’re counting fives from 0|999,you end up counting the fives in the hundreds, not the thousands.

SG That’s true when you’re counting the batches which don’t start with a five, but not whenit does.

SY It’s as though each time you add a digit (increasing n by 1), you end up multiplying by10, and adding a power of 10:

n = 1 n = 2 n = 3 n = 41 20 300 4000

Multiply by 10 and add 10. Then, multiply by 10 and add 100. Then, multiply by 10and add 1000.

Monday, November 7: #65—66

Page 21: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

Combinatorics 19

66. Draw five circles labeled Al, Sue, Don, Pam, and Jo. Find a way to draw red and greenlines between people so that every pair of people is joined by a line? and there is neitherWe say this graph is

complete. a triangle consisting entirely of red lines nor a triangle consisting entirely of green lines.

MS I think we’re starting with all the people in a pentagonshape.

MR A Star of David should work.

KS A pentagram, really.

SY I thought that was supposed to be Satanic.

KS We started by making all the ”outside” lines green andthe ”inside” lines red.

Dr. S Is there any other way to do it besides that?

KS You have 10 lines total (I did 52−52 =

(52

).) Does it matter how many green lines and

how many red?

RG Does it matter if we arrange the dots differently?

Dr. S Not as long as every pair of dots is still connected by a line.

MR We may have found a different way.

Dr. S Is there a connection between these?

KS Each graph has the same number of red and greenlines.

MR And each person has two red and two green lines com-ing out.

Dr. S But if you interchange Dan and Joe, and then Dan andPam, you get the original graph again.

Dr. S So are those two graphs different? Is there any advantage to considering these graphs tobe the same or different?

KS It’s like a reflection.

Dr. S In fact, we will define these two graphs to be isomorphic: identical but for a renamingof the vertices.

65. Prove that, in any group of six people, either three must be mutual friends, or three mustbe perfect strangers. (That is, the Ramsey number R(3,3) = 6.)

Page 22: Combinatorics - Bridgewater State Universitywebhost.bridgew.edu/msalomone/345/345script.pdf · Combinatorics 3 Dr. SI think you may be short by half. SGWhat about 48 for n =2? Dr.

20 Chapter 1. What is Combinatorics? Combinatorics

SY Let’s start by following the pentagram example above, using half the total number ofedges of the complete graph.

Dr. S How many edges total would there be in the complete graph K6?

SG Thirty (= 6×5) since each vertex must connect to the five others.

JT I think that’s too many. I counted fifteen.

SG Because order doesn’t matter when you connect an edge.

Dr. S So we may want to try connecting close to half of that, because we’re looking for abalance between having enough edges to eliminate groups of perfect strangers, but notso many edges that we create groups of mutual friends.

Dr. S Here’s a hint to get you started. Single out a vertex (say, vertex 1). If you look at 1’s“friends” (vertices to which it connects) and “strangers” (vertices to which it does not),how many of each must there be? Is it possible for there to be less than three of each?

Class No, because there are five other vertices to choose from. So 1 is either connected to, ordisconnected from, at least three other vertices.

Dr. S Now, without loss of generality, let’s say that vertex 1 has three “friends,” 2, 4, and 6.What can we then say about vertex 2?

SG Then, if we want to avoid making a triangle, 2 can connect only to 3 and 5.

Dr. S Right now, what relationship exists between 2, 4, and 6 — the friends of 1?

KS They’re “friends of friends,” but not friends. They’re mutually disconnected.

Dr. S So condition B (three mutual strangers) is satisfied by 2, 4, and 6, unless two of themare friends. What happens then?

SG Condition A (three mutual friends) holds, since they are both friends with 1.

Dr. S Is that enough?

MH If there is an edge anywhere between 2, 4, and 6, then that edge will make a trianglewith 1, giving three mutual friends.


Recommended