<<

Math 342 Class Wiki Fall 2006 2 Authors

This document was produced collaboratively by: • Keegan Asper • Justin Barcroft • Shawn Bashline • Paul Bernhardt • Kayla Blyman • Amanda Bonanni • Carolyn Bosserman • Jason Brubaker • Jenna Cramer • Daniel Edwards • Kristen Erbelding • Nathaniel Fickett • Rachel French • Brett Hunter • Kevin LaFlamme • Rebeca Maynard • Katherine Patton • Chandler Sheaffer • Kay See Tan • Brittany Williams

3 4 Introduction

This is a hard-copy version of a collaborative document produced during the Fall semester 2006 by students in my combinatorics course. The original hypertext version is currently being served at:

http://pc-cstaecker-2.messiah.edu/~cstaecker/classwiki

Since the original document was produced collaboratively by the students with minimal contributions by the professor, some errors may exist in the text. This hard-copy was translated into LATEX markup language by a computer program, which may have introduced a few further cosmetic errors. Thanks to all the students for their hard work and a great semester. Dr. P. Christopher Staecker Messiah College, 2006

5 6 Contents

Arrangements with repetition 11

Arrangements with restricted positions 12

Base case 14

Big O notation 14

Binary search tree 14

Binomial theorem 15

Bipartite graph 17

Circle-chord technique 17

Cliques 18

Color critical 32

Combinatorics 33

Comparing binary search trees 33

Complement 40

Complete graph 41

Computing coefficients 42

Computing coefficients/Examples 44

Coq 45

Counting with Venn diagrams 46

Dijkstra 49

7 8

Directed graph 49

Distributions 50

Enumeration 52

Euler 55

Euler’s Formula for , and Other Complex Solids 56

Euler 62

Exponential 64

Fibonacci Sequence and Pascal’s Triangle Relationship 66

Fibonacci sequence 67

Forest 68

Four color theorem 69

Four color theorem/Example 2: Chromatic of Graph 71

Gamma function 72

Generating function 79

Graph coloring 84

Graph theory 85

Hamilton 87

Hamilton circuit 88

Heawood Conjecture 90

Inhomogeneous recurrence relation 100

Integer partitions 101

Isomorphic 102

Isomorphism 107

Kuratowski 111

Linear recurrence relation 113 9

Minimal Recursion Circuits 116

Minimal cost 122

More Coloring Fun 124

Multigraph 124

Network 125

Network Flow 130

Pascal’s Tetrahedron 137

Path 144

Permutations and combinations 146

Permutations and combinations/“SYSTEMS” example 149

Planarity 150

Planarity 151

Ramanujan 156

Recursion 157

Rook Polynomials 160

Solving recurrence relations with generating functions 161

Spanning tree 164

Sperner’s lemma 166

Spherical and Toroidal Graphs 172

Stirling’s Formula 178

Subdivision 181

The Birthday Paradox 181

The Inclusion/Exclusion Principle 183

Towers of Hanoi 185

Traveling salesman problem 186 10

Tree 188

Using combinations in statistics 192

Varadarajan example 193

Vertex 194

Where chess meets 195 11

Arrangements with repetition

Counting Arrangements

A common enumeration problem one may have to solve deals with how many arrangements can be made from a collection of repeated objects of different types.

Our theorem states, if we have n objects with r1 of type 1, r2 of type 2, ..., rm of type m, where r1 + r2 + ... + rm = n, then the number of arrangements that can be made is:

        n n − r1 n − r1 − r2 n − r1 − r2 − ... − rm−1 P (n; r1, r2, ..., rm) = ∗ ∗ ∗...∗ r1 r2 r3 rm An example of when this theorem would be useful is when counting the number of rearrangements in our previous example, SYSTEMS. Although our theorem might be slightly more tedious, we will reach the same answer. Let us think of rearranging the word systems as counting the arrangements with 3 of letter S, 1 of letter Y , 1 of letter T , 1 of letter E, and 1 of letter M. Therefore, our problem would look like: 7 4 3 2 1 P (7; 3, 1, 1, 1, 1) = ∗ ∗ ∗ ∗ = 840 3 1 1 1 1 As you can see, we have arrived at the same conclusion and answer as we did in the “SYSTEMS” example. However, this method proves more useful for problems which contain more than one quantity of various types. For another example, also see the Varadarajan example. See also: Distributions

An Arrangements with Repition Example: Burgers

How many ways are there to choose 10 burgers of 4 different types?

• You can start off by thinking of it as choosing a certain number of each type, such as 4 of the first type, 3 of the second, 1 of the third, and 2 of the fourth, with the total adding up to 10. • Then, in order to display this, you can write it as xxxx|xxx|x|xx where the x’s are the burgers and the pipes (|’s) separate the types. • Now you can treat this problem like an arrangement, and the new question is how many arrangements can we make with the x’s and pipes? There are 10 characters, 10 x’s and 3 pipes. 12

• Now we can represent this problem with P (13; 10, 3).

This example shows us a new theorem:

• The number of ways to choose r things of ntypes is:

C(r + n − 1, r) r is the number of x’s n − 1 is the number of pipes (|) For the example above: r = 10 burgers; n = 4 types. So the theorem results in:

C(r + n − 1, r) = C(10 + 4 − 1, 10) = C(13, 10), which yields the same answer as P (13; 10, 3).

Arrangements with restricted positions

Board where ’bad’ positions are shaded

If you one is counting arrangements with too many restrictions, it may be nec- essary to use a grid diagram in which ’bad’ positions are shaded. In this way, one can count the number of ways to arrange mutually non-capturing rooks within the grid. This might be used to solve problems such as: How many arrangements can be made with the letters a b c d e with: a not in position 1 or 2 b not in position 1 d not in position 3 or 4 e not in position 3, 4, or 5 Let U = all possible arrangements of the 5 letters 13

A1 = all arrangements with a ’bad’ letter in position 1

A2 = all arrangements with a ’bad’ letter in position 2 ...  Ai = all arrangements with a ’bad’ letter in position i

So, we want N(A¯1...A¯5) We know from The Inclusion/Exclusion Principle that we should find N(U) − S1 + S2 − S3 + S4 − S5

S1, the sum of the first-fold arrangements in this case signifies all the arrange- ments ’bad’ in 1 position.

Similarly, Sk will be all arrangements bad in k positions or the number of ways to pick k bad spots on the board (with no 2 in the same row or column). Given some board, the number of placements of k mutually non-capturing rooks th is as the function rB(B), or the k rook number of B.

Example 1

Find all rk’s for B1 :

r0(B1) = 1 There is always one way to place 0 things

r1(B1) = 4 This is the number of spots on the board

r2(B1) = 3 This can be counted

r3(B1) = 0 There is no way to place 3 rooks in B1 without them attacking eachother all other, higher rk are zero.

Rook Polynomials

The rook polynomial r(x, B) of a board, B is the Generating function for rk.

2 i r(x, B) = r0(B) + r1(B)x + r2(B)x + ... + ri(B)x

2 So, from the previous example, r(x, B1) = 1 + 4x + 3x . 14

Example 2

Find all rk’s for B2

r0(B2) = 1

r1(B2) = 20

r2(B2) = 10 ∗ 9

r3(B2) = 0 All the others higher than r3(B2) will all be zero.

Base case

A base case is the simplest case of a recurrence relation that can be solved without further recursion. For example, r(1) = 1 is a properly-stated base case. A recurrence relation can have more than one base case if the recurrence relies upon more than one previous term.

Big O notation

Big O notation is a term used in both mathematics and computer science. In computer science it categorizes the complexity of an algorithm. It is often seen as an indicator of the efficiency of an algorithm, as it can roughly predict the time required to complete n iterations or recursions of an algorithm. For example, a given algorithm loops through n rows and adds each one to a sum. The Big O notation for this algorithm would be notated O(n). We would say that the algorithm has “order of n” complexity.

Common “Orders”

• O(log n) (logarithmic) • O(n) (linear) • O(n2) (quadratic) • O(cn) (exponential) • O(n!) () 15

Binary search tree

A binary search tree is a 2-ary tree the nodes of which have the following prop- erties:

1. The node has a value.

2. The sub-tree with the node’s left child as its root contains nodes with values less than the node.

3. The sub-tree with the node’s right child as its root contains nodes with values greater than the node.

Binomial theorem

n Pn n k n n n 2 The Binomial Theorem states: (1+x) = k=0 k x = 0 + 1 x+ 2 x + n n ... + n x (This is also known as Observation 0) From the Binomial Theorem, we can also find an exponential generating func- tion: (1 + x)n is also an exponential function for P (n, r)

• ∞ X n (1 + x)n = xr r r=0 • ∞ X n! = xr (n − r)!r! r=0 • ∞ X n! xr = (n − r)! r! r=0 • ∞ X xr = P (n, r) r! r=0 proof:

First we will look at a specific case, when n = 3 16

(a+x)3 = (a+x)(a+x)(a+x) = (a+x)(aa+xa+ax+xx) = aaa+aax+axa+axx+xaa+xax+xxa+xxx This is all words of length 3 on x and a. Here, the term xi corresponds to words with i x’s. Thus, the coefficient on xi is the number of words of length n on x and a, using i x’s. By the arrangements with repetition theorem, the coefficient on xi is:

n n − i n P (n; i, n − i) = ∗ = i n − i i Thus,

3 3 3 3 3 X 3 (1 + x)3 = + x + x2 + x3 = xk 0 1 2 3 k k=0 by observation, the same thing can be extended to (1 + x)n.

• Example problem using the Binomial Theorem.

More binomial identities

1. n n n n + + + ... + = 2n 0 1 2 n 2. n (n + 1) (n + 2) (n + r) (n + r + 1) + + + ... + = 0 1 2 r r

3. r (r + 1) (r + 2) n (n + 1) + + + ... + = r r r r (r + 1) 4. n2 n2 n2 n2 2n + + + ... = 0 1 2 n n 5. r X m n  (m + n) = k (r − k) r k=0 6. m X m n  (m + n) = k (r + k) (m + r) k=0 17

7. m X (m − k)(n + k) (m + n + 1) = r s (r + s + 1) k=0

Bipartite graph

an example of a bipartite graph from class

This is a property in that depends on paths or circuits of even length. However, this property of length is defined differently in the world of combinatorics by meaning the number of edges in the path or circuit.

Bipartite Defined:

A graph is bipartite if the graph’s vertices can be partitioned into two sets (we’ll call them V1 and V2) such that all edges go from vertices of V1 to vertices of V2 (and vice versa). If all of the vertices on one side are connected to all of the vertices on the other side and vice versa by edges, it is a .

Theorem Involving Bipartite Graphs:

A graph G is bipartite iff every circuit in G has even length.

Circle-chord technique

The circle-chord technique is a technique that checks a graph for planarity. To use this method, first find a circuit in the graph that visits every vertex once. Draw this circuit in a circle, and then insert the rest of the edges represented on the graph, connecting each vertex to the other around the circle. Below you will see the class example of this technique. 18

Circle-Chord Technique Example

After creating the circle-chord representation of the graph, you can determine whether the graph is planar. If the chords are able to be drawn inside the circle and/or outside of the circle without crossing each other, the graph is planar. However, if the chords do cross each other, you must try other methods before determining whether or not the graph is nonplanar.

Cliques

Everyone encounters cliques on a regular basis because they are the fabric of society. Social cliques, which are smaller groups of people who all know one another, exist within the larger group of society. Social cliques are simply one of the many applications of cliques within graphs. Cliques within graphs can easily be understood through the analogy of social cliques. The graph is society’s equivalent in this analogy. Within the graph, vertices represent the people and the edges represent relationships between the pairs of people (vertices) which they connect. So if Bill (Vertex B) knows Sue (Vertex S) there will be an edge connecting Vertex B to Vertex S, representing their relationship. 19

200

Cliques

Technically, a is a complete subgraph within a larger graph. More specif- ically, a clique is a subset of the set of vertices creating the graph. Within the subset of vertices, every vertex is adjacent to every other vertex in the subset, and is not contained in any larger subset meeting this same requirement. The resulting subset and the edges that connect the vertices in the subset to one another is the clique. To show that a graph contains a clique of a given size we use a clique number. The clique number is the number of vertices contained in the largest clique in the graph. The clique number is written ω(G) for the graph, G.

Example 1

A graph can have just one clique as shown in the graph, G, below.

ω(G) = 4 The clique is highlighted in red. 20

Example 2

A graph can also have many cliques of different sizes as shown in the graph, H, below.

ω(H) = 5 The largest clique, made from five vertices, is highlighted in red. There is another clique made of four vertices highlighted in blue. There is also a clique made of three vertices highlighted in green.

Perfect Graphs

Clique are used to determine whether a graph is perfect. To understand what a perfect graph is, an understanding of induced subgraphs is necessary. An induced subgraph is a subgraph created by selecting a collection of vertices from the original graph, and creating a graph from them and every edge present in the original graph that connects one vertex in that set to another vertex in the set. A perfect graph was defined in two ways by Berge. According to Berge a graph, G, could be γ-perfect or α-perfect. A γ-perfect graph, G, has ω(H) = χ(H) for all H which are induced subgraphs of G.

Example of γ-Perfect γ-perfect graphs can be complicated, but also very simple. Here is a simple example of a perfect graph shown in a bipartite graph. 21

Notice that for any set of vertices that you may hap- pen to choose to select, you will get a chromatic number and a clique number of either 2 or 1; they will always be the same.

α-Perfect Graphs

To understand an α-perfect graph, some new terms need to be explained. The first is the clique number’s complement, the independence number, written α(G). The independence number is the largest subset of vertices in a graph, G, which do not have edges connecting them. Since there were edges connecting all of the vertices in the clique in the original graph, G, there will be no edges connecting the vertices that have become the independent set of the original graph’s complement, G¯.

Independence Number Example Here the clique number in G and the independence number in G¯ are shown to be equal. 22

The graph on the left is the original graph with ω(G) = 4. The edges of the clique are highlighted red, while the vertices in the clique are highlighted green. The graph on the right is the complement of G with α(G¯) = 4. The vertices involved in the independent set are highlighted green. Notice that these vertices are the same vertices that were involved in the clique in the original graph.

Clique Covering Number Another important concept to grasp is the clique covering number of a graph. This is the smallest number of cliques needed for every vertex of the graph to be included in at least one of the selected cliques. The clique covering number is notated θ(G), and it is χ(G)’s complement. So, for any graph, G, χ(G) = θ(G¯).

Clique Covering Number Example Here the chromatic num- ber in G and the clique covering number in G¯ are shown to be equal. 23

The graph on the left is the original graph with χ(G) = 3. The vertices are colored with three different colors, red, blue, and green, showing that the clique covering number and chromatic number really are com- plements. A chromatic number of 2 would not work because the graph has a clique number of 3 and clique numbers are one of the lower bounds of the pos- sible chromatic numbers. In class, this was expressed as, “since the graph has a K3, it must have a minimum chromatic number of 3.” The graph on the right is the complement of the original graph, G, with θ(G¯) = 3. The edges of the three cliques needed to cover the graph are all colored a different color, the clique in the upper left corner has green edges, the lowest clique has red edges, and the right most clique has blue edges. Returning to the topic of perfect graphs which led to the presentation of all of this terminology, an α-perfect graph, G, has α(H) = θ(H) for all H which are induced subgraphs of G. Using the definitions of the two types of perfection possible in graphs, there are connections between them that can be made. α-perfect can be written as γ-perfect’s complement. So a graph is perfect if χ(G¯) = ω(G¯). This also works in reverse, γ-perfect is α-perfect’s complement.

Perfect Graph Theorem

The Perfect Graph Theorem of Lovsz states that the complement of every perfect graph is also perfect. It was proved using the fact that if a graph is α-perfect, then it is also γ-perfect. 24

Example

You can see that this theorem works on the bipartite graph pre- sented as the γ-perfect example. Here is that graph’s complement to be exam- ined.

The complement will have a chromatic and clique number of 3, 2, or 1; however, they will always stay the same.

The Mycielski Construction

Perfect graphs are a very special case when it comes to the relationship between the chromatic and clique numbers of a graph. The more typical case is when the chromatic number is much higher than the clique number. In fact, there is a graph construction which shows that a graph can have a very large chromatic number with a clique number of two. The construction is called the Mycielski Construction. An important requirement to remember when attempting this construction is that the original graph must be free of triangles. The construc- tion asserts that for every triangle-free graph, G, with any chromatic number, χ(G), it is possible to create a new triangle-free graph, G0, with chromatic num- ber, χ(G0) = (χ(G) + 1). There is no limit to how large the original chromatic number can be, so it would be true to say that the chromatic number could become infinite, thus making it infinitely larger than the clique number.

To build the construction, take the original set of vertices, V = {v1, vn}, and add an identically sized set of vertices, U, and a single vertex, w. First, connect every vertex in U to w. Second, take every vertex, ui and connect it to the vertex v(i+1). Do not connect un to any vertex. Third, take every vertex, vi and connect it to the vertex u(i+1). Do not connect vn to any vertex. 25

Example 1

The steps to the Mycielski Construction are outlined visually be- low.

The original graph is in the upper left. The edges of the original graph are blue, and the vertices of the original set of vertices, V , are colored orange. Note that the chromatic number of the original graph is 2, just like its clique number. Also illustrated in this graph are the set of vertices, U, along with the vertex, w, which will be needed for the construction. The vertices in U are colored purple, and w is colored black. The graph labeled “1” is the graph that follows the first instruction in the preceding paragraph, connecting every vertex in U to w. The edges that show this are colored red. The graph labeled “2” is the graph that follows the second instruction in the preceding paragraph. The edges that show this are colored green. The graph labeled “3” is the graph that follows the third instruction in the preceding paragraph. The edges that show this are colored aqua. The graph labeled “3” is the Myscielskian Construction of the original graph. Notice that its chromatic number is 3, while its clique number is still 2.

Example 2

The Mycielski Construction for five vertices is known as the Grotsch graph. It is the smallest graph – free of triangles – to have a chromatic number 26 of 4. It is illustrated below in the same manner that the last example was using the same color key.

Notice that the original graph’s chromatic number is 3 and after the Myscielski edges and vertices have been added the new graph’s chromatic number is 4. It has now been shown that the Mycielski Construction works in two different examples, but that does not prove that it works all of the time. Here is the proof that it does, in fact, work in all cases of triangle-free graphs.

Proof

A triangle-free graph, G, is constructed of a set of vertices, V . A graph, G0, is to be constructed from G using the Mycielski Construction. As explained earlier, a set of vertices, U, identical to V , is added, along with a single vertex, w. The vertices in V are connected to other vertices in V , but never in a way that creates a triangle. No two vertices in U are ever connected because the Mycielski Construction does not instruct for this to happen. No vertex in V will ever be connected to w because the Mycielski Construction does not indicate that this should happen either. Every vertex in U will be connected to w however because the Mycielski Construction requires it. Therefore, the only way that a triangle could be formed is if a vertex in U, ui, is connected to two adjacent vertices in V , vj and v(j+1), which is not a part of the instructions to create a Mycielskian. The Mycielski Construction only directs that ui should be connected to v(i−1) 0 and v(i+1) which will always be two non-adjacent vertices. This proves that G will not have triangles in it as long as G does not have a triangle in it. Since G being triangle-free is one of the requirements to use the Mycielski Construction, it is safe to assume that G has no triangles. By proving that G0 does not have 27 triangles, it has been proven that the clique number does not increase from G to G0. Now, it must be proven that the chromatic number does increase. If G has chro- matic number χ(G) = k, then in G0 the subset of vertices created by combining the existing subsets V and U also has a chromatic number equal to k. Since ui is not adjacent to vi, the color of ui can be the same as the color of vi. The color of w must be different than the color of any of the other vertices in G0 because it is connected to every vertex in U, and if the chromatic number of U is less than the chromatic number of V , then the graph G can use fewer colors in its vertex coloring than were originally used, giving it a smaller chromatic number to begin with. This can be proved by working through the coloring in a reverse order, starting with w in G0 and working towards the outside of the graph. If a chromatic number is found for G0, then a lower chromatic number for G can be found. If the color of w is t, then the coloring of U must be done in (t − 1) colors. ui and vi will be adjacent to the same two vertices in V . So if U is colored in (t − 1) colors, and V is allowed to be colored with all t colors again, then a subset, C, can be taken from V consisting of the vertices in V that have the color t. The members of C will keep the same subscripts as they had in V . Every member of C can be taken, one at a time, and matched with its corresponding vertex in U, and colored the same as that vertex. So ci = vi, and ci can therefore be colored the same color as ui. This will result in the set V being colored in (t − 1) colors, which is the same as the original graph, G, being colored in (t − 1) colors. Therefore proving that a smaller number of colors could be used to color G, making χ(G0) > χ(G).

Vertex Coloring in the Mycielski Construction

Here are the previous two examples of the Mycielski Construction, illustrating the vertex coloring of the original graphs, G and H, and the graphs created by the Mycielski Construction, G0 and H0. 28

Notice that w must be a different color in both cases, G0 and H0, than any other vertex in the graph.

Clique Graphs

Forming clique graphs is an interesting thing to do with graphs containing cliques. A clique graph is a graphical representation of the cliques in a graph and their connections with one another. In the clique graph, every clique from the original graph is represented by a vertex. If the clique intersects another clique in the original graph, that is, they share at least one vertex, then the vertices representing those cliques will have an edge between them in the clique graph, representing that intersection. 29

Example 1

The graph on the left is the original graph which con- sists of three cliques, each a different color. The vertices that are a part of an intersection are colored yellow, while all the rest are black. In the graph on the right there is a vertex for every clique, totaling three vertices. The vertices are the same color as the clique they represent from the original graph. The lines in the graph to the right connect the vertices which represent the cliques connected by a yellow vertex, so the yellow vertices have become the edges.

Example 2

An interesting case of this is when the clique number of a graph is 2. 30

Notice that the clique graph is essentially the same shape as the original graph. The clique graph has the same number of vertices and edges as the original had. The edges have become vertices, and the vertices have become edges. This is illustrated through the use of a different color for every vertex and edge, which remains consistent from the original graph on the left to the clique graph on the right.

Conclusion

In conclusion, cliques appear more places in our lives than just socially. One simple example of this is the game of Uno. Following are some pictures of some Uno cards acting as vertices for a graph. Wild cards and other non-numeric cards have been omitted to keep the graph from getting too complex. The edges of the graph connect cards that have relations between them. The relations that would be of interest are those which make play of either card on the other legal. For example, all of the yellow cards have edges between them, making a clique of yellow cards. Also all of the “1“s have edges between them making a clique of “1“s. 31

Exercises

1. Do a Mycielski construction on a graph with six vertices. Comment on the relationship of the chromatic and clique number of the original graph in relation to those numbers of your resulting graph.

2. What is the clique number of the graph below?

3. Create a clique graph for the graph below.

4. Give an example of a perfect graph. 32

5. What is the clique covering number of the graph below?

References

14. Some Graph Theory. 11 Nov. 2006 . Balakrishnan, V. K. Schaum’s Outline of Theory and Problems of Graph Theory. New York: McGraw Hill, 1997. Rosen, Kenneth H. Handbook of Discrete and Combinatorial Mathematics. Boca Raton: CRC Press, 2000. Weisstein, Eric W. MathWorld – A Wolfram Web Resource. 4 Nov. 2006 . West, Douglas B. Introduction to Graph Theory. 2nd ed. Upper Saddle River, NJ: Prentice Hall, 2001.

Color critical

A graph is color critical if the removal of any vertex of the graph decreases the chromatic number. By removing the vertex, you also remove all the edges that connect to that vertex. 33

Graph G

Examples: The graph G is color critical. (It has, a chormatic number, χ = 3, but the removal of vertex B or D gives χ = 2.)

Combinatorics

Combinatorics is a crazy word that rhymes with “Dabombinatorics” and “Your- mominatorics”.

Comparing binary search trees

Binary search trees (BSTs) are used extensively in computer science as building blocks for data structures with a higher level of abstraction. Computer scientists use BSTs because they store data compactly and can be searched or sorted efficiently. Exactly how efficiently depends upon the structure of the tree.

Insertion and search efficiency

To insert a new value into a BST, one must travel down a path from the root, comparing the new value to the values of the existing nodes. If the new value is less than the value of any given node, the new value is next compared to the left child of that node. If it is greater, it is compared to the right value. Eventually, the new value is inserted as a leaf. This same basic process occurs when searching. Therefore, the height of the BST will be the main determining factor in the efficiency of the algorithm. A BST of minimal height is a balanced binary tree. James Fill has shown that, given a random set of values, a balanced tree has a high probability of occurring[35]. So the height of the tree is in the range of log n, where n is the number of elements in the tree. Therefore, in the average case, searching or inserting in a BST is O(log n). The worst-case efficiency is less optimal. In the worst case, a BST ends up looking like a list–each node has only a single child. Searches and insertions in 34 such a tree occur in O(n) time. Since all useful data has groupings and patterns, computer scientists have developed methods for keeping a BST balanced and efficient.

Red-black tree

The red-black tree was invented in 1972 by Rudolf Bayer.[57] He called his data structure the B-tree. It was later revised and renamed in 1978 by Leo J. Guibas and Robert Sedgewick. A red-black tree maintains balance by introducing a new property to each node, essentially a boolean value, that identifies the node as either red or black. Red-black trees have the following properties in addition to those already imposed by the definition of a BST:

1. Every node is either red or black.

2. The root node is black.

3. All leaves are black (any node without two child nodes is assigned a black “null” node in each empty position).

4. Both children of every red node are black.

5. All paths from any given node to any descendant leaf nodes contain the same number of black nodes.

Insertion

In order to keep a tree balanced, certain operations must be performed on the tree after every insertion. In a red-black tree, insertion itself occurs as it would in any BST, with the exception that the inserted node is by default colored red. After insertion, a balance operation is performed on the inserted node. This operation does one of five things depending upon the properties of the immediate “family” of the inserted node.

Rotation Rotations in both of the BSTs follow the general form for rotations: the node p upon which the rotation is performed becomes the right child (for right rotations) or left child (for left rotations) of its existing left child (for right rotations) or right child (for left rotations) c. The empty spot that used to be occupied by the original child is now occupied by the original grandchild g that was displaced. 35

Case 1 The new node is the root of the tree; it’s the first node we added. In this case we re-color the node black.

Case 2 The parent of the inserted node is black. We don’t need to do anything, as no rules have been broken.

Case 3 The parent of the inserted node and the uncle (the other child of the new node’s grandparent) are both red. This would violate rule 4, as our new node has a red parent. If it weren’t for rule 5, we could just re-color either the new node or the parent of the new node black. However, this would mean that the path to the leaves underneath the new node would have more black nodes in it than the path to any leaves under the uncle. So, the solution is to re-color both the parent and the uncle of the new node black, and make the grandparent red. Since this could conceivably break a rule higher up in the tree, we must now balance the grandparent.

Case 4 The new node’s parent is red but its uncle is black. Additionally, either the parent is a left child and the new node is a right child or the parent is a right child and the new node is a left child. This also violates rule 5. The solution here is to perform a rotation. We perform a left rotation on the parent if the new node is a right child and right rotation on the parent if the new node is a left child. The conclusion of this case does not fully fix the tree; therefore, we apply Case 5 to what was the parent node (but is now the child of the new node).

Case 5 The new node’s parent is red and its uncle is black. Also, both the new node and the parent are either right or left children. This violates rule 4. The first step towards reconciliation is to re-color both the parent and (if it exists) the grandparent red. Additionally, we must perform a rotation on the grandparent. We rotate right if the node and its parent are left children and left if the node and its parent are right children. 36

Randomized search trees (randomized treaps)

The randomized search tree was invented in 1989 by Cecilia R. Aragon and Raimund G. Seidel.[3] This data structure is a modified version of something commonly called a treap because it maintains its balance by behaving not only like a tree, but also like a heap. In practice this means the following:

1. Every node has an assigned “priority”.

2. Every descendant of a node has a priority greater than the node. This puts the treap in min-order. (Note: in his treatment of the subject, Seidel usually arranges his treaps in max-order.)[22]

Insertion

Treap insertion, like insertion in a red-black tree, follows the same algorithm as any BST. The priority of the node is assigned upon insertion. In order to make our treap randomized, we assign a random priority. After inserting the node, the treap is balanced according to heap rules applied to the random priority. This has the same effect as having a tree of totally random data. Since randomized data entry minimizes the height of the tree (see “Insertion and search efficiency,” above), new insertions as well as searches are guaranteed to have worst case efficiency O(log n). This improves efficiency over entering non-random data into a tree without balancing. To balance the treap, we compare the inserted node’s priority to the priority of the parent node. If the new node’s priority is less and it is a left child, we rotate right. If the new node’s priority is less and it is a right child, we rotate left. After any rotation, we must compare the node’s priority to its new parent, as rotation has moved it up one level in the tree. In this way we recursively balance the node until the tree has become a proper heap.

Evaluating insertion algorithms

When determining which tree to use, one must find some way to compare the algorithms used in each type of tree. The most obvious comparison is that of performance (usually the amount of time it takes to complete n operations). The first and most obvious indicator of performance is the number of iterations required in an algorithm. For both of these algorithms, the main source of iterations is the path taken from the root to the leaf where the node is initially added to the tree. Therefore, the height of the tree is of primary significance when comparing computational efficiency. 37

Treap height

The function used to categorize the height of a treap is based in probability and is beyond the scope of this paper. However, it can be shown that the probability of the height of a randomized search tree being greater than logarithmic is exceedingly low. Therefore, the height of the tree can be said to be O(log n).[22]

Red-black tree height

Lemma: The height of a red-black tree is at most 2 log2 (n + 1).

Proof We start by claiming that any sub-tree in a red-black tree has at least 2bh(x)−1 internal nodes, where bh(x) is the number of black nodes in the sub-tree defined by the node x (this is known as the black-height of the node). Claim: Any sub-tree has i(x) = 2bh(x) − 1 internal nodes. Base case: bh(leaf) = 0 (there are 20 − 1 = 0 internal nodes in the sub-tree of a leaf) Inductive case:

• If some x where h(x) = k and i(x) = 2bh(x) − 1

• Then, in order for the claim to be true, we must show x0 where h(x0) = k+1 0 and i(x0) = 2bh(x ) − 1

• If h(x0) > 0, then x0 is an internal node.

• The children of x0 have black-height bh(x0) (if x’ is red) or bh(x0) − 1 (if x’ is black).

0 • So, each child has internal nodes i(child) ≥ 2bh(x )−1 − 1

0 0 • Therefore, i(x0) = 2bh(x )−1 − 1 + 2bh(x )−1 − 1 + 1

0 • Simplifying, we get i(x0) = 2bh(x ) − 1

Having found the number of internal nodes, we can find the limits on the height of the tree. According to rule 4, both children of every red node are black. Conversely, every red node must have a black parent. Therefore, at least half of the nodes on any path from root to leaf must be black. This means that h(root) bh(root) ≥ 2 .

Let i(root) = n n ≥ 2bh(root) − 1 38

h(root) n ≥ 2 2 − 1 h(root) log (n + 1) ≥ 2 h(root) ≤ 2 log (n + 1)

Thus, the height of a red-black tree is O(log n), as well.

Other considerations

While the height of a treap can be expected to be logarithmic, and the height of a red-black tree is no more than 2 times that, there are other factors to consider. So far all we have done is insert the new node; no balancing activities have taken place. In our red-black tree, we never have more than 2 rotations per insertion (see cases 4 and 5 above). We also have no more than m re-colorings averaged over a sequence of m insertions.[57] However, in a treap, we can have up to O(log n) rotations per insertion. This is because it is possible for the randomly assigned priority of the inserted node to be smaller than any other node in the tree. In this case, the rotations would occur recursively until the node is the root. Still, our complexity is O(log n) (as n goes to infinity, the doubling of the iterations becomes insignificant). Although the complexity of the insert operations on both trees is comparable, one would likely see a difference in practice. Firstly, the cost of recursively rotating in a treap is much higher than the cost of a constant number of rotations and re-colorings in the red-black tree. This is particularly a cause for concern when the tree is part of a larger data structure that would require recalculation after every rotation. Secondly, while it is true that the theoretical height of a randomized treap is less than the red-black tree, small data sets often behave differently. In smaller data sets the red-black tree tends to be more balanced as it is not subject to the whims of random priorities. In general, the red- black tree is seen as an improvement on the randomized treap as it has more predictable height (and hence, more predictable asymptotic running time) and requires fewer expensive rotations.

Improving efficiency in randomized treaps

Suppose a start-up company with a new search engine wished to provide a simple dictionary definition every time a user searched for a term. Additionally, assume that the search for the definition would use a treap. There would be certain terms that would be searched upon many times an hour, and other terms that might be searched upon once or twice a year. Using our completely randomized binary search tree, both the likely term and the unlikely term would have the same chance of being at the top or the bottom of the tree. If by chance the 39 popular search term happened to be at the bottom of the tree, the search would have sub-optimal performance. One way of optimizing this search algorithm would be to analyze the search data from, say, the past six months, and produce a continuous probability distribution for the data. This distribution would enable the company to weight the data entering the tree with regard to its likelihood of being retrieved. Doing so would create a treap where the most-used data is at the top. This could significantly speed up the majority of the searches. Seidel and Aragon have shown that such a treap would have a search time of W O(1 + log w(x) ), where W is the sum of all of the weights in the treap and w(x) is the weight of the piece of data being searched for.[22]

Conclusions

After having analyzed insertion and searching in two different BSTs, are there any conclusions that can be drawn about these trees? First, a word of caution: insertion and searching aren’t the only operations that can be done on a tree. There are also deletions, splits, and merges to consider. That being said, the following observations can be made:

1. A red-black tree is more rigid than a treap. Probability plays much less of a role in the red-black tree, so it is easier to predict its asymptotic behaviors.

2. A treap is more flexible than a red-black tree. Because the priorities determine the depth of a datum in the treap, the makeup of a treap can be tweaked simply by making subtle adjustments to the priorities. With this knowledge, data sets with less-than-random usage patterns can be handled very efficiently.

3. Red-black trees make a good base for general-use libraries. The red-black tree is a good general-use performer when nothing is known beforehand about the makeup of the data.

4. Treaps are useful for specialized custom data structures. Knowing a little bit about the usage of the data can make a treap very efficient, so it is a good choice when building a custom data structure for a specific purpose.

An implementation

The page http://pc-cstaecker-2.messiah.edu/ cstaecker/jason/Trees.htm con- tains my own implementation of both a red-black tree and a randomized treap. Values entered in the form at the top are added to both trees simultaneously. 40

Click the “Balance” button that appears after a value is added to run the balance algorithms on the trees (if you don’t balance before you add another element, the code calls the balance algorithms automatically). The visual representation of the tree relies upon tables, where each cell contains a node. The cell directly above any node contains the node’s parent. Hence, the first row contains one cell, the second two cells, the third four cells, and so on. Source code for the red-black tree can be found at http://pc-cstaecker-2.messiah.edu/ cstaecker/jason/RedBlack.js and source for the treap can be found at http://pc-cstaecker-2.messiah.edu/ cstaecker/jason/Treap.js. Each implementation contains a class definition for the tree as a whole and an- other class definition for nodes.

Exercises

1. Suppose you are tasked with implementing search functionality on a state government’s website. You analyze a year’s worth of usage statistics and come up with a continuous probability distribution for the search terms entered by users. However, the oversight committee argues that analyzing the search terms once a year is not often enough – your search function must react dynamically if a search term suddenly becomes more popular. Describe a method for dynamically updating your treap so that the time it takes to search for a term decreases as it gains popularity.

2. A certain red-black tree has 32,767 nodes. If it has worst-case height and each binary comparison takes 1 one-thousandth of a second, how long will it take in the worst case to find a value in the tree?

3. Another consideration when comparing trees is the amount of computer memory required to store the tree. Assuming that null children are not represented by null-valued nodes but are actually empty pointers, which of the two trees discussed here is more space-efficient and why? (See Red-black tree definition above for explanation of null nodes).

See the bibliography section.

Complement

A complement of some set A in some universe U is written as A¯. A¯ is the set of all things in U not in A. This is illustrated in the diagram below. The purple portion of the diagram represents the set A and the blue portion represents the complement of A, A¯. 41

Complete graph

The complete graphs for K3,K4, and K5, respectively

K6

A complete graph is a set of vertices and edges in which every vertex is adjacent to every other vertex. The notation for a complete graph on n vertices is Kn. A bipartite graph can also be complete. A complete bipartite graph is no- tated as Kn,m where n and m are the number of vertices in each of the two sets.

To determine the number of edges in Kn we would use the formula Σd = 2 ∗ e, where d is the of each vertex and e is the number of edges in the graph. In a complete graph the degree of each vertex is n − 1 (each vertex has an edge connecting it to every other vertex). The sum of the degrees is then n(n − 1) , so the number of edges in a complete graph of n vertices is: n(n−1) 2 . 42

Graph Example

Description

Uses of complete graphs

When determining whether or not a graph is planar, if the graph in question contains a K3,3 configuration or a K5 configuration. This is known as Kura- towski’s Theorem.

Computing coefficients

Basically, these are tricks that are based on simple polynomial identities.

Observation 0

n X n n n n n (1 + x)n = xk = + x + x2 + ... + xn k 0 1 2 n k=0 (This is actually the Binomial Theorem.)

Observation 1

1 − xm+1 1 + x + x2 + ... + xm = 1 − x

Proof:

(1 − x)(1 + x + ... + xm)

= (1 + x + x2 + ... + xm) − (x + x2 + x3 + ... + xm+1)

= 1 − xm+1 43

Observation 1.5

1 1 + x + x2 + ... = 1 − x

Proof:

(1 − x)(1 + x + x2 + ...)

= (1 + x + x2 + ...) − (x + x2 + x3 + ...) = 1

Observation 2

1 1 + n − 1 2 + n − 1 = 1 + x + x2 + ... (1 − x)n 1 2

Proof:

By 1.5, 1  1 n = = (1 + x + x2 + ...)n (1 − x)n 1 − x The coefficient on this is the number of ways to choose r things from n types. r r+n−1 So the coefficient on x is r , which is what we want. Class Example involving Observations 1 and 2

Observation 3

n n n n (1 − xm)n = 1 − xm + x2m − x3m + ... + (−1)n xnm 1 2 3 n

Proof:

n Pn n k • The binomial theorem is (1 + x) = k=0 k x

n m n Pn n k mk • If x = −1x , then (1 + (−1)x ) = k=0 k (−1) x

0n 0m 1n 1m 2n 2m • This written out is (−1) 0 x + (−1) 1 x + (−1) 2 x ... • Which, if you squint, will look familiar (it equals the right half of the observation above). 44

Observation 4

2 2 (a0 + a1x + a2x + ...)(b0 + b1x + b2x + ...) =

2 a0b0 + (a1b0 + a0b1)x + (a2b0 + a1b1 + a0b2)x + ... r +(arb0 + ar−1b1 + ... + a0br)x + ... Observations Example Combining All Observations

Computing coefficients/Examples

Find the number of ways to collect $15 total from 20 people with: each of first 19 give $0 or $1, last one gives $0, $1 or $5

e1 + e2 + ... + e20 = 15 = r

e1...e19 ∈ {0, 1}

e20 ∈ {0, 1, 5} Our generating function is (1 + x)19(1 + x + x5) We want the coefficient on x15, so by the Binomial Theorem we can expand our generating function as shown below:

19 19 19 (1 + x)19(1 + x + x5) = (1 + x + x2 + ... + x19)(1 + x + x5) 1 2 19

15 coefficient on x is a15b0 + a14b1 + ... + a0b15 all b’s are 0 except b0, b1, b5 = 1 19 19 19 So we get a15 + a14 + a10 = 15 + 14 + 10

Another Example

Here is another problem that we can solve using observations 1-4. Find the coefficient of x25 in (x2 + x3 + x4 + x5 + x6)7. We can begin solving the problem by factoring an x2 out from the sum, and then raising it to the to equal x14(1 + x + x2 + x3 + x4)7.

2 3 4 1−x5 We can use Observation 1 to put (1 + x + x + x + x ) into the form 1−x . 7 14  1−x5  This step simplifies the equation to x 1−x . 45

7 14 5 7  1  By separating the fraction so that the expression is x (1−x ) 1−x , we can apply Observations 2 and 3. 5 7 7 5 7 10 7 35 Observation 3 shows that (1 − x ) = (1 − 1 x + 2 x − ... − 7 x ). 7  1  1+7−1 2+7−1 2 Observation 2 shows that 1−x = (1 + 1 x + 2 x + ...).

14 7 5 7 10 When we combine these pieces of the expression, we get x (1− 1 x + 2 x − 7 35 1+7−1 2+7−1 2 ... − 7 x )(1 + 1 x + 2 x + ...). To find the coefficient on x25, we can determine the coefficient of x11 on

7 7 7 1 + 7 − 1 2 + 7 − 1 (1 − x5 + x10 − ... − x35)(1 + x + x2 + ...) 1 2 7 1 2 since this expression will be multiplied by x14 at the end. 11 From Observation 4, we know that the coefficient on x equals a11b0 + a10b1 + ... + a1b10 + a0b11.

In the first piece of the expression, the only nonzero values of a are a10, a5, and a0, which simplifies the sum for the coefficient to

a10b1 + a5b6 + a0b11

77 76+7−1 11+7−1 77 This equals 2 1 + 1 6 + (1) 11 , which simplifies to 2 1 + 712 17 1 6 + 11 or 8383.

Another example

Find the coefficient of x16 in (x2 + x3 + ...)5 Stategy: make it look like one of our formulas (observations) Factor out x2, x10(1 + x + x2 + ...)5

1 5 = x10( ) 1 − x

1 = x10 (1 − x)5

1 + 5 − 1 2 + 5 − 1 x2(1 + x + x2 + ...) 1 2

16 6 6+5−1 The coefficient on x is coefficient on x in the above part so...it’s 6 = 6+5−1 10 6 = 6 46

Coq

French software. Stands for “Cost of Quality”

Counting with Venn diagrams

First, it is necessary to have a basic understanding of set theory.

Set Theory Terms

If A is a set in some universe U, then the complement of A is the set of all things in the universe U that is not in A. A ∪ B is all the things in A or B. A ∩ B is all the things in A and B. N(A) is the number of things in A. If we know N(A) and N(B), then what is N(A ∪ B)

N(A ∪ B) = N(A) + N(B) − N(A ∩ B)

Venn Diagrams

Here is an example of a Venn Diagram:

From this diagram, we know that the red and blue portions can be symbolized as A ∪ B. The purple portion of the diagram symbolizes A ∩ B. We can find Venn Diagrams (using the traditional circle) for sets of n = 1, 2, 3 where n is the number of sets and every possible intersection is represented as a region. These first three Venn Diagrams are illustrated below. 47

However, when we try to create a circular Venn Diagram for n = 4 we find that we cannot create a Venn Diagram with a common center for the circles and so no portion of the diagram represents A ∩ B ∩ C ∩ D. We can only create Venn Diagrams utilizing circles for sets of n ≤ 3.

DeMorgan’s Law

A ∪ B = A¯ ∩ B¯ N(A¯ ∩ B¯) = N(A ∪ B) = N − N(A ∪ B) = N − N(A) − N(B) + N(A ∩ B) 48

Example 1

If there are 3000 students and 750 take c3, 20 take canoeing, and 2 take both, how many take neither? Let A= set of students in c3. Let B= set of students in c. Let A¯ ∩ B¯= set of students in neither. N = 3000

N(A¯ ∩ B¯) = 3000 − 750 − 20 + 2 = 2232

Example 2

How many arrangements of 0, ..., 9 have first digit > 1 and last digit < 8? U= set of all arrangements N(U) = n = 10! A= set of arrangements first digit > 1 B= set of arrangements lastdigit < 8 N(A) = 2 ∗ 9! N(B) = 2 ∗ 9! N(A ∩ B) = 2 ∗ 2 ∗ 8! N(A¯ ∩ B¯) = 10! − 2 ∗ 9! − 2 ∗ 9! + 2 ∗ 2 ∗ 8!

Example 3: An extension of DeMorgan’s Law

Calculations with three sets: N(A¯ ∩ B¯ ∩ C¯) = N − N(A) − N(B) − N(C) + N(A ∩ B) + N(A ∩ C) + N(B ∩ C) − N(A ∩ B ∩ C) As Christmas draws near, Uncle Woody starts to prepare gifts for his three mischievous sons. He has 15 different gifts, and has decided to give at least one gift to each son, The rest is be distributed to them according to their behavior. How many ways are there to distribute these 15 gifts to the three sons with each receiving at least one gift? N(U) = N = 315 U =all possible ways to distribute gifts N(A) = 215 A =ways to distribute such that Son A receives none N(B) = 215 B =ways to distribute such that Son B receives none 49

N(C) = 215 C =ways to distribute such that Son C receives none N(A ∩ B) = 1 A ∩ B =ways such that Son A and B receive none N(A ∩ C) = 1 A ∩ C =ways such that Son A and C receive none N(B ∩ C) = 1 B ∩ C =ways such that Son B and C receive none N(A ∩ B ∩ C) = 0 A ∩ B ∩ C =ways such that Son A, B and C receive none N(A¯ ∩ B¯ ∩ C¯) = 315 − 3(215) + 3(1) − 0

Dijkstra

Edsger Wybe Dijkstra (1930-2002) was a Dutch computer scientist. He con- tributed a great deal to the world of computer science. One of his most well known contributions is his self-named algorithm, Dijkstra’s Algorithm or also called the Shortest-Path Algorithm. Other interesting facts:

• Dijkstra was known for his hatred of the GOTO command in computer programming • He only owned one computer in his lifetime

Directed graph

Directed graphs differ from nondirected graphs by containing ordered pairs of vertices which causes what is called directed edges. Notation on directed graphs consists of a small arrow within the edge of the graph pointing in the specified direction. Here’s an example: 50

description

• Directed edges are also used to create a kind of directed graph called a rooted tree.

• For more examples see the directed graph example

Distributions

Distribution problems are problems where certain objects are to be distributed to a certain number of persons or things, with or without repetition. See also: Generating Function

Theorems

• ’The number of distributions of k different things into n spots is nk.’

• ’The number of distributions of k different things into n spots with ri things in spot i is P (k; r1, r2, r3, ..., rn).’ r+n−1 • ’The number of distributions of r identical things into n spots is r .’

Examples

Example 1

How many ways can Professor Staecker distribute 7 homework assignments over 10 class sessions?

• Let the homework assignments be blanks:

• Each homework assignment has 10 possible classes in which it could be handed out, so each blank has a 10 (representing that each homework assignment has 10 choices). *The total number of possible distributions is then simply 10 ∗ 10 ∗ 10 ∗ 10 ∗ 10 ∗ 10 ∗ 10 = 107.

Example 2

What if the professor must give 1 homework assignment in class 1, 2 in class 3, and 4 in class 9 (ignoring the fact that homework assignments generally come in a particular order). 51

• Now we have only 3 possible spots, or class sessions, for the 7 homework assignments.

• Again, let each homework assignment be a blank, and randomly assign each homework assignment a class session (under the particular require- ments). As an example: 9, 3, 1, 3, 9, 9, 9.

• All that remains is to find the number of combinations for these numbers.

7! • Then, the number of possible distributions is P (7; 4, 2, 1) = 4!∗2! = 105.

See also Arrangements with repetition

Class Example 1

I have 15 pennies to give to my 3 kids. How many possible distributions do I have?

• This can be written as the number of ways to choose 15 things of 3 types.

17 • So, following the theorem above, we can set this up as 15 .

Class Example 2

In bridge, what is the probability that I get all spades? (Note that in bridge there are 4 players who each get 13 cards, so all cards are dealt.)

52! • Number of Possible Deals: P (52; 13, 13, 13, 13) = (13!)4

39! • Number of Deals of All Spades for Me: P (39; 13, 13, 13) = (13!)3

39! (13!)3 39!13! • P robability = 52! = 52! , (13!)4

1 which we discovered is also equivalent to 52 (13) also see: partitions

Example 3

How many numbers between 0 and 100,000 have a sum of digits equal to 9?

• In order to think about this problem, we can think of this as a distribution problem, where we have 9 ones (to sum to 9) that we want to distribute 52

into 5 different boxes (each box being a place holder for each of the 1’s, 10’s, 100’s, 1000’s, and 10,000’s place). An empty box would represent the digit 0, a box with (1) one would represent the digit 1, and so on.

• Since each of our 9 ones are identical, we can use this theorem to solve the problem.

9+5−1 • Therefore, our answer is 9 , or the way to distribute 9 identical things into 5 spots.

Example 4

Increasing the difficulty of Example 3 slightly, we ask how many numbers be- tween 0 and 100,000 have a sum of digits equal to 10?

• We begin by thinking of this problem in the same manner that we did Example 3: we are distributing 10 ones into 5 different boxes.

• However, we must remember that there will be certain situations that we count into our total where one box will have all 10 ones in it. This would be equivalent to the digit 10, which is not possible in one box (only 0-9 is).

• Therefore, we must subtract the cases from our original total where this occurs. Since there are only 5 cases when this would happen (all 10 one’s in any of the 5 boxes means 0 ones in the rest), we will subtract 5 from the total number of ways to distribute 10 things into 5 spots.

10+5−1 • Therefore, our answer will be 10 − 5.

Enumeration

Enumeration is a procedure that uniquely lists all elements of a set in its correct sequence. Below are two main principles in the realm of enumeration.

Addition principle

If there are n disjoint sets (none overlapping) and ki elements in set i, then the total number of elements can be calculated as: Pn i=1 ki = k1 + k2 + k3 + ... + kn. 53

Multiplication principle

If set i of an n -step process has ki possible outcomes, and all of the ultimate outcomes are different, then the total number of outcomes is:

n Y ki = k1k2 . . . kn i=1

Probability

If one needs to determine the probability of some event happening (say, the probability that a hand in 5-card poker will contain all diamonds), the basic approach is as follows:

1. Determine the total possible combinations or permutations (in this case, how may possible hands are there?). 2. Determine the number of combinations/permutations that satisfies the criteria (how many different hands contain all diamonds?). 3. Divide the specific number (step 2) by the total number (step 1).

Examples

Sequences of Letters

• Using a, b, c, d, e, f, how many three-letter sequences can we make without repetition? • In the first blank there are 6 choices using all the letters. • In the second blank there are 5 choices left after using one above. • In the third blank there are 4 choices left after using two above.

We have6 ∗ 5 ∗ 4 = 120 possibilities.

• Same as above; without repetition, but now we will use e once? • If e is first, then there are 5 choices left for the second blank and 4 left for the third. ( e 5 4 ) • When e is second, there are 5 choices for the first and 4 for the last. ( 5 e 4 ) • Lastly, when e is in the third blank, there are 5 choices for the first blank and 4 for the second. ( 5 4 e ) 54

We have5 ∗ 4 + 5 ∗ 4 + 5 ∗ 4 = 60 possibilities.

• Same as above; with repetition, use e at least once? • If e is first, then there are still 6 choices for the second and third blanks because now e can be repeated. ( e 6 6 ) • When e is in the second blank, there are 5 choices for the first blank (because if e would be chosen, there would be a repetition of a sequence from the first part) and 6 choices for the last blank. ( 5 e 6 ) • Finally, if e is inserted in the final space, there are 5 choices for the first and second blanks respectively (because e cannot be used in either space or it would repeat an already mentioned sequence). ( 5 5 e )

We have6 ∗ 6 + 5 ∗ 6 + 5 ∗ 5 = 91 possibilities.

. Another Example

• From a group of x married couples, how many ways can you pick a man and woman who are not married? • There are x men and x women, because there are x married couples. • If one man is chosen, there are x − 1 women that he can be paired with who are not his wife. • Therefore, like the examples above and using the multiplication principle, the possible pairs of man and woman who are not married is equal to x(x − 1). • Let’s apply this to an actual set. We have 4 married couples, with 4 men and 4 women.

right 55 rightOur number of possible unmarried couples is 4(4 − 1) = 4 ∗ 3 = 12. We can check this using graph theory. Let the possible pairings be the edges and each of the men and women be vertices of a binary graph with married couples opposite each other. This yields the graph on the right. Notice that there are 12 edges and the married couples (assumed to be hori- zontally paired vertices) are not connected by an edge. This confirms that the multiplication principle for this example gives us the answer of 12.

Categories

Problems of enumeration can often either be categorized or split up into cate- gories. Some categories follow:

• Permutations and Combinations

• Distributions

• Generating Function

• Binomial Theorem

• Computing Coefficients

Euler

Leonhard Euler

Leonhard Euler (1707–1783) was a Swiss mathematician, and he made signif- icant contributions in pretty much every mathematic-type field. His work in the realm of mathematics includes analytical geometry, trigonometry, geome- try, calculus, topology, and number theory, and he also worked quite a lot in physics. Some say that he was the greatest mathematician of the 18th century. He published 886 papers and books; these and the rest of his works fill about 90 volumes!! Even more astounding is that a lot of this work was done during the last 20 years of his life, and for the whole 20 years, he was blind. Imagine just DOING calculus, with your eyes closed; now think about DISCOVERING calculus theorems with your eyes closed. He was certainly a rare, extraordinary 56 man! So extraordinary that there is even an asteroid named in his honor called “2002 Euler.” Euler is famous for Euler’s function, Euler’s identity, Euler’s formula, Euler’s theorem, Euler’s number(s), and others, but for Applied Combinatorics, we focused most of the Bridges of Knigsberg and Euler circuits. To learn even more about Euler, you can visit this sister wiki site Leonhard Euler1.

Euler’s Formula for Spheres, Toruses and Other Complex Solids

Introduction

When studying planar graphs, Euler’s Formula is a highly significant mathemat- ical discovery. Swiss mathematician, Leonhard Euler discovered the influential geometric formula entitled Euler’s Formula. As we studied earlier in our Applied Combinatorics course, Euler’s Formula can be applied to any finite connected drawn with no edge crossings in a plane. Remember, this means that the graph we draw in the plane cannot contain a K3,3 or a K5 graph; these would make the graph nonplanar. Euler’s Formula is r − e + v = 2 where e is the number of edges in the graph, r is the number of regions bounded by the edges of the graph (remember that the outside region is also included) and v is the number of vertices. The is a direct result of Euler’s Formula and was originally created in reference to polyhedron. The symbol for the Euler Characteristic is χ and the formula for the Euler Characteristic for the previously mentioned finite connected planar graph drawn with no edge cross- ings is χ = r −e+v = 2. In short, for any , the Euler Characteristic may be calculated using χ = r − e + v. We know for the finite connected nonplanar graphs that the Euler Characteristic will always be 2.

Euler’s Formula for Platonic Solids and Cylinders

But will Euler’s formula hold for other surfaces? First, we will examine its validity on a simple shape such as a . It is true that all cubes have six faces, twelve edges, and eight vertices and when these values are applied to Euler’s Formula we find that 6 + 8 − 12 = 2. Thus, Euler’s Formula holds for all cubes. In addition, it is important to note that this shape does not intersect itself as Euler’s Formula only applies to planar graphs. Not only does this apply to cubes, but Euler’s Formula can be used on the five platonic solids as well. The platonic solids include all of the following: the

1http://en.wikipedia.org/wiki/Leonhard_euler 57 tetrahedron, cube, octahedron, dodecahedron, and icosahedron. Assuming basic knowledge of platonic solids, it is assumed that the following will be concluded:

The above table demonstrates that Euler’s Formula holds for all platonic solids. Now, we venture to think of how Euler’s Formula is affected by figures with curved surfaces. Let us begin by taking a look at the cylinder. To simplify our visualization of how Euler’s formula can be used on such a surface, we will represent a cylinder in a traditional three-dimensional picture and also in a two-dimensional graph as seen below.

When such a shape is considered, the flat faces on top and bottom are ob- vious, but the curved part of the cylinder is also considered a face. In our two-dimensional graph, sides both named a need to be joined in order to create a cylinder. Yet, where these two edges meet, only one edge is created. There- fore, we have three faces (top and bottom flats and the curved surface), three 58 edges (circular edges b and c and edge a described above), and 2 vertices (points A and B in 2D graph). From this we also find that Euler’s Formula applies, as 2 + 3 − 3 = 2.

Euler’s Formula for Spheres

Euler’s Formula proves to be quite helpful. However, the restrictions under which we are able to currently calculate an Euler Characteristic for are very narrow. We might wish to apply the Euler Formula or calculate the Euler Characteristic for a solid such as a . To apply the Euler Formula to the sphere, we can draw any example of a finite connected planar graph on the surface of the sphere. I chose to draw a graph of an octahedron inside the sphere.

The octahedron has six vertices, twelve edges and eight resulting regions. This means when the Euler Formula is applied to the octahedron, the resulting Euler Characteristic is χ = 8 − 12 + 6 = 2. We can know from this result that the sphere’s Euler Characteristic is the same as the finite connected planar graphs we studied earlier in the semester; the Euler Characteristic for spheres is χ = 2. Another observation involving spheres is that if we have multiple non-connected spheres, we can find the Euler Characteristic of the collection of spheres by multiplying the Euler Characteristic for one sphere, 2, by the number of spheres.

Euler’s Formula for Toruses

While Euler’s Formula has proven true for these various shapes, we will begin to consider more complex and curved surfaces. In fact, when the ends of a cylinder are joined, one of these more complex figures, called a , is formed. As with the cylinder, we will again provide both a three-dimensional picture (of the C-Store’s version of a torus) and two-dimensional representation of the torus below. 59

In our two-dimensional representation, the edges marked by a are to be con- nected and will create a cylinder. Next, edges marked by b will be connected to create the donut-shaped torus. In order to test Euler’s Formula on such a curved surface, we can simplify our work by drawing a planar graph on our two-dimensional representation. Let’s take a look at an example: 60

Using this graph on the torus, we can conclude that there are five regions which are each represented by a different color. Also, the number of edges within the graph are found to equal nine, keeping in mind that some edges will wrap around the torus region. Finally, there are four vertices marked in red which are at the intersection of the edges. Using Euler’s formula we then find that 4 + 5 − 9 = 0, which is not equal to the expected result of 2. As in the case of a sphere, a torus will not fit into the Euler Formula, but rather the Euler Characteristic where χ = 0.

Genus

Another useful concept involving the Euler characteristic is called the . The genus of a surface is the number of holes in that surface and it is symbolized by g. The formula for the genus of a surface is χ = 2 − 2g. This concept can prove very useful for solids such as the torus or the double torus. However, we can even apply the formula for the genus of a surface for a solid that does not have holes, such as a sphere. For a sphere, g = 0 and so χ = 2 − 2(0) = 2 which confirms our calculation of the Euler characteristic using Euler’s formula.

Euler’s Formula for Mobius Strips

The next solid we would like to explore with Euler’s Formula is the Mbius Strip. The Mbius Strip is formed by taking a long rectangle and twisting one end of the strip 180 degrees and then fastening the two shorter sides together. The diagram for the Mbius Strip is illustrated below. 61

The twist in the Mbius Strip is illustrated by the different direction of the arrows. To fold properly, you must glue the ends together after twisting the strip so that each arrow points either up or down. This simplistic diagram of the Mbius Strip might lead you to believe we can simply draw another finite connected planar graph on the strip and once again apply Euler’s Formula as we have done for the sphere. However, this is a misconception. If we explore the possibilities of the Mbius Strip further, we see that this three-dimensional solid only has one edge, not two like a regular loop would have (inside and outside). The resulting Euler Characteristic for the Mbius Strip is χ = 1 − 1 + 0 = 0.

Euler’s Formula for Klein Bottles

A more complicated example of a solid is what is called the . The Klein bottle is created by gluing the two ends of a cylindrical tube together after twisting them. However, we cannot do this in a three-dimensional space. Another visual depiction of the Klein bottle occurs when we insert the one end of the cylindrical tube into the inside of the other end of the tube. You can see an image of the Klein bottle in three dimensions by visiting this website http://alem3d.obidos.org/i/kbottle/kbc1.png This again is not a true depiction of the Klein bottle because of the insertion of the one end into the other, which really does not exist in the four-dimensional space in which the Klein bottle truly exists. If we cut the Klein bottle down the center of its length it will produce two Mbius strips we can also cut the Klein bottle to produce only a single Mobius strip. However, because the Klein bottle is so difficult to physically recreate or to even picture mentally we will create a gluing diagram such as the one we created for the Mbius strip. This diagram for the Klein bottle is illustrated below.

These gluing instructions tells us that we would glue the top and the bottom together to form a cylindrical tube and then the other two ends are twisted and then are glued together and to a single point with the first two glued ends. The Klein bottle has an Euler characteristic of χ = 0. 62

Exercises

1) Using your knowledge of the genus and its formula, what is the Euler char- acteristic of a double torus? 2) Find another example of a platonic solid other than the octahedron to prove that the Euler characteristic is 2 for a sphere. EXTRA CREDIT!! Make a mobius strip and hang it on Staecker’s office door.

Our References http://en.wikipedia.org/wiki/Planar graph http://en.wikipedia.org/wiki/Euler characteristic http://www.math.ohio-state.edu/ fiedorow/math655/Klein2.html http://mathworld.wolfram.com/MoebiusStrip.html http://mathworld.wolfram.com/Genus.html http://mathforum.org/library/drmath/view/61167.html http://mathisfun.com/geometry/eulers-formula.html 63

Euler cycle

Euler’s Problem

There existed in the town of Konigsberg two islands with 7 bridges to and from them (as shown in the lovely picture). The local populous, often engaged in consuming spirits at the local pub, would become inebriated and go out for a walk. While walking they claimed that they could use all 7 bridges, without repeating any, and end up at where they had started. However, upon sobering up, they would try to prove their claims and could never do so.

simplification or Euler’s Definition: An Euler Cycle is a circuit that uses every edge of a graph, not repeating any edge, and ends where it started. The problem is as follows: Can one find an Euler Cycle for the Bridges of Konigsburg? Leonhard Euler solved this problem, proving that it was indeed impossible to cross every bridge exactly once and finish where one started. The reasoning behind this is as follows:

• No matter the vertex at which we start, in order to complete the cycle at the same vertex, the degree of said vertex must be even. This is because if we leave (“using up” one edge), then there must be another edge to use to return. • Similarly, every other vertex must be of even degree. This is because if we travel to another vertex (“using up” one edge), then there must be another edge in order to leave the vertex.

Further Class Thoughts on The Bridges of Konigsburg:What if a person were able to teleport from one bridge to another? Would this allow us to have a Euler Cycle after all? A teleport would allow you to get from one bridge to another regardless of the physical possibility. The teleports in this problem would be equivalent to adding an extra edge wherever we want. Adding the teleport edge cannot create the desired Euler cycle because the graph of the Bridges of Konigsburg would still have two odd degree vertices. So, even a teleport would not enable us to have an Euler cycle. 64

Euler’s Theorem

A graph has an Euler cycle if and only if all vertices have an even degree. As you can see from the provided graphs there is no possible way that an Euler Cycle exists on account of there being no vertex with an even degree existing in the graph.

Exponential generating function

Formal Definition

An exponential generating function for a sequence ar is a function

x2 x3 g(x) = a + a x + a + a + ··· 0 1 2 2! 3 3! Exponential generating functions should be used when choosing r objects from n types of objects where order matters. If order does not matter, an ordinary generating function should be used. Some keywords which indicate that order matters: “arrangements”, “count words”, “count sequences”, “distribution of different things”. See also: Ordinary generating function

Series Expansion

Taylor :

x2 x3 ex = 1 + x + + + ··· 2! 3! x2 x3 enx = 1 + nx + n2 + n3 + ··· 2! 3! sinh x Series:

1 x3 x5 (ex − e−x) = x + + + ··· 2 3! 5! cosh x Series:

1 x2 x4 (ex + e−x) = 1 + + + ··· 2 2! 4! 65

Examples

Example 1

How many words of length 4 are there using the letters A, B, C where A is used twice?  x2 x3  Because the A must appear at least twice, our term for A is 2! + 3! + ··· .  x2  The term for both B and C is 1 + x + 2! + ··· . So our generating function is: x2 x3   x2 2 g(x) = + + ··· 1 + x + + ··· 2! 3! 2!

x4 In order to find all the different words of length 4, we find the coefficient on 4! . Therefore, when finding the number of way to choose r objects from n types, we xr find the coefficient of r! in the generating function. In general, the coefficient is:

r! = P (r; e1, e2, e3, ··· ) where e1 + e2 + e3 + ··· = r. e1!e2!e3!···

Example 2

How many 20-digit sequences are there on the set {0, 1, 2, 3} with an even num- ber of zeros and an odd number of ones?

::e1 + e2 + e3 + e4 = r e1 ∈ {0, 2, ···}

::::::::::::e2 ∈ {1, 3, ···}

::::::::::::e3,4 ∈ {0, 1, 2, ···}

x2 x4 x3 x5 x2 x3 g(x) = [1 + + + ··· ][x + + + ··· ][1 + x + + + ··· ]2 2! 4! 3! 5! 2! 3!

= cosh x · sinh x · e2xusing the coshx and sinhx identities 1 x −x 1 x −x 2x = 2 (e + e ) · 2 (e − e ) · e 1 2x −2x 2x = 4 (e − e )e 1 4x = 4 (e − 1) 1 1 4x = − 4 + 4 e 1 1 2 x2 3 x3 nx = − 4 + 4 (1 + 4x + 4 2! + 4 3! + ··· ) using the e identity x20 To find the number of 20-digit sequences, we want the coefficient on 20! , which 1 20 19 is 4 4 = 4 . 66

Example 3

How many ways are there to put 15 different presents into 3 Christmas stockings with at least 1 thing in each stocking?

Begin with the equation e1 + e2 + e3 = r with the side condition that ei ≥ 1. Since there are 15 different gifts to be distributed, we will use an exponential x2 x3 3 generating function. This function is g(x) = (x + 2! + 3! + ...) x15 In this case, we want the coefficient on 15! . g(x) = (ex − 1)3, which can be rewritten as

g(x) = −(1 − ex)3

= −(1 − 3ex + 3e2x − e3x) by polynomial expansion = −1 + 3ex − 3e2x + e3x x2 2 x2 3 x3 = −1 + 3(1 + x + 2! + ...) − 3(1 + 2x + 2 ( 2! ) + 2 ( 3! ) + ...) + (1 + 2 x2 3 x3 3x + 3 ( 2! ) + 3 ( 3! ) + ...) x15 By taking the sum of the coefficients on all 15! terms in the previous equation, we can determine the number of ways to distribute the gifts.

x15 15 15 The coefficient on 15! is 3 + (−3(2 )) + (3 ).

Fibonacci Sequence and Pascal’s Triangle Rela- tionship

Amazingly enough, the Fibonacci Sequence and Pascal’s Triangle have a rela- tionship regarding the summation of the digits in the diagonal rows.

• This first picture uses the colors to denote how the rows are being summed up. The boxes that are the same color are the ones that are added in order to come up with the fibonacci numbers. 67

The Cool Relationship

• This second image, a Pascal’s triangle formed into a right triangle, makes it easier to see what digits are actually being summed up.

1

1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 One may wonder why or how this relationship works. Since every number in the diagonal row that you add on each time is the sum of the previous numbers above it, it’s no surprise that the diagonal summations of these derived numbers sum up to the fibonacci numbers. 68

Fibonacci sequence

Fibonacci, a medieval mathematician and businessman created what is known as the Fibonacci Sequence in response to the question: “How many pairs of rabbits will be produced in a year, beginning with a single pair, if in every month each pair bears a new pair which becomes productive from the second month on?” (This question was posed in his Liber Abaci in the year 1202.) His answer to his own posed question follows the sequence:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ...

Forest

A forest is an unconnected graph formed by grouping disjoint trees. An example of a forest is shown below:

As with single tree graphs, a formula for the number of edges can be deter- mined. A single graph of n vertices has n − 1 children because one vertex is the parent, or root, and the rest are children. Starting at the root and working down, each edge has one child attached to its end, so the number of edges is equal to the number of children, n − 1. Now, if we have a forest of t trees, with n total vertices, that means we also have t roots and n − t children. Since we know that there are the same number of edges as children in a tree, it follows that a forest of t trees with n total vertices will have n − t edges. Test this on the example above and you will find: 69 n = 22, t = 3, and edges = 19 = n − t

Four color theorem

A Planar Map

The Problem:

We have a planar map like the one shown in the upper right and we want to color it so that no two neighboring regions will have the same color.

The Theorem:

Any map can be colored (using the specifications stated in the problem) using only four colors.

Timeline From Proposal to Proof:

• 1852 - Posed by DeMorgan (DeMorgan asked Hamilton for help with the Four Color Theorem Problem)

• 1879 - Published by Caley

• 1880 - Proof #1 published

• 1881 - Proof #2 published

• 1890 - Proof #1 found to be wrong

• 1891 - Proof #2 found to be wrong

• 1952 - Still no proof after 100 years

• 1976 - Possible proof with 2000 cases and an unreliable computer to check them

• 1996 - Better proof with only 663 cases 70

• 2004 - Best proof yet, checked by Coq

• Yet to be Found - A proof that explains why this is true!

Dual Graphs

Top left: Original Map; Top right: Map with Resulting Graph Layed on Top; Bottom: Resulting Graph on Its Own

Dual Graphs are the representation of a map by a graph. Turning The Maps into Graphs:

• Vertices represent regions of the map

• Edges connect neighboring regions

The resulting graph is always planar (as seen in the example on the right).

The Four Color Theorem in Graph Theory Language

Any planar map has a vertex coloring with four colors, where no two adjacent vertices have the same color. 71

Chromatic Number

The chromatic number of a graph is the minimum number of colors needed to color a graph in such a way that no two adjacent vertices are of the same color. So for any planar graph, the chromatic number is less than or equal to 4. (χ ≤ 4) Chromatic Number and Degree Planar or not, if each vertex of a graph has degree at most k, the chromatic number of the graph must be ≤ k + 1. Some other general information can be found in , color critical and torus coloring 72

Four color theorem/Example 2: Chromatic Num- ber of Graph

Determine the chromatic number for the following graph:

A K3 graph

1. This graph is planar; thus, by the Four color theorem, the chromatic number is ≤ 4.

1. As the graph contains a K3 subgraph, the chromatic number is ≥ 3.

2. Let us try with 3 colors:

We have shown that the minimum number of colors needed in a vertex coloring of this graph is 3; thus the chromatic number is 3. 73

Gamma function

History

The history of the gamma function dates back to the 18th century. During R 1 1 x−1 the years of 1729 and 1730, Euler thought about the integral 0 ln t dt. He wrote about it in a letter to Christian Goldbach, dated January 8, 1730. In the letter, Euler pointed out that for x > 0, this integral converges. Euler and other mathematicians continued to explore the implications of this integral for many years. Over the next century, it was discovered that the integral is surprisingly useful. In 1809, Adrien-Marie Legendre (1752-1833) called this integral “Gamma,” with the symbol Γ[23]. The theory surrounding the gamma function continued to be developed, partially for the purpose of generalizing the factorial function since only the of natural numbers were known. Even R ∞ −t n when the gamma function was named, it was known that that 0 e t dt = n! for n ∈ Z. Before long, it was found that by slightly altering the integrand, the function could produce values of factorials for non-integer real numbers. R ∞ −t x−1 Thus, the gamma function, Γ(x) = 0 e t dt, sometimes called the general factorial function, was created [49] . Most of this paper focuses on the basic applications of the gamma function and several of its interesting uses.

The function

R 1 1 x−1 The gamma function is Γ(x) = 0 ln t dt. However, written in a more useful way, it is

Z 1  1x−1 Z 1 Γ(x) = ln dt = (− ln t)x−1dt, x > 0. 0 t 0 By substituting t in for − ln t, the gamma function becomes Z ∞ Γ(x) = tx−1e−tdt, x > 0. 0 74

Gamma Function and its Reciprocal

[[image:coyote.jpg—500px—Gamma Function and its Reciprocal]] When first looking at the integral, one may think that there are too many variables within the integrand. However, t is a ’dummy’ variable, as the value of the integral only depends on x. Furthermore, the integral is improper because the interval over which it is integrated is infinite. Also, notice that in the graph above, the gamma function exists everywhere except at the points x = −N, 1 where N = 0, 1, 2, 3 ··· . Thus, the limit as x approaches any −N of Γ(x) is 0[12].

A recursive representation

The gamma function can be used to create a recursive definition of a factorial. R ∞ x −t First, notice that Γ(x + 1) = 0 t e dt[23]. Integrating this by parts, with u = tx, v = −e−t, du = xtx−1dt, and dv = e−tdt, and remembering that x is a constant, we get: Z Z Z uv − vdu = −txe−t − xtx−1(−e−t)dt = −txe−t + x tx−1e−tdt.

Recalling that we are solving a definite integral from 0 to ∞, we get

Z ∞ Z ∞ x −t ∞ x−1 −t x−1 −t −t e |0 + x t e dt = 0 + x t e dt. 0 0 R ∞ x−1 −t So Γ(x + 1) = x 0 t e dt = xΓ(x). Notice that we have obtained a function such that

Γ(x + 1) = xΓ(x) = x(x − 1)Γ(x − 1) = x(x − 1)(x − 2)Γ(x − 2) = ··· This is a recursive definition that gives the factorial for x ∈ N (whenever ”x+1” is entered into the function). However, a base case still needs to be established, Γ(1). Z ∞ Z ∞ 0 −t −t −t ∞ Γ(1) = t e dt = e dt = −e |0 = 0 − (−1) = 1 0 0 So the complete recursive formula for gamma which gives the factorial function for natural numbers is: Γ(x + 1) = xΓ(x) Γ(1) = 1 Notice that without even knowing the gamma function, this recursive formula produces any factorial for x ∈ N, as follows: Γ(2) = 1Γ(1) = 1 75

Γ(3) = 2Γ(2) = (2)(1)Γ(1) = (2)(1)

Γ(4) = 3Γ(3) = (3)(2)Γ(2) = (3)(2)(1)Γ(1) = (3)(2)(1)

And so forth. Thus, it is clear that when n is an integer, Γ(n+1) = n!. Because of this, the gamma function is sometimes referred to as the generalized factorial function[34]. If we plug in n for Γ(x), we will get (n − 1)!.

Factorials for fractions

√ R ∞ −u2 π Accepting that 0 e du = 2 , we find interesting facts, such as the value of ∞ p−1 ∞ 2 1 1 R 2 −t R p −u 2 !. First, we note that 2 0 t e dt = 0 u e du. This fact is used to 1 Γ(x+1) find 2 !. Also remembering that Γ(x) = x , we know

    Z ∞ Z ∞ √ 1 3 1 1 1 − 1 −t −u2 π ! = Γ = Γ = t 2 e dt = e du = 2 2 2 2 2 0 0 2 √ 3  π As seem directly above, we know that Γ 2 = 2 . Using the fact that Γ(x) = Γ(x+1) 1  3  x once again, we also know that Γ 2 = 2Γ 2 . Combining these two 1  facts, we can find − 2 !

√  1 1 π √ − ! = Γ = 2 = π 2 2 2

1  Additionally, now we can find any factorial in the form n − 2 ! where n is an integer[23]. Example 1 Find 3 !. 2 √ 3 5 3 3 3 π ! = Γ = Γ = 2 2 2 2 4

Example 2 7  Find 2 !. √ √ 7 9 7 7 7 5 5 7 5 3 π  105 π  ! = Γ = Γ = Γ = = 2 2 2 2 2 2 2 2 2 4 16

1  So, the formula for n − 2 ! can be generalized as:

1  1  (1)(3)(5)···(2n−1) √ n − 2 ! = Γ n + 2 = 2n π, where n ∈ N. 76

One of a kind

Using the Bohr-Mollerup Theorem, it was shown in 1922 that the gamma func- tion is the only differentiable function where f(x + 1) = xf(x) and f(1) = 1. Thus, there is no other function which generlizes factorials for real numbers. We are omitting the proof due to its length and complication[23].

An interesting identity

There are several other gamma identities which are both interesting and unique. The identity that we develop below relates the gamma function to the sine func- ∞ −x 1 γ Q x  r tion. Karl Weierstass (1815-1897) proved that Γ(x) = xe r=1 1 + r e . 1 1 From this, multiplying Γ(x) by Γ(−x) leads to the following result:

∞ ! ∞ ! 1 1 γ Y  x −x −γ Y  x x = xe 1 + e r −xe 1 − e r Γ(x) Γ(−x) r r r=1 r=1

Since we can find from earlier identies that Γ(1−x) = −xΓ(−x), we can deduce:

∞ 1 1 Y  x2 = −x2 1 − Γ(x) Γ(1−x) r −x r=1 and

∞ 1 1 Y  x2 = x 1 − Γ(x) Γ(1 − x) r r=1

Notice that the right side is the power series for sin x with different constant values. Using a few intricate mathematical concepts and Euler’s Formula (not shown here):

 x2   x2   x2  sin(πx) = πx 1 − 1 − 1 − ··· 12 22 32

sin(πx) 1 1 Therefore, we finally obtain the identity that π = Γ(x) Γ(1−x) , or Γ(x)Γ(1− π x) = sin(πx) . 1  √ Using this new identity, we will verify that Γ 2 = π must be true. 1 Let x = 2

π  sin 2 1 1 = 1  1  π Γ 2 Γ 2 77

 12 π Γ = 2 1 s  12 √ Γ = π 2 1 √ Γ = π 2 Notice that additional identities can be created: Example 3 1 Let x = 6 in the identity.

π  sin 6 1 1 = 1  5  π Γ 6 Γ 6 1 5 π Γ Γ = 1 = 2π 6 6 2 1  5  So even though we know nothing about Γ 6 or Γ 6 , we know that when they are multiplied together, they are equal to 2π. Furthermore, certain trigonometric identites are easily discovered without any π  prior knowledge of trigonometry. For example, it can be seen that sin 6 = 5π  1 5 sin 6 by setting x equal to 6 or 6 . Additionally, with this identity, it is easy to see that the sine function is symmetric from 0 to π.

Applications

Gamma distribution

A gamma distribution is used in statistics when a variable of interest has a skewed distribution. The random variable X in a gamma distribution is contin- uous, and the probability distribution function for it is defined as:

( 1 − x xα−1e β , x ≥ 0 f(x; α, β) = βαΓ(α) 0, otherwise

where the parameters α and β satisfy α > 0, β > 0.

The standard gamma distribution has β = 1. The probability distribution function for this is:

( α−1 −x x e , x ≥ 0 f(x; α) = Γ(α) 0, otherwise 78

Two additional distributions related to the gamma distribution are the exponen- tial distribution and the chi-squared distribution. The exponential probability distribution function is a special case of the general gamma probability distri- 1 bution function in which α = 1 and β is replaced by λ . It is given by: ( λe−λx, x ≥ 0 f(x; λ) = 0, otherwise

The chi-squared distribution is the basis for numerous procedures in statistical inference. The probability distribution function for a chi-squared distribution for a random variable X with parameter v, where v is a positive integer, is defined as: ( 1 v −1 − x v x 2 e 2 , x ≥ 0 2 2 Γ( v ) f(x; v) = 2 0, otherwise So a chi-squared distribution’s probability distribution fuction is that of a gamma v function with α = 2 and β = 2[4].

The Multiple Gamma function and the Hurwitz function

The multiple gamma function Γn was introduced in 1900 by Kinkelin, Glaisher, and Sarnak. Defined by a recurrence-functional equation, the multiple gamma function is a generalization of the Euler gamma function. Recently, work by Conrey, Katz, and Sarnak has led to applications of the multiple gamma function in the summation of series and infinite products. One of the main functions that it is connected to is that of the Hurwitz function. Hurwitz zeta function: ∞ X 1 ζ(s, z) = ,R(s) > 0, s ∈ , z ∈ (k + z)s C C k=0 The most famous of the series and integral representations of Hurwitz is that of the Hermite integral. The Hermite integral is:

z−s z1−s Z ∞ sin(s arctan x ) ζ(s, z) = + + 2 z dx 2 2 s 2πx 2 s − 1 0 (x + z ) 2 (e − 1)

s 6= 1 and R(z) > 0

From this, the asymptotic expansion at infinity can be deduced to be

1−s −s m−1   z z X B2jΓ(2j + s − 1) 1 ζ(s, z) = + + z−2j−s+1 + O s − 1 2 (2j)!Γ(s) z2m+s+1 j=1 79

The Hurwitz function and the multiple gamma function are closely related by the following recurrence-related equations:

Γn+1(z) Γn+1(z + 1) = Γn(z)

Γ1(z) = Γ(z)

Γn(1) = 1

for z ∈ C and n ∈ N[37] .

Bessel function

Friedrich Wilhelm Bessel created the bessel function in 1817 as a mathemati- cal method dealing with the movement of three bodies moving under mutual gravitation. Later, in 1824, he introduced the idea that bessel functions are the coefficient of the series expansion of the indirect perturbation of a planet [30]. Below are what has come to be known as the “Bessel Functions of the First Kind”. ∞ X (−1)n x2n+v J (x) = v n!Γ(1 − v + n) 2 n=0 ∞ X (−1)n x2n−v J (x) = −v n!Γ(1 − v + n) 2 n=0 [34]

Exercises

1. Find Γ(7).

11  2. Find 2 !. 3 3. Find Γ(− 2 ). π 3 4. Show that Γ(x)Γ(1 − x) = sin(πx) is true when x = 2 .

1  5. Find Γ n + 2 where n ∈ Z. 1  6. Find a general formula for Γ 2 n .

References

See the bibliography section. 80

Generating function

If we have a combinatorial problem involving the choosing of r things, we can solve it using the following steps:

• Identify a product of polynomials • Multiply the polynomial out using polynomial expansion (preferably using Derive) • Combine the appropriate terms (ones with like powers) • Find the term with the power r

The coefficient on this term is the number of ways to choose the r things. We use an ordinary generating function if the order does not matter.

Formal Definition

A generating function g(x) for an is the number of ways to do some specified pro- cedure with n objects, which is a polynomial or power series with the expansion 2 n g(x) = a0 + a1x + a2x + ... + anx + ... See also: Exponential generating function

Building a Generating Function

Suppose a contestant playing Plinko has 5 chips to play. A Plinko chip can land on one of 5 dollar amounts ($0, $100, $500, $1000, $5000). How many different ways can the Plinko game play out (consider 2 chips landing on $500 to be different than one landing on $1000)?

Step One: Determine Exponents

We have 5 dollar amounts. These are the 5 “slots” into which we are selecting 5 items (the chips): e1 + e2 + e3 + e4 + e5 = 5 This function represents an integer partition of the number of chips being played. For each slot, we can have anywhere from 0 to 5 chips. So, our exponents in our generating function will be (1x0 + 1x1 + 1x2 + 1x3 + 1x4 + 1x5). This simplifies to (1 + x + x2 + x3 + x4 + x5). 81

Step Two: Create Generating Function

In our example, all of the slots have the same possibilities for # of chips to land there. So our generating function will be (1 + x + x2 + x3 + x4 + x5)5.

Step Three: Expand and Contract

We can now use polynomial expansion and combine like terms (which I will leave for someone else to do). The answer to our original question will be the coefficient on the x5 term.

Examples

Example 0

Use a generating function to choose r things of n types (the general case).

e1 + e2 + ... + en = r

f(x) = (1 + x + x2 + x3 + ...)n

Example 1

n n n n 2 n n (1 + x) equals 0 + 1 x + 2 x + ... + n x n n (1 + x) is a generating function for the sequence r

Example 2

Find a generating function for ar, the number of ways to select r M&Ms from a pile of 2 red, 2 yellow and 2 green M&Ms. Another way of thinking about this question: “What is the coefficient of xr?”

r = e1 + e2 + e3 0 ≤ ei ≤ 2 such that e1 represents the number of red M&Ms chosen, e2 the number of yellow M&Ms chosen, and e3 the number of green M&Ms chosen. We want to find a product of 3 factors (corresponding to the 3 colors) that would yield all products of the form xe1 xe2 xe3 when multiplied out. Each factor is therefore (x0 + x1 + x2) or (1 + x + x2) The required generating function from 3 factors is thus (1 + x + x2)3. 82

Example 3

Use a generating function to find the number of ways to choose 6 things from 3 types, no more than 4 of each type. We will use a generating function to find the number of ways to choose r things. Next we will use r = 6, so we will use the coefficient on x6. This is the number of solutions to:

e1 + e2 + e3 = r

ei = 0, 1, 2, 3, 4 So, our function will be:

(1 + x + x2 + x3 + x4)3

So, to get the number of ways to choose 6 things, multiply this out and take the coefficient onx6. Using derive, this equation can be expanded and the following result is obtained:

1+3x+6x2 +10x3 +15x4 +18x5 +19x6 +18x7 +15x8 +10x9 +6x10 +3x11 +x12

From this, one can easily see that the coefficient of x6 is 19. Therefore, there are 19 ways to choose 6 things from 3 types, when there can be no more than 4 of each type.

Example 4

Find a generating function to represent the number of distributions of r identical things into 5 spots with at most 2, 1, 3, 4, and 2 things in each respective spot. This is the number of solutions to:

e1 + e2 + e3 + e4 + e5 = r

e1 ∈ {0, 1, 2}

e2 ∈ {0, 1}

e3 ∈ {0, 1, 2, 3}

e4 ∈ {0, 1, 2, 3, 4}

e5 ∈ {0, 1, 2} So, our function will be: 83

f(x) = (1 + x + x2)(1 + x)(1 + x + x2 + x3)(1 + x + x2 + x3 + x4)(1 + x + x2)

= (1 + x)(1 + x + x2)2(1 + x + x2 + x3)(1 + x + x2 + x3 + x4)

Example 6

Find a generating function that can be used to find the number of ways to choose r things from 3 types. This is the number of solutions to:

e1 + e2 + e3 = r

+ ei ∈ Z So, our function will be:

f(x) = (1 + x + x2 + x3 + x4 + ··· )3

While this isn’t really a function, because it has an infinite number of terms, it will aid us in finding an answer for a certain value of r as we are only concerned with the coefficients. Note: Keep in mind that a generating function must be able to model the problem for all possible numbers of objects involved in the distribution.

Example 7

• This problem was in one of our homework assignment for Section 6.1- I found it helpful when studying different models of generating functions

Build a generating function for ar, the number of distributions of r identical objects into: a) 5 different boxes with at most 4 objects in each box.

(1 + x + x2 + x3 + x4)5 b) 4 different boxes with between 3 and 8 objects in each box.

(x3 + x4 + x5 + x6 + x7 + x8)4 c) 7 different boxes with at least 0 object in each box.

(x + x2 + x3 + ...)7 d) 3 different boxes with at most 5 objects in one box.

(1 + x + x2 + x3 + x4 + x5)3 84

Polynomial Expansion

2 m 1−xm+1 • 1 + x + x + ... + x = 1−x

2 1 • 1 + x + x ... = 1−x

1 1+n−1 2+n−1 2 n+n−1 n • (1−x)n = 1 + 1 x + 2 x + ... + n x

m n n m n 2m n 3m nn nm • (1 − x ) = 1 − 1 x + 2 x − 3 x + ... + (−1) n x 2 2 • (a0 + a1x + a2x + ...) ∗ (b0 + b1x + b2x + ...)

2 r = a0b0+(a1b0+a0b1)x+(a2b0+a1b1+a0b2)x +...+(arb0+ar−1b1+...+a0br)x +... (See Computing coefficients for proofs of these observations.)

Example 8

Find the coefficient of x16 in (x2 + x3 + ...)5

• Change it to look like one of the polynomial expansion formulas • factor out x2 x10(1 + x + x2 + ...)5 • 1 = x10 (1 − x)5 • 1 + 5 − 1 2 + 5 − 1 = x10(1 + x + x2... 1 2

• coefficient on x16 is coefficient on x6x10 6+5−1 10 • 6 = 6

Graph coloring

Complete Graphs

The chromatic number of a complete graph Kn is n.

For example, if a graph contains a K3 subgraph, then the chromatic number is ≥ 3. 85

Some Examples

Four color theorem/Example 2: Chromatic Number of Graph

Uses

The four color theorem does not only help us to color vertices in graphs. It also has practical applications. For example, it can be used for scheduling events that use the same rooms, such as classes at a school. If the classes and times are set, we can use the four color theorem to determine the minimum number of classrooms needed to hold all of the classes. To do this:

1. Draw a graph where the vertices represent the classes, and the edges connect classes that occur at the same time.

2. The colors will represent the classrooms. When you find the chromatic number of the graph, you will know the necessary number of classrooms to hold all of the classes.

Graph theory

Definitions

A graph G is a pair G = (V,E) where V is the set of vertices and E is the set of pairs of distinct adjacent vertices. A line connecting two vertices of a graph is called an edge. Two vertices are adjacent if there is an edge connecting them. The degree of a vertex is the number of edges connecting to that vertex (or the number of adjacent vertices).

Example

G = (V,E)

A drawing of the graph would look something like this: 86

description

More definitions

A path is a sequence of adjacent vertices. A graph is connected if any 2 vertices can be connected by a path. A circuit is a path that starts and ends at the same vertex. Graphs are isomorphic when the graphs are the same except for renaming of vertices. There must be a one-to-one correspondence of their vertices such that adjacent vertices correspond to adjacent vertices (adjacency is preserved). One way to tell if graphs are isomorphic is to draw subgraphs of the original graphs. Directed graphs are graphs where each of the edges has an arrow pointing from one vertex to the other. For directed graphs to be isomorphic, there must be a direction-preserving and adjacency-preserving correspondence of vertices. A Complete graph is a graph where every vertex is connected to every other, and is represented by Kn, where n is the number of vertices. A Bipartite graph is a graph that has vertices that can be partitioned into two sets V1, V2 such that all edges go from vertices of V1 to vertices of V2. A Planar graph is a graph that can be drawn in a plane with no edge crossings. One technique to tell if a graph is planar is the circle-chord technique. To use this technique, one should find a circuit that visits each vertex exactly once and then draw the circuit in a circle. Then simply attempt to insert the remaining edges (as chords) without any edges crossing. A Multigraph is a generalized graph that allows for two vertices to be con- nected by more than one edge, or for a single vertex to be connected to itself by what is called a loop edge. A Network is any graph, whether complete or not, that has integer “costs” on its edges. 87

Graph Theory Topics

• Bipartite graph • Complete graph • Directed graphs • Euler Cycle • Four Color Theorem • Hamilton Circuit • Isomorphism • Multigraph • Path • Planarity • Subdivision • Trees • Vertex • Network

Hamilton

Sir William Rowan Hamilton 1805-1865

Hamilton on a stamp

“On earth there is nothing great but man; in man there is nothing great but mind.” Hamilton Lectures on Metaphysics Hamilton was born August 4, 1805 in Dublin, Ireland. By the time he was five, Hamilton had learned Latin, Greek, and Hebrew. At the age of thirteen, he was 88 introduced to Algebra and then started studying Newton and LaPlace. When he was eighteen, Hamilton attended Trinity College in Dublin. Hamilton began to write poetry, especially in times of depression. He began to write poetry, for the first time, after he lost the love of his life to a clergyman who was richer and more affluent than he was. Hamilton met with Wordsworth and discussed poetry. Hamilton compared the art of poetry to the art of math- ematics. William married Helen Maria Bayly, whom he did not love and whom he did not view as intelligent. In 1834 Hamilton and Helen had a son, William Edwin. Hamilton was knighted in 1835 and later that year his second son, Archibald Henry, was born. He and Helen also had a daughter, Helen Eliza Amelia. In 1843 Hamilton discovered what are called quaternions as he was walking along the Royal Canal. His original discovery remains etched, to this day, in the Brougham Bridge. The quaternions form a noncommutative division algebra. Shortly after finding out that he had been elected the first foreign member of the National Academy of Sciences of the USA, he died on September 2nd, 1865 in Dublin, Ireland.

Hamilton circuit

Hamilton Circuits

A Hamilton circuit is a circuit in which each vertex is visited exactly once. This is not to be confused with a Euler cycle, in which every edge needs to be visited exactly once. An example of a Hamilton circuit can be found below:

example

Some simple, but useful properties of a Hamilton circuit are:

• Within a Hamilton circuit there are no edge repeats (it is a cycle). 89

• Within a Hamilton circuit, there are no proper subcircuits.

• Within a Hamilton circuit, any vertex of degree two must have both of its edges used in the Hamilton circuit.

• At a vertex, if a Hamilton circuit uses two edges, it cannot use any other edge at that vertex.

Does it still have a Hamilton circuit?

If we add the vertex seen below to create a subdivision, does the graph still have a Hamilton circuit?

First, all vertices of degree two must use both of their edges.

The edges that were added form a proper subcircuit. 90

...So this does not have a Hamilton circuit.

Heawood Conjecture

Introduction

One of the most famous graph theory problems of modern mathematics has been trying to prove the Four-Color Problem. This problem conjectures that for every planar map, a maximum of four colors can be used to completely color the graph, with no same-colored region sharing a border. Despite the relative simplicity of this problem, it has proven deceptively hard to rigorously and mathematically prove, despite many attempts. One of these attempts was given by Alfred Kempe, who published his proof for the Four-Color Theorem in 1879, in England.[59] A contemporary, Percy Heawood, published a paper entitled “Map colour the- orems” in 1890– an entire eleven years later–that showed a counterexample to Kempe’s proof, and therefore an error in the reasoning.[59] Heawood spent most of his mathematical career devoted to the understanding of the Four-Color Problem, and also coloring graphs and graphs on surfaces in general. Heawood managed to use Kempe’s ideas to prove the Five-Color Theorem for the planar map on a plane, but not the Four-Color Theorem.[56] From Kempe’s flaw, Hea- wood began to conjecture in what situations could he force a map to need more than four colors.[11] Stemming from these thoughts comes what he is perhaps best known for: his self-titled Heawood Conjecture. In this paper, we will dis- cuss two situations where a planar map will require more than four colors–one on a planar graph with restrictions on what can be colored what, and the other on maps embedded on surfaces with genus greater than zero. The first situa- tion is M-pire coloring, while for the second we will mostly limit our scope to discussing graphs embedded on the torus, a surface with genus 1. As we will see, the thinking process necessary for arriving at both of these conclusions is 91 very similar.

Coloring Maps of Empires[11] [16]

One way in which a map can require more than four colors to completely color it, is if we impose certain restrictions on it. To think of this in a practical sense, say that we have a map of a continent, and every country is possessed by a certain empire. In this problem, we do not just want to color every country a different color, but we want every disconnected country in an empire to be the same color, with empires sharing a border to be colored differently. This problem is similar to just coloring a planar map, but in this case we are forcing certain regions to be colored the same, leaving us less choice and freedom. Figure 1 shows a straight- forward planar map coloring of a map, while Figure 2 portrays the same map, but this time forcing two of the regions to be in the same empire, and therefore the same color (we used purple). The first map required 4 colors, while the second map requires 5 colors. If we let M be the number of countries in the largest empire (by quantity of countries in its possession) on a connected map, then Heawood proved that this map could be colored with at most 6M colors. In our example, M = 2, so the upper bound on coloring this map would be 6M, or 12 colors. Obviously, this simple example used far less colors than Heawood’s theorem shows as an upper bound, but Heawood did find an example of 12 empires, each consisting of 2 regions, therefore making M = 2, and every pair of empires had a border in common, thus forcing a chromatic number of 12.[40]

Figure 1: This planar map of seven regions requires at most four colors to color by the Four-Color Theorem. We leave it to the reader to prove that this map does indeed require a minimum of four colors also.

Figure 2: When we restrict the map’s coloring so that the two regions colored with purple are in the same empire, therefore requiring the same coloring, we find that we now need 5 colors to color the map, instead of just 4. 92

Figure 3: Each country in our map was translated into a vertex, with edges connecting adjacent countries.

Figure 4: Collapsing the two purple vertices together to make one empire, we find that our graph is no longer planar, and therefore the Four-Color Theorem no longer applies.

To understand Heawood’s proof for M-pire coloring, we will translate our maps into their corresponding graphs, with the vertices representing the countries, and the edges representing adjacent countries on our map (Figure 3). This graph is planar, meaning that we can apply the Four-Color Theorem to it. However, since we are forcing the same coloring of countries in an empire, we will redraw our graph to illustrate empire coloring. By collapsing vertices that are in the same empire together into one vertex and removing any multiple edges, we will create a new graph (Figure 4). The problem here is that, in most cases, our corresponding M-pire graph is no longer planar, and the Four-Color Theorem no longer applies. Therefore, we need a new theorem, which Heawood constructs in the following manner. We will start with Euler’s Formula: v − e + r = 2 (1) with v vertices, e edges, and r regions in the original planar graph. If we count each edge bordering a region, we will count each edge twice, because an edge will separate two different regions, one on each side. Knowing that a region will have at least three bordering edges (a region will not exist with 2 or less edges), then we can derive the inequality: 2e 2e ≥ 3r or 3 ≥ r (2) If we substitute (2) into Euler’s Formula, we arrive at: 2e v − e + 3 ≥ 2 or solving for e, 93

e ≤ 3v − 6 (3)

We let di represent the degree of each vertex i. Recalling that the sum of the degree of all the vertices will equal twice the number of edges, we substitute (3) to obtain: Pv i=1 di ≤ 2(3v − 6) or Pv i=1 di ≤ 6v − 12 (4) If we then translate our original graph G of the planar map into its corresponding M-pire graph G∗, we will then have v∗ vertices and e∗ edges. Because we are collapsing vertices onto each other and removing multiple edges in G∗, we can produce the following inequalities: e∗ ≤ e (5) and ∗ v v ≥ M (6) Intuitively speaking, when moving from G to G∗, one cannot add edges, only remove multiple edges, explaining (5). Similarly, if M is the maximum number of countries in any given empire on our map, then the least number of empires there can be is v/M, because that is assuming every empire in the map has M countries. However, it can also be the case that only one empire has M countries, and being the maximum number an empire can have, the other empires will have less than M. v∗ is equivalent to the number of empires in the map, so we derive the inequality (6). Rewriting (6), we find that Mv∗ ≥ v (7)

∗ Pv ∗ k=1 dk = 2e ≤ 2e ≤ 6v − 12 and substituting (7) in, we find that

∗ Pv ∗ k=1 dk ≤ 6Mv − 12 (8) If we divide through by v∗, ∗ Pv ∗ k=1 dk 6Mv −12 v∗ ≤ v∗ we arrive at Pv∗ k=1 dk 12 v∗ ≤ 6M − v∗ (9) The left-hand side of this inequality is equivalent to the average degree of the vertices in G∗. The right hand side can be simplified by recognizing that 6M − 12/v∗ < 6M, so we can now conclude that:

Pv∗ k=1 dk v∗ < 6M (10) Because the average degree of vertices in G∗ must be an integer less than 6M, 94 we can conclude that G∗ at most contains a vertex of degree 6M −1. This means that at most, a vertex will be adjacent to at most 6M −1 vertices, meaning that it can be colored by at most 6M colors. Since G∗ is representative of our original map, we can translate this back to our map, concluding that an M-pire map needs to be colored by at most 6M colors. Heawood more rigorously proves this in his proof by induction, using the principles we have derived here.[11] However, it should be noted that all Heawood proved was that 6M was the upper bound needed to color an M-pire map, but not that there was always a case where 6M colors were needed. He did not know if there was a better (and therefore lower) upper bound. Gerhard Ringel and J.W.T. Youngs went on to prove that for every M > 1, there is an M-pire graph that requires 6M colors.[11] This means that there does exist maps for say, M = 4, that 6M or 24 colors are needed. This is not the case for M = 1, where we have empires of just one country, which is the same as simply coloring a planar map on the plane, which by the Four-Color Theorem, we know only needs a maximum of four colors. Therefore, saying we need six colors to solve the coloring for M = 1, is just excessive.[16]

Embedding Maps on Surfaces

Figure 5: A rectangular piece of paper.

Figure 6: The torus can be constructed by bringing the alpha sides together, followed by the beta sides (in the same direction).

Using a process similar to the M-pire problem, Heawood went on to think about coloring maps on different surfaces, and thus developing his famous Heawood Conjecture. Generally a surface is an (n−1)-dimensional subobject in an object. For our purposes, we will be dealing with two-dimensional surfaces on three- dimensional objects. A useful way to begin thinking about the surfaces we will be discussing here is to imagine a rectangular sheet of paper, as shown in Figure 5. To construct the surface of a torus, which looks like a donut or a bagel, one must take opposite sides of the piece of paper and connect them together, in the 95 same direction. Figure 6 demonstrates the construction of a torus, while Figure 7 depicts a torus (with an embedded graph on it).

Embedding Graphs

When we embed maps on surfaces, it usually allows for more complicated planar maps to be drawn, requiring more colorings. While a graph of K5–which has no corresponding planar map on the plane–can be drawn as planar on other surfaces. In other words, a non-planar graph on a plane can be “planarized” such that there are no edge crossings on other surfaces, such as the torus. K5, when embedded on a sphere, will have the same planarity as it does on the plane, because a sphere does not allow for any additional ways to draw an offending edge (or the edges that are forced to cross over other edges when drawn on the plane). The torus, however is different; because the hole in the torus allows for new ways to draw graphs like K5. To better imagine this, think of the spherical earth, where a country that lies entirely on the northern hemisphere cannot be adjacent to another country that lies completely on the southern hemisphere. However, if a bridge was formed in the sphere by boring a tunnel from the north pole to the south pole, the sphere becomes a torus, or the spherical earth essentially becomes a toroidal earth. The inner walls of the tunnel allow the countries in the northern hemisphere to extend and touch the countries in the southern hemisphere without crossing the equator. Thus, the presence of a hole allows for countries to be adjacent to more countries; the more holes there are, the higher the degree of adjacency permitted.[15] It is possible to draw a planar graph of K5 on the torus, which was previously not possible on a “plane”. Our next example will help clarify what this then means for coloring maps on the surface of the torus.

The Houses-and-Utilities Puzzle[50]

Figure 7: A picture of K3,3 embedded on a torus. The dark blue lines are edges on the top of the torus, while the lighter blue lines are edges that run underneath the torus.

Three houses are built on planet earth (a spherical earth). Three utilities (water, gas, and electricity) have to be joined to these three houses in a way that the water pipes, gas pipes and electric cables never cross one another. Is this possible? 96

left

This question can be expressed as a K3,3 graph, such that each house and utility is represented by a vertex and each pipe is an edge. Since K3,3 is not planar, it is not possible for the pipes never to cross on planet earth. Even though this problem is not solvable on a spherical planet, it is actually viable if the planet were a torus.[32] [19] Figure 7 attempts to depict what the K3,3 graph would look like embedded on the torus. [15]

Coloring Graphs on Surfaces

Intuitive Approach to Heawood’s Torus-Coloring Conjecture

Motivation Example

Color the vertices of the following complete graphs, K4, K5, K6 and K7, such that none of the vertices share the same color as its neighbors.

Here, we see that the chromatic number of Kn is n. Since each vertex has n − 1 neighbors connected to it by an edge, n colors are needed to color a complete n-graph. Similarly, if each vertex is expanded into individual regions, which we will refer to as countries, each country will be adjacent to all the other countries. Thus, in a complete m-map, a map consisting of m countries in which every two are adjacent to one another, m colors are needed to color each country.[15]

Graphs Embedded on the Torus

Following the reasoning of the Four Color Theorem, such that the K4 graph is the highest complete graph on the plane that can be drawn as planar, thus requiring four colors, the successive task is to find the complete m-map of with the highest value of m that can be embedded on the torus to find the chromatic number of any graph on the torus.[15] 97

Note: For help to visualize these embeddings on a torus, visit torus repre- sented on a plane. We offer, without proof, that a complete 5-map can be embedded on a torus; so can a complete 6-map and a complete 7-map. However, a complete 8-map cannot be embedded onto the torus. Thus, since the complete 7-map requires 7 colors, any map on the torus will require at most 7 colors, since every country will have at most 6 neighbors. Intuitively, this is what the 7-Color Theorem for the torus means, but we in the following section, we will offer an explanation for Heawood’s thinking for this conjecture, which remained unproved until 1968.[17]

The Heawood Conjecture and the Torus

The validity of the first published proof of the Four Color Conjecture by A.B. Kempe in 1879 was unchallenged until P.J. Heawood’s paper in 1890. In his pa- per Map Color Theorem, the English mathematician Heawood pointed out the gap in Kempe’s proof by counterexample, and he succeeded in using Kempe’s reasoning to give the first proof for the Five Color Theorem.[15] More impor- tantly, his paper conjectured the number of colors required by maps on higher surfaces, and he also established that the chromatic number of any map on the torus is equal to or less than 7. In other words, each map on the torus is colorable with 7 colors.[17] Heawood’s approach to coloring graphs on surfaces utilizes a central fact of geometry as the starting point. In any map on the torus, let m be the countries being colored. Let n denote the nodes, or points at which three or more countries meet, and b denote the borderline of a country from one node to another. The Euler-Poincar formula asserts that for any map embedded on a g-holed torus, the following relationship holds:[15] n − b + m = 2 − 2g (11) For a torus where g = 1, the Euler-Poincar formula infers n − b + m = 0 (12) Let A be the average number of borderlines on the map [given m countries, each with a corresponding number of edges around it], mA then represents the count 98 of all occurrences of borderlines on the map. Since each borderline is shared by two countries, the total number of edges on a map is mA b = 2 (13) Similarly, since each country has the same number of nodes as borderlines, A must also be the average number of nodes on the boundaries of these countries. However, unlike the certainty of a borderline shared between two countries, one can only be certain that each node appears on the boundaries of at least 3 countries, thus yielding the inequality mA n ≤ 3 (14) Equations (12), (13) and (14) combine to produce mA mA 3 − 2 + m ≥ n − b + m = 0 (15) A  m 1 − 6 ≥ 0 (16) Given a positive number, m, of countries, we can thus arrive at the conclusion that A ≤ 6. This means that in any map embedded on the torus, the average number of nodes and borderlines on the boundary of a country does not exceed 6. A corollary that follows is that a country on any toroidal map is adjacent to no more than six other countries. By applying Euler’s formula for polyhedrons to the torus, Heawood showed that some region on every torus has at most six neighbors, thus seven colors is the maximum needed to color any toroidal map.[50] Derived from this finding is the impossibility of drawing a complete 8-map on the torus since every country would then be adjacent to seven other countries. An algorithm can then be produced: any map on the torus can be colored with seven colors, and the complete 7-map requires seven colors. However, Heawood’s conjecture achieved more than this. Heawood derived an upper bound for the chromatic number of each surface for a given genus g.

Heawood’s Conjecture: Beyond the Basics

[15] Roughly speaking, the genus of a surface refers to the number of holes or handles in it. The torus has one hole, and therefore has genus 1, while the sphere has none, so it has genus 0. The double torus has two holes and therefore has genus 2. A more technical definition of genus is that it is the highest number of nonintersecting simple closed curves that can be drawn on the surface without 99 separating it.[58] The genus of a graph is the minimum genus of a surface where the graph can be drawn without edge crossings. As we have discussed before, K5 is not planar on the sphere, but it is on the torus, so the graph of K5 has genus 1. For the purpose of this paper, this rough definition of genus is enough to understand how Heawood moved beyond the torus (genus 1) to other surfaces with greater genus. Using The Euler-Poincar formula that describes the relationship between n nodes, b borderlines given m countries drawn on the surface Sg, n − b + m = 2 − 2g Heawood proved the subsequent inequality about the chromatic number χ(g), also known as the Heawood number Hg, on the orientable surface of genus g ≥ 1, with the Klein bottle being the only exception, is:  1 √  Hg ≤ 2 7 + 1 + 48g for g ≥ 1 This inequality was “proven” to be equal based on observation, and to illustrate that Hg colors were the maximum number of colors necessary to color some map on Sg, Heawood drew a complete 7-map on the torus. Heawood noted, “For more highly connected surfaces, it will be observed that there are generally contacts enough and to spare for the above number of divisions [countries] each to touch each.”[15] Heawood was under the impression that he had shown and proven equality. However, though his intuition was correct, it was not until 1968,[17] three quar- ters of a century later, that the equality  1 √  Hg = 2 7 + 1 + 48g for g ≥ 1 which Heawood called the Map Color Theorem, was actually proved by a series contributions by different mathematicians such as Heffter, Ringel and Youngs.[11]

This confirms√ that any map on the torus (g = 1) can be colored with H1 ≤  1 7 + 1 + 48 = 7 colors, every map on the double torus (g = 2) 2 √  1  with H2 ≤ 2 7 + 1 + 96 = b8.42 · · · c = 8colors. The following table shows the chromatic number for the first few values of g.[17] g 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Hg 7 8 9 10 11 12 12 13 13 14 15 15 16 16 16 17 17 18 18

Exercises

1. You and five of your friends (Elijah, Woody, Candy, Josiah, and Samson) are playing an intense game of Risk. On the Eurasian continent, there are sixteen territories to conquer, and currently you and Elijah control three each, while Woody and Samson each control two, Candy controls five, and Josiah controls one. According to Heawood’s M-pire Theorem, what is the maximum number of colors needed to color the map, with each of your 100

“empires” receiving the same color?

2. What is the genus of the graph K6? What kind of surface has this genus? When K6 is embedded on this surface, how many colors will it need to color it? 3. Following the logic from equations (11) to (16), demonstrate that graphs on a surface of genus 2 requires 8 colors. Hint: The form of the answer gives A ≤ the smallest integer value possible. 4. Using the Heawood Conjecture formula presented in this paper, calculate the maximum number of colors needed to color a surface with genus 20, 21, and 22, respectively.

References

See the bibliography section.

Inhomogeneous recurrence relation

Inhomogeneous recurrence relations take many forms.

One of these forms is an = can−1 +f(n) where f(n) is any non-recursive function of n. To solve an inhomogeneous recurrence relation, one must find any solution to the inhomogeneous recurrence relation and add it to one particular solution. ∗ Say that βn is a particular solution, βn = cβn−1 + f(n). Say an is the general ∗ ∗ ∗ solution to the homogeneous part, an = can−1. We want βn +an to be a solution to the inhomogeneous recurrence relation.

∗ ∗ an + βn = can−1 + cβn−1 + f(n) ∗ ∗ an + βn = c(an−1 + βn−1) + f(n) Therefore, it is a solution to our recurrence relation. Now we need to find the general solution to the homogeneous part.

an = can−1 − 1

n A solution is an = Ac , where A is determined by the base case. n Our solution to the recurrence relation will be an = Ac +(a particular solution whose form is determined by the form of f(n)). n Proposition: If f(n) = d (a constant), then the solution looks like an = Ac +B for some B ∈ R. 101

n If f(n) = dn (of a linear form), then the solution looks like an = Ac +B0 +B1n. 2 n If f(n) = dn (of a quadratic form), then the solution looks like an = Ac + 2 B0 + B1n + B2n . n If f(n) = ed (of an exponential form), then the solution looks like an = Acn + Bdn. If f(n) is a sum of things, then the particular solution is a sum of things.

Integer partitions

For r, a positive integer, a partition of r is an unordered “set” (really a multiset) of positive summing to r. Thus p(4) = 5 because 4 can be written as:

• 1 + 1 + 1 + 1

• 1 + 1 + 2

• 2 + 2

• 1 + 3

• 4

The Partitions Function

A generating function can be created to describe the partitions. Choosing a partition of integers is like choosing some 1s, 2s, 3s, and so on. For the creation of our partitions function, we will say the following:

• e1 = # of 1’s

• e2 = # of 2’s

• e3 = # of 3’s

More generally, ei is the number of i’s

Where r = e1 + 2e2 + 3e3 ··· + rer and ei ∈ 0, 1, 2, ... 102

• In order to make the creation of our generating function easier, we will let iei = di

So, we now have d1 + d2 + d3 + ... + dr = r where di ∈ 0, i, 2i, 3i, ···. Our generating function will be:

(1 + x + x2 + ··· )(1 + x2 + x4 + ··· ) ··· (1 + xr + x2r + ··· )

This can also be written:

Q∞ P∞ rk g(x) = k=1 k=0 x .

Example

Find the generating function for partitions of r into distinct parts.

f(x) = (1 + x)(1 + x2)(1 + x3) ··· Find the generating function for partitions of r into odd parts. g(x) = (1 + x + x2 + ··· )(1 + x3 + x6 + ··· )(1 + x5 + x10 + ··· ) ··· Actually, these two are equal.

1 − x2  1 − x4  1 − x6  f(x) = (1 + x)(1 + x2)(1 + x3)... = ··· 1 − x 1 − x2 1 − x3  1   1   1  = ··· = (1+x+x2+··· )(1+x3+x6+··· )(1+x5+x10+··· ) ··· 1 − x 1 − x3 1 − x5

Euler’s Contributions

Euler contributed to the topic of Integer partitions in the following two for- mulas:

Q∞ r • Euler’s Function: r=1(1 − x )

∞ 3n2−n P n 2 • Euler’s Identity: n=−∞(−1) x see also: Distributions

The Indian mathematician, Ramanujan√ came up with the formula to approx- 1 π 2n imate p(n) as p(n) ≈ √ e e . 4n 3 p(n) is the partition function calculating the number of partitions of a number n. 103

Isomorphic algorithms

Determining Isomorphism Isomorphism as defined in out text is given as, “a one-to-one correspondence of vertices that preserves adjacency is called an isomorphism.” However his is not always the case, isomorphism can be applied to many other situations; from dancing patterns to modular math as to be explained in some examples that will follow. First what is the problem that is at the base of this? Why are we interested if two things are isomorphic anyway? One simple and comical answer is that it gives mathematicians something to do and secondly and more importantly is this can be applied to a plethora of other sciences (as listed from the article by Douglas Campbell and David Radford) from molecular biology to gene splicing where the application lies not in determining the isomorphism between graphs but in trees. Now determining isomorphism has still not been proven to be an NP-complete problem but involving some cases it will take anywhere from O(n) to O(n2). A simple introduction to the basics of is, I believe, necessary and will prove to be colorful. The following matrix is the first four non-negative integer values summed modular 4: (with explanation of the colors later)

none

Now we can see that this matrix is correct (with exception to the 0-0 entry, which we will consider correct anyway) but what about the colors, what do they represent? The colors represent a certain pattern that emerges when 4 integers are used. In order to determine whether something else is isomorphic to this would require the same color pattern to emerge.

• For my problem to assign, imagine that there is a dance consisting of four couples in a circle. Now the couples can perform one of four moves, move within the circle counter-clockwise, move clockwise, move half-way around the circle, or stay in the same place. Come up with a matrix that represents the moves composition (such that moving in a clockwise motion twice is the same as moving around the circle halfway), determine 104

whether or not this matrix is isomorphic to the one listed here and if it is not, determine if there is a way to change the matrix such that they are isomorphic.

Other than just plowing through all of the possible values, there is no one set way to determine whether two graphs or trees are isomorphic. The only known way to speed up this process is to use various algorithms on the sub-graph/tree and then one may determine whether or not two items are isomorphic. To use a more complex example to illustrate how this process takes place, I will give you the example set forth in the article “Tree Isomorphism Algorithms: Speed vs. Clarity” by Douglas Campbell and David Radford which takes place as a discussion between two people, Peter and Jill.

none

Jill asks Peter whether or not the figures are isomorphic, Peter responds that of course they are and gives the proof as the correspondence A → a, B → b, C → c, D → d to which Jill replies that it is and is not isomorphic, what Peter described is graph isomorphism while she was referencing tree isomorphism. She gives the formula:

T = (E, V, r) where E is a set of edges, V is a set of vertices, and r is a specific vertex known as the root. Tree isomorphism is where the roots must match as well as be consistent with graph isomorphism. Peter wanting to create a quick way to say if two trees are isomorphic details the more in-depth specifics and comes up with a observation about trees and conjecture about how to prove they are isometric. *Observation 1: Since a tree isomorphism preserves edge and root incidence, the level number of a vertex (the number of edges between a vertex and the root) is a tree isomorphism invariant. *Conjecture 1: Two trees are isomorphic if and only if they have the same number of levels and the same number of vertices on each level. 105

David sets up how to quickly determine if two trees are isomorphic, start with array L[0..||V ||] which entries are initially 0. Let L[n] stand for the number of vertices on level n. For each vertex, if the vertex has level number ’n’ increment L[n] by one. Only this needs to be done to determine whether the tree is isomorphic or not, with this taking the amount of time in respect to how many vertices there are. Jill tells him he did not take into consideration the time it would take to determine the level numbers as well as fill in the array as to how fast it would take and that his conjecture is also wrong and can prove this for ||V || > 4. She then comes up with another observation. *Observation 2: Since a tree isomorphism preserves root and edge incidence, the number of paths from the root to the leaves is a tree isomorphism invariant. To give an example of how she can create two trees to disprove his conjecture she describes the trees in figure 2:

none

Where tree T1 has n − 3 vertices at level one, one of which has two descendants and let T2 also have n−3 vertices at level one two of which have one descendant. T1 has n − 2 paths from the root to the leaves and T2 has n − 3 paths from the root to the leaves, they cannot be isomorphic. David did not take into account the degree spectrum of a tree. The number of non-negative integers Dj where Dj is the number of vertices in T that have j descending edges when the tree is drawn from the root down. Jill determines a better conjecture: *Conjecture 2: Two trees are isomorphic if they have the same degree spectrum. She changes the example of the array D[0..||V ||] where D[n] is the number of vertices with [n] descending edges. For every vertex, if the vertex has ’n’ descend edges increase D[n] by one. This should only take the time 2||V || to determine isomorphism. David points out that Jill forgot to take into consideration the time to compute the degree of each vertex and gives another observation and example that proves Jill’s conjecture wrong. *Observation 3: Since a tree isomorphism conserves the longest path, the num- ber of levels in a tree is a tree isomorphism invariant. 106

none

Both trees have the same degree spectrums of (3, n − 5, 2) but do not conserve the longest path, therefore: *Conjecture 3: Two trees are isomorphic if and only if they conserve the same degree spectrum at each level. The example goes on and the entirety can be viewed through the Murray Library website. The main issues are to what extent do you have to compare the degree of the vertices, depth of the tree itself, and to what order of time will the comparison take? The really important fact is how many children a vertex has, this gives an absolute base on which to determine isomorphism in a timely fashion. To fast forward to the solution that Douglas Campbell and David Radford finally settled on here is an excerpt of pseudo computer code (since computers will be obviously faster at comparing trees) from their paper and then I will try to explain what is going on. The first piece of code given:

none

Childless vertices are given the “name” (0) to indicate that they have no children and for those who have children, give them the name ((0)). However this will 107 not be a complete answer to determine if two trees are isomorphic or not on the basis of the names of the graphs of the following figure will not be the same:

none

This is solved by just condensing the names into, basically, 10s and 00s so that when a root name is computed and compared, they will be the same when the children’s ’names’ are rearranged in order. However, the time it takes to compare and store each and ever one of the children’s name will take O(n2). So instead of using names that become exponentially long, a comparison of the names of the same level is used instead and condensed names are used so that the level names to not become just a cumbersome to compare. The final pseudo computer code can be found at the website. This code allows for early ending if the tree is found to be non-isomorphic, and makes use of condensed vertex names at each level, which will take approximately O(||V ||log||V ||) to determine isomorphism of two trees. The complete example and explanation of Douglas Campbell and David Rad- ford’s paper can be found through the Murray Library Academic Search premier when “isomorphic algorithms” is entered. The url for Douglas Campbell and David Radford’s paper is: http://web.ebscohost.com/ehost/detail?vid=7&hid=109&sid=4ad48d33-712e-470d- a849-212b226cec0c%40sessionmgr107

Isomorphism

Isomorphism

Definition:

Isomorphism is a one-to-one correspondence of vertices that preserves ad- jacency (See also: Abstract Algebra) 108

Example 1:

Description

Theorem: The degree of a vertex is preserved by an isomorphism (if A corresponds to x, then deg(A) = deg(x)). This theorem is true since by the definition of an isomorphism adjacent vertices on the first graph correspond to adjacent vertices on the second graph. By definition, adjacent vertices are connected by an edge. The degree of a vertex is defined as the number of edges that connect to that vertex.

Isomorphism preserves adjacency

For example: Two graphs G and G0 are Isomorphic if there exists a one-to-one correspon- dence between the vertices in G and the vertices in G0 such that a pair of vertices are adjacent in G if and only if the corresponding pair of vertices are adjacent in G0. To be isomorphic, two graphs must have the same number of vertices and the same number of edges. Each vertex in the first graph would correspond to one vertex in the second graph:

• 1 ↔ A • 2 ↔ B • 3 ↔ C 109

• 4 ↔ D • 5 ↔ E

Note: The order of numbers and/or letters may vary according to each particular set of graphs. They will not always be in numerical or alphabetical order.

Nonisomorphism

Just as there are graphs that are isomorphic, there are those that are not. The following examples can help to illustrate non-isomorphic graphs. (Note: this is also a directed graph)

Example 1

Construct all non-isomorphic directed graphs with three vertices:

Given all combinations of directions and adjacencies, there are a maximum of 7 possible graphs that fit the given constraints.

Example 2

These are all nonisomorphic graphs with three vertices: 110

Example 3

Prove that these graphs are nonisomorphic: The graph on the left has no vertices of degree four, while the vertex labeled “5” in the right graph has degree four.

Subgraphs and Isomorphism

Subgraphs can be used as a method for determining whether or not there is an isomorphism between graphs, especially when the graphs share basic properties, such as the number of vertices and edges. Example: Show that the following representations of graphs are not isomor- phic. 111

Initial check: Graph 1: 8 vertices, 10 edges Graph 2: 8 vertices, 10 edges Additional method to determine isomorphism: Constructing subgraphs Construct subgraphs for both graphs, showing the subset of the vertices of a selected degree and all the edges connecting them. For this example, build subgraphs of all degree 2 vertices.

None of the degree 2 vertices in Graph 1 are connected. Graph 2 has two edges connecting two pairs of vertices. The subgraphs of degree 2 vertices are different, thus they are NOT isomorphic. 112

Kuratowski

Kuratowski

Kazimierz Kuratowski (1896-1980) was a professor of mathematics at Politech- nika Lwowska and Warsaw University. His major contributions to mathematics are in the fields of topology and metric spaces. In relation to graph theory, his major contribution is known as Kuratowski’s Theorem.

His Life

Kuratowski spent most of his early years in Warsaw, which although now part of Poland, was then under the rule of Russia. Along with many other Poles from the area called “Vistula Land,” Kuratowski chose to go abroad to a for- eign university, rather than study in the Russian-language-only schools in his homeland. He attended the University of Glasgow in Scotland as an engineer- ing student until World War I made it impossible for him to continue. Before the war ended, Russia had withdrawn from Vistula Land and the University of Warsaw was reestablished as a Polish school. Kuratowski graduated from the University in 1919 and obtained his doctorate in 1921. Kuratowski first taught at Politechnika Lwowska, and then at Warsaw Univer- sity. Here he began to work towards the establishment of Polish mathematics. In 1939, however, Germany invaded to open up World War II. During the war, Kuratowski was active in an underground university, as all open academic work was quashed by the Nazis. After the war, Kuratowski was instrumental in the rebuilding of mathematical research and teaching in Poland. During this time he was the president of the Polish Mathematical Society. In 1949 he became the Director of the Mathemat- ical Institute of the Polish Academy of Sciences. Throughout his later years he served as an unofficial ambassador of Polish mathematics, traveling world-wide as he was received into the memberships of many of the world’s academies. 113

His Work

Topology

Kuratowski did much of his work in topology, including using boolean algebra to describe the topology of abstract space without using points. He also authored the work Topologie, a monologue on point set topology.

Graph theory

Kuratowski’s only major contribution to graph theory is known as Kura- towski’s Theorem.

Set theory

Kuratowski is also famous for his insight in describing an order pair as the set {{x}, {x, y}}.

Linear recurrence relation

A linear recurrence relation is a function that is written in terms of other values of that same function, in which there are constants in front of all of the terms. A linear recurrence relation will be written in the form:

an = c1an−1 + c2an−2 + ... + cran−r

This function is also homogeneous because it is a recurrence relation where an is a sum of terms, each involving some lower ak term. We can also note the following about linear recurrence relations:

• an = 0 is always a solution

• If αn, and βn are two different solutions to the recurrence relation, then any linear combination is also a solution.

k1αn + k2βn = k1(c1αn−1 + ... + crαn−r) + k2(c1βn−1 + ... + crβn−r)

So, an = α, and β are two different solutions both obeying the recurrence relation. All solutions of this relation will make a subspace of a vector space of all se- quences of real numbers. 114

Solving Recurrence Relations

n Assert that an = α is a solution for some α ∈ R Find α

n n−1 n−2 n−r n−r α = c1α + c2α + ... + crα Divide by α r r−1 r−2 α = c1α + c2α + ... + cr r r−1 r−2 α − c1α − c2α − ... − cr = 0 Solve for α (There will typically be r solutions) n n an = α1, α2, α3... So anα1 is a solution, anα2 is a solution, etc. n n n General Solution: an = A1α1 + A2α2 + ... + Arαr align=“right” Where

Ai ∈ R Note on multiple roots: If this happens, say with a root of multiplicity g, then the solutions consist of that root g times, each multiplied by increasing powers of n, from 0 to g − 1

αn, nαn, n2αn, ..., ng−1αn

Example: Fibonacci Sequence

Fibonacci Sequence: 0, 1, 1, 2, 3, 5, 8, ... This sequence can be represented by an = an−1 + an−2, with base cases a0 = 0, and a1 = 1 n n n−1 n−2 Let an = α so that the sequence can then be represented as α = a +a . n−2 2 2 Next, divide anby α which will give you the following: α = α+1; α −α−1 = 0 √ 1± 5 In order to solve, we use the quadratic formula and find that α = 2 √ n √ n  1+ 5   1− 5  Finally, we will set an equal to A1 2 +A2 2 and solve for A1 and √ √  1+ 5   1− 5  A2 using base cases 0 = A1 + A2, and 1 = A1 2 + A2 2 √ √ √ √  1+ 5   1− 5  We then find that: A1 = 1/ 5 2 , and A2 = 1/ 5 2

th thus giving us the solution for the n term of the sequence to be: an = √ √ n+1 √ √ n+1  1+ 5   1− 5  1/ 5 2 + 1/ 5 2 More on the Fibonacci Sequence 115

Example of Multiple Roots an = 4an−1 − 4an−2, with a base case of a0 = 1, and a1 = −2 n n n−1 n−2 Substituting an for α , the sequence can be written as α = 4α − 4α and dividing by αn−2 then gives:

α2 = 4α − 4 α2 − 4α + 4 = 0 (α − 2)2 = 0

n Therefore, α = 2 is one root and the other is nα and the solution is an = n n A12 + A2n2

Now, when solving for A1, and A2 using the base cases 1 = A1 + 0, and −2 = 2A1 + 2A2 we find that:

A1 = 1, and

A2 = −2

n n+1 The final solution is an = 2 − n2 So if a root is a multiple of K then: (α− )k = 0 then the solutions are: αn, nαn, n2αn, ..., and nk−1αn

Example of Imaginary Roots an = −2an−2 − an−4 a0 = 0, a1 = 1, a2 = 2, and a3 = 3

αn = −2αn−2 − αn−4 where the initial conditions are:

a0 = 0

a1 = 1

a2 = 2

a3 = 3 Again, we will solve for α 116

α4 = −2α2 − 1

α4 + 2α2 + 1 = 0

(α2 + 1)2 = 0

((α − i)(α + i))2 = 0

so i, and −i are double roots. n n n n solution: an = A1i + A2ni + A3(−i) + A4n(−i) solve for A’s

0 = a0 = A1 + A3

1 = a1 = A1i + A2i − A3i − A4i

2 = a2 = −A1 − 2A2 − A3 − 2A4

3 = a3 = −A1i − 3A2i + A3i + 3A4i

3 where A1 is − 2 i 1 where A2 is − 2 + i 3 where A3 is 2 i 1 where A4 is 2 − i There are also recurrence relations which are not homogeneous; they are referred to as Inhomogeneous. Some recurrence relations can be solved with generation functions. See Solving Recurrence Relations with Generating Functions.

Minimal Recursion Circuits

Finding Euler Cycles

As we all know, a graph has an Euler cycle if and only if all it is connected and every vertex has even degree. But that only tells us if a graph has an Euler circuit. So how do we find one? The process follows something called Fleury’s Algorithm. 117

Fleury’s Algorithm

1. Check to make sure that the graph is connected and all vertices are of even degree.

2. Start at any vertex

3. Travel through an edge as long as it is not a bridge for the untraveled part, or if there is no other alternative.

4. Label the edges in the order in which you travel them.

5. Continue this process until you have traversed all the edges.

[53] But why was this question of Euler Cycles even raised? The answer deals with the problem of the bridges of Koningsberg. Since we went over this in class, I will not go into the problem, except to say that Euler found the answer and came up with this theorem in the process. Hence the term Euler cycle. But what happens, as in the case with the bridges of Koningsberg, when a graph does not have all vertices with even degree? Is there a way to make a circuit out of it. The answer is yes. In fact, there is another famous problem that deals with this issue, and it is the Chinese postman problem.

Chinese Postman Problem

The Cinese Postman Problem or the Route Inspection Problem, as it has be- come known today, was proposed and first studied by a chinese mathematician, Mei-Ko Kwan[26], or Meigu Guan[5], in 1962. This problem was originally for- mulated to find the best route for a postman as he goes on a delivery. In order to save time, effort and money, the postman requires to complete his round in the shortest distance possible. The postman must obviously travel along each road in a given road network to visit all of the houses and deliver letters there. Note: The Chinese Postman Problem differs slightly from the Travelling Sales- man Problem, which we discussed in class, as the salesman only has to visit all their towns and is not concerned with travelling along every road in between. [10] While this is all good, it still does not answer the question of how to find an Euler cycle when a graph has some vertices with odd degree. In order to do this, we have to consider something I like to call the Minimal Recursion on a graph. Now the process to find this minimal recursion is called Eulerization or eulerizing a graph. 118

Eulerization

Adding edges to a graph to make all valences even is called eulerizing the graph.

The Eulerization Process

1. Take the given graph and find all the odd degree vertices.

2. Add edges to these vertices by duplicating the extisting ones, until one arrives at a graph that is connected and even-valent.

3. Find an Euler circuit on the eulerized graph.

4. “Squeeze” this Euler circuit from the eulerized graph onto the original graph by reusing an edge of the original path each time the circuit on the eulerized graph uses an added edge.

[5]

An Example

Let’s look at the following graph.

First, we have to identify the vertices with odd degree. They are D and E. Then we draw another edge, connecting D and E, as shown in the graph below. 119

The final step then is to squeeze the edge onto the existing graph to find that there is a recurrance over the line segments, DF and EF , as shown in the graph below.

A Better Eulerization

Although the euerization in the example above works, there is a better way to do it. Instaed of retracing two edges, DF and EF , there is a way to do it by just reusing one edge, namely DE. This “better eulerization” is shown in the graph below. 120

This process can also be done for weighted graphs. While the process is still the same, now one not only has to consider the number of edges being squeezed, but also which of these squeezings is of minimal cost.

Example on a Weighted Graph

The problem here is to find the minimal cost euler cycle on the following graph.

First, we have to identify the odd vertices, whcih are B,D,E and F . Next, we have to list all possible pairings of these; BD and EF , BE and DF , BF and DE. For the three sets of pairings, we have to find the shortest distances between each pair of odd vertices. For BD and EF , we have (6 + 3) + (1 + 8) = 18 going via G in both cases. For BE and DF , we have (6+1)+(3+8) = 18 going via G in both cases again. For BF and DE, we have (7 + 2) + 5 = 14 going via A for BF and direct for DE. Then, all we have to do is find an euler circuit: A, B, C, G, D, G, E, D, E, F, G, B, A, F, A 121

Knowing the circuit, now we add up all the edges to find the minimal cost:

7+9+7+3+4+1+5+5+12+8+6+7+2+2=78

[51] The following are a few exercises to figure out.

Exercise #1

Solve the bridges of Koingisburg problem using Eulerization.

Exercise #2

Find a minimal cost duplication circuit on the following graph. 122

References

See the bibliography section.

Minimal cost

Below is a minimum cost example from class. To find the minimal cost path from vertices A to Z, a breadth-first spanning tree will not help us. In order to find the path with the minimal-cost, we can implement algorithms such as the one below:

Dijkstra’s algorithm

At each step, we look for some unlabeled vertex, adjacent to a labled vertex V , with (X, k) such that k+ [the “cost” of an edge] = m in this case, the unlabeled vertex gets the label (V, m). 123

Implementing Dijkstra’s algorithm

image:Pepsi.JPG Objective: Find the minimal path from A to Z. Strategy:

• Label each vertex according to its minimal distance from A • Initialize a counter m, starting with m = 1 • At each step, look for vertices distance m from A.

Implementation:

• Let m = 1 B is 1 unit from A, so B = (A, 1) • Let m = 2 F is 2 units from A, so B = (A, 2) • Let m = 3 H is 2 units from B, 3 from A, so H = (B, 3) • Let m = 4 No vertices are 4 units from A 124

• Let m = 5 C is 3 units from F , 5 from A, so C = (F, 5) • Let m = 6 D is 1 unit from C, 6 from A, so D = (C, 6) • Let m = 6 G is 3 units from H, 6 from A, so G = (H, 6) • Let m = 7 Z is 1 unit from G, 7 from A, so Z = (G, 7)

Here, we are done. The shortest path from A to Z is cost 7 . This path is A−B −H −G−Z, which was obtained by working backward from m = 7 using the labels given at the vertices

More Coloring Fun

Multigraph

A multigraph is a generalized graph that allows for two vertices to be con- nected by more than one edge, or for a single vertex to be connected to itself by what is called a loop edge. Here are some pictures of multigraphs: Image:Multigraph example1.JPG — Example 1: a relatively inter- esting graph Image:Multigraph example2.JPG — Example 2: a way lame graph 125

An example of a trail in the graph is A − E − B − D − C

Definitions:

• A trail is defined as a path with no repeated edges. • A cycle is a circuit trail, or a circuit with no repeated edges. • An Euler Cycle is a cycle that uses every edge of the graph. • An Euler Trail is a trail that uses every edge.

Theorems

• A connected multigraph has an Euler Cycle if and only if all vertices have an even degree.

To understand how we arrive at this theorem, consider each of the vertices in a multigraph. You must arrive at each vertex once, and leave it once to continue on in the cycle. Therefore each vertex must have a degree that is even. A vertex with odd degree would force the path to end at a vertex different then where it started.

• A connected multigraph has an Euler trail but no Euler Cycle if and only if all vertices except two are of even degree.

Knigsberg Bridge Problem

Bridges of Knigsberg

See Bridges of Konigsberg

• Is it possible to walk over all seven bridges exactly once and end where you started? More specifically, is there an Euler cycle for this graph? • For the graph of this problem, there are four vertices and seven edges. The seven bridges make up the seven edges and the four areas of land are the four vertices. 126

Network

A network is a graph that has numerical values placed on each of its edges. Weighted graphs are important when trying to find a Hamilton circuit that is of minimal “cost.” In other words, we want to find a circuit that has the smallest sum of the weights. Often called aTraveling salesman problem, one way to solve this is the Approximate Tour Method.

Example of a network

Weighted Graph

Approximate Tour Construction

For an approximate tour construction, we construct a sequence of circuits which are increasing in length until we have a Hamilton Circuit. The steps for creating such a construction are:

1. Choose any vertex at which to start. That vertex is called C1

2. If a sequence, Ck, has been constructed, find the vertex outside Ck which is the closest to any vertex in Ck. Call the outside vertex Zk and the inside vertex Yk

3. Form the sequence Ck+1 by inserting Zk before Yk in the existing sequence Ck.

4. Repeat steps 2 and 3 until all of the vertices have been added.

A more efficient method to solve this problem has not yet been proven, but this method will help us to find a solution. 127

Cost Matrix

A human can find the best solution in Kn graphs where n is relatively small. However, if you wanted to try to find the best solution for more complicated graphs it may be necessary to construct a cost matrix. A cost matrix is created by using all the vertices both as row and column headings. The cell in the matrix whose location is described by two vertices contains the cost of the edge connecting those vertices. The following is an example of a cost matrix and its corresponding (complete) graph.

The Approximate Tour Contruction will work more efficiently under two condi- tions:

1. The cost matrix is symmetric. You could imagine how ifAB and BA, and all the other edges in the graph, have different lengths depending on which way you travel, it would majorly complicate our cost matrix.

2. ”’The costs obey the inequality: Cij + Cjk ≥ Cik.”’ This is similar to the triangle inequality which states that in a triangle with vertices A, B, and C, it is shorter to go from A to C than to go from A to B to C.

A cost matrix for the graph at the top of the page is included below 128

image:costschedule.GIF The x’s on the graph indicate that the graph is not complete and no path exists. A better way to show this may also be to put infinity ∞ in the graph instead of ”x’s” or nothing. There is always nothing on the main diagonal2 of a cost matrix because at that point the rows and columns are paired with the same vertex and cost nothing. Another useful application of weighted graphs is to find a path of minimal cost, instead of a Hamilton circuit. One method for doing this is called Dijkstra’s Algorithm. For more examples using the “ATC,” see Traveling salesman problem.

Finding cost-minimal spanning trees

Another helpful process to find minimal-cost path is to create a cost-minimal spanning tree for the network. Below are two algorithms useful in creating a cost-minimal spanning tree:

A Visual Example of Kruskal’s Algorithm: Cost = 14

Kruskal’s algorithm

• Start with the edges of least cost

2http://pc-cstaecker-2.messiah.edu/~cstaecker/2005fwiki/index.php/Main_ diagonal 129

• In each step add the edge of minimal cost not forming a circuit with already chosen edges • In the case of a tie, either edge may be chosen • Exhaust all edges to form the desired cost-minimal spanning tree for the network • An example of this is shown to the right.

Prim’s algorithm

With a given network, start with an edge of minimal cost. If there are multiple edges of minimal cost, arbitrarily choose one. Once the first edge is selected, add the edge of smallest cost adjacent to the selected edge. Now add the edge of smallest cost adjacent to the two edges already selected. Repeat this process until a spanning tree is built, being sure to never create a circuit. Implementing Prim’s algorithm Using the example graph above, find a spanning tree of minimal cost using Prim’s Algorithm.

A Visual Example of Prim’s Algorithm: Cost = 14

• First, an edge of minimal cost should be chosen. Because there are three edges of cost 1, we can arbitrarily choose one of them. In this instance, we’ll choose (A, B). • (A, B) has two edges adjacent to it with cost 2. Choose (A, F ). • (B,H) must be selected, as it has cost 2. The edge (F,H) can no longer be selected, as it would create a circuit. • Now there is a choice of two sides both with cost 3, choose (H,G). • Must choose (G, Z) because it has a cost of 1. • Have a choice between two cost 2 edges, choose (C,G). • (C,D), which has a cost of 1, must be selected. • (D,E), with cost 2, is selected. This completes the spanning tree, as selecting anymore edges would create a circuit. 130

• This is shown on the Right.

The spanning tree created has a minimal cost of:

1 + 2 + 1 + 2 + 3 + 2 + 1 + 2 = 14

Network Flow

Suppose engineers were working on a flood evacuation plan for a city, and wants to know what the maximum flow of traffic is to a neighboring city, and which roads should be used for this to be achieved. This is the type of problem our study of network flows and maximum flow algorithms will enable us to solve. We will look at some basic terminology as well as a maximum flow algorithms

Flow: Definitions

We will start by modeling the above problem with a directed graph. The set of vertices, V , will represent the intersections in the roads, and the set of edges, E, will be the roads themselves. Further, we will define c(e) to be the maximum capacity for the edge e (here c(e) is the maximum number of cars per minute on a given road). We will also say that for vertices u, v ∈ V , and the edge going from u to v,(u, v), relates to the edge going from v to u,(v, u) in the following way: (u, v) = −(v, u) In(v) and out(v) will denote the set of edges going into and out of the vertex v respectively. The city that is being evacuated, the initial vertex, will be the source vertex, s. The city being evacuated to, the end vertex labeled t, will be the sink. The flow for the edge, e, we will define as f(e) and will be subject to the following:

1. f(e) ≤ c(e) P P 2. For v 6= s or t, e∈in(v) f(e) = e∈out(v) f(e)

The total flow through the network will be denoted as F , and is defined as: P P F = e∈in(t) f(e) − e∈out(t) f(e) Our graph looks like this, with the edges labeled with c(e), f(e) 131

image: FlowExl1.jpg Note: If there are more than one source vertices or sink vertices, it can still be modeled as using one by adding a single vertex supplying the source vertices, or a single vertex receiving a combined flow from the sink vertices. Finally, we will define a cut to be the sum of edges going into a set of vertices S, in(S), and the edges going out of S, out(S), were S is a subset of V . The set S¯ will then be defined as: S¯ = V − S ¯ P (The set S equals the set V minus the set S) c(S) = e∈out(S) c(e), will be called the capacity of the cut.

Flow: Theorems

Lemma 1

For every S ⊂ V such that s ∈ S and t ∈ S¯, P P P e∈(s,V ) f(e) = e∈out(S) f(e) − e∈in(S) f(e)

Proof: By (2), for every v ∈ S, where v 6= s, P P e∈out(v) f(e) − e∈in(v) f(e) = 0. Thus, P P P P v∈S,v6=s e∈out(v) f(e) − v∈S,v6=s e∈in(v) f(e) = 0 Therefore, P P P P P e∈out(S) f(e)− e∈in(S) f(e) = e∈out(s) f(e)− e∈in(s) f(e) = e∈(s,V ) f(e).

→← 132

Lemma 2

For every S ⊂ V such that s ∈ S and t ∈ S¯, P P P e∈(V,t) f(e) = e∈out(S) f(e) − e∈in(S) f(e)

Proof: Clearly, out(S) = in(S¯), and in(S) = out(S¯) So, P P P P e∈out(S) f(e) − e∈in(S) f(e) = e∈in(S¯) f(e) − e∈out(S¯) f(e) By the definition of an edge, P P e∈(V,t) f(e) = − e∈(t,V ) f(e) So, P P P P − e∈(V,t) f(e) = e∈(t,V ) f(e) = −[ e∈out(S) f(e) − e∈in(S) f(e)] P P P P = −[ e∈in(S¯) f(e) − e∈out(S¯) f(e)] = e∈out(S¯) f(e) − e∈in(S¯) f(e) So, P P P e∈(t,V ) f(e) = e∈out(S¯) f(e) − e∈in(S¯) f(e) Which is true by the same process as Lemma 1. Therefore, P P P e∈(V,t) f(e) = e∈out(S) f(e) − e∈in(S) f(e)

→←

Theorem 1

For every S ⊂ V such that s ∈ S and t ∈ S¯, P P e∈(s,V ) f(e) = e∈(V,t) f(e)

Proof By Lemma 1, P P P e∈(s,V ) f(e) = e∈out(S) f(e) − e∈in(S) f(e) By Lemma 2, P P P e∈(V,t) f(e) = e∈out(S) f(e) − e∈in(S) f(e) Therefore, P P P P e∈(s,V ) f(e) = e∈out(S) f(e) − e∈in(S) f(e) = e∈(V,t) f(e)

→← 133

Theorem 2

For any total flow F through a network N, and any S ⊂ V such that s ∈ S and t ∈ S¯, F ≤ c(S)

Proof By definition of total flow, P P F = e∈in(t) f(e) − e∈out(t) f(e) P F = e∈(V,t) f(e) By Theorem 1, P P F = e∈(V,t) f(e) = e∈(s,V ) f(e) By (1), P P P F = e∈(V,t) f(e) = e∈(s,V ) f(e) ≤ e∈(s,V ) c(e) By definition of cut capacity, P P P F = e∈(V,t) f(e) = e∈(s,V ) f(e) ≤ e∈(s,V ) c(e) ≤ c(S) (*)

→←

Corollary 2a

For any total flow F through a network N, and any S ⊂ V such that s ∈ S and t ∈ S¯, if the F = c(S), then F is a maximum and the cut determined by S is of minimum capacity.

Proof: Let Fmax be the maximum, and let c(M) be the minimum capacity, then by Theorem 2,

F ≤ Fmax ≤ c(M) ≤ c(S) So, if F = c(S),

F = Fmax and c(S) = c(M)

→←

Max Flow Algorithms

We will define a chain from vertex u to vertex v, to be a path disregarding edge direction. We will define the slack of an edge, s(e) to be, 134

s(e) = c(e) − f(e).

Ford and Fulkerson’s Algorithm: Edited by Edmonds and Karp

1. Let F = 0, and give s the labels (−, ∞).

2. Define p to be the vertex being scanned, and ∆p to be the second label of p. Initially, p = s

3. *First, check if all edges, e = (q, p), coming in to see if they are labeled. If an edge is not labeled and f(e) > 0, label q with the labels (p−, ∆q) where ∆q = min(∆p, f(e)).

4. *Next, check if all edges, e = (p, q), going out to see if they are labeled. If an edge is not labeled and s(e) > 0, label q with the labels (p+, ∆q) where ∆q = min(∆p, s(e)).

5. If t is labeled, go on to step 4. Else, pick another labeled vertex that has not been scanned, and scan it using repeating step 2. If no there are no non-scanned vetices, let S be the labeled vertices, then F = c(S), and thus F = Fmax by Corollary 2a.

6. Back track through the labels to find the chain from s to t. Increment the flow of all edges by ∆t; increase the flow if the edge is directed toward t, decrease the flow if the edge is directed toward s.

Example We will now finish the problem from the beginning of the paper using this algorithm.

image: FlowExl1.jpg 135

image: FlowExl2.jpg

image: FlowExl3.jpg

image: FlowExl4.jpg 136

image: FlowExl5.jpg

image: FlowExl6.jpg

Dinic’s Algorithm

First, the graph needs to be layered:

1. The first layer, L0, is s, and i = 0. Si 2. Let T ={v|v∈ / 0 Lj, and having an edge, e with s(e) 6= 0, connecting them to Li}.

3. If T is empty, the network already has maximum flow, so halt.

4. If t ∈ T , then let Li+1 = t and layering is finished, else go on to step 5.

5. Let Li+1 = T . Set i = i + 1, and then go back to step 2. 137

The Algorithm Given a layered network, N, and a path, P

1. Mark each edge as unblocked. Let v = s. Add s to P .

2. If edges to the next layer are blocked:

3. *If s = v, then the flow for N is maximal, so halt.

4. *Else remove v from P , mark the edge to v as blocked, set v equal to the last vertex in P , and repeat step 2.

5. Choose an edge to or from the next layer conecting v to u, add u to P , and set v = u. If v 6= t, go to step 2.

6. Find the minimum slack on P and use it to increment the flow of all edges in P ; increase the flow if the edge is directed toward t, decrease the flow if the edge is directed toward s. Mark every e ∈ P as blocked, and go back to step 2.

Exercise

Find the maximum flow in the following graph using Ford and Fulkerson’s al- gorithm:

image: FlowExercise1.jpg

References

Gould, Ronald. Graph Theory. Reading, Mass.:Cummings, 1988. Tucker, Allen. Applied Combinatorics. New York: John Wiley & Sons, 2002. 138

Pascal’s Tetrahedron

Introduction

Pascal’s triangle is a two-dimensional representation of binomial coefficients of the form (a+b)n. The horizontal rows of the triangle represent the exponent, n, in the binomial expression (with the first row expressed as n = 0), and the diag- onal columns are expressed as k, (beginning with k = 0). One way to determine the coefficient on the xi term from a binomial expression using Pascal’s triangle, is to use the nth row, and the ith diagonal column to find the corresponding number in the triangle. While Pascal’s triangle is a geometric and numeri- cal representation of binomial coefficients, the three dimensional version of this triangle, known as Pascal’s tetrahedron, represents the trinomial coefficients of the expansion of (a + b + c)n. In his article Pascal’s Simplices, Eric Row- land describes what the tetrahedron looks like. Row- land, Eric S., Pascal’s Simplices, http://www.math.rutgers.edu/ erow- land/pascalssimplices.html Each side of the tetrahedron is a Pas- cal’s triangle The tetrahedron has three dimensions: the horizontal levels, the rows within each level, and the position within each row. By convention, we be- gin counting each dimension at zero. The entries on the inside of the tetrahedron are determined by the sum of the three adjacent values of the level immediately above.

Pascal’s Tetrahedron.

The first picture shows the levels of the tetrahedron from n = 0 to n = 4 The second picture shows a model of levels n = 0 to n = 4 of Pascal’s tetrahedron. 139

Determining the Entries for Pascal’s Tetrahedron

In Pascal’s triangle, each entry is the sum of the two entries directly above it. Similarly, each entry in Pascal’s tetrahedron is the sum of the three entries that form a triangle over it in the level immediately above. Eric Rowland states n  that m represents the entry in row n and position m of that row in Pascal’s triangle. [?] We know from the definition of a combination that n  n! m = m!(n−m)! . We also know that each inner entry of the triangle can be written as the sum of the two adjacent entries in the level above it. This can be written as n  n−1  n−1 m = m−1 + m In the tetrahedron, each entry has three dimensions, and the entry is determined by the sum of the three adjacent values in the level immediately above. We let n represent the levels of the tetrahedron, m represent the rows of a given level, and k represent the position within any row. Eric Rowland states that the formula for finding the value of any inner entry of the tetrahedron can be found using the formula n m m k [?] Proof n m We can show that if m k is the formula for determining the entries for Pas- cal’s tetrahedron, then n m n−1m n−1 m−1 n−1 m−1 m k = m k + m−1 k + m−1 k−1 By the formula for combinations, we know that n m n! m! n! m k = m!(n−m)! ∗ k!(m−k)! = (n−m)!(m−k)!k! We can also show that n−1m (n−1)! m! (n−1)! m k = m!(n−1−m)! ∗ k!(m−k)! = (n−m−1)!(m−k)!k!

n−1 m−1 (n−1)! (m−1)! (n−1)! m−1 k = (m−1)!(n−m)! ∗ k!(m−1−k)! = (n−m)!(m−k−1)!k!

n−1 m−1 (n−1)! (m−1)! (n−1)! m−1 k−1 = (m−1)!(n−m)! ∗ (k−1)!(m−k)! = (n−m)!(m−k)!(k−1)! We can combine these previous three identities to get the equation n−1m n−1 m−1 n−1 m−1 m k + m−1 k + m−1 k−1

(n−1)! (n−1)! (n−1)! = (n−m−1)!(m−k)!k! + (n−m)!(m−k−1)!k! + (n−m)!(m−k)!(k−1)! 140

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

by finding common denominators and simplifying the factorials.

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

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

n! n m = (n−m)!(m−k)!k! , which we already found to be equal to m k .

Sum of Entries in a Level

In Pascal’s triangle, we know that the nth row corresponds to the coefficients of the binomial expansion of (a + b)n. (a+b)n can be rewritten as (a+b)(a+b)...(a+b) in which there are n binomials. n n n−1 n−2 2 n−1 We can expand this to be (a+b) = c1a +c2a b+c3a b +...+cn−1ab + n cnb We can set a = 1 and b = 1 and plug them into the previous equation to get n (1 + 1) = c1 + c2 + c3 + ... + cn We know that the coefficients of the binomial expansion of (a + b)n can be determined by row n of Pascal’s triangle, so the sum of the nth row of Pascal’s triangle equals 2n. Similarly, we know that the entries in level n of Pascal’s tetrahedron correspond to the coefficients of the trinomial expansion of (a + b + c)n. Example The expansion of (a + b + c)2 = a ∗ a + a ∗ b + a ∗ c + b ∗ a + b ∗ b + b ∗ c + c ∗ a + c ∗ b + c ∗ c = a2 + 2ab + 2ac + b2 + 2bc + c2 The coefficients of this expansion are {1, 2, 2, 1, 2, 1} and the entries in level n = 2 of Pascal’s tetrahedron are {1, 2, 2, 1, 2, 1}. The expansion for (a + b + c)n is similar to the binomial expansion, except that a third variable is incorporated into the equation. If we let a = 1, b = 1, c = 1, and plug those values into the expansion equation, we are left with n (1 + 1 + 1) = c1 + c2 + c3 + ... + cn.

Since ci is an entry in level n of Pascal’s tetrahedron, we know that the sum of 141 all of the entries in level n is 3n.

Patterns

Pascal’s Triangle

There are many patterns in Pascal’s triangle. The diagonals going along the left and right edges contain only 1’s. The diagonals next to the edge diagonals contain the natural numbers in order. Moving inwards, the next pair of diagonals contains the triangle numbers in order. The next pair of diagonals contains the tetrahedral numbers in order, and the next pair gives pentatope numbers. In general, each next pair of diagonals contains the next higher dimensional of “triangle” numbers. The “natural numbers” are the numbers we use to count, {1, 2, 3, }. A “triangle number” is a such that the shape of an equilateral triangle can be formed by that number of dots. Triangular numbers can be thought of as the numbers of dots you need to make a triangle. The sequence of triangular numbers for n = 1, 2, 3... is: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55,. The formula for the n(n+1) nth is 2 . A “” [8]is a number that represents a pyramid with a triangu- lar base and three sides. This pyramid is called a tetrahedron. Tetrahedral num- bers can be thought of as the number of dots you need to make a pyramid. The nth tetrahedral number is the sum of the first n triangular numbers added up. n∗(n+1)∗(n+2) The tetrahedral numbers can be found using the formula: 6 . The sequence of tetrahedral numbers for n = 1, 2, 3... is: 1, 4, 10, 20, 35, 56, 84, 120,. n(n+1)(n+2)(n+3) The pentatope numbers[7] can be calculated by using 24 . A pen- tatope is a geometric structure that is hard to visualize because it is like a 4-dimensional tetrahedron. 142

Counting Inner Tetrahedrons: In terms of Pascal’s tetrahedron, the triangle numbers provide a way to count the number of inner tetrahedrons in a Pascal’s tetrahedron. In order to count the number of inner tetrahedrons in Pascal’s tetrahedron, we sum the triangle numbers from level 0 to n. We start counting the levels at 0 and we end at the Pn i(i+1) bottom level (n) of the tetrahedron. Therefore the summation is: i=0 2 An example: the number of inner tetrahedrons in Pascal’s tetrahedron with 5 P4 i(i+1) 0(0+1) 1(1+1) 2(2+1) 3(3+1) 4(4+1) levels is: i=0 2 = 2 + 2 + 2 + 2 + 2 = 20

Sierpinski’s Triangle

Another pattern in Pascal’s Triangle corresponds to Sierpinski’s Triangle. If you color the odd numbers in Pascal’s triangle and keep the other spaces clear, you can see Sierpinski’s triangle.

Tetrahedral Relationship

Before Pascal’s triangle ever existed, there was a table of rectangular form au- thored by the Italian mathematician Niccolo Tartaglia. His table resembles Pascal’s triangle, simply in a rectangular form. If we look at the diagonals which are at a 45 degree angle (the red diagonal is the first, the purple diagonal is the second, etc.) of the rectangle, we notice that those are the entries of Pascal’s triangle. Tartaglia’s rectangle looks like this for 10 levels (n = 9 and k = 5). 143

Tartaglia’s Rectangle

The zeroeth row and column contain entries of just one’s, and the succeeding entries are formed by summing the digit directly to left of the entry and above the entry. For instance, when forming “2,” one would add 1 (the digit to the left of that entry) and 1 (the digit from directly about that entry), and 1 + 1 = 2. To get the “3,” in the second column we sum 1 and 2, the numbers to the left and above, respectively. n Using this information, we know that any given number can be labeled by (T )k, where n is the row and k is the place in the row (Rows are formed diagonally and the kth row will be the same digits that are in the kth row of Pascal’s triangle. Row 0 is 1; Row 1 is 1, 1; Row 2 is 1, 2, 1, where “2” would be in the second place in that row. Comprehension exercise: What digit is in the third place n 3 of the third row? Some examples using the formula (T )k would be: (T )2 = 3. 3 2 (T )3 = 1.What does (T )1 equal? This expression can be defined for any n ≥ 0 and k = 0, 1, ..., n. If we create an infinite sequence of this expression, we find that our sequence looks like this:

k k+1 k+2 n (T )k, (T )k, (T )k, ..., (T )k

The elements that result from this sequence as k goes to n are the elements in Pascal’s triangle and Tartaglia’s rectangle.

• When we plug in k = 0 we get the sequence 1, 1, 1, 1, 1, 1... (the zeroeth row or zeroeth column of Tartaglia’s rectangle).

• When we plug in k = 1, we get a sequence of the natural numbers, 1, 2, 3, 4, 5, 6, ... (the first row or column in Tartaglia’s rectangle).

• When we plug in k = 2, we get the following sequence: 1, 3, 6, 10, 15, 21, ...(or the second row or column in Tartaglia’s rectangle). 144

If we look closely, these are the triangular numbers, as previously discussed in Patterns. If we wanted to get the mth triangular number we m+1 th would use the expression (T )2. So the 4 triangular number would be 4+1 5 (T )2 = (T )2 = 10, and as we can see from the ordinary triangular number sequence, 10 is the fourth triangular number.

• If we proceed to plug in one more value for k: k = 3, then we get the most interesting sequence: 1, 4, 10, 20, 35, 56, ... (or the third row or column of Tartaglia’s rectangle). These numbers are referred to as pyramidal or tetrahedral numbers. If we form an expression similar to the one for m+2 th k = 2, we get (T )3 and that allows us to find the m tetrahedral number. Our gum drop model has 5 levels and thus the tetrahedral number 5+2 7 is (T )3 = (T )3 = 35, so we know that there are 35 gum drops in our model without tediously counting each one. If we had 8 levels, this expression would be very useful to us because counting the individual gum drops would be impractical [45].

Application of the Relationship: The following is an interesting application of this expression: the mth tetrahedral m+2 number of (T )3 is the number of spheres that can fit inside that tetrahedron, given that the base is an equilateral triangle with base m. 8+2 Continuing with our m = 8 example, we would say that (T )3 is the number of spheres that can be packed into that large tetrahedron[45].

Exercises

1. Based on the formulas mentioned in this paper, find the value of the tetra- hedral entry that is the sum of the numbers in positions (6, 4, 0), (6, 4, 1), (6, 5, 1).

2. For a tetrahedron with 8 levels, letting m = 8, how many gum drops would be needed in order to construct it?

3. If a tetrahedron has an equilateral base with side m equaling 7, how many spheres would fit inside of that tetrahedron?

4. In his book, Applied Combinatorics, Alan Tucker states that C(n, k)/C(n, k− 1) = (n+k−1)/k. [14] Similarly, show that C(n, m, k)/C(n, m−1, k−1) = (n + m − 1)/k.

References

See the bibliography section. 145

Path

A path is a sequence of adjacent vertices.

There is a path from 1 to 6

A graph is connected if any two vertices can be connected by a path.

Each vertex is connected to every other vertex.

A circuit is a path that starts and ends at the same vertex.

1-2-4-1 is a circuit

Note that two graphs can be the same while appearing quite different. As long as the vertices are the same, and they are connected by edges in the same places, a graph can be shown in practically any way. Two graphs may be the same regardless of the path taken. See the page Isomorphism. Paths have several practical applications, such as:

• Road maps and airline route maps • Six Degrees of Kevin Bacon • Sexual partner maps for AIDS tests 146

• Sentence diagrams

• Flow charts and directed graphs

• Computer networking

• Integrated Circuit design

Permutations and combinations

Permutations

An r- of n things is a particular ordered arrangement of r items form among the n things. For example, (2, 3, 1) is a 3-permutation of {1, 2, 3, 4, 5}. The notation for this is P (n, r), given r-permutations from a set of n-things.

General formula for permutations

P (n, 1) = n P (n, 2) = n(n − 1) P (n, 3) = n(n − 1)(n − 2) P (n, r) = n(n − 1)...(n − r + 1) n!     = (n−r)!

Examples

• The Birthday Paradox

• Permutations and combinations/“SYSTEMS” example

• Varadarajan example

Combinations

Making combinations involves grouping a set of things without repetition and finding the number of possibilities where order does not matter. It is a subset r of n total items. For Example: (1, 2, 3) is a subset of (1, 2, 3, 4, 5). An example would be drawing names from a hat. Similarly to permutations, C(n, r) denotes the number of r-combinations from the set of n-things. For example, {1, 2, 3} is a 3-combination of {1, 2, 3, 4, 5}. 147

General formula for combinations

The general formula is similar to the one for permutations, however remember that we don’t want to count everything, we just want to count arrangements with a unique group of elements. To do this, we divide out the number of orderings of a set of r elements which leads to:

P (n, r) n! C(n, r) = = r! (n − r)!r! Using Combinations in Statistics

Examples

Say there are 10 names in a hat and one would like to choose 4. This is called 10 “ten, choose four” and is notated like: 4 . a P (a,b) a! The general formula for a combination of b is C(a, b) = b! = b!(a−b)! . 10! The result for that particular example would be 4!(10−4)! = 210. This result also corresponds to the entry in Pascal’s triangle in row a column b (if one starts counting at zero).

We can use Pascal’s Triangle to prove some combinatorial propositions as well. n n−1 n−1 For example, we can prove that k = k + k−1 , simply by looking at a diagram and using the general principle that an item in Pascal’s Triangle is the sum of the two items above it. The diagram below shows this. 148

Another Example - Breaking the problem into cases:

How many 4-digit phone extension numbers have one or more re- peated digit? Case 1: Let all four digits of the number be the same. Since there are 10 digits, there are 10 possible extensions in this case. Case 2: Let 3 of the digits be the same, and the fourth one be differ- ent. There are 10 choices for the repeated digit, and 9 choices for the other digit. Since the digits could be in any order, we also multiply by the number of configurations for a specific set of digits, which in this case is 4. This case has (10)(9)(4) = 360 possibilities. Case 3: Let 2 digits be the same, and let the other 2 digits be the same as each other. Since there are 2 digits appearing in this number, we can consider this problem to be choosing 2 things from 10, disregarding their order for now. 149

10! So, C(10, 2) = (8!)(2!) = 45. Since the order of the numbers is important, we can determine the number of ways to locate the numbers by the formula (4!) C(4, 2) = (2!)(2!) = 6. The total possibilities for this case are (6)(45) = 270. Case 4: Let 2 of the digits be the same, and let the other 2 digits be different. We have 10 choices for the digit that will be repeated. The other 2 digits can be chosen from 9 possibilities. We can express this by C(9, 2) = (9!) (7!)(2!) = 36. There are 2 locations out of 4 for the repeated digits, which can (4!) be expressed as C(4, 2) = (2!)(2!) = 6. There are 2 choices of location left for the non-repeated digits. There are (10)(36)(6)(2) = 4320 choices for this case. Finally, take the sum of all possible numbers for each case. In all, there are 4960 phone extension numbers that have one or more repeated digit.

Fast Facts

n When using r notation, we have a couple properties that can speed-up the process of solving a problem:

n  n 1. n−r = r

2. n = 1 n

3. n = n 1

n 4. If r > n, then r = 0

Stirling’s Formula

This is an interesting formula that allows for an approximation of n!, and is true for any large n.

√ nn n! ≈ 2πn e

Links

Distributions 150

Permutations and combinations/“SYSTEMS” ex- ample

PROBLEM: How many ways are there to rearrange the letters in the word SYSTEMS? (A wrong way to think about this problem: There are 7 elements, so to look at all 7 possibilities you take 7! This is the wrong way to approach the problem because it counts all 3 S’s as separate and different letters. This gives us too many solutions.)

Two Correct Ways

First Way: Take all 7! possibilities and divide by the orderings of S’s. Thus you have 7!/3!, which equals 7 ∗ 6 ∗ 5 ∗ 4 or 840 Second Way: First think of the placing of the non-S’s. So place Y,T,E,M and fill in the blanks with S’s. Each of Y,T,E,M gets a location from 1 to 7. We are choosing 4 positions out of a possible 7. Order is important. So we take P (7, 4), which is 7!/3! or 840.

Part B

Problem: How many ways are there to rearrange SYSTEMS with all S’s appearing together? First imagine SSS as one letter. So you have 5 elements. The number of ways of ordering 5 letters is 5!. See also Burger Example Back to Permutations and combinations

Planarity

A graph is said to be planar if it can be drawn on a plane with no edge crossings.

Any graph containing a non-planar subgraph (either a K3,3 or a K5) is not planar. Any graph containing a subdivision of a non-planar graph is also non-planar.

Kuratowski’s Theorem (1930)

A graph is non-planar iff it contains a K3,3 configuration or a K5 configuration. 151

Euler’s Formula

A Planarity.net puzzle I completed (level 5, oh yeah.)

If G is a connected, planar graph, then any planar drawing of the graph satisfies r − e + v = 2 where: v = the number of vertices e = the number of edges r = the number of regions defined by the graph’s edges (including the “outside” as a region) Corollary (from Euler’s Formula) If G is a graph that is both planar and connected with more than one edge, then e ≤ 3v − 6 Extension of Euler’s Formula If G is a planar graph, made up of c components (connected sub-graphs), where any vertex in component H is not connected to any vertex outside of that component H then we can extend Euler’s formula and get r − e + v − 1 = c. Euler’s Formula for Spheres, Toruses and Other Complex Solids Check out this page for calculating the Euler characteristic for more complex solids using Euler’s Formula. Planarity.net3 hosts the Flash game shown in class where the object is to uncross the edges of a planar graph.

3http://www.planarity.net/ 152

Planarity algorithm

This paper assumes prior knowledge of the topics in this wiki. Specifically look at Graph theory and Planarity for additional information. In this paper, graphs are assumed to be simple, undirected (see Directed graph), have at least 5 vertices, biconnected and, thus, connected. A graph is called biconnected if the removal of any vertex maintains the con- nectedness of the graph. So, a biconnected graph must have at least two possible paths to every other vertex[2]. It is safe to assume that the graph in question is simple, undirected, has 5+ vertices and is biconnected because these things do not affect a graph’s planarity:

• If the graph were not complex (meaning it had loops or multiple edges), just add the loops very close to the vertex and the additional edges along the same path as the originals.

• Any graph with 4 or less vertices must be planar because K4 is planar and all its subgraphs must be too. • If the graph were not connected, one could just test the planarity of the separate pieces by themselves and the whole graph’s planarity would be true only if each piece were planar. • Iff a simple graph is planar, then all of its “biconnected components” must be planar as well. • *These biconnected pieces can be treated as one vertex all unto themselves and if they are added to the external face of the graph they will always maintain the planarity of the graph.

Remember that Kuratowski proved in his 1930 theorem, that the one and only thing that a graph’s planarity hinges on is whether or not it contains at least one K3,3 or K5configuration or a subdivision of these. A simple graph is called maximal planar if it is planar but adding any edge would destroy that property. There are several ways to quickly identify if a graph is not planar. For example, all planar graphs must follow:

1. If the number of vertices is greater than 2 then the number of edges is ≤ 3n − 6 2. If the number of vertices is greater than 3 and there are no cycles of length 3, then the number of edges must be ≤ 2n − 4[21]

There are several Planarity algorithms to figure out for sure if a graph is planar: 153

St-order Test

The ideas in this section are sometimes also called vertex addition.

For every vertex we want one neighbor before and after, except for the first and last vertex.

A collection of vertices v1, ..., vn is an st-order if (v1, vn) is an edge, and if every vertex vi, 1 < i < n has at least one vertex before and at least one after. i.e., s is numbered 1, t is numbered n, and every node distinct from s and t has a lower and a higher numbered neighborCertifying Graph Recognition Algorithms. K. Mehlhorn and S. Naher: The LEDA Platform for Combinatorial and Geometric Computing, 1999, Cambridge University Press link4. It is fairly obvious that if a graph is biconnected, then it has an st-order for any two edges because all vertices must be of at least degree two, and if there was a path to a vertex there must be at least one other path back to another vertex in the st-order. In this way, vertices are added to the order in an algorithmic process...

• Starts with an st-order on the outer region of the graph (say (v1, vn))

• Let G be the graph made by v1, ..., vi, and use that for the simple, planar, “complete” portion of the algorithm

• *vn is on the outer face then of this new region and each vi...vn are inside the outer face of G

• *For any vertex not yet in G there must be a path to any vertex, vi...vn, that uses only vertices not in G

4http://www.mpi-sb.mpg.de/~mehlhorn/ftp/CertifiedGraphAlgs.pdf 154

See the guidelines to help you out when rearranging vertices.

• So, for each vertex that has exactly one endpoint outside of G, we add a vertex of degree 1 to each vertex in G at each place it is adjacent.

• Arrange the vertices so they are grouped together, consecutively.

• *Vertices may have to be rearranged to let other “active” vertices (not yet connected) remain bordering the outside region. Here are guidelines for rearranging:

• **If there is a vertex not yet biconnected, then the order of the “biconnected components” can be moved around arbitrarily

• **Each binconnected component can be flipped to the reverse order[18].

So in the example to the right, the number 1’s all go to a vertex, 1, not yet added to our planar representation G. The graph needs to be arranged so that the edges created leave other connections not yet made as part of the figures outside region or face. Following the above two guidelines for rearranging the graph (this is the graph before adding the vertex in question) makes the possible arrangements somewhat more manageable. If too many edges can be found that cannot go on either side of the edges being added due to the additional vertex, than this will show that there is a K3,3 or K5 configuration there.

Planarity by Edge Addition

This algorithm deals largely in Bicomps, the graph’s largest subgraphs that are biconnected and planar. In their simplest form a bicomp could be a single edge.

• Testing by the edge addition method first creates a Depth-first span- ning tree of the graph in question. 155

• Each vertex is assigned an index based on when it is visited when the tree is created.

• Also, edges not included in the depth-first spanning tree are given an index after the whole tree has been indexed. These edges not included on the spanning tree are called back edges.

• The vertices are sorted by their index order.

• Vertices from the spanning tree are added to a new empty graph, G one at a time.

• The algorithm keeps track of the planar arrangements of biconnected pieces that develop as each edge from the input graph is added.

• back edges are added in reverse order of their depth first indexes.

• By going in reverse order the back edges from a vertex, x, to its descen- dants are added, but the back edges from the ancestors of x to both x and its descendants will not be added until later. While processing x, all descendants with back edge connections to the tree’s ancestors of x must be kept on the outside (or the “external face”) because the algorithm only adds edges next to vertices that are kept on the external face.

• The main thing to keep in mind is that at any stage when adding edges to the new graph, there is a planar representation of the whole graph which must be consistent with our partial representation which has the remain- ing edges in the external face of the graphJohn M. Boyer. Planarity by Edge Addition: A new approach to a foundational problem in computer science. link5.

Exercise

5http://www.ddj.com/184406070?pgno=1 156

Other Topics

Other questions that come up when discussing planarity:

• Planarity on graphs represented on different surfaces... How does this change things?

• Planarity for directed graphs and Upward Planarization, where all edges of a graph point in some upward angle

• Data structures to hold this information when performing a test of pla- narity

• Opportunities for parallel processing in testing

See the bibliography section.

Ramanujan

Srinivasa Ramanujan

Srinivasa Ramanujan (December 22, 1887 - April 26, 1920) is known as the last self-taught contributor to mathematics. He was one of the most unorthodox mathematicians (as evidenced by his formulas) and accordingly one of the most brilliant. Currently, he holds the credit for the fastest converging approximation of π that we use today; it is:

√ ∞ 1 2 2 X (4k)!(1103 + 26390k) = π 9801 (k!)43964k k=0 Where the first term is accurate to within 15 digits of π He sent his theorems off to Europe in hope that one of his theorems might be worth something and, on a more important note, be valuable enough as to earn him some money so he could eat. Only one person, Godfrey Harold Hardy, actually looked at what Ramanujan had sent and replied that he might be the greatest mathematical mind in existence at that time. Hardy sent Ramanujan 157 some money and also requested that he move to England. Ramanujan did move to England and worked for four years with the entirety of math that was available at that time, however at the end of the four years he died of starvation because he was not able to eat European foods. While on his deathbed, Hardy came for one last visit and said that he was disappointed because the number of the cab he had taken, 1729, wasn’t interesting. Ramanujan replied and told Hardy that the number was a very interesting number because it was the smallest number that can be expressed as the sum of two cubes in two different ways. see also: Distributions / Integer partitions

Recursion

A recursion relation gives a function in terms of previous values of the same function, along with initial starting value(s) that defines a specific instance of that function. This initial starting point is called the ’base case.’ For example, if we wanted to specify r(n) as the number of ways to reorder n different things, we can express r(n) in terms of r(n − 1). In this case, our complete recurrence relation would be:

r(n) = n ∗ r(n − 1)

and r(1) = 1

Common Examples of Recursion:

Towers of Hanoi f(n) = 2f(n − 1) + 1 Factorial – n! = n(n − 1)! 0! = 1 Leaves in a balanced 4-ary tree of height k p(k) = 4p(k − 1) p(1) = 4 Fibonacci numbers – f(n) = f(n − 1) + f(n − 2) f(1) = 1, f(2) =1 The base case for the Fibonacci Sequence is f(1) = 1 and f(2) = 1 because it is the sum of the previous two numbers; thus, two consecutive initial values are needed to define a specific instance.

More Examples

Example 1: The Blind Pizza Cutter Problem A local pizzeria was feeling overwhelmed with work, so they hired a man off the street to simply cut all their pizzas once they were finished cooking. On the man’s first day on the job, 158 he was given a giant pizza to cut. When the manager went to check on him, he discovered that the pizza cutter had cut many random lines throughout the pizza, with every cut intersecting every other cut at least once, and no parallel cuts. Almost despairing, the manager realized that he could still sell the pizza, but wondered how many slices the pizza cutter (who turned out to be blind) had cut. Remembering his studies in recursion from his Applied Combinatorics class (emphasis on applied) in college, he realized that his current problem was very similar to one they had covered in class, and the same one that the professor had wanted him to present at a conference. The problem goes as such: Draw n lines in the plane in “general position” (where there are no intersections of more than two lines at the same point, every line intersects every other line at least once, and there are no parallel lines). Let’s look at some examples:

image:Linesspectacular.JPG

There are f(n-1) regions on the right, and n new regions on the left thumb—There are f(n-1) regions on the right, and n new regions on the left 159

Look at the examples above. There is a number placed in each new region. Notice that as a “new” line is added, it intersects n − 1 lines (also, see diagram at right). So, the number of new regions created is n. The total number of regions will then be the number of regions previously present plus n. This means that f(n) = f(n − 1) + n defines the number of regions for a given number of lines n. However, a base case is still needed. The base case would be when n = 1. Referring to the picture above, it is easy to see that when n = 1 there are 2 regions. So the complete recurrence relation is the following: f(1) = 2 f(n) = f(n − 1) + n This could also be written using sequence notation: a1 = 2 an = an−1 + n As an example, let’s find f(4)

f(4) = f(3) + 4 = f(2) + 3 + 4 = f(1) + 2 + 3 + 4 = 2 + 2 + 3 + 4 = 11

Therefore, knowing the number of cuts the blind pizza cutter had cut, the manager was thus able to determine the number of slices in the pizza, and sold them at his fine establishment, the Falcon Express. Example 2: Elves Climbing Stairs An elf (yes, one of Santa’s elves) has to climb a satircase of n stairs to get his hammer and saw. The elf is able to go up either one or two stairs for each step he takes. Find a recurrance relation for an, the number of uniques ways he can climb the stairs. It is obvious that: a1 = 1 a2 = 2 (two one-steps or a two-step) a3 = 3 (one-step and two-step, two-step then one-step, three one-step) a4 = 5 If we break the problem down into parts for climbing the first four stairs we can come up with a systematic way to enumerate the possibilities for climbing the stairs. The first step can either be a one-step or a two-step. If it is a one-step then there are 3 steps remaining, and there are now a3 ways to finish climbing the stairs. If the first step was a two-step then there are a2 ways to climb the remaining stairs. So we know that a4 = a3 + a2 (for us 5 = 3 + 2). This can be applied to any number of stairs using the relation an = an − 1 + an − 2. 160

Example 3: Find a recurrence relation for the number of rounds in a single elimination tournament with n players (assume the number of players is a power of 2). a2 = 1 an = an/2 + 1

a8 = 3

In general, any recurrence that looks like: a2 = k (k is a constant) an = can/2 + f(n) ( c is a constant) is called a divide-and-conquer relation.

Solving Recursions

In a divide-and-conquer relation, if c = 1 and f(n) is a constant such as f(n) = d then, an = d dlog2(n)e + A where A is a constant determined by the base case. examples of solving recurrence relations

Solving recurrence relations with generating functions 161

Rook Polynomials

—Arrangements with restricted positions}}

Rook Polynomials

When trying to count arrangements with many restrictions in placement, it is helpful to create rook polynomials to help us work with the problem. An example of the type of problem that we use rook polynomials is if we were to arrange the letters a, b, c, or d, with:

• no a in positions 3 or 4 • no b in positions 1 or 3 • no c in positions 1, and • no d in positions 2 or 4.

As you can see, the many restrictions on this problem make an inclusion/exclusion solution to this rather difficult. Therefore we think of it as a board:

On this board, the rows represent the letters, while the columns represent the positions. The letter positions that are restricted have been shaded in. The placement counting for this is called the number of ways to place k mutually noncapturing rooks. This comes from the game of chess, where rooks can only move either horizonatally or vertically. Mutually noncapturing rooks refers to the placement of rooks on the board where each one is unable to conquer another. Therefore, no rook shares either a column or a row with another rook. Our example follows this rule, because we can not have two letters in one position, and we also can’t have the same letter in multiple positions. rk(B) is the number of placements of k mutually noncapturing rooks on board B.

The rook polynomial of B r(x, B) is formed by the generating function for rk

2 r(x, B) = r0(B) + r1(B)x + r2(B)x + .... 162

Solving recurrence relations with generating func- tions

Solving Recurrence Relations with Generating Functions

We can say that a function g(x) is a generating function for the recurrence 2 relation an if g(x) = a0 + a1x + a2x .... Another way of thinking about this is n that an is the coefficient on x .

Example: Solve an = an−1 − 5 when a0 = 7 using generating functions. P∞ n We need to get our recurrence relation in the form g(x) = n=0 anx . (note: the recurrence relation only applies if n ≥ 1) P∞ n P∞ n P∞ n Start with g(x) − a0 = n=1 anx = n=1(an−1 − 5)x = n=1 an−1x − P∞ n n=1 5x Looking at the first of these two terms:

∞ ∞ ∞ X n X n−1 X k an−1x = x an−1x = akx = xg(x) n=1 n=1 k=0

The purpose of this step was to make the subscript of the an term match the exponent on x so that the summation could be made from 0 to ∞, which in turn could be directly related to g(x). Looking at the second of the two terms:

∞ ∞ X X 1 −5xn = −5 xn = −5x ∗ (1 + x + x2 + ...) = −5x 1 − x n=1 n=1

1 Now we have g(x) − a0 = g(x) − 7 = xg(x) − 5x 1−x . This is sometimes called the functional equations for g(x). 7 5 Solving for g(x), g(x) = 1−x − (1−x)2 . We need the coefficient on xn. To get this, we write g(x) as a sum again:

∞ ∞ ∞ ∞ X X n + 2 − 1 X X n + 2 − 1 g(x) = 7xn − 5x xn = 7xn − 5 xn+1 n n n=0 n=0 n=0 n=0

n n−1+2−1 So, the coefficient on x is 7 − 5 n−1 = 7 − 5n = an 163

Second Example

Say we want to solve the equation an = a(n − 1) + n where a0 = 1 where this sloves the problem how we find out the number of regions made by N lines. P∞ n We want the equation to look like g(x) = n=0 anx P∞ n so we start at g(x) − a0 = g(x) = n=1 anx

∞ X n = (an − 1 + n)x n=1 ∞ ∞ X n X n = an−1x + nx n=1 n=1 ∞ ∞ X n−1 X n = x an−1x + nx n=1 n=1 ∞ X = xg(x) + nxn n=1 1 = xg(x) + (1 − x)2 1 = g(x) − a = xg(x) + 0 (1 − x)2

Where the initial value is a0 = 1

1 = g(x) − 1 = xg(x) + (1 − x)2 1 = g(x)(1 − x) = 1 + (1 − x)2 1 x = g(x) = + 1 − x (1 − x)3 So now we want to find the coefficient of the equation:

∞ X x g(x) = xn + x (1 − x)3 n=0 ∞ ∞ X X n + 3 − 1 = xn + x xn n n=0 n=0 ∞ ∞ X X n + 3 − 1 = xn + x xn+1 n n=0 n=0 164 so we find out that the coefficient on xn is:

n − 1 + 3 − 1 n + 1 a = 1 + = 1 + N n − 1 n − 1

Spanning tree

Spanning Trees

Definition: Given a graph G, a spanning tree for G is a tree that is a subgraph of G using all of the vertices. Two techniques to build spanning trees:

• depth-first • breadth-first

Depth-first

Depth-first spanning trees are often used in search algorithms and computer networking theory. Here’s how to build a depth-first spanning tree:

• Choose a vertex to be the root • Travel the longest path that you can find without repeating any vertices. • Back-track from the bottom leaf and try to make alternate choices higher up in the tree. • Continue back-tracking and follow the path until all vertices are used.

Example 165

Breadth-first

Breadth-first spanning trees can be used to find the shortest path between two vertices on a graph. Here’s how to build a breadth-first spanning tree:

• Choose any vertex to be the root.

• Every vertex adjacent to the root becomes a child in the tree.

• Repeat this on each child, adding all possible children on each level before moving on. Do not repeat any vertices during this process.

In order to build a successful spanning tree, the graph G must be connected. Two applications:

• Path-Finding: In order to find a path from A to Z, start a spanning tree at A. If Z appears in the tree, then there is a path from A to Z; if not, then there is no path.

• Shortest Path-Finding: Use a breadth-first spanning tree, and the re- sult will automatically be the shortest path.

Spanning trees can also be used in networks to find a cost-minimal path.

Example

Find the shortest path from A to G. 166

• A is the starting point and therefore becomes the root

• B becomes the single child of A because A was of degree one in the original graph

• C and D both become children of B in the new spanning tree because they are both adjacent to B

• The paths continue and include F and H under C, and E and G under D; once these vertices have been put into the tree, they are connected only to the vertices they are adjacent to without repeating vertices.

The resulting spanning tree is

so the shortest path from A to G is ABDEG.

Sperner’s lemma

Emanuel Sperner

Emanuel Sperner was a German mathematician who lived from 1905 to 1980 and worked 40 of those years as a professor at various German universities. He is most famous for Sperner’s Theorem and Sperner’s Lemma, both of which he developed in the 1920’s. 167

The Basics

Some terms

• A lemma is a “helping theorem” or a theorem that is not valued on its own, but rather is used to prove other theorems. • A simplex is a basic geometric shape:

one-dimensional: line segment

A BAD (the problem vertices are green) and a GOOD triangulation.

two-dimensional: triangle three-dimensional: tetrahedron

• Triangulation is subdivision into simplices, or a “simplical subdivision.”

For Sperner’s lemma, we will be using triangulation of triangles, which means that any two sub-triangles either have: no common points, a common vertex, or a common side. The smaller triangles are called the faces of the triangulation, their vertices are the vertices, or nodes, of the triangulation, and their sides are the edges of the triangulation. See the examples to the right for one incorrect and one correct triangu- lation of a triangle.

The Lemma 168

A proper Sperner coloring of a triangulation

The vertices of a triangulation of a triangle are colored, or labeled, according to what is called a Sperner coloring or labeling, which is defined by the following characteristics:

1. the vertices of the original triangle receive three distinct labels 2. vertices of sub-triangles which lie on an edge of the original triangle must be labeled with one of the two labelings of the vertices forming the end- points of the edge 3. vertices of sub-triangles which lie in the interior of the original triangle may be colored with any of the three labels used for the vertices of the original triangle

Sperner’s Lemma says that there is at least one sub-triangle labeled with the three distinct labels. Such a sub-triangle is called completely labeled. Actually, there’s an odd number of completely labeled sub-triangles. How many do you see in the graph above?

Proofs

The one-dimensional version

In the one-dimensional version of Sperner’s lemma, a line segment is divided into sub-segments. The endpoints of the segment are labeled with two distinct labels, and the vertices along the segment (which form the sub-segments) are each labeled with one of those two labels (following the rules of a Sperner labeling in one-dimension). Sperner’s Lemma says that there will be at least one sub-segment whose endpoints are labeled with the two distinct labels. One proof of this version works by making another graph of the line segment. Each sub-segment becomes a vertex and the region outside the whole segment is a vertex. Two vertices are adjacent if the vertex between the two sub-segments they represent is labeled with a particular one of the two labels. (This label is chosen arbitrarily, as will be demonstrated in the following complete proof.) Let’s say that the labels are 1 and 2, as shown in the graph pictured below. A random number of vertices are places along the segment to create sub-segments, and those vertices are randomly labeled with either a 1 or a 2.

Now we will construct the new graph. Vertices will be adjacent if they have a 1 labeling between them. The images below show the new graph on top of the 169 old one, and then the new one by itself. The labels are left in that graph for clarity. It should be evident that the vertex representing the region outside the original segment has been placed to the far left, although it makes no difference where it is placed.

As can be seen in these graphs, the vertex that represents the region outside of the segment has degree one. It will always have degree one, since it is only adjacent to the vertex representing the sub-segment on the end (next to the endpoint labeled 1). Also, we know that the only possible degrees of the other vertices are 0, 1 and 2. A sub-segment/vertex with 2’s on both sides has degree 0, a vertex with a 1 on one side and a 2 on the other has degree 1, and a vertex with 1’s on either side has degree 2. Note that the only odd number of degrees is 1, which corresponds to a sub-segment with endpoints labeled 1 and 2. That is, a vertex in the new graph that has an odd degree corresponds to a completely labeled sub-segment. Now, by the odd-degree corollary, which says that in any (finite) graph, the number of vertices of odd degree is even, remembering that the vertex in the new graph representing the region outside of the line segment always has degree 1 (an odd value), we can say that there must be an odd number of vertices representing sub-segments of odd degree. (odd + odd = even). Since the only vertices with odd degree represent completely labeled sub-segments, there must be an odd number of completely labeled sub-segments. It follows that there must be at least one of them, based on the fact that the smallest (nonnegative) odd number is 1. It may be argued that this proof is trivial, since it is obvious to the casual observer that there must be at least one sub-segment labeled with a 1 and 2. (Think about it.) However, this proof uses more objective, less intuitive reasoning, and also provides a basis for the way in which the two-dimensional case is proved.

The two-dimensional version

We will begin with the example of a Sperner coloring (or labeling) of a triangu- lation of a triangle given in The Basics. Similarly to the proof of Sperner’s Lemma in one dimension, we will construct a new graph, in which the vertices represent the sub-triangles (also called faces or regions) of the original graph, including a vertex for the region outside the triangle. In two dimensions, two vertices are adjacent if the edge between the 170 sub-triangles they represent is labeled with a particular two of the three labels or colors. For this proof, those colors will be red and pink. Using the one-dimensional case it can be proven that (in the original graph) there is an odd number of sub-segments along the edge of the big triangle, which connects the vertices colored with red and pink, that themselves have endpoints colored red and pink.

right

When we construct our new graph (shown to the right, on top of the old graph), the degree of the vertex representing the region outside the triangle (placed for convenience in the upper right of the graph) is equal to the number of sub- segments colored red and pink along the edge just described. Since that number is odd, the vertex has odd degree. The possibilities for the degrees of vertices representing sub-triangles are again 0, 1, and 2. Where r = red, p = pink, and b = blue, if the sub-triangle has vertices colored (r,r,r), (p,p,p), (b,b,b), (b,p,p), (b,b,p), (b,r,r), or (b,b,r), then the vertex representing that sub-triangle in the new graph has degree 0. That is, there is not both a red and pink vertex, so there is no edge connecting them, which would make the vertex representing that sub-triangle adjacent to the vertex representing the sub-triangle on the other side of the edge. Sub-triangles with (r,p,p) or (r,r,p) have two edges with red and pink vertices as endpoints, so the corresponding vertices have degree 2. The only way to have a vertex of degree 1 is to have a completely labeled sub- triangle. This follows from the fact that the sub-triangle must have exactly one red vertex and one pink vertex (to form exactly one edge with red and pink vertices), meaning that the third vertex must be blue. As in the one-dimensional case, a degree of 1 is the only odd degree, so vertices of odd degree correspond to completely labeled sub-triangles. The second graph on the right shows the completely labeled sub-triangles shaded, so that it can easily be seen that they are indeed the sub-triangles whose corre- sponding vertices in the new graph have odd degree, or degree 1. Following a similar argument as that used in proving the one-dimensional case, because the vertex representing the region outside the triangle has odd degree and (by the odd-degree corollary) the number of vertices with odd degree must be even, there must be an odd number of vertices of odd degree which represent 171 sub-triangles. Since the only way to have a vertex representing a sub-triangle of odd degree is for the sub-triangle to be completely labeled, there must be an odd number of completely labeled sub-triangles. One being the smallest odd number, there must be at least one.

Higher Dimensions

To take Sperner’s lemma into n dimensions, an n -dimensional simplex is created (which has n + 1 vertices). The simplex is triangulated or subdivided into simplices that are also n -dimensional. The vertices of the original simplex are labeled with n + 1 distinct labels, and vertices located on a face of the triangulation are labeled only using the labels of the vertices forming the face. This multi-dimensional version of Sperner’s Lemma is proven by induction using the two-dimensional case.

Applications

As explained in the definition of a lemma (see The Basics), Sperner’s lemma is an important theorem only because of its usefulness in proving other theorems. The primary theorem which makes use of Sperner’s Lemma is Brouwer’s fixed point theorem, which forms a basis for fixed point theory.

Brouwer’s fixed point theorem

Brouwer’s fixed point theorem says that if there is a continuous function which maps some shape or object onto itself, there will always be one fixed point. This means that given a mapping function f and a point P , f(P ) = P . One example of this is stirring a glass of water. When the molecules stop moving, there will be one molecule that is in the same place it was before the stirring began. Another example involves two identical pieces of paper. If one of the pieces is crumpled and set on top of the other, there will be one point on that paper that lies directly above the corresponding point of the uncrumpled paper. The proof of Brouwer’s fixed point theorem assumes that either a triangle is being mapped onto itself, or another two-dimensional space is being mapped onto a triangle. Then a series of triangulations of decreasing size is constructed, and Sperner’s lemma is used to help conclude that the convergence of the series proves the existence of a fixed point. 172

An Exercise

Create a triangulation of a triangle that can be labeled so that the vertices of each sub-triangle are labeled with (the same) three distinct labels. The labeling need not follow the regular rules of a Sperner labeling, but only three labels may be used for the whole graph. Now, similar to the proofs, and map-coloring, create a new graph which has as vertices the regions of the old graph (the region outside the original triangle need not be counted). These new vertices are adjacent if the regions they represent have a common edge. Question: what is the chromatic number of this graph?

References

Cut-the-knot.org. http://www.cut-the-knot.org/do you know/poincare.shtml Project Links. Rensselaer Polytechnic Institute. “Graph Theory: Sperner’s Lemma.” http://links.math.rpi.edu/devmodules/graph sperner/index.html Shashkin, Yu. A. “Sperner’s Lemma.” Fixed Points. Providence, RI: American Mathematical Society, 1991. West, Douglas.Introduction to Graph Theory 2nd Ed. Prentice Hall, 2001. Wikipedia. “Sperner’s Lemma.” http://en.wikipedia.org/wiki/Sperner%27s lemma “Emanuel Sperner.” http://en.wikipedia.org/wiki/Emanuel Sperner

Spherical and Toroidal Graphs

Introduction

A sphere graph is any graph G that can be embedded on the surface of a sphere without edge crossings. Our discussion of graph theory in class has focused on the types and properties of plane graphs, or graphs that are drawn on a plane. It is very useful to discuss the relationship between plane and sphere graphs, especially because we live on a spherical earth but represent it on flat maps. Torus graphs are another type graph that share some properties with sphere and plane graphs, but also have some unique properties. I will present in this paper some of the relationships that exist between plane, sphere, and torus graphs.

Stereographic Projection

One way to view the relationship between sphere graphs and plane graphs is through projection. An easy way to understand stereographic projection is by 173 imagining a translucent globe, sitting on a piece of paper, and holding a light at the north pole. The way that the light passes through each point of the sphere and onto the paper is the same way that stereographic projection projects a graph onto a plane.[52] Projection is a process by which a graph on a sphere is projected onto a plane. This method projects graphs embedded in the sphere M onto a plane O. Sphere M has two opposite poles N and S. To discuss this:

• Mwill lay tangent to the plane at S.

• A point P on M is projected onto O by drawing a line from N, through P and extending it through O.

• The point at which the line intersects O is called P 0.[39]

This method is often used where plane N passes through the center of M through the equator:

This a projection of a sphere with latitude and longitude markings where the poles lay on the y-axis at points (0,r,0) and (0,-r,0), and latitude 0 passes through the x-axis at point (r,0,0) and (-r,0,0): 174

[39] This grid represents how the earth is projected onto a flat map. Looking at this picture you can see that there is some distortion from the original graph. The lower hemisphere is represented projected entirely inside of the darker circle created by the equator. This hemisphere has slight distortion since the surface area of the hemisphere is larger than the area of the circle. However, the upper hemisphere, represented by the red lines, is largely distorted, especially toward the upper pole(not the north pole of the globe which lies on the y-axis, but the upper pole that lays on the z-axis). The upper pole actually goes off to inifinity because a line tangent to to the upper pole will never intersect the plane.[39]

Proof of planarity

Thinking about the relationship between sphere and plane graphs in terms of stereographic projection we can prove that any planar graph can be drawn on a sphere also without any edge crossings. We have sphere M with opposite poles N and S and projection plane O which passes through the center of M at the equator, all embedded into the three dimensional cartesian coordinate system. We also have a graph G embedded in the sphere, without any edge crossings.

• If G has no edge crossings, no two points on any two edges of G share the same coordinates, except at the vertices. • A line through N and a point on the sphere P passes through a distinct point on O • If no two points on any two edges in G share the same coordinates, except at the vertices, then the lines from those points to N interesect O at different points • For two edges to intersect on O they must have the same coordinates at one point. 175

• Therefore, if a graph G is drawn on a sphere without edge crossings, it can also be drawn on a plane without edge crossings.

This still leaves the question of whether or not any planar graph can be drawn on a sphere, but if we use the same reasoning as in the above proof, the answer to this question is easy. We can see that any graph drawn on a plane can also be drawn on sphere if we just reverse the projection method. Then, using the proof above, we can show that if no two edges of the graph cross in the plane, they can not cross on the sphere. Therefore, any planar graph can be drawn on a spehre without edge crossings. Now we can put these two facts together to come up with a theorem:

Theorem

”’A graph is both planar and spherical if it can be drawn on either a plane or a sphere without edge crossings”’

Conclusion

This theorem shows us that planarity is equivalent for sphere and plane graphs. This leads us to a conclusion about the chromatic number for a sphere graph. If a planar graph is four colorable because Kn is planar for n ≤ 4, than sphere graphs must also be four colorable because its planarity is the same. We can now see that planar graphs and sphere graphs are very closley related share many of the same properties.

Toroidal Graphs

A torus is a three dimensional surface in the shape of a donut. Here is an example:

Torus graphs are more difficult to draw and imagine than spherical graphs are. So we must find a way to represent a torus graph with a model that is eaier to work with. To do this, imagine a piece of paper. Tape the edges together at opposite ends so that you now have a cylinder. Now if you tape the two ends together, you will have a torus. If you unroll the piece of paper again, you can see begin to understand how graphs on a torus work. Opposite ends of the 176 paper were tpaed together, meaning if you drew a line off the right side of the paper, it would begin on the left. It is the same with the upper and lower ends. Using this model we can think about and draw torus graphs on planes with boundaries with the condition that going over the boundary brings you back to the other side. [31]Here is an example of a torus graph represented on a plane:

Using this representation we can see that any graph that can be drawn on a plane can be drawn on a torus the same way because a torus can be represented as a plane. However, torus graphs have a unique characteristic that allow for some properties that may not be true of plane graphs. For example, any planar graph can be drawn on a torus without edge crossings, but we must look to see if any toroidal graph can also be drawn on a plane without any edge crossings. To test this, we can look at non-planar graphs to see if they are toroidal.

In a plane, any graph containing a K5 or K3,3 as a subgraph is not planar. So we can use these to test for toroidal graphs. We will test the complete bipartite graph K3,3

First we try the circle chord technique on the toroidal plane: 177

We can’t connect the final edge (5, 2) without crossing the edges on the regular plane, but on the toroidal plane we can rewrite the (3, 4) edge and add the (5, 2) edge without crossing:

So we know that there are toroidal graphs that cannot be drawn on a plane without edge crossings.

Torus Coloring

We can also look at graph coloring on the torus. We know that a complete graph is a graph where each vertex is connected to every other vertex in the graph. In a Kn, there is a minimum requirement of n colors to color the graph. We will try to make a K5 graph: Start by completing the circle-chord technique as far as possible:

Then add the missing edges by drawing edges through the boundaries:

The maximum necessary coloring for a g-holed torus is given the the Heawood Conjecture, which states: √ • g(χ) =c1/2(7 + 48g + 1) where χ is the chromatic number of the graph.[13] 178

Plugging 1 into this equation gives us 7. This means that for the torus, all maps drawn on the surface can be colored with no more than 7 colors. This also means that it is possible to draw a K7 graph on a torus. An example of torus with a 7-color map is shown here:

This picture shows each of the regions of the 7-color torus, along with its neces- sary color. Using this picture, if you made a torus through the folding process that was previously discussed, each region would lay adjacent to the other 6. This represents a K7 graph on the torus which requires 7 colors. [13]

Conlcusion

Torus graphs share some of the same characteristics as plane graphs because all plane graphs can be drawn on the torus plane. However, torus graphs have many unique qualities because the boundaries on their planar representaitons.

Excercises

1. If a graph G is a sphere graph, where one edge of G passes through the northern pole, can G be projected onto a planar graph? Explain.

2. Draw a K6 on the toroidal plane.

References

See the bibliography section.

Stirling’s Formula

Definition

Stirling’s Formula, also known as Stirling’s Approximation is a formula used to find an approximation for factorials where n is a large integer. 179

n n The formula is: ln(n!) ≈ nlnn − n or n! ≈ ( e ) . This formula can also be written as a limit function: lim √ n! = 1 n→∞ n n (2nπ)( e ) p n n or n! ≈ (2nπ)( e ) . [9]

History of Stirling’s Formula

Stirling’s Formula was first discovered by Abraham De Moivre in the early 18th century. De Moivre is known for his work with probability and analytical trigonometry. The original form of the formula, where c

n+ 1 −n n! ≈ c ∗ n 2 ∗ e

[25] [29]

Proof

Let’s do this in steps. De Moivre and Stirling both started off with the same equation: n! (1) n! (2) log(n!) = log(1) + log(2) + ··· + log(n) R n R n+1 (3) n−1 log(x)dx < log(n) < n log(x)dx R N R n+1 (4) F or n ≥ 1, use n = 1, 2, 3 ...,N : 0 log(x)dx < log(N!) < n log(x)dx (5) Now use the antiderivative of log(x) n log(n) − n < log(n!) < (n + 1) log(n + 1) − n 1 (6) Set dn = log(n!) − (n + 2 ) log(n) + n 1 1 (7) dn − dn+1 = (n + 2 ) log(n + 2 ) − 1 1 n+1 1+ 2n+1 (8) By using algebraic manipulation : n = 1 1− 2n+1 1 1+t 1 3 1 5 (9) Now use T aylor Expansion : 2 log( 1−t ) = t + 3 t + 5 t + ... 1 1 1 1 (10) W ith −1 < t < 1 : dn − dn+1 = 3 (2n+1)2 + 5 (2n+1)4 + ... 1 1 1 (11) W hich implies : 0 < dn − dn+1 < 3 ( (2n+1)2 + (2n+1)4 + ... ) 1 1 1 1 1 (12) W hich now implies : 0 < dn − dn+1 < 3 (2n+1)2−1 = 12 ( n − n+1 ) 180

(13) T his implies that dn converges to a number c : limn→∞ dn = limn→∞ dn − 1 12n = c n! c (14) T ake the exponent of dn : limn→∞ (n+ 1 ) = e n 2 ∗e−n √ c (2)(2)(4)(4)(6)(6)...(2n)(2n) (15) By using the W allis F ormula we can show e = 2π : limn→∞ (1)(1)(3)(3)(5)(5)...(2n−1)(2n−1)(2n+1) = π 2 (2)(4)(6)...(2n) (16) → √ ≈ p π (1)(3)(5)...(2n−1)( 2n) 2

(2nn!)2 (17) √1 ≈ p π (2n)! 2n 2 (n+ 1 ) −n c (18) n! ≈ n 2 ∗ e ∗ e

22n(n2n+1e−2ne2c) (19) √1 ≈ p π (2n+ 1 ) 2 (2n) 2 e−2nec 2n √ (20) T hrough algebra you get ec ≈ 2π 0 0 (21) W ith this√ Stirling modified De Moivre s F ormula to get Stirling s (n+ 1 ) −n F ormula : n! ≈ 2π ∗ n 2 ∗ e [33] [42] [48]

Error Estimates

1 Stirling’s Formula solves n! with an error smaller than 4 % for integers of n ≤ 20. The error decreases as n ≥ 20 down to 3.5 ∗ 10−7%. The error percentage for factorials as numbers get too high to calculate by hand or calculator have a very low error percetage; and are therefore very accurate. [41]

Uses & Applications

Stirling’s Formula can be used in many mathematical situations and equations. For example the most common use of Stirling’s Formula is to solve for large factorials. It is also used to approximate Γ(n + 1) for large real n. This implies √ 2nπnne−n the ratio rn = n! as n → ∞. An example to show factorial approximation:

3598696 r 0 = = 0.9917 1 3628800 Stirling’s Formula is less than 1% error for n as small as 10. An example of a probability problem where Stirling’s Formula could be used: 181

The probability of obtaining n heads and n tails in 2n tosses of a balanced coin 2n −2n is given by f(n) = n 2 . [43]

Exercises

(1) Approximate 1000! by Stirling’s Formula (2) Use Stirling’s Formula to approximate 631! n n (3) Explain why S(n, n−2) = 3 +3 4 , and find a similar formula for S(n, n− 3). (4) Find the probabililty of obtaining 50 heads and 50 tails from 100 tosses of a balanced coin. (5) Why can Stirling’s Formula be written as both an equation and as a limit? [55] [38] [1] [28]

Stirling’s Series

Stirling’s Formula also happens to be the first approximation of the Stirling Series; also founded by James Stirling. Stirling’s Series is the asymptotic ex- pansion of the which looks like:

1 1 1 1 lnn! = nlnn − n + ln(2πn) + − + − ... 2 12n 360n3 1260n5

[6] [54]

References

See the bibliography section.

Subdivision

Subdivision is a new graph created by adding extra vertices onto existing edges. Subdividing a graph does not change its planarity. Do not confuse this with a subgraph; a subgraph contains some of the edges and vertices of the original graph but does not add any vertices. 182

The Birthday Paradox

The Birthday Paradox states that given 23 persons, there is more than 50% chance that 2 of them share the same birthday. Let us look at the probability for 25 persons: What is the probability that two (or more) people in a random group of 25 people have the same birthday? Assuming equal distribution of birthdays among 365 days, and ignoring leap years, we have 365 days and thus 365 choices of days. Total possible birthdays for 25 persons, each having 365 days to “choose” from: 36525 If all 25 persons have different birthdays:

365364363 341 = ... 1 1 1 1 = (365)(364)(363)...(341) 365! = 340! = P (365, 25) Probability of all 25 being of different birthdays: P (365, 25) P r(all different) = 36525

The probability of 2 or more persons having the same birthday is the comple- ment each person having a different birthday, thus: P (365, 25) P r(≥ 2 same) = 1 − 36525 = .568699704 ≈ .57

Following this method, the probability of two (or more) persons having the same birthdays given n people can be approximated: n probability 10 1.6948% 20 41.1438% 23 50.7297% 30 70.6316% 40 89.1232% 50 97.0374% 100 99.99996% 366 100% 183

See if it works: Ask everyone on your floor their birthdays. Does anyone have the same birthday as you? How would the probabilities change if we were looking for the same month? How would the problem change if we accounted for February 29th?

The Inclusion/Exclusion Principle

Notation: (write A1 ∩ A2 as A1A2)

We will find a way to determine N(A1A2...An) (the intersection of all things in sets A1...An) using an alternating sum. First we let N = all the things in the universe. P then let S1 = i N(Ai) = N(A1) + N(A2) + ... + N(An) P then let S2 = i,j N(Ai ∩ Aj) (sum of all two-fold intersections) P then let S3 = i,j,k N(Ai ∩ Aj ∩ Ak) (sum of all three-fold intersections) let Si = sum of all i-fold intersections Theorem: n N(A¯1 ∩ A¯2 ∩ ... ∩ A¯n) or N(A¯1A¯2...A¯n) = N − S1 + S2 − S3 + ... + (−1) Sn Corollary

n+1 N(A1 ∪ A2 ∪ ... ∪ An) = S1 − S2 + S3 − .. + (−1) Sn

Example 1

How many 5 card hands are there with at least one card from each suit? U = all five card hands

A1 = hands with no hearts

A2 = hands with no clubs

A3 = hands with no spades

A4 = hands with no diamonds

Then we are looking for A¯1A¯2A¯3A¯4 and N(A¯1...A¯4) = N − S1 + S2 − S3 + S4

52 N = 5

S1 = N(A1) + ... + N(A4) 39 N(A1) = 5 and N(A2),N(A3),N(A4) are the same. 184

39 S = 4 1 5

S2 = N(A1A2) + N(A1A3) + ... 4 each of the terms is equal, and there are 2 of them. The number of 5 card hands with no hearts and no clubs:

26 N(A A ) = 1 2 5 426 S = 2 2 5 4 S3 = N(A1A2A3) + ... each term is equal and there are 3

13 N(A A A ) = 1 2 3 5 413 S = 3 3 5

S4 = N(A1A2A3A4) = 0 52 39 426 413 N(A¯ A¯ A¯ A¯ ) = − 4 + − 1 2 3 4 5 5 2 5 3 5

Example 2

How many proper colorings of the graph on the right are there using n colors? (A proper graph has no vertices of the same color connected by an edge.)

Let the universe be all possible colorings of the graph (proper and improper) using n colors.

A1 = the colorings in which both vertices at the ends of e1 are the same color

A2 = the colorings in which both vertices at the ends of e2 are the same color 185

A3 = the colorings in which both vertices at the ends of e3 are the same color

A4 = the colorings in which both vertices at the ends of e4 are the same color

A5 = the colorings in which both vertices at the ends of e5 are the same color The representation of all of the proper colorings of the graph is:

(A¯1A¯2A¯3A¯4A¯5) To determine the number of proper colorings of the graph, we will use the Inclusion/Exclusion Principle, and solve for each component (Si). N = n4 since there are four vertices, and each of them have n choices of color 3 N(Ai) = n since one color would be used for two adjacent vertices and two other colors would be used for the other vertices. We will multiple the 0 answer by five, since there are five Ais. 3 S1 = 5n 2 N(AiAj) = n because one color would be used for the three con- nected vertices, and another color would be used for the last vertex. There are 5 2 combinations for the edges, so we will multiply our answer by that. 5 2 S2 = 2 n 2 N(A1A2A3) = N(A3A4A5) = n since three of the vertices will be the same color, and the fourth one will be a different color. All other triple intersections will cover all four vertices, so the number of colors will be n. There 5 2 are 3 triple intersections, so two of them will have n proper colorings, and 5 ( 3 − 2) of them will have n proper colorings. 2 5 S3 = 2n + ( 3 − 2)n

N(AiAjAkAm) = n since all of the vertices will be the same color. 5 There are 4 of these intersections. 5 S4 = 4 n

N(A1A2A3A4A5) = n since all of the vertices will have to be the same color. There is only one intersection of these five conditions.

S5 = n The number of proper colorings of the graph (called the chromatic polynomial of G) is: ¯ ¯ ¯ ¯ ¯ 4 3 5 2 2 5 5 (A1A2A3A4A5) = n − 5n + 2 n − (2n + ( 3 − 2)n) + 4 n − n. 186

Towers of Hanoi

This is a puzzle comprised of three components. The first component is a board as its base. The second component is three pegs that come out of the base. And the final component is a stack of rings, with each ring getting smaller as you go toward the top of the peg. You can also play the game online6. It looks like this:

The Challenge

The whole point of the puzzle is to get a stack of pegs from the first peg to the last peg, only moving one peg at a time. Also, a bigger ring can never be on top of a smaller ring at any point in the completion of this task. (Note: a ring can move to any peg, not just a peg right beside it). The question to answer is: How many ways are there to move the puzzle with n rings?

The Result

The answer is found using recursion. The way to think of it is this. First, you must find the way to move all the rings, except for the base ring, from the first peg to the middle peg. Then, all that has to happen is to move the base peg to the final peg, and then repeat the first step so that all the rings end up on the last peg. To put this in terms of a function, it is f(n) = f(n − 1) + 1 + f(n − 1) OR

f(n) = 2f(n − 1) + 1 with a base case of: f(1) = 1.

6http://www.mazeworks.com/hanoi 187

Traveling salesman problem

A salesman starts at house A and needs to go to each of the three other houses, B, C, and D in the neighborhood and return to A in the shortest distance. How can we find this distance?

One way to solve this problem would be to find all possible Hamilton cir- cuits, calculate the distance traveled for each one, and choose the minimum value. However, this method proves tedious and inefficient as the difficulty grows factorially with the size of the graph, which is called factorial complexity. The difficulty depends on n factorially.

n ∗ (n − 1) ∗ (n − 2)... = n! A better way to solve this problem is the Approximate Tour Construction.

An example and an interesting question 188

The most “cost-efficient” circuit of the K6 graph shown above (with its corre- sponding cost matrix) can be estimated using the Approximate Tour Construc- tion (ATC) Method. For example, in class, we found the circuit AEF DCBA, which has cost 26. An interesting question is: what difference would it make to start with a different vertex? To answer this, I tried it. I used the ATC, starting with every vertex, and including all the different ciruits that could be made within those starting points (because of vertices of equal “closeness” to the subcircuit). I came up with:

So, the answer is: it makes a big difference what vertex you start with! If only there were some way to tell which one is best... However, the circuits produced by this method do seem to give a helpful range for the minimum cost. (Actually the ATC always gives answers in the range of less than or equal to twice the minimum cost–see the theorem below). Another interesting question is: what is the actual minimum cost for this graph? Is it 15? Surprisingly, no! As an example, the tour A − D − B − C − E − F − A has cost of 4 + 1 + 2 + 5 + 1 + 1 = 14. There are most likely other examples to show the Approxiamate Tour Construction is not perfect. However, the theorem below does establish the process as appropriate for creating an approxiamate tour.

Theorem

The approximate tour construction generates a cost of the tour that is less than or equal to twice the minimal cost. 189

Tree

A tree, as in real life

A tree shepherd, as in Lord of the Rings

A tree is a connected graph that has only circuits of a trivial nature. A rooted tree is a connected directed graph with one vertex called the root such that there is a unique path from the root to any other vertex.

Terminology

A tree, as used in graph theory

Generational language

In a rooted tree with edge (a, b), we say b is a child of a, and a is a parent of b. Two vertices with the same parent are called siblings. Similarly, ancestors 190 and descendents are also used to describe relations between certain vertices.

Arboreal language

A vertex with no child is called a leaf. Any vertex that is not a leaf is called an internal vertex (the root is an example of an internal vertex).

Arity (ary-ness)

If a rooted tree is such that every internal vertex has m children, then the tree is called m-ary. Special terms are used for trees where every internal vertex has one child or two children. A tree with one child for each internal vertex is called unary, and a tree with two children for each internal vertex is called binary.

Other terminology

• level number - The edge-distance, that is the number of edges from the root to a given vertex, is called the level number of that vertex.

• height - The height of a tree is the maximum # of edges required to get from the root to any particular leaf. The height is equal to the highest level number in the tree.

• balance - A tree is balanced if and only if all of the leaves are at level h or level h − 1; where h is the height of the tree.

NP-Complete

Steven Cook and Richar Sharp gave birth to the idea of NP-complete. A problem is NP-complete when it can be verified in polynomial time and there is an algorithm that can solve the problem that is also computationally equivalent to the solution algorithm for other hard set of problems.

• The traveling salesman problem is one example of an NP-complete prob- lem.

Theory

A tree with nvertices has n − 1edges. We know this is true, as every vertex in a tree is a child with the exception of the root. Each child is connected to the root by a path, so the number of 191 children in a tree is equal to the number of edges. Therefore, there must be one more vertex than there are edges, as the root, which is not a child, must be accounted for. If T is an m-ary tree with n vertices and i internal vertices, then n = mi + 1. Why? It is evident that the number of vertices n equals the numberofchildren+ 1 since the only vertex that is not a child is the root. Since every internal ver- tex has m children, the total number of children equals the number of internal vertices times m, or im. Thus, n = numberofchildren + 1 = mi + 1. Example How many vertices are in a 5-ary tree with 9 leaves?

n = mi + 1 n = 5i + 1 The total number of internal vertices, i, is the same as the total number of vertices, n, minus the number of leaves, l

n = 5(n − l) + 1 n = 5(n − 9) + 1 n = 5n − 45 + 1 => n = 11

Theorem

If T is m-ary of height h with leaves l, then:

• (a) if all of the leaves are at height h, then l = mh • (b) if all of the leaves are not at height h, then l < mh

If tree T is m − ary, with l leaves, and T is balanced, then h = dlogmle

Trees in computing

Examples of trees used in computer science include:

• Search algorithms - construct a tree to enable quick searches for stored data as used in AI. One may use a breadth-first search, which spans to all of the branches of one level before moving onto the next level, or may use a depth-first approach which looks down the levels of the tree to find the desired state. Depending on the structure of the tree being searched, constraints may have to be assigned (parameters to shorten the search) unless you really want to solve a NP-Complete problem. 192

• XML (and HTML) - the structure of an XML document that mimics a tree. XML terminology is very similar to tree terminology. In XML, a pseudo-language called XPath enables travel along the edges of the tree.

• Directory structures - the “folders” on your hard drive make a nice tree (if one ignores shortcuts).

The example we used in class to show a computer might search for names

Related Sites

• Spanning Trees

• Forest

• Binary search tree

Using combinations in statistics

Combinations are often used in the field of statistics. We will look at one problem where they prove very useful to us. If a student takes a 10 question multiple choice exam of which they have no prior knowledge of the test material (so they are purely guessing), what is the probability that they will get 0 right? 1 right? 2? 3? 4,...,10? (No partial credit can be given). We will first set up a table:

• x is the number of correctly answered questions

• p(x) is the probability of getting x questions correct on the exam

• n is the number of trials

x 0 1 2 3 4 5 6 7 8 9 10 p(x) 193

In order to know out what our p(x) values are, we must use what we’ve learned about combinations and binomials. We have to modify the Binomial theo- rem. p(0) = (1 − p)n is all of the failures and p(n) = pn is all of the successes. So, in order to get p(x) we multiply the number of successes and the number of failures. We get the resulting equation: p(x) = px(1 − p)n−x. However, if we just used that equation, then we would only have one combination of how you can get the answers wrong (for example, this equation would say that missing questions 1, 2, and 3 is the same as missing 4, 5, and 6 because each time you missed 3 questions. We want those to both count as two different ways to get n the questions wrong). So we want to use combinations: the combination of x . n x n−x Now we have p(x) = x p (1 − p) . This is the formula we will use to find the values for our table. n = 10 and p = .25 (you have a 1 in 4 chance of getting each question right)

• 10 p(0) = .250(1 − .25)10−0 ≈ .0563 0

• 10 p(1) = .251(1 − .25)10−1 ≈ .1877 1

10 2 10−2 • p(2) = 2 .25 (1 − .25) ≈ .2503

...

• 10 p(10) = .2510(1 − .25)10−10 ≈ 0 10

Filling in our table gives us: x 0 1 2 3 4 5 6 7 8 9 10 p(x) .0563 .1877 .2816 .2503 .1460 .0584 .0162 .0031 .0004 ≈ 0 ≈ 0 And looking at the table, we can deduce that a student is most likely to get 2 questions right on such an exam.

Varadarajan example

Arrangements with Repetition This example will lead to a formula that is helpful in solving these types of problems faster. 194

How many rearrangements can you make with the letters from the name: Varadarajan7? First, place the As.

11 • There are 5 As out of 11 letters, so there are 5 ways to place the As.

Given that As are placed, now let’s place the Rs.

6 • There are 6 remaining spots in which to place the 2 Rs, or 2 ways to place the Rs.

4 Having placed the As and Rs, there are 4 spots for V, or 1 choices. Similarly,

3 • 1 choices for D

2 • 1 choices for J

1 • 1 choices for N

116321 The total number of rearrangements is: 5 2 1 1 1 . This leads to the following theorem.

If we have n objects, with r1 of type 1, r2 of type 2,..., rm of type m, (So for r1 + r2 + ... + rm = n) Then the number of arrangements is n n−r1n−r1−r2...n−r1−r2−...−rm−1, r1 r2 r3 rm which is written P (n; r1, r2, ..., rm). More on this concept: Arrangements with repetition

Vertex

Definitions

Adjacency

A vertex is said to be adjacent to another if an edge exists between those two vertices.

7http://www.math.ucla.edu/~vsv/ 195

Path

A path is a sequence of adjacent vertices.

Cycle

A path through a graph that does not repeat any edges and ends where the path began.

Degree

The number of edges that connect with a given vertex is called the degree of that vertex.

Edge

A physical connection (usually in the form of a simple line) that exists between two vertices.

Trail

A path through a graph that does not repeat any edges and does not end where the path began.

Vertex

A vertex is the building block of a graph. A set of vertices, along with the set of connections between vertices (edges) define a graph. Vertices usually represent some real-world object or state. For example, a vertex can represent a node in a network, a state of a computer program, or tasks that need to be completed in a specific order.

Where chess meets mathematics

Where Chess Meets Mathematics

Albert Einstein once said that, “Chess holds its master in its own bonds, shack- ling the mind and brain so that the inner freedom of the very strongest must suffer.” Chess is a game that takes much thought and strategy to outwit the opponent and “trap” the opposing king. But what does a game with such a rich 196 history and continued popularity have anything to do with mathematics? The truth is that many mathematicians like Carl Friedrich Gauss have worked on different problems dealing with various pieces and variations of the traditional eight by eight chess board. Some problems discussed below include the eight queens problem and the knight’s tour.

Eight Queens Puzzle

The eight queens problem is one of “the oldest, and most famous, independence problem(s)” [47]. The problem consists of placing eight queens on a standard eight by eight chessboard so that each queen is unable to capture any other queen. The problem was first published back in 1848 by Max Bezzel in a Ger- man chess newspaper. Two years later the problem found its way to another newspaper by Franz Nauck, who proceeded to publish all of the 92 solutions cor- rectly months later. Nauck discussed this problem regularly with Gauss months before the article’s publication, where they figured out that there were indeed 92 solutions to this problem. Gauss’ mathematical genius combined with some logic and knowledge of the game of chess enabled him to come up with a remarkable solution. Knowing that each row and column could only contain one queen, Gauss realized he could use a permutation of the columns (one through eight) to get the queens to satisfy this condition. Now all he needed to do was find a way to make sure that the queens weren’t on the same diagonals. The example below shows his method of proving the independence of each queen using the permutation 2 4 6 8 3 1 5. If each sum of the column and row number is a unique integer, then no queens lie on the positive diagonal. If the sums are unique for the rows and the columns in descending order, then no queen lie on the negative diagonal[44].

This is a solution to the problem because the integers are distinct on both the positive and negetive diagonals meaning no queens are diagonal to each other. There is an easier algorithm to use to construct a solution the works only for 197 boards n x n where n = 1 or n ≥ 4. The process will be shown in parentheses on the standard eight by eight board. (2)

1. Divide n by 12. Remember the remainder. (8/12 has remainder 8)

2. Write a list of the even numbers from 2 to n in order. (2 4 6 8)

3. If the remainder is 3 or 9, move 2 to the end of the list. (2 4 6 8)

4. Write the odd numbers from 1 to n in order, but, if the remainder is 8, switch pairs (i.e. 3, 1, 7, 5, 11, 9, ...). (3 1 7 5)

5. If the remainder is 2, switch the places of 1 and 3, then move 5 to the end of the list. (3 1 7 5)

6. If the remainder is 3 or 9, move 1 and 3 to the end of the list. (3 1 7 5)

7. Place the first-column queen in the row with the first number in the list, place the second-column queen in the row with the second number in the list, etc. (2 4 6 8 3 1 7 5), which is the example used in the example from Gauss above.[20]

Try using this algorithm to find a solution for an n x n board with n queens where n=10, 13, 15. One last algorithm to look at is one used primarily for computer program- ming called brute-force algorithm (or brute-force search). The programmer gets the computer to look at all the different placements of the eight queens (64*63*62*61*60*59*58*57= 178,462,987,637,760 possible layouts for the queens) for placements that fit the criteria. Another algorithm which is somewhat bet- ter would be 88 putting only one queen in each row and then searching those 16,777,216 possible placements for ones that match criteria. Other program- mers try placing pieces to eliminate the number of possibilities. For example, there are only ten place to put the first queen (shown below) because the other spots are just reflections of the ten spots. By placing the queen, it leaves no more than 42 “safe” spaces (also shown below). After the first queen is put down there are still 10*42*41*40*39*38*37*36 = 1,359,707,731,200 possibilities that the computer has to check. This is obviously not a practical way to figure these out without the help of the computer analyzing the millions and billions of possibilities. 198

Kinght’s Tour

Another intriguing problem is called the knight’s tour. A knight starts at any spot on the board and moves around in its L-shaped pattern around the board touching every space exactly once. If the knight is able to move back to the starting space, then the path is said to be closed. However if the knight moves around the board, touching every space once and can’t get back to the starting space it is considered an open path. One major mathematician that looked at this problem was Euler because it is related to graph theory. It turns out that if each space is made a vertex and try to use each vertex once we are finding Hamilton paths and cycles with the restraint of having to move the knight in an L-shaped pattern. [27] Below is a knight’s tour on a five by five board.

This problem was first looked at on a standard eight by eight board, but now has been expanded to various board sizes. Allen Schwenk came up with a the- orem that determines whether or not there is a closed knight’s tour. Schwenk’s theorem states that for any m n board with m less than or equal to n, a closed knight’s tour is always possible unless one or more of these three conditions are true:

1. both m and n are odd 199

2. m = 1, 2, or 4 3. m = 3 and n = 4, 6, or 8[46]

This theorem proves that there are closed tours for the 5 x 6 and 3 x 10 boards. Find a closed tour for each of the two boards. A picture of both boards can be found below.

Domination

Domination is another major topic when it comes to the mathematics of chess. The idea is to place a certain piece at various spaces on the board to dominate (be able to attack) every space on the board. Below is two examples of queen domination.

The queens domination tends to be the most talked about out of all the dom- inations. On a standard eight by eight chess board five queens are needed to dominate they board. It has been calculated that there are 4860 ways to place the queens to dominate the board. Find one of these dominations using 5 queens on an eight by eight board with one restriction: the queens must be placed on the main diagonal. Examples of other dominations on standard boards Top Left: Kinghts (N) Top Right: Rooks Bottom Left: Bishops (B) Bottom Right: Kings 200

Board Variations

Chess boards have taken various abnormal shapes as more studying has been done in this branch of mathematics. One strange form is the toroidal chessboard (a board wrapped around a torus). These kinds of boards are generally drawn flattened and look like a regular board, but the sides are connected as well as the top and bottom. It is generally easier to work with a flat board, knowing that because it really is a torus, special moves can be made to “cross” between one side and another because it is known that they are connected. Also some chess boards can be cylindrical. A cylindrical board is very similar to a torus, except that only one pair of opposite edges connect. Some cylindrical boards produce knight’s tours that normal boards of that size don’t have any.[36] 201

Chess isn’t usually thought of as a very mathematical game. John Watson in his book entitled Across the Board tell of how his brother showed him a magazine article about chess and its mathematical aspects. Although solving various problems isn’t actually playing the game of chess, it is still a very interesting field with lots to explore. Some topics that weren’t covered that are interesting include domination using different pieces, variations like the Klein bottle, a more in depth look at independence, Eulerian squares, and polyominoes. Chess and mathematics are very interesting subjects, but when combined together there is so much there that has been done and still more that has yet to be figured out. See the bibliography section. 202 Bibliography

[1] Maurer, Stephen B. & Anthony Ralston. Discrete Algorithmic Mathematics 1991. Page 477.

[2] Stop Minding Your P’s and Q’s: A Simplified O(n) Planar Embedding Algorithm. link8

[3] Treap Wikipedia (http://en.wikipedia.org/wiki/Treap)

[4] Devore, Jay L., Probability and Statistics: For Engineering and the Sci- ences, 2004, pages 174-179

[5] Circuits with Reused Edges, For all Practical Purposes: Mathematical Lit- eracy in Today’s World. 6th ed. W. H. Freeman and Company: New York, 2003.

[6] discrete>

[7] “Pentatope Number” http://en.wikipedia.org/wiki/Pentatopic number

[8] “Tetrahedral Number” http://en.wikipedia.org/wiki/Tetrahedral number

[9] Sethna, James P. Oxford University. Stirling’s Formula for N! 1997. http://www.lassp.cornell.edu/sethna/Cracks/Stirling.html

[10] More Detailed Discription, The Chinese Problem. http://people.bath.ac.uk/tjs20/detaileddescription.htm. 11/15/2006.

[11] Hutchinson, Joan. “Coloring Ordinary Maps, Maps of Empires, and Maps of the Moon.” Mathematics Magazine. Vol. 6, No.4, (October, 1993), pp.212-215

[12] Rabenstein, Albert, L., Introduction to Ordinary Differential Equations, 1966, pages 134-135

[13] Weisstein, Eric W. Torus Coloring. From MathWorld–A Wolfram Web Re- source. http://mathworld.wolfram.com/TorusColoring.html

8http://portal.acm.org/ft_gateway.cfm?id=314545\&type=pdf

203 204

[14] Tucker, Alan, Applied Combinatorics, 2002 [15] Stahl, Saul. “The Other Map Coloring Theorem.” Mathematics Magazine. Vol. 58, No. 3 (May, 1985), pp. 131-145. [16] Freimer, Robert. “Generalized map coloring for use in geographical in- formation systems.” Geographic Information Systems. New York: ACM Press, 2000, pp.167-173 [17] Ringel, G. Map Color Theorem. Springer-Verlag. New York:1974

[18] On the Cutting Edge: Simplified O(n) Planarity by Edge Addition link9 [19] Coxeter, H.S.M. “The Mathematics of Map Coloring.” Leonardo. Vol. 4, No. 3 (Summer, 1971), pp. 273-277. [20] Eight Queens Puzzle, Wikipedia Article, http://en.wikipedia.org/wiki/Eight queens [21] Wikipedia: Planar graph link10 [22] Seidel, Raymund G. and Cecilia R. Aragon: Randomized search trees. Al- gorithmica, 1996 [23] Havil, Julian, Gamma: Exploring Euler’s Constant, 2003 [24] O’Connor, J.J. and E. F. Robertson, “Percy John Heawood”, http://www- groups.dcs.st-and.ac.uk/ history/Biographies/Heawood.html [25] University of St Andrews, Scotland. 1998. Stirling Biography 1998. http://www-history.mcs.st-andrews.ac.uk/Biographies/Stirling.html [26] History of the Problem, The Chinese Problem. http://people.bath.ac.uk/tjs20/historyofproblem.htm. 11/15/2006. [27] Knight’s Tour, Wikipedia Article, http://en.wikipedia.org/wiki/Knight%27s tour [28] Hillman, Abraham P., Gerald L. Alexanderson & Richard M. Grassl. Dis- crete and Combinatorial Mathematics 1987. Pages 262,292. [29] Eves, Howard. An Introduction To The History Of Mathematics 6th Edition 1990. Pages 429, 457. [30] O’Connor, J.J. and E.F. Robertson, Friedrich Wilhelm Bessel, http://www-history.mcs.st-andrews.ac.uk/Biographies/Bessel.html, 1997 [31] Staecker, Chris, Professor of Mathematics, Messiah College. [32] Harary, Frank. “Some Historical and Intuitive Aspects of Graph Theory.” SIAM Review. Vol. 2, No. 2 (Apr., 1960), pp. 123-131.

9http://jgaa.info/accepted/2004/BoyerMyrvold2004.8.3.pdf 10http://en.wikipedia.org/wiki/Planar_graph 205

[33] Beyer, William H. Handbook of Mathematical Sciences 6th Edition Boca Raton, Florida. 1987. [34] Zill, , Dennis G., A First Course in Differential Equations, 2005, page 260. [35] Fill, James: On the distribution of binary search trees under the random permutation model. Random Structures and Algorithms, 1996 [36] Watkins, John, Across the Board: The Mathematics of Chessboard Prob- lems, 2004, page 65-73 [37] Adamchik, V.S., Multiple Gamma Function and Its Application to Com- putation of Series, http://www.cs.cmu.edu/ adamchik/articles/rama.pdf, 2000 [38] demoivre> [39] Dutch, Steven, Spherical Projections, http://www.uwgb.edu/dutchs/structge/sphproj.htm, 1999. [40] Weisstein, Eric W. “Empire Problem.” From MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/EmpireProblem.html [41] Zeghbroeck, Bart J. Van. Stirling’s Approximation 1997. http://ece.colorado.edu/ bart/book/stirling.htm [42] formula [43] Kalbfleisch, J.G. Probability and Statistical Inference. Volume 1: Probabil- ity Springer-Verlag New York, 1985. Pages 28-29. [44] Watkins, John, Across the Board: The Mathematics of Chessboard Prob- lems, 2004, page 164-166 [45] Uspenskii, V.A., Pascal’s Triangle, 1974, pages 14-16 [46] Knight’s Tour, Wikipedia Article, http://en.wikipedia.org/wiki/Knight%27s tour [47] Watkins, John, Across the Board: The Mathematics of Chessboard Prob- lems, 2004, page 164 [48] mathworld [49] Artin, Emil, The Gamma Function, 1964 [50] Beineke, Lowell W. “Are Graphs Finally Surfacing?” The College Mathe- matics Journal. Vol.20, No. 3 (May,1989), pp. 206-225 [51] Worked Example, The Chinese Problem. http://people.bath.ac.uk/tjs20/workedexample.htm. 11/15/2006. [52] Sullivan, John M., Stereographic Projection Demo,http://torus.math.uiuc.edu/jms/java/stereop/ 206

[53] Euler Graphs, http://www.people.vcu.edu/ gamerom/MAT131/euler.html 11/15/2006. [54]