Combinatorics and Graph Theory Workbook

Combinatorics and Graph Theory Workbook∗ Note to Students (Please Read): This workbook contains examples and exercises that will be referred to regu...
2 downloads 3 Views 641KB Size
Combinatorics and Graph Theory Workbook∗

Note to Students (Please Read):

This workbook contains examples and exercises that will be referred to regularly during class. YOU WILL BE EXPECTED TO HAVE THE RELEVANT PORTIONS OF THIS WORKBOOK WITH YOU FOR EVERY CLASS SESSION. • To Print Out the Workbook. Go to the web address below http://www.sonoma.edu/users/l/lahme/m316/ and click on the link “Math 316 Workbook”, which will open the workbook as a .pdf file.

*A special thanks to Dr. Izabela Kanaana for generously sharing her class notes and activities, which greatly helped in the preparation of this workbook.

2

Sonoma State University

Table of Contents Chapter 1 – What Is Combinatorics? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Chapter 2 – The Pigeonhole Principle Sections 2.1 & 2.2 – Pigeonhole Principle: Simple and Strong Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Chapter 3 – Permutations and Combinations Sections 3.1-3.3 – Counting Principles, Permutations, and Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Sections 3.4 & 3.5 – Permutations and Combinations of Multisets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Chapter 5 – The Binomial Coefficients Sections 5.1 & 5.2 – Pascal’s Formula and the Binomial Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Section 5.3 – Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Chapter 6 – The Inclusion/Exclusion Principle and Applications . . . . . . . . . . . . . . . . . . . . . . . . 37 Chapter 7 – Recurrence Relations and Generating Functions Sections 7.1 & 7.2 – Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Section 7.4 – Generating Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Chapter 9 – Matchings in Bipartite Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Chapter 11 – Introduction to Graph Theory Section Section Section Section Section

11.1 11.2 11.3 11.4 11.5

– Basic Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . – Eulerian Trails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . – Hamilton Chains and Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . – Bipartite Multigraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . & 11.7 – Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

70 80 85 91 94

Chapter 13 – More on Graph Theory Section 13.1 – Chromatic Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Section 13.2 – Plane and planar graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Section 13.3 – A Five-Color Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ??

3

Math 316 Workbook

Chapter 1 – What is Combinatorics? Preliminary

Exercise. Two experimental courses, Course A and Course B, are to be taught in the math and statistics department in each of 3 consecutive semesters. During each semester, three sections of each course will be taught, each by a different instructor. Nine faculty members have agreed to participate in the experiment, and each of the nine will teach Course A once and Course B once. Can a teaching schedule be made so that, during all three semesters, Courses A and B will both be taught by professors of three different ranks (assistant, associate, and full) and of three different concentration areas (stats, teaching, and pure)? If so, indicate how the schedule should be made.

Fall 2011 • Course A Instructors: • Course B Instructors: Spring 2012 • Course A Instructors: • Course B Instructors: Fall 2012 • Course A Instructors: • Course B Instructors:

Note: Before starting this excercise, you’ll be given a list of the 9 participating instructors, with their rankings (indicated by color) and their concentration areas (indicated by the letters P, S, and T).

4

Sonoma State University

Definition. A Latin square of order n > 1 is an n×n matrix that contains each of the integers 1, 2, 3, . . . , n exactly one time in each row and in each column of the matrix. Two Latin squares of order n are called orthogonal if, when they are juxtaposed, all of the n2 possible ordered pairs (i, j), with i = 1, 2, 3, . . . , n and j = 1, 2, 3, . . . , n, result.

Example 1. Rephrase the preliminary exercise from the previous page using the language of Latin squares.

Some facts about Latin squares 1. Orthogonal Latin squares can be constructed using techniques from modern algebra; in particular, using finite fields. 2. Euler first showed how to construct a pair of orthogonal Latin squares of order n whenever n is odd or is a multiple of 4. 3. Euler correctly conjectured that, for order n = 6, no pair of orthogonal Latin squares exist. This was proven in 1901 by Tarry. 4. Euler incorrectly conjectured that no pairs of orthogonal Latin squares exist for n = 10, 14, 18, 22 . . . . The mathematician/statisticians Bose, Parker, and Shrikhande disproved this conjecture around 1960 by showing how to construct pairs of orthogonal Latin squares for these values of n. 5. To summarize, it is possible to construct a pair of n × n orthogonal Latin squares for every order except .

5

Math 316 Workbook

Example 2. Construct two orthogonal Latin squares of order 4.

The Map Coloring Problem Definition. A map in the plane is a subdivision of the plane into simply connected regions called countries. Two countries are called adjacent if they share a common boundary; that is, if they share some portion of a line or a curve. A coloring of the map is an assignment of colors to each of the countries; we call the coloring proper if adjacent countries are always assigned different colors.

Note: Two countries that share only a common point are not considered adjacent. Example 1. For each of the following maps, find a proper coloring that uses as few different colors as possible. (a)

6

Sonoma State University (b)

(c)

The Map-Coloring Problem. What is the smallest number of colors necessary to guarantee a proper coloring of any map in the plane? History of the Map-Coloring Problem: • Problem posed by Francis Guthrie (1852). He noticed that it appeared that four colors would suffice for any map in the plane. • Alfred Kempe publishes a widely acclaimed proof of the Four Color Theorem (1879). • Percy Heawood discovers an error in Kempe’s proof (1890). However, the strategy in Kempe’s invalid proof can be altered to prove a Five Color Theorem. • K. Appel and W. Haken successfully prove the Four-Color Theorem (1976). The proof amounted to exhaustive checking of many map configurations, and was unique in that the proof was computer-generated using over a thousand hours of computer time!

Math 316 Workbook

7

Combinatorics: concerned with the existence, enumeration, analysis, and optimization of discrete structures I. Enumeration: Arrangements of the objects of a set into patterns satisfying specified rules • existence of the arrangements • enumeration or classification of the arrangements • study of a known arrangement • construction of an optimal arrangement II. Graph Theory III. Combinatorial Designs

Exercise. (Please do this and turn it in during our next class.) To the right, a proper four coloring of the contiguous 48 U.S. states is shown. Maps like this can be created at the following website: http://www.apples4theteacher.com/coloringpages/usa/regional/usa.html (a) Can the 48 U.S. states be properly colored using fewer than four colors? If yes, go to the website above and create and print out such a map (don’t forget Rhode Island!)? If no, find a configuration of states that forces you to use all four colors and explain.

(b) Now, suppose that we want to also color the region outside of the 48 states (this region is sometimes called the “outer country” of a map). Is there a proper way to color the 48 states and the outer region and still use only four colors? If yes, go to the website above and create and print out such a map. If no, explain why not.

8

Sonoma State University

Sections 2.1 & 2.2 – The Pigeonhole Principle Preliminary Exercise. How many people must be in a group in order to guarantee that (a) at least 2 people in the group were born in the same month? (b) at least 3 people in the group were born in the same month? (c) at least 4 people in the group were born in the same month? (d) at least r people in the group were born in the same month?

The Pigeonhole Principle (Weak Form). If n + 1 objects (pigeons) are placed in n boxes (holes), then at least one box must contain two or more of the objects.

The Pigeonhole Principle (Intermediate Form). If objects are placed in n boxes, then at least one box must contain r or more of the objects.

The Pigeonhole Principle (Strong Form). Let q1 , q2 , . . . , qn be positive integers. If objects are placed in n boxes, then either the first box contains at least q1 objects, or the second box contains at least q2 objects, . . . , or the nth box contains at least qn objects.

Math 316 Workbook

9

Examples and Exercises 1. (Taken from Brualdi) Prove that, for any n + 1 integers a1 , a2 , . . . , an+1 , there exist two of the integers ai and aj with i 6= j such that ai − aj is divisible by n.

2. Show that if 26 of the first 50 positive integers are chosen, there must be two integers whose sum is 51.

10

Sonoma State University 3. (Taken from Rosen) During a month with 30 days, a baseball team plays at least 1 game a day, but no more than 45 total games (see diagram to the right for one possible schedule). Show that with these conditions, no matter how the games are scheduled, there must be a period of some number of consecutive days during which the team plays exactly 14 games.

June Sun

Mon

Wed

Tue

Thu

Fri

Sat

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

Math 316 Workbook

11

4. (Taken from Rosen) A drawer contains a dozen brown socks and a dozen black socks, none of them joined. A man takes socks out at random in the dark. How many socks must he take out to be sure he has at least 2 of the same color?

5. A community of 82 town houses wants to repaint its houses. What is the maximum number of color choices that the residents can be given in order to guarantee that at least 5 houses in the community share a common color?

12

Sonoma State University 6. Several apples, bananas, and peaches have been sliced, mixed, and are ready to be put in an ambrosia salad. How many total slices of fruit must be put in the salad to guarantee that there are either at least 20 apple slices, at least 10 banana slices, or at least 16 peach slices?

7. At the Lahme family reunion, family members can escape the general mayhem indoors and settle their differences on the back porch with a friendly game of ping pong. Each ping pong game involves exactly two family members playing against each other. Show that, after the reunion is over, there are at least two family members who have played against the exact same number of different opponents.

Math 316 Workbook

13

Sections 3.1-3.3 – Counting Principles, Permutations, and Combinations Addition Principle. If an object can be selected from one pile in p ways or from a separate pile in q ways, then the selection of one object from either of the two piles can be made in p + q ways.

Multiplication Principle. If a first task has p outcomes and, no matter what the outcome of the first task, a second task has q outcomes, then the two tasks performed consecutively have pq different outcomes.

Example 1. There are 10 computer science students, 8 mathematics students, and 4 chemistry students who are eligible to receive scholarships from the School of Science and Technology. (a) In how many ways can just one student be chosen to receive a scholarship?

(b) In how many ways can one student from each of the three departments be chosen to receive a scholarship?

Example 2. Brigitte wants toast with jam for breakfast. If she can choose from either white or wheat bread, and from either strawberry, blackberry, or raspberry jam, how many different breakfast choices are there?

14

Sonoma State University

Example 3. How many four letter “words” can be formed using the standard 26 letter English alphabet if (a) there are no restrictions?

(b) all letters in the word must be distinct?

(c) the word must end with a vowel (a, e, i, o, or u)?

(d) the letters in the word must be distinct and the word must end in a vowel?

15

Math 316 Workbook

Example 4. A math club consists of 5 members: Amy, Bob, Jane, Mary, and Phil. (a) In how many ways can the math club select a president, vice-president, and a treasurer, assuming that one person cannot serve in multiple positions?

Amy

Bob

Jane

Mary Phil

(b) In how many ways can the math club choose a committee of 3 to plan the Rick Luttmann fashion show?

ABJ AJB BAJ BJA JAB JBA

ABM AMB BAM BMA MAB MBA

ABP APB BAP BPA PAB PBA

AJM AMJ JAM JMA MAJ MJA

AJP APJ JAP JPA PAJ PJA

AMP APM MAP MPA PAM PMA

BJM BMJ JBM JMB MBJ MJB

BJP BPJ JBP JPB PBJ PJB

BMP BPM MBP MPB PBM PMB

JMP JPM MJP MPJ PJM PMJ

Definition and Theorem. Let S be a set having n elements. 1. An r-permutation of S is an ordered arrangement of r of the n elements in S. The number of distinct r-permutations of a set of n elements is given by P (n, r) = 2. An r-combination of S is an unordered selection of r of the n elements in S. The number of distinct r-combinations of a set of n elements is given by C(n, r) =

16

Sonoma State University

Example 5. A recital with 3 singing acts and 2 poetry readings is to be organized. The organizer must choose 5 people from a group of 12 to perform. Of the 12 available performers, 6 of them can sing a song, 4 of them can recite a poem, and 2 of them can either sing a song or recite a poem. Assuming that the order of the acts in the performance is irrelevant, how many different recitals are possible?

17

Math 316 Workbook

Example 6. The password for a telephone voice mail system must be a string of 3 digits. How many possible passwords are there that contain at least one zero? (a) Explain why the following “solution” to the above problem is incorrect. Case 1. Password looks like 0 Case 2. Password looks like Case 3. Password looks like

0 0

←−

10 · 10 = 100 passwords like this

←−

10 · 10 = 100 passwords like this

←−

10 · 10 = 100 passwords like this

Therefore, there are 100 + 100 + 100 = 300 total passwords that contain at least one zero.

(b) Give a correct solution to this problem.

18

Sonoma State University

Example 7. (a) List all distinct subsets of the one-element set {1} . Don’t forget the empty set!

(b) List all distinct subsets of the two-element set {1, 2} .

(c) List all distinct subsets of the three-element set {1, 2, 3} .

(d) Using the results of parts (a) through (c) as a guide, answer the following question: How many distinct subsets does an set that contains n elements have? Prove that your answer is correct.

Math 316 Workbook

19

Sections 3.4 & 3.5 – Permutations and Combinations of Multisets Preliminary Exercise 1. (a) Suppose we have unlimited supplies of butterscotch, cinnamon, and mint candies. How many different selections of two candies are there?

(b) Now, suppose we have unlimited supplies of butterscotch, cinnamon, mint, licorice, and apple candies. How many different selections of 7 candies are there?

20

Sonoma State University

Preliminary Exercise 2. How many different ways are there to arrange the letters in the word “PAPPELAPAPP”?

Theorem. 1. Suppose we have an infinite supply of r different kinds of objects. combinations of these objects is given by

The number of distinct n-

2. Suppose we have n total objects, with n1 objects of one kind, n2 objects of a second kind, ..., and nk objects of a kth kind. Then the number of distinct permutations of the n objects is given by

Math 316 Workbook

21

Examples and Exercises 1. A donut shop sells 15 different varieties of donuts, one of which is chocolate. How many selections of 6 donuts are possible if (a) there are no restrictions?

(b) the selection must include exactly 2 chocolate donuts?

(c) the shop only has 2 chocolate donuts left?

22

Sonoma State University 2. With each entree, the Gutbomb family restaurant offers your choice of 3 side dishes from the following selection: green beans, scalloped potatoes, corn, baked potato, mixed vegetables, french fries, mashed potatoes, or onion rings. How many different side dish selections are possible if (a) repeat selections of side dishes are not allowed?

(b) repeat selections of side dishes are allowed?

3. How many different 5-card poker hands are of the following types? (a) full houses (three of one kind and two of a second kind)

(b) three of a kind (but not four of a kind or a full house)

Math 316 Workbook

23

4. A woodwind quintet consists of five musicians playing five instruments: the flute, oboe, clarinet, bassoon, and French horn. There are 12 musicians available, 7 women and 5 men, and each of the 12 can play any of the five instruments. In how many ways can the quintet be chosen if (a) there are three men and two women in the quintet?

(b) there are three men and two women in the quintet, but one particular man and one particular woman refuse to perform together?

24

Sonoma State University 5. A disgruntled postman has 11 pieces of mail that he wants to deliver to three mailboxes labeled “Barnier”, “Ford”, and “Mendez”, though he doesn’t particularly care which mail goes into which mailbox, as long as each piece of mail ends up in someone’s box! In how many different ways can the mail be delivered under each of the following assumptions? (The order in which the pieces of mail are placed or arranged in a given mailbox is irrelevant.) (a) The 11 pieces of mail are indistinguishable.

(b) The 11 pieces of mail are all different.

(c) The 11 pieces of mail are all different, and 5 pieces of mail go to Dr. Barnier, 4 pieces of mail go to Dr. Ford, and 2 pieces of mail go to Dr. Mendez.

25

Math 316 Workbook

Sections 5.1 & 5.2 – Pascal’s Formula and the Binomial Theorem   n counts the number of k-combinations of a set containing n k distinct elements. We call such a number a binomial coefficient.

Definition. Recall that the number

Introductory Exercise. For values of k ≤ n, fill in the missing binomial coefficients in the table below. Do you notice any patterns?

0 0 1 2 3 n 4 5 6 7 8 .. .

1

2

3

k 4

5

6

7

8

26

Sonoma State University

Pascal’s Theorem. Let n and k be nonnegative integers with n ≥ k. Then       n n−1 n−1 = + k k−1 k

Algebraic Proof:     n−1 n−1 + = k−1 k

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

=

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

= =

“Combinatorial” Proof:

n · (n − 1)! − k · (n − 1)! k(n − 1)! + k!(n − k)! k!(n − k)!   n! n = . k!(n − k)! k

←−

since j(j − 1)! = j!

Math 316 Workbook

Binomial Theorem. Let n be a positive integer. Then, for all x and y, (x + y)n =

27

28

Sonoma State University

Example 1. What is the coefficient of x6 y 14 in the expansion of (3x − 5y)20?

Example 2. (a) Substitute x = y = 1 into the Binomial Theorem and write down both sides of the resulting formula.

(b) Give a combinatorial proof of the identity that you wrote down in part (a).

29

Math 316 Workbook

Exercises 1. Find the coefficient of x27 in the expansion of (1 − 3x)50 .

2. In this problem, you will investigate and combinatorially prove the identity

    n n = . k n−k

(a) In the space below, make a two-column table. In the first column, list all 2-subsets of {a, b, c, d, e}. In the second column, list the complements of the sets in the first column. For what values of n and k does your table illustrate the truth of the above identity?

30

Sonoma State University (b) Use the idea of part (a) to write a combinatorial proof that

    n n = . k n−k

31

Math 316 Workbook

Section 5.3 – Identities Example 1. Let n be a positive integer. (a) Use the binomial theorem to write down the expansion of (1 + x)n .

(b) By taking the formulaand  derivative   of the  above   substituting an appropriate value for x, derive the identity n n n n n−1 n2 = +2 +3 + ··· + n . 1 2 3 n

32 (c) Give a combinatorial interpretation of the identity from part (b).

Sonoma State University

33

Math 316 Workbook

Example 2. (a) For n = 1, 2, 3, and 4, find the value of the sum below and locate the sum in Pascal’s Triangle:  2  2  2  2 n n n n + + + ··· + 0 1 2 n

1 1 1 1 1 1 1 1

1 2 3 4 5 6 7 8

1 3 6 10 15 21 28

1 4 10 20 35 56

(b) Based on your observations above, make a conjecture by filling in the blank below:  2  2  2  2 n n n n + + + ··· + = 0 1 2 n

1 5 15 35 70

1 6 21 56

1 7 28

1 8

1

34 (c) Give a combinatorial proof of your identity. group having n women and n men.)

Sonoma State University (Hint: Count the number of ways to choose n people from a

35

Math 316 Workbook

Exercises 1. (a) Prove the identity

3

n

          n n n 2 n 3 n n = + 2+ 2 + 2 + ··· + 2 0 1 2 3 n

by substitution into

the Binomial Theorem.

(b) Give a combinatorial proof of the above identity. red, blue, or not at all.)

(Hint: Count the number of ways to paint n houses

36

Sonoma State University 2. (a) Substitute x = 1 and y = −1 into the Binomial Theorem and simplify the resulting identity.

(b) Let A = {a, b, c}. Write down two separate lists, one that contains all subsets of A with odd numbers of elements, and one that contains all subsets with even numbers of elements. What do you notice about the length of each list?

(c) Rearrange your identity from part (a) to illustrate that every n-element set has equal numbers of subsets with even and odd numbers of elements.

37

Math 316 Workbook

Section 6.1 – The Principle of Inclusion-Exclusion Example 1. A trick-or-treater has 7 candy bars in her Halloween basket, each of a different type: Almond Joy, Butterfinger, Milky Way, Mounds, Nestle Crunch, Snickers, and Twix. (a) How many different selections of 4 candy bars can she make?

(b) How many different selections of 4 candy bars can she make that contain an Almond Joy or a Butterfinger (possibly both)?

Theorem. Let S be a finite set of objects, let A1 be the set of objects in S having property P1 , and let A2 be the set of objects in S having property P2 . Then the number of objects having either property P1 or P2 is given by

A1

A2

|A1 ∪ A2 | =

S The number of objects having neither property P1 nor P2 is given by |A1 ∩ A2 | =

38

Sonoma State University

Example 2. Derive similar formulas to the previous theorem with sets A1 , A2 , and A3 .

A1

A2

A3

Example 3. How many integers between 1 and 6000, inclusive, are not multiples of 4, 6, and 7?

S

39

Math 316 Workbook

General Principle of Inclusion-Exclusion. Let S be a finite set of objects, and for each i, let Ai be the set of objects in S having property Pi . Then the number of objects having at least one of the properties P1 , P2 , . . . , Pm is given by X X X |A1 ∪ A2 ∪ · · · ∪ Am | = |Ai | − |Ai ∩ Aj | + |Ai ∩ Aj ∩ Ak | + · · · + (−1)m+1 |A1 ∩ A2 ∩ · · · ∩ Am |,

where the first sum is over all 1-combinations of {1, 2, . . . , m}, the second sum is over all 2-combinations of {1, 2, . . . , m}, the third sum is over all 3-combinations of {1, 2, . . . , m}, and so on. Similarly, the number of objects in S having none of the properties P1 , P2 , . . . , Pm is given by X X X |A1 ∩ A2 ∩ · · · ∩ Am | = |S| − |Ai | + |Ai ∩ Aj | − |Ai ∩ Aj ∩ Ak | + · · · + (−1)m |A1 ∩ A2 ∩ · · · ∩ Am |

Example 4. Five mathematicians go to a wild party at Dr. Barnier’s house, each wearing one coat. After the festivities, Dr. B passes back the coats at random, one to each guest. In how many different ways can none of the guests receive her or his own coat back? What is the probability that none of the guests receive her or his own coat back?

40

Sonoma State University

Example 5. A bakery sells three different kinds of donuts: jelly, chocolate, and glazed. At the moment, the bakery only has 11 jelly, 11 chocolate, and 5 glazed donuts. In how many ways can Ben buy a box of 20 donuts assuming that the order in which the donuts are placed in the box is not relevant?

41

Math 316 Workbook

Sections 7.1 & 7.2 – Number Sequences and Recurrence Relations Example 1. For each positive integer n, let dn represent the number of different ways to completely tile a fixed 2 by n chessboard with 2 × 1 pieces (dominoes) and 2 × 2 pieces (see diagram to the right). Such a tiling is called a perfect cover of the board with the specified types of pieces. (a) By drawing all possible tilings, determine the values of d1 and d2 .

2x1

2x2

(b) Repeat part (a) above to find d3 . You may find that you don’t use all of the copies of the 2 × 3 board below.

(c) Below, you are given all possible perfect covers of a 2 × 4 chessboard. Convince yourself that all the cases are indeed covered. Do you notice a relationship between these tilings and any of the previous tilings that you drew?

42

Sonoma State University

(d) Write down a formula that indicates how dn can be calculated from the values of dn−1 and dn−2 . Such a formula is called a recurrence relation. Then, use your formula to find the number of perfect covers of a 2 × 8 board using 2 × 1 and 2 × 2 pieces.

Math 316 Workbook

43

Example 2. (Taken from Brualdi) Determine the number hn of regions that are created by n mutually overlapping circles in general position in the plane. By mutually overlapping we mean that each two circles intersect in two distinct points. By general position we mean that there do not exist three circles with a common point.

44

Sonoma State University

Example 3. As in Example 1, let dn be the number of different perfect covers of a 2 × n chessboard. Recall that in Example 1d, we derived the recurrence relation dn = dn−1 + 2dn−2 . Find a formula for dn as a function of n. Such a formula is called a solution to the recurrence relation.

45

Math 316 Workbook

Theorem 7.2.1. Let q be a nonzero number. Then hn = qn is a solution of the linear homogeneous recurrence relation (1)

hn − a1 hn−1 − · · · − ak hn−k = 0

(ak 6= 0, n ≥ k)

with constant coefficients if and only if q is a root of the characteristic equation (2)

xk − a1 xk−1 − a2 xk−2 − · · · − ak = 0.

If the characteristic equation has distinct roots q1 , q2 , . . . , qk , then (3)

hn = c1 q1n + c2 q2n + · · · + ck qkn

is the general solution of (1) in the following sense: No matter what initial values for h0 , h1 , . . . , hk−1 are given, there are constants c1 , c2 , . . . , ck so that (3) is the unique sequence which satisfies both the recurrence relation (1) and the initial conditions.

Note: If a root q of the characteristic equation (2) is repeated s times (that is, if (x − q)s is a factor of (2)), then the portion of the general solution to (1) that corresponds to the root q is as follows: c1 q n + c2 nq n + c3 n2 q n + · · · + cs ns−1 q n

Example 4. The Fibonacci sequence f0 , f1 , f2 , . . . is defined by the recurrence relation fn = fn−1 + fn−2 , where f0 = 0 and f1 = 1. (a) Find the first 9 terms in the Fibonacci sequence.

(b) Observe what happens when you sum entries diagonally in Pascal’s triangle (indicated by the arrows in the diagram to the right). What pattern do you notice?

1 1 1 1 1 1

1 2 3 4 5 6

1 3 6 10 15

1 4 1 10 5 1 20 15 6 1

46

Sonoma State University

(c) Solve the Fibonacci recurrence relation fn = fn−1 + fn−2 , fn in terms of n.

Examples and Exercises 1. Solve each of the following recurrence relations. (a) bn = 6bn−1 − 8bn−2 ,

b0 = 4,

b1 = 10

f0 = 0,

f1 = 1 to find a general formula for

47

Math 316 Workbook (b) bn = 4bn−1 − 4bn−2 ,

b0 = 5,

b1 = 6

(c) bn = −bn−1 + 2bn−2 ,

b0 = 4,

b1 = 1

48

Sonoma State University (d) bn = bn−2 ,

b1 = 2,

(e) bn = −5(2bn−1 + 5bn−2 ),

b2 = −1

b0 = 1,

b1 = 2

Math 316 Workbook

49

2. Let dn be the number of perfect covers of a 2 × n chessboard using the following types of square pieces: white 1 × 1 pieces, and/or 2 × 2 pieces of 6 different colors: white, black, red, green, yellow, purple. (Note that a white 2 × 2 square is different than 4 white 1 × 1 squares.) (a) Find d1 and d2 .

(b) Derive a recurrence relation with initial conditions for dn .

(c) Solve the recurrence relation from part (b) above, and use it to find the number of perfect covers of a 2 × 100 chessboard using the pieces described above. Obviously, you’ll want to leave your answer in unsimplified form!

50

Sonoma State University 3. (Taken from Brualdi) Let hn be the number of different ways in which the squares of a 1 × n chessboard can be colored, using the colors red, white, and blue so that no two squares that are colored red are adjacent. Find a recurrence relation that hn satisfies, and then find a formula for hn .

Math 316 Workbook

51

4. (Taken from Brualdi) By evaluating each of the following expressions involving the Fibonacci numbers, guess a general formula. Then, use induction to prove your formula. (a) f02 + f12 + f22 + · · · + fn2

52

Sonoma State University (b) f1 + f3 + f5 + · · · + f2n−1

53

Math 316 Workbook

Section 7.4 – Generating Functions Preliminary Example. Suppose we throw three labeled six-sided dice. For each positive integer n, let hn be the number of different ways that the sum of the numbers on the dice can equal n. A graphical illustration of h5 is shown to the right.

Dice Arrangement

Algebraic Term

54

Example 1.

Sonoma State University         n n n n Find a generating function for the sequence of binomial coefficients: , , , ..., 0 1 2 n

Definition. The generating function corresponding to the sequence h0 , h1 , h2 , h3 , . . . is the formal power series h0 + h1 x + h2 x2 + h3 x3 + · · ·

=

∞ X

hk xk

k=0

with the understanding that no value is assigned to the symbol “x”; that is, we consider xn to be a “placeholder” for hn .

Some Useful Generating Functions (1 + x)n

=

1 − xn+1 1−x

=

1 1−x

=

1 1 − xr

=

1 (1 − x)2

=

1 (1 − x)n

1+

      n n 2 n x+ x + ··· + xn−1 + xn 1 2 n−1

=

n   X n k x k

(1)

k=0

n X

xk

(2)

∞ X

xk

(3)

xrk

(4)

(k + 1)xk

(5)

 ∞  X n+k−1 k x k

(6)

1 + x + x2 + · · · + xn

=

k=0

1 + x + x2 + · · ·

=

k=0

1 + xr + x2r + · · ·

=

∞ X

k=0

1 + 2x + 3x2 + · · ·

=

∞ X

k=0

=

    n n+1 2 1+ x+ x + ··· 1 2

=

k=0

Math 316 Workbook

55

Example 2. Let hn be the number of nonnegative integer solutions to the equation e1 + e2 + e3 = n. Find a formula for hn .

56

Sonoma State University

Example 3. Suppose that plentiful supplies of the following types of fruit are available to make a fruit basket: apples, bananas, oranges, and pears. You may consider different pieces of fruit of the same type to be identical, and assume that the order in which the fruit is arranged in each basket is irrelevant. With each of the following conditions, find a generating function for hn , the number of different fruit baskets containing n pieces of fruit. (a) There are no restrictions.

(b) The number of pears must be even.

(c) There must be at least 2 apples, no more than 3 bananas, and exactly 4 oranges.

57

Math 316 Workbook

Example 4. Use generating functions and the fact that (1 + x)n (1 + x)m = (1 + x)n+m to derive a summation

formula for the binomial coefficient

m+n k

.

58

Sonoma State University

Examples and Exercises 1. (Taken from Brualdi) Given that plentiful supplies of apples, bananas, oranges, and pears are available, find a generating function for the number of ways to fill a fruit basket with n pieces of fruit in such a way that each basket has an even number of apples, an odd number of bananas, between 0 and 4 oranges, and at least one pear.

2. Suppose that we have three jars: Jar A, Jar B, and Jar C. In how many ways can we put 40 identical quarters into the three jars?

Math 316 Workbook

59

3. Use a generating function to find the number of ways to collect $15 from 20 distinct people if each of the first 19 people can give at most a dollar, and the 20th person can give either nothing, $1, or $5. Please assume that each person who contributes gives only even dollar amounts.

60

Sonoma State University

Section 9.1 – Matchings in Bipartite Graphs Example 1. A company has 6 applicants applying for 5 jobs. Let {x1 , x2 , . . . , x6 } represent the 6 applicants and {y1 , y2 , . . . , y5 } represent the 5 jobs. After holding interviews, the company determines which applicants are qualified for each job (see table to the right). Given that each applicant can hold at most one job, and each job can be filled by at most one applicant, what is the maximum number of jobs that can filled?

Applicant x1 x2 x3 x4 x5 x6

Jobs Qualified for y1 y2 , y3 y2 , y4 y4 , y5 y2 , y4 y3 , y4

Math 316 Workbook Example 2. To the right, you are given a 4 × 5 chessboard with 8 “forbidden” positions labeled with “X”. What is the maximum number of nonattacking rooks that can be placed on the chessboard given that we must avoid the forbidden positions? (Note: Rooks are called “nonattacking” when they share neither the same row nor the same column of the board.)

61 X X X

X X X

X

X

62

Sonoma State University

Definition. Let G = (X, ∆, Y ) be a bipartite graph. A set M of edges in G is called a matching of G if no edges of M meet at a common vertex. We define ρ(G) to be the size of the largest possible matching in G; in other words, ρ(G) = We call a matching M ∗ a max-matching of G if |M ∗ | = ρ(G).

Example 3. For the bipartite graph G to the right, find a matching M that is not a max-matching, a max-matching M ∗ , and find ρ(G).

x1

y1

x2

y2

x3

y3

x4

Definitions. Let u and v be two vertices in a bipartite graph G = (X, ∆, Y ). A path γ joining u and v is a sequence of distinct vertices (except that u may equal v) γ : u = u0 , u1 , u2 , . . . , up−1 , up = v such that any two consecutive vertices are joined by an edge. Thus, for γ to be a path in G, it must be true that {u0 , u1 } , {u1 , u2 } , . . . , {up−1 , up } are all edges in ∆. We call the path γ a cycle if u = v, that is, if the path starts and ends at the same vertex.

Math 316 Workbook

x1

y1

x1

y1

x2

y2

x2

y2

x3

y3

x3

y3

x4

y4

x4

y4

x5

y5

x5

y5

Definitions. Let M be a matching in a bipartite graph G = (X, ∆, Y ), and let M be the complement of M, that is, the set of edges of G that don’t belong to M. Let u and v be vertices such that one of u and v is a left vertex and one is a right vertex. A path γ joining u and v is called an M-alternating path if all of the following properties hold: 1. The first, third, fifth, . . . edges of γ do not belong to the matching M (thus, they belong to M ). 2. The second, fourth, sixth, . . . edges of γ belong to the matching M. 3. Neither u nor v meets an edge of the matching M.

Observations and Notation: • An M -alternating path always has an • Mγ = • Mγ =

number of edges.

63

64

Sonoma State University

Theorem 9.2.1. Let M be a matching in a bipartite graph G = (X, ∆, Y ). Then M is a max-matching if and only if

Definition. Let G = (X, ∆, Y ) be a bipartite graph. A subset S of the set X ∪ Y of vertices of G is called a cover, provided that each edge of G has at least one of its two vertices in S: {x, y} ∩ S 6= ∅ for all {x, y} in ∆ We define the cover number of G, denoted c(G), to be the smallest number of vertices in a cover of G; i.e., c(G) =

Example 4. For both of the following bipartite graphs, find two covers: one that is minimal, and one that is not. Also state the cover number c(G) of each graph. (a)

x1

y1

x2

y2

x3

y3

x4

(b)

x1

y1

x2

y2

x3

y3

x4

y4

65

Math 316 Workbook

Theorem 9.2.4. Let G = (X, ∆, Y ) be a bipartite graph. Then ρ(G) = c(G); that is, the largest number of edges in a matching equals the smallest number of vertices in a cover.

Corollary. Let G = (X, ∆, Y ) be a bipartite graph, and let S be a cover of G. Then, if M is a matching of G with |M | = |S|, then M must be a max-matching and S must be a minimal cover.

66

Sonoma State University

Examples and Exercises 1. To the right, you are given a 6×6 chessboard with forbidden positions labeled with an “X”. First, construct the rook bipartite graph that corresponds to this board. (a) Construct the rook bipartite graph corresponding to this chessboard.

X X X X X X

X

X

X

X X

X

X X X X

X X X

X X X

X

(b) What is the largest number of nonattacking rooks that can be placed on the chessboard above? Answer this question by finding the largest possible matching in your graph from part (a), and then labeling the above chessboard with R’s in the positions corresponding to your matching.

67

Math 316 Workbook 2. For each of the following, you are given a graph and a matching M (denoted by the highlighted edges). IF POSSIBLE, find an M -alternating path γ in G, and then use the path to obtain a new matching with one more edge than M. Indicate your new matching on the second copy of the graph. (a)

(b)

x1

y1

x1

y1

x2

y2

x2

y2

x3

y3

x3

y3

x4

y4

x4

y4

x1

y1

x1

y1

x2

y2

x2

y2

x3

y3

x3

y3

x4

y4

x4

y4

x5

(c)

(d)

x5

x1

y1

x1

y1

x2

y2

x2

y2

x3

y3

x3

y3

x4

y4

x4

y4

x5

y5

x5

y5

x1

y1

x1

y1

x2

y2

x2

y2

x3

y3

x3

y3

x4

y4

x4

y4

68

Sonoma State University 3. For each of the following graphs, find a max-matching and use the Corollary following Theorem 9.2.4 to prove that your matching really is a max-matching. (a)

(b)

x1

y1

x2

y2

x3

y3

x4

y4

x1

y1

x2

y2

x3

y3

x4

y4 y5

(c)

x1

y1

x2

y2

x3

y3

x4

y4

Math 316 Workbook 4. A company has 6 applicants applying for 6 jobs. After holding interviews, the company determines which applicants are qualified for each job (see table to the right). Given that each applicant can hold at most one job, and each job can be filled by at most one applicant, what is the maximum number of jobs that can filled with qualified applicants? Explicitly state how the jobs should be assigned to achieve this maximum, and show that your answer is correct.

69 Applicant x1 x2 x3 x4 x5 x6

Jobs Qualified for y1 , y4 y1 , y3 , y6 y5 y2 , y3 , y5 , y6 y3 y3

5. Prove or disprove: Given a matching M in a bipartite graph G that is not maximal, it is possible to obtain a max-matching by adding an appropriate number of edges from G.

70

Sonoma State University

Section 11.1 – Basic Properties of Graphs Definition. A graph G = (V, E) (also called a simple graph) consists of a finite vertex set, V, and a finite set of edges, E, that join vertices in V. If x and y are vertices in V, and if α = {x, y} = {y, x} is an edge of G, we use the following terminology: • α joins x and y • x and α are incident, and y and α are incident. The number of distinct vertices in the graph is called the order of G. The degree of a vertex v ∈ V, is defined by deg(v) = the number of edges of G that are incident with v.

Example 1. Given to the right is a graph G = (V, E). Write down the vertex and

a

edge sets, state the order of G, and write down the degree of each vertex.

d c

b

e

Definition. A multigraph G = (V, E) consists of a vertex set V and a multiset E of edges that join vertices in V, possibly multiple times.

Example 2. Given to the right is a multigraph H = (V, E). Write down the vertex and edge sets, state the order of H, and write down the degree of each vertex.

a

b

c

d

71

Math 316 Workbook

Definition. A general graph G = (V, E) is a multigraph that allows loops; that is, edges of the form {x, x} that are only incident with one vertex x ∈ V. Example 3. To the right is an adjacency matrix describing train connections between 6 German cities: Alme, Berlin, Hamburg, Munich, Paderborn, and Stuttgart. Each row and column of the matrix corresponds to one of the 6 cities, listed in alphabetical order (as above) from left to right and top to bottom. A “1” in the matrix represents direct train service between the two corresponding cities, while a “0” represents no direct train service. Construct a general graph to model this network. What do you think the loops in the graph might represent?

       

0 0 0 0 0 0

0 1 1 1 0 0

0 1 1 1 1 1

0 1 1 1 0 1

0 0 1 0 0 0

0 0 1 1 0 1

       

Definition. A complete graph on n vertices, denoted by Kn, is a simple graph of order n such that each vertex in the graph is joined with all other vertices in the graph (except itself).

Example 4. Draw the graphs K2 , K3 , and K4 . In general, how many distinct edges are there in the graph Kn ?

72

Sonoma State University

Example 5. For the graph G given in Example 1, add up the degrees of the vertices of G and compare the sum to the number of edges in the graph. Repeat the same calculations for the general graph H given in Example 2. What do you notice?

Theorem 11.1.1 Plus. Let G = (V, E) be a general graph. Then the sum of the degrees of all of the the number of edges of G; in other words,

vertices of G equals X

deg(x) = d1 + d2 + · · · + dn =

.

x∈V

Proof.

Implications of Theorem 11.1.1 Plus: 1. The sum of the degrees in any general graph is always 2. All general graphs must have an

. number of vertices of odd degree.

73

Math 316 Workbook

Example 6. Are the two graphs below “different”? Discuss. H ′ = (V ′ , E ′ )

H = (V, E)

Definition. Two general graphs G = (V, E) and G′ = (V ′ , E ′ ) are called isomorphic if there is a 1-1 correspondence (i.e. a bijection) θ : V −→ V ′ such that, for each pair of vertices x and y of V, there are as many edges of G joining x and y as there are edges of G′ joining θ(x) and θ(y).

Notes: 1. Conceptually, if you think of the vertices of a graph as being pins on a bulletin board and the edges being rubber bands attached to the pins, then two graphs are isomorphic if we can move the pins around in one of the graphs and obtain the other one by stretching or shrinking rubber bands (no breaking!). 2. An isomorphism can be thought of as a bijection between the vertex sets of two graphs that “preserves adjacency.” 3. Write down an isomorphism that corresponds to Example 6 above:

74

Sonoma State University

Example 7. Which of the following graphs are isomorphic? For those that are, write down an isomorphism. G1

G2

G3

G4

Properties that isomorphic general graphs G and G′ must share:

G5

75

Math 316 Workbook

Definition. Let G = (V, E) be a general graph. Let U be a subset of V and F be a submultiset of E such that the vertices of each edge in F belong to U. Then G′ = (U, F ) is also a general graph and is called a general subgraph of G. If F consists of all edges of G that join vertices U, then G′ is called the induced general subgraph of G, which we denote by GU . Example 8. For each of the following graphs G = (V, E), find two subgraphs: one that is an induced subgraph, and one that is not an induced subgraph. (a)

f b a

j

e g

c d

h

(b)

a

k i

f

b

e c

d

76

Sonoma State University

Examples and Exercises Definition. Let G = (V, E) be a general graph.

A sequence of m edges in G of the form {x0 , x1 } , {x1 , x2 } , . . . , {xm−1 , xm } is called a walk of length m that joins x0 and xm . We also denote this walk by writing x0 − x1 − x2 − · · · − xm .

A walk may have repeated edges. If a walk has distinct edges, then it is called a trail. If, in addition, a walk has distinct vertices (except, possibly, x0 = xm ), then the walk is called a path. A closed path (i.e. one with the same starting and ending vertex) is called a cycle. The distance between two vertices x and y of G, denoted by d(x, y), is the length of the shortest path joining x and y. We also define d(x, x) = 0.

f

1. Let G = (V, E) be the graph shown to the right. Use the graph and the above definitions to complete the following:

b a

(b) Find a trail in G joining a and k that is not a path.

(c) Find a walk in G joining a and k that is not a trail.

(d) Find cycles of length 3, 4, and 5 in G.

(e) Calculate the following distances: d(a, k), d(b, i), d(c, k), and d(c, c).

(f) List all vertices of G that have distance 3 from g.

g

c d

j

e

(a) Write down two distinct paths in G that join a and k.

h

k i

77

Math 316 Workbook

Definition. A general graph G is called connected, if, for each pair of distinct vertices x and y there is a walk joining x and y (equivalently, a path joining x and y). Otherwise, we say that G is disconnected. 2. Sketch two graphs of order 4, one that is connected and one that is disconnected.

Definition. Let G = (V, E) be a general graph, and let let F be a submultiset of E. Then a general subgraph of the form G′ = (V, F ) is called spanning general subgraph. In other words, a subgraph is spanning if it contains all of the vertices of the original graph G, but not necessarily all of the edges. a

3. Given to the right is a graph G = (V, E). For each of the subgraphs of G given below, decide whether they are connected or disconnected, spanning or not spanning, and induced or not induced.

b

e

d c

(a)

a

b

d

e

ca

(b) b d

e

c

(c)

a

b

e d c

(d)

a

b

e d c a

(e) b

d c

e

78

Sonoma State University 4. Determine whether or not each pair of graphs is isomorphic. If the graphs are isomorphic, find an isomorphism. If the graphs are not isomorphic, clearly explain why not. (a)

a

e

b

d

w

c

(b)

z

v

a

u

f e

b c

(c)

y

x

z y

v w

d

a e

x

y

v

z

d b

(d)

c

a

x

q

e j

f b

w

r s

i

g

h

t u x

y

w y

z

d

v

c

w z

(e)

f a

b c

d

u v e

x

Math 316 Workbook

79

5. Draw all 14 nonisomorphic simple graphs of order 5 that have 4 or fewer edges.

6. Prove that, if two vertices in a general graph are joined by a walk, then they are joined by a path. (Hint: Let γ be a walk of shortest length between the two vertices, and then show that γ must be a path.)

80

Sonoma State University

Sections 11.2 – Eulerian Trails Example 1. The city of Koenigsberg in East Prussia was located along the banks and on two islands of the Pregel River, with the four parts of the city connected by seven bridges as shown to the right. Is it possible to start in one part of the city and take a stroll so that you use each bridge exactly once and return to the same place you started? If so, specify the route.

A B

C D

Definition. Let G be a general graph. A trail in G that contains every edge of G exactly once is called an trail. A trail contains every edge of the graph exactly once and has the same starting and ending vertex. Closed Trail Algorithm. Let G = (V, E) be a general graph, and assume that the degree of each vertex is even. Then the following algorithm produces a closed trail in G: (0) Pick a starting edge α1 = {x0 , x1 } from E. (1) Put i = 1. (2) Put W = {x0 , x1 } (3) Put F = {α1 } (4) While xi 6= x0 , do the following: (a) (b) (c) (d)

Locate an edge αi+1 = {xi , xi+1 } not in F. Put xi+1 in W (xi+1 may already be in W ). Put αi+1 in F. Increase i by 1.

81

Math 316 Workbook

Example 2. Using the algorithm on the previous page as a guide, find a

a

closed Eulerian trail in the graph G to the right. Note that G is connected and that every vertex of G has even degree.

b e

d

c

g

f h

j

i k

m

82

Sonoma State University

Theorem 11.2.2. Let G be a connected general graph. Then G has a closed Eulerian trail if and only if

Example 3. Given to the right is a graph G = (V, E).

a

b

(a) Does G have a closed Eulerian trail? Explain.

c e

d f

(b) By adding one edge e to the graph G above, create a new graph G′ = (V, E ∪ {e}) that does have a closed Eulerian trail. Then, write down a closed Eulerian trail in G′ that starts with the edge you added.

(c) Use the closed trail in G′ to help you write down an open Eulerian trail in the original graph G.

83

Math 316 Workbook

Theorem 11.2.3. Let G = (V, E) be a connected general graph. Then G has an open Eulerian trail if and only if there are exactly two vertices of odd degree.

Examples and Exercises a

1. Find a closed Eulerian trail in the graph G to the right.

d

b

c

f e i m

h

g j n

k

84

Sonoma State University 2. For each of the graphs below, find either a closed Eulerian trail or an open Eulerian trail. Clearly indicate what constitutes your final trail. (a)

a

b

c d

e f

g h

j

(b)

i

a

b

c

d

e

g

f

h

i

(c)

a

c

b

e

d g

h

f

85

Math 316 Workbook

Section 11.3 – Hamilton Paths and Cycles B

Example 1. A mail carrier wants to deliver mail in each of the C

A

20 towns represented by vertices in the graph G to the right. The edges in the graph indicate the existence of a direct road between towns. Is there a route she can take that will allow her to start in Aberdeen (labeled “A”), visit each of the towns exactly once, and return to Aberdeen? If so, specify the route she should take.

E

D

F

I

H G

J M

K

L

O

N

P R

Q S

T

Definition. Let G be a graph. A path that visits each vertex in the graph exactly once is called a . A closed path that visits each vertex of the graph exactly once . and returns to the starting point is called a

Example 1. Given below are two graphs, G and H. Does either graph have a Hamilton path? a Hamilton cycle? If the answer is yes, explicitly specify the path and/or cycle. G H v

w

a

x

y

z

g

b c

d

e

f h

86

Sonoma State University

Theorem 11.3.1. A connected graph with a bridge does not have a Hamilton cycle. Example 2. Prove that the converse of Theorem 11.3.1 is false by giving an appropriate counterexample and carefully explaining why it works.

Definition. Let G be a graph of order n. We say that G satisfies the Ore property if, for all pairs of distinct vertices x and y that are not adjacent, we have deg(x) + deg(y) ≥ n.

Example 3. Draw two graphs of order 4: one that satisfies the Ore property, and one that does not.

Math 316 Workbook

Example 4. Prove that any graph that satisfies the Ore property must be connected.

87

88

Sonoma State University

Theorem 11.3.2. Let G be a graph of order n ≥ 3 that satisfies the Ore property. Then G has a Hamilton cycle.

89

Math 316 Workbook

Examples and Exercises 1. For each of the following, draw a connected graph G satisfying the indicated conditions, or explain why no such example exists. (a) G has a Hamilton cycle and a Hamilton path.

(e) G has a closed Eulerian trail and a Hamilton cycle.

(b) G has a Hamilton path but not a Hamilton cycle.

(f) G has an open Eulerian trail and a Hamilton cycle.

(c) G has a Hamilton cycle but not a Hamilton path.

(g) G has an open Eulerian trail and a closed Eulerian trail.

(d) G has neither a Hamilton path nor a Hamilton cycle.

(h) G has neither an open Eulerian trail nor a closed Eulerian trail.

90

Sonoma State University 2. Prove that the converse of Theorem 11.3.2 is false by giving an appropriate counterexample and carefully explaining why it works.

3. Draw all connected nonisomorphic graphs of order 6 that have closed Eulerian trails.

91

Math 316 Workbook

Section 11.4 – Bipartite Multigraphs Example 1. Let G = (V, E) be a graph whose vertices are the integers from 1 to 6, with two integers joined by an edge if and only if their difference is an odd integer. (a) Draw this graph and decide whether or not it is bipartite.

(b) Write down as many different cycles in G as you can. What do you notice about the length of each cycle?

Definition. Let G = (V, E) be a multigraph. Then G is called bipartite provided that the vertex set V may be partitioned into two subsets X and Y such that each edge of G has one vertex in the set X and the other vertex in the set Y. A pair X, Y with this property is called a bipartition of G (or of the vertex set V ). Definition. A bipartite graph G with bipartition X, Y is called complete provided that every vertex in X is adjacent to every vertex in Y. A complete bipartite graph with m left vertices and n right vertices is denoted by Km,n .

Notes: 1. The graph from Example 1 above is isomorphic to 2. In general, the graph Km,n has

edges.

.

92

Sonoma State University

Example 2. Decide which of the following graphs are bipartite. For those that are, give a bipartition. (a)

(b)

(c)

(d)

(e)

Math 316 Workbook

Theorem 11.4.1. A multigraph is bipartite if and only if

93

94

Sonoma State University

Section 11.5 – Trees and Applications Example 1. (a) Let G be a graph of order n = 3 (that is, having 3 vertices). What is the smallest number of edges that G can have in order to be connected?

(b) Answer the same question as above for n = 4 and n = 5. For each value of n, try to draw all possible nonisomorphic graphs with the smallest number of edges required to be connected.

(c) Look back at all of your graphs from parts (a) and (b) above. Do they have anything in common? In particular, do they contain any cycles? Can any of the edges be removed without disconnecting the graphs?

Theorem 11.5.1. A connected graph of order n has at least integer n, there exist connected graphs with exactly graph of order n with exactly edges leaves a . each edge is a

edges. Moreover, for each positive edges. Removing any edge from a connected graph, and hence

95

Math 316 Workbook

Definition. A tree is a connected graph that becomes disconnected upon removal of any edge. Thus, a tree is a connected graph such that each of its edges is a bridge. Equivalent Ways of Defining Trees A connected graph G = (V, E) of order n is a tree if and only if . . . 1. . . . it has exactly n − 1 edges.

2. . . . there are no cycles in G.

3. . . . every pair of distinct vertices x and y are joined by a unique path, which is necessarily a shortest path between x and y.

96

Sonoma State University

Example 2. The graph G to the right represents a network of roads connecting 9 cities. By removing successive edges from the graph, find a subgraph of G with as few edges as possible that keeps the network of cities connected.

Definition. A tree that is a spanning subgraph of a graph G is called a spanning tree of G. Theorem 11.5.7. Every connected graph has a spanning tree. Example 3. Use Dijkstra’s algorithm below to find a distance tree for the vertex u in the graph to the right.

y

v 1 u

2 3

4 x

1

1 2 3

3 2 w

z

Dijkstra’s Algorithm for a distance-tree for u Let G = (V, E) be a weighted graph of order n, with weight function c, and let u be any vertex. (1) Put U = {u} , D(u) = 0, F = ∅, and T = (U, F ). (2) If there is no edge in G that joins a vertex x in U to a vertex y not in U, then stop. Otherwise, determine an edge α = {x, y} with x in U and y not in U such that D(x) + c {x, y} is as small as possible, and do the following: (i) Put the vertex y into U. (ii) Put the edge α = {x, y} into F. (iii) Put D(y) = D(x) + c {x, y} and go back to (2).

97

Math 316 Workbook

Proof that Dijkstra’s algorithm works Claim: Let G be a connected graph, and let T = (U, F ) be the spanning tree obtained by applying Dijkstra’s algorithm to G. Then for any vertex y of G, the distance between u and y equals D(y), and this is the same as the weighted distance between u and y in the weighted tree T. Suppose by way of contradiction that the above claim is not true. Then Basic Idea of Proof: there will be at least one vertex v in resulting tree T where D(v) does not equal the weighted distance from the starting vertex to v, as illustrated in the example below: (5)

(1)

b

4

(0)

2

d 1

(2)

5

l

2

2 (12)

2

m 3

1

2

h

(5)

3

i

(8)

4

(13)

n

1

e 1

c

g

(4)

2

2

(9)

2

(3)

2

a

4

3

1

(11)

f

(11)

2

k

2 1

j (10)

2

98

Sonoma State University

Example 3. In Eisundkalt county of North Dakota, 9 towns are

2.2

2.6

connected by a network of dirt roads (see diagram to the right); 1.2 1.5 3.2 the edge weights indicate the time required to pave that road, in 3.6 thousands of man hours. The highway department wants to pave 2.0 2.0 3.2 enough roads so that it is possible for a motorist to travel between 1.0 any two towns using only paved roads. They also want to complete 1.4 1.4 1.0 the project in as little time as possible, since summer only lasts 3 2.4 weeks in Eisundkalt county. Use Prim’s algorithm (see bottom 4.2 of page) to determine which roads should be paved in order to complete the project with the minimum number of man hours. (Terminology Note: In this example, we are being asked to find a minimum-weight spanning tree.)

3.6

Prim’s Algorithm for a minimum-weight spanning tree Let G = (V, E) be a weighted, connected graph of order n with weight function c, and let u be any vertex of G. (1) Put i = 1, U1 = {u} , F1 = ∅,

and

T1 = (U1 , F1 ).

(2) For i = 1, 2, . . . , n − 1, do the following: (i) Locate an edge αi = {x, y} of smallest weight such that x is in Ui and y is not in Ui . (ii) Put Ui+1 = Ui ∪ {y} , Fi+1 = Fi ∪ {αi } , and Ti+1 = (Ui+1 , Fi+1 ). (iii) Increase i to i + 1. (3) Output Tn−1 = (Un−1 , Fn−1 ). (Here Un−1 = V.)

Math 316 Workbook

99

Examples and Exercises 1. Draw all nonisomorphic trees of order 6.

2. Draw all nonisomorpic spanning trees of the graph shown to the right. Is there any relationship between your answers to this problem and your answers to problem 1?

Definition. A vertex of degree 1 in a graph G is called a pendent vertex of G. 3. (a) By experimentation, determine, in terms of n, the smallest and largest numbers of pendent vertices that a tree of order n can have.

100

Sonoma State University (b) Prove that, if a tree T of order n has 2 vertices of degree p, then it must have at least 2(p − 1) pendent vertices. (Hint: Let k be the number of pendent vertices of T, and use Theorem 11.1 Plus to show that k ≥ 2(p − 1).)

4. For each of the following graphs, use Dijkstra’s Algorithm to find a minimum distance tree from u. Then, use it to write down the minimum weighted distance from u to v. (a)

1 3

4 3

2 2

u

1 3

1

5

v 2

3

(b)

u 2

1 5

3 4

6

3 4

1

4

2

5

v

2

3 3

2

101

Math 316 Workbook (c)

u

5 3

2

4

4

2

2

1

3

2

3

4

5

3

3

2

4

4

1

1

3

3

5 5

4

4

v

6

5. In the same three graphs as in the previous exercise, use Prim’s algorithm to determine a minimum-weight spanning tree, and find the minimum weight. Do you obtain the same trees that you did in the previous excercise? (a)

1 3

4 3

2 2

u

1 3

1

v

5

2

3

(b)

u

1

3

5

2

4

6

3 4

(c)

u

1

4

2

5

v

2

3 3

2

5 3

2

4 2 2 1

5

3

3 4

2 2

3

4

4

4

1

3

3

3

1 5

5 4 6

4

v

102

Sonoma State University

Section 13.1 – Chromatic Number Example 1. Given to the right is a schedule giving the times of six different math courses. What is the smallest number of classrooms needed to accommodate the courses without creating room conflicts? (Suggestion: Model this problem with a graph, where the classes are the vertices, and edges join vertices if and only if there are time overlaps between the corresponding classes.)

Class

Times

Intro to Higher Math Modern Algebra Stats Consulting History of Math Real Analysis 2 Vector Calculus

MTWF, 11-11:50 MW, 10-11:50 TR, 10-11:50 MWF, 10-10:50 TR, 9:20-10:35 MTWF, 10-10:50

Definitions. Let G = (V, E) be a graph. A vertex-coloring of G is an assignment of a color to each of the vertices of G in such a way that adjacent vertices are assigned different colors.

If the colors are chosen from a set of k colors, then the vertex-coloring is called a k-coloring, whether or not all k colors are used. If G has a k-coloring, then G is called k-colorable.

The smallest k such that G is k-colorable is called the chromatic number of G, and is denoted by χ(G).

103

Math 316 Workbook

Example 2. Draw graphs that have chromatic number 2, 3, and 4.

Example 3. Find the chromatic number of the graph G shown to the right, and show that your answer is correct.

a

g h i

f

b

e d c

Example 4. Use the Greedy Algorithm for vertex coloring (see below) to find a coloring of the graph to the right. Does the algorithm produce an optimal solution? Discuss.

x3

x7

x1

x5

x2

x6

x8

x4

Greedy Algorithm for vertex-coloring Let G be graph in which the vertices have been listed in some order x1 , x2 , . . . , xn . (1) Assign the color 1 to vertex x1 . (2) For each i = 2, 3, . . . , n, let p be the smallest color such that none of the vertices x1 , . . . , xi−1 which are adjacent to x1 are colored p, and assign the color p to xi .

104

Sonoma State University

Some Chromatic Number Theorems Theorem 13.1.1. Let G be a graph of order n ≥ 1. Then 1 ≤ χ(G) ≤ n. Moreover, χ(G) = n if and only if G is a graph.

Corollary

13.1.2.

Let

G .

then

graph, and χ(G) = 1 if and only if G is a

be a graph and let H be a subgraph of G. Then If G has a subgraph equal to a complete graph Kp of order p, .

Theorem 13.1.4. Let G be a graph with at least one edge. Then χ(G) = 2 if and only if G is .

Theorem 13.1.6 (Brooks’ Theorem). Let G be a connected graph for which the maximum degree of a vertex is ∆. If G is neither a complete graph Kn nor an odd cycle graph Cn , then χ(G) ≤ ∆.

105

Math 316 Workbook

Definition. For each k ≥ 0, the number of k-colorings of the vertices of a graph G is denoted by pG (k). We call pG (k) the chromatic polynomial of G. Example 3. Find the chromatic polynomials of K3 , the complete graph on 3 vertices, and N3 , the null graph on 3 vertices.

Fact 1. Let G be a graph having edge e = {x, y} . Then pG (k) = pG1 (k) − pG2 (k), where G1 is the graph obtained from G by removing the edge {x, y} from G, and G2 is the graph obtained from G by contracting the edge {x, y} .

106

Sonoma State University

Fact 2. For any graph G, the quantity pG (k) is a polynomial in k.

Examples and Exercises 1. Find the chromatic number of each of the following graphs, and show that your answer is correct. (a)

(b)

Math 316 Workbook (c)

(d)

2. Prove or disprove: For a graph G, if χ(G) ≥ n, then G must contain Kn as a subgraph.

107

108

Sonoma State University

3. Let G be the complete graph shown to the right, let G1 be the graph obtained from G by deleting the edge e, and let G2 be the graph obtained from G by “contracting” the edge e (see diagram to the right). Determine the number of different 3-colorings of each graph. Is there any relationship between the number of colorings for these graphs?

c

a

c

b a c

a

a

b a

b a

c

b a c

b a c

b a

G c

c

c

e

c

c

b a c

c

b a

b c

b a

b a

b a

G2

b a c

c

G1

b a c

b c

b a

b a

b

c

c

c

c

c

c

a

a

a

a

a

a

4. Let T be any tree of order n ≥ 1. By experimenting with small values of n, try to guess a formula for pT (k), the chromatic polynomial of T.

Math 316 Workbook

109

5. Find the chromatic polynomial of each of the following graphs. Feel free to leave your answers in unsimplified form. (a)

(b)

(c)

(d)

110

Sonoma State University

Section 13.2 – Plane and Planar Graphs Definition. Let G be a general graph. We say that G is planar if it can be drawn in the plane without any edge crossings. Such a drawing is called a plane-graph and is referred to as a planar representation of G.

Example 2. Each of the following plane graphs divide the plane into a finite number of connected regions, labeled R1 , R2 , . . . , Rk . Let fi denote the number of edges in the graph that “border” the region Ri as one walks around its border. Find fi for each region, and then add up all the fi ’s. What do you notice? (a)

R1

R4

R5

R3 R2

(b)

R3

R1

R4

R2

R6

R7

R5

(c) R2 R1 R3 R4

111

Math 316 Workbook

Example 3. For each of the plane graphs in Example 2 on the previous page, let n be the number of vertices, let e be the number of edges, and let r be the number regions. Calculate r − e + n for each of the graphs. What do you notice?

Theorem 13.2.1 (Euler’s formula). Let G be a plane-graph of order n with e edges, and assume that G is connected. Then the number of regions into which G divides the plane satisfies r=

112

Sonoma State University

Theorem 13.2.2. Let G be a connected planar graph. Then there is a vertex of G whose degree is at most 5.

Example 4. Prove that Kn is planar if and only if n ≤ 4.

113

Math 316 Workbook

Example 5. Investigate the planarity of the Petersen graph, which is

x1

given to the right.

y2 y3 y1

x2

x3

Definition. Let G = (V, E) be a graph, and let {x, y} be any edge of G. The process of choosing a new vertex z not in V and replacing the edge {x, y} with two new edges {x, z} and {z, y} is called subdividing the edge {x, y}, and it leads to a new graph. A graph H is called a subdivision of G if H can be obtained from G by successively subdividing edges of G. Theorem 13.2.3 (Kuratowski’s Theorem). A graph G is planar if and only if it does not have a subgraph that is a subdivision of a K5 or of a K3,3 .

114

Sonoma State University

1. For each of the following, decide whether or not the graph is planar. If it is, draw a planar representation of the graph. If not, show that it is not planar. (a)

(b)

(c)

(d)

Math 316 Workbook

115

2. In this problem, you will investigate the planarity of the complete bipartite graph K3,3 . (a) Draw K3,3 with as few edge crossings as possible. Do you think K3,3 is planar?

(b) Does K3,3 satisfy the inequality e ≤ 3n − 6? What, if anything, can you conclude from this?

(c) Observe that K3,3 has no cycles of odd length because it is bipartite. Therefore, if it were planar, we would have fi ≥ 4 for all i, where fi represents the number of edges that border on the ith region. Use this fact and a similar argument as in our proof of Euler’s Theorem to prove that, if K3,3 were planar, then e ≤ 2n − 4.

(d) Use part (c) to show that K3,3 is not planar.