Math 342 Class Wiki Fall 2006 2 Authors
Total Page:16
File Type:pdf, Size:1020Kb
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 Spheres, Toruses and Other Complex Solids 56 Euler cycle 62 Exponential generating function 64 Fibonacci Sequence and Pascal’s Triangle Relationship 66 Fibonacci sequence 67 Forest 68 Four color theorem 69 Four color theorem/Example 2: Chromatic Number 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 algorithms 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 algorithm 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 mathematics 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!) (factorial) 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.