Combinatorial Generati


 Clifford Stewart
 2 years ago
 Views:
Transcription
1 Combinatorial Generation Combinatorial Generation Combinatorial Generatio ombinatorial Generation Combinatorial Generati mbinatorial Generation Combinatorial Generat binatorial Generation Combinatorial Genera inatorial Generation Combinatorial Gener natorial Generation Combinatorial Gene atorial Generation Combinatorial Gen torial Generation Combinatorial Ge orial Generation Combinatorial G rial Generation Combinatorial October 1, 2003 ial Generation Combinatoria al Generation Combinatori l Generation Combinator Generation Combinato eneration Combinat neration Combina eration Combin ration Combi ation Comb tion Com Combinatorial Generation ion Co on C Working Version (1jCSC 425/520) n no comments printed; pseudocode version Co on Com ion Comb tion Combi ation Combin ration Combina eration Combinat neration Combinato Frank Ruskey eneration Combinator Generation Combinatori l Generation Department of Computer Science Combinatoria al Generation University of Victoria Combinatorial ial Generation Victoria, B.C. V8W 3P6 Combinatorial G rial Generation CANADA Combinatorial Ge orial Generation Combinatorial Gen torial Generation Combinatorial Gene atorial Generation Combinatorial Gener natorial Generation Combinatorial Genera inatorial Generation Combinatorial Generat binatorial Generation Combinatorial Generati mbinatorial Generation Combinatorial Generatio ombinatorial Generation Combinatorial Generation Combinatorial Generation
2 i The covers of your book are too far apart. George Bernard Shaw. No man but a blockhead ever wrote except for money. Dr. Samuel Johnson. Everything has been said before by someone. Alfred North Whitehead It is a wise father that knows his own child. William Shakespeare, The Merchant of Venice, Act II, Scene II, 73. good quote for chapter 8. There are various versions of this book. If there is a comment printed as a footnote to this sentence then comments to myself are printed. These contain bibliographic remarks, sources of info, rewriting suggestions, etc.
3 ii
4 Preface Humanity has long enjoyed making lists. All children delight in their newfound ability to count 1,2,3, etc., and it is a profound revelation that this process can be carried out indefinitely. The fascination of finding the next unknown prime or of listing the digits of π appeals to the general population, not just mathematicians. The desire to produce lists almost seems to be an innate part of our nature. Furthermore, the solution to many problems begins by listing the possibilities that can arise. There are lists of mathematical objects that have a historical interest, or maybe I should say that there are lists of historical objects that have a mathematical interest. Examples include the Fu Hsi sequencing of the hexagrams of the I Ching (e.g., as described in Martin Gardner  Knotted Donuts [148]) and the Murasaki diagrams of the Tale of the Genji (by Lady Shikibu Murasaki, 1000 A.D.) as explained in Gould [158]. Viewed properly, these are lists of the first 64 binary numbers 0, 1,..., 63 and all 52 partitions of a 5set, respectively. They are illustrated in Figures 1 and 2 at the end of this preface. However, it was not until the advent of the digital computer that the construction of long lists of combinatorial objects became a nontedious exercise. Indeed, some of the first applications of computers were for producing such lists. With the computer as our able assistant we can construct interesting lists to our hearts content. There is deeply satisfying feeling that one obtains by watching a well ordered list of combinatorial objects marching down the computer screen. The author hopes that the readers of this book will implement some of the algorithms found herein and experience this feeling for themselves! These lists are not only interesting but can be extremely useful. Nearly every computer scientist and mathematician has encountered some instance where they solved a problem simply by listing all the possibilities and checking for a desired property. One can find applications of the ideas in this book to circuit design, statistical computing, chemistry, and operations research, just to name a few. Ever since the 1960 s there has been a steady flow of new algorithms for constructing lists of combinatorial objects of various types. There is no widely accepted name for the field but I like to call it Combinatorial Generation. Many of the papers in the field have a title that contains the word generating. Unfortunately, generate is an overworked word in mathematics and computer science, so the name is not fully satisfying. A widely used alternative is enumerate, which, unfortunately, also has another widely accepted meaning, to count, as used in Goulden and Jackson s book Combinatorial Enumeration [157]. Some people use generate to mean generate uniformly at random. In algebra, generator is a term use for a subset of an algebraic structure that, via some operation, can produce the entire structure, as in the generators of a group. A good alternative title for the book would be Exhaustive Listing of Combinatorial Objects. Nevertheless, Combinatorial Generation is the name chosen and used in this book. iii
5 iv Several books contain chapters about generating combinatorial objects, but there is no book devoted solely to the subject (with pehaps the exception of Wilf s update [451] of [289]). The books of Nijenhuis and Wilf [289], and of Reingold, Nievergelt and Deo [340] contain such chapters and have provided an inspiration for me over the years. Many of the ideas of the present book can be traced back to these books. I would also like to mention the influential books of Even [115], Page and Wilson [296], Rohl [347], Wells [440], and Williamson [453], all of which contain interesting material on generating combinatorial objects. The forthcoming Volume 4 of the Art of Computer Programming by Knuth will contain material on combinatorial generation. The concern of this book is not with existence questions By an existence question we mean one of the form find a single instance of a combinatorial object with certain properties. These questions have quite different methods of attack and warrant a separate treatment, although backtracking, which is covered is a widely used technique for solving existence questions. Existence questions arise, for example, in the search for various types of block designs. The recent book of Kreher and Stinson [233] covers such techniques, as well as overlapping some of the exhaustive listing material discussed in this book. Of course, the particular topics that are treated here reflect my own personal choices about the elegance, importance and accessibility of particular topics not to mention that they are those with which I am most familiar and find most interesting. There is something of interest for many types of readers to be found in the chapters to follow. The reader who simply wants a fast algorithm to generate a wellknown class of objects will find it here. Many algorithms are fully implemented as Pascal procedures, others with a Pascallike pseudocode. The analysis of generation algorithms provides interesting problems for those interested in combinatorial enumeration. The analysis of most of our algorithms involves some sort of counting problem, and many techniques from enumerative combinatorics have been brought to bear in solving these counting problems. The software engineer will find interesting nontrivial, but short, procedures. These provide excellent examples for students on which to try their skill at providing formal proofs of correctness of programs. Recently, there seems to be an explosion of results on combinatorial generation. This renewed interest is fueled by many sources: the increasing speed of computers, mathematical interest in Hamiltonicity of graphs, the emergence of parallel computers, the complexity theory of counting problems, and so on. It is my belief that a book on combinatorial generation is timely. Many of the programs presented in this book can be downloaded from the author s Combinatorial Object Server (COS) at The main purpose of this site is to provide an online resource for the generation of small numbers of combinatorial objects. The user first selects a type of object, then supplies input parameters, and output options, and COS returns the appropriate list of objects. There are very few universities that offer courses on combinatorial generation so I don t expect this to be often used as a textbook (of course, the appearance of a suitable text may change that). The book is mainly intended as a reference and perhaps for supplementary reading in a course. Each chapter contains some exercises, and some contain extensive sets of exercises. It is quite feasible to use the book as a textbook, but it would be essential for prospective students to have had a course in discrete mathematics or combinatorics and enough programming experience to be totally comfortable with recursion. Other than that the background necessary to read the book is minimal. Most of the material should be
6 v accessible to the typical undergraduate Computer Science or Mathematics major. The first chapter discusses some general issues in combinatorial generation. The second chapter reviews some basic definitions and counting results that are useful in the rest of the book; the reader is advised to skip over this chapter and just refer to it as needed. Chapter 3 is a short introduction to backtracking. The following chapters are broadly organized by type of algorithm. Chapter 4 is Lexicographic Algorithms, Chapter 5 concerns algorithmic aspects of Gray codes and Chapter 6 is a continuation, concentrating on graph theoretic aspects of Gray codes. Chapter 7 considers problems that can be modeled as Eulerian cycles, such as De Bruijn cycles. Chapters 4, 5, 6, and to a lesser extent, Chapter 7 are concerned with elementary combinatorial objects. Orderly Algorithms are covered in Chapter 8 and Chapter 9 looks at problems of generating various types of subgraphs of graphs, such as spanning trees and cliques. Parallel algorithms for generating combinatorial objects are discussed in Chapter??. The uniform random selection of objects is the subject of Chapter 10. Some complexity issues are discussed in Chapter??. And finally, Chapter?? contains solutions and hints to the exercises. I have tried to provide a fairly comprehensive list of references to papers whose main objective is the development of an algorithm for generating some class of combinatorial objects. Inclusion in the references implies no judgement on my part about the merits of the paper. It is evident from the large number of these references that there has been much interest in generating combinatorial objects and that that interest is increasing. It is my hope that this book will provide a guide to those interested in combinatorial generation, both in regards to what has been done before, and in terms of what approaches have proved most successful. The exercises form an integral part of the book. Many of them expand upon the material of the chapters and contain material about generating other types of combinatorial objects beyond those covered in the main body of the chapter. Many useful generation problems have been relegated to the exercises because of space limitations. The reader is urged to at least read the exercises and understand what they are asking. Solutions or hints or references to the relevant literature are provided for most of the exercises; these solutions may be found in the final chapter at the end of the book. They are classified according to difficulty using a modification of the rating scheme of Stanley [402] as follows. [1] routine, straightforward. [2] somewhat difficult or tricky. [3] difficult. [4] extraordinarily difficult. [R] research problem. Further gradations are indicated by + and. An [R] indicates that the problem is a research problem, and that the solution is unknown to myself. An [R ] or [R] rating does not necessarily imply that the problem is extremely difficult; indeed, I suspect that some of them can be solved quite easily. If you do solve any one of these problems, please let me know! An [R ] indicates that I don t know the solution or of anybody who has worked on the problem before. Such problems may be quite easy to solve. An [R] indicates that at least one person has unsuccessively worked on the problem, and a [R+] means that several
7 vi wellknown researchers have worked on the problem without success. Some of the [R+] problems are notoriously difficult! I would like to thank my favorite list, Susan, Jennifer, and Albert, for putting up with the many lost hours spent away from them as I wrote this book. Many people have contributed to this book, knowingly or not. In particular I would like to mention Larry Cummings, Brendan McKay, Carla Savage, Ian Roberts, Colin Ramsay, Peter Eades, Malcolm Smith, Gara Pruesse, Joe Sawada, and Donald Knuth. Frank Ruskey
8 vii T ai Chi K un 8 earth Kên 7 mountain K an 6 water Sun 5 wind Great Yin Lesser Yang YIN Chên 4 thunder Li 3 fire Tui 2 lake Ch ien 1 Heaven Lesser Yin Great Yang YANG Figure 1: The 64 Hexagrams of the Fu Hsi ordering (from the I Ching). The I Ching (or Book of Changes) is a book that has been used for centuries as an aid to fortune telling in China. The I Ching is said to have originated around the eighth century B.C. and the Fu Hsi ordering is from the 11th century. Each of the 2 6 hexagrams consists of six symbols, either a long dash or two short dashes, placed one above the other. Originally the hexagrams were arranged in other, seemingly random, orders; one such order is indicated by the numbers above each hexagram.
9 viii Figure 2: The 52 Murasaki diagrams from The Tale of the Genji. The novel Tale of Genji was written about 1000 A.D. by Lady Shikibu Murasaki, who is often referred to as the Shakespeare of Japan. The book has 54 chapters and some early copies have one of the Murasaki diagrams at the top of each chapter, except for the first and last. The diagrams themselves derive from a Japanese game involving the identification, by smell alone, of a sequence of 5 incense sticks. Each diagram is formed from 5 vertical bars, where bars representing the same type of incense are connected by a horizontal bar.
10 Contents 1 What is Combinatorial Generation? Some Examples Fisher s Exact Test A Second Example Elementary Objects Four Basic Questions A Word about the Algorithms The Representation Issue Complexity Measures Analyzing the Algorithms Exercises Bibliographic Remarks Basic Combinatorial Objects Alphabets, Strings, Languages, and Lists Relations and Functions Asymptotic Notation Subsets and Combinations Permutations Permutations of a Multiset Partitions Numerical Partitions Set Partitions The twelvefold way Tableau Partially Ordered Sets Antimatroids Trees Ordered Trees Rooted Trees Free Trees Graphs The Matrix Tree Theorem Representing Graphs Depth First Search Finite Groups Permutation Groups ix
11 x CONTENTS Burnside s Lemma Polya Theorem Cayley Graphs Miscellanea Summations Fibonacci Numbers Constant Time Array Initialization Exercises Bibliographic Remarks Backtracking Introduction Backtracking Algorithms Solving Pentomino Problems with Backtracking Eliminating Isomorphic Solutions Estimating the Running Time of Backtracking Exercises Bibliographic Remarks Lexicographic Algorithms Introduction Subsets Combinations Permutations Permutations of a Multiset Combinations of a Multiset Trees Binary Trees, Ordered Trees Rooted Trees, Free Trees Btrees Set Partitions Numerical Partitions Generalized Settings Wilf s Generalized Setting The Generalized Setting of Flajolet, Zimmerman, and Cutsem Listing solutions to problems solved by dynamic programming Retrospective Why recusive and iterative algorithms have similar analyses Ideals and Linear Extensions of Posets VarolRotem Algorithm for Linear Extensions Algorithms for Listing Ideals Exercises Bibliographic Remarks
12 CONTENTS xi 5 Combinatorial Gray Codes: Algorithmic Issues Introductory Example Combinatorial Gray Codes The Binary Reflected Gray Code Applications of the BRGC Gray Codes for Combinations Permutations Gray Codes for Binary Trees Wellformed Parentheses Binary Trees Multisets Permutations of a multiset Combinations of a multiset Compositions Numerical Partitions Set Partitions Linear Extensions of Posets Combinatorially Interesting Posets Generating Linear Extensions Fast Ideals of Posets Loopless Algorithms Binary Trees Finding a Hamiltonian cycle ExtensionRotation Algorithms Cubic graphs Exercises Bibliographic Remarks Combinatorial Gray Codes: Graph Theoretic Issues The Hypercube Monotone Gray Codes Hamiltonicity Results for Graphs A useful lemma VertexTransitive Graphs AntiGray Codes Permutations Subsets Hamilton Cycles in Cayley Graphs Directed Cayley Graphs Undirected Cayley Graphs Cayley graphs over S n Exercises Bibliographic Remarks
13 xii CONTENTS 7 DeBruijn Cycles and Relatives Eulerian Cycles Generating an Eulerian cycle An Eulerian Cycle in the Directed ncube Necklaces De Bruijn Sequences Computing the Necklace of a String Universal Cycles Polynomials over finite fields Linear Feedback Shift Registers Another look at the BRGC Exercises Bibliographic Remarks Orderly Algorithms Undirected Graphs Tournaments Restricted Classes of Graphs Bipartite Graphs Cubic Graphs Posets Dedekind s Problem Coset Enumeration Exercises Bibliographic Remarks Subgraph Generation Spanning Trees A naive algorithm A CAT algorithm A Spanning Tree Gray Code Reverse Search Cycles Cliques Maximal Independent Sets Cutsets Chromatic Polynomials Convex Polytopes Exercises Bibliographic Remarks Random Selection Permutations Combinations Permutations of a Multiset Necklaces Numerical Partitions Set Partitions
14 CONTENTS xiii 10.7 Trees Wellformed Parentheses Graphs Exercises Bibliographic Remarks Bibliography Useful Tables 281 Term Index 281
15 xiv CONTENTS
16 List of Figures 1 The 64 Hexagrams of the Fu Hsi ordering (from the I Ching) vii 2 The 52 Murasaki diagrams from The Tale of the Genji viii 2.1 Ferrer s diagram and conjugate partition (a) A standard Young tableau of shape 6,4,4,2,1,1. (b) The hook lengths of that tableau (a) Forbidden subposet for lattices. (b) Forbidden sublattices for distributive lattices The path corresponding to A triangulation of a rooted 10gon and the corresponding extended binary tree with 10 leaves Catalan correspondences for n = The functional digraph of f and the bijection θ For this tree x is the centroid and y is the center A graph and its adjacency list representation The four queens backtracking tree The 12 pentomino pieces A solution to the 6 by 10 pentomino problem Numbering the board (and the placement of a piece) Lists for piece 11, with those anchored at location 7 shown explicitly Eliminating isomorphs in the 6 by 10 pentomino puzzle (a) True backtracking tree with random roottoleaf path shown. (b) Assumed tree from that random path The Soma cube pieces A 6 by 6 knight s tour Computation tree of B(5, 2) The walk corresponding to the rank 100 = combination of ( 9 5) in colex order Computation tree of GenMult on input 2, 1, Computation tree of gen1 on C(5; 1, 2, 2, 1, 1) Extended binary tree represented by the sequence Lexicographic tree sequences for n = 4 (read down) The walk, , corresponding to the rank 333 = tree in T(8) The rooted trees on at most 5 nodes Two isomorphic rooted trees. The one on the right is canonic xv
17 xvi LIST OF FIGURES 4.10 (a) The 20 canonic sequences of length n = 6 in relex order (read down). (b) The 9 canonic sequences of length n = 5 with elements contributing to x indicated in bold and those contributing to y underlined The rooted versions of the free trees on 6 vertices, listed in relex order. Central vertices are darkened Condition (B2) fails: (The height of T 2 is reduced too much). (a) original tree T. (b) succ(e(t )). (c) Succ(e(T )) Condition (C) fails: ( T 1 has too many nodes). (a) original tree T. (b) succ(e(t )). (c) Succ(e(T )) Condition (D) fails: (The encoding of T 1 is too large). (a) original tree T. (b) succ(e(t )). (c) Succ(e(T )) Btree of order 4 with encoding The eight trees in B(6, 2) (with m = 4) Computation tree for n = k = A typical computation tree of a recursive algorithm generating strings in lexicographic order Computation tree of VarolRotem algorithm on the example poset Position detection on a rotating device with two different labellings The definition of G n A 3cube Towers of Hanoi for n = n = 3: Counting, Gray Code, and Towers of Hanoi A six ring Chinese rings puzzle The Spinout puzzle Multiattribute file storage; Gray and lex order Brun s Brunnian link [Trans],[HTrans],[2Trans](R(6, 3, 1)) NonHamiltonian Adjacent Transposition graph Path in the prism of combs for n = 8 and k = A left or right rotation at node x Example of induced tree (a) Given T [1..n 1] there are 6 places where n could possibly be inserted to get T. (b) The n has been inserted at the position of the double arrow List of trees for n = 2, 3, Recursion Tree (A) for n = 2, 1, Recursion Tree (B) for n = 2, 1, The list (a) Comp(5, 4) (first two columns, read down) and the corresponding list (b) Comb(5, 4) of the elements of B(8, 5) (last two columns) Peaks and valleys The closeness graph G(6, 4) of L(6, 4) The L lists for the special cases in X The M lists for the special cases in Y Gray codes for RG functions n = 1, 2, 3, 4: (a) Knuth list, (b) differing in only one position The lists S(5, 3, 0) and S(5, 3, 1)
18 LIST OF FIGURES xvii 5.26 (a) Poset whose linear extensions correspond to binary trees. (b) Poset whose linear extensions correspond to Young tableau of shape 6,4,4, Poset whose linear extensions correspond to set partitions of type (2,2,2,3,3) A poset and its transposition graph The graph G(P) K Part of a Hamiltonian cycle through G (P) K A Bposet The trace of the calling sequence for the poset of Figure The extension and rotation operations Implicated edges on Hamilton cycles in cubic graphs A monotone Gray code for n = Illustration of the 4cycle construction Three of the four known nonhamiltonian vertextransitive graphs The nonhamiltonian directed Cayley graph Cay({(1 2)(3 4), (1 2 3)}:S 4 ) Hamilton cycles in Cayley graphs over Abelian groups The Cayley graph Cay({(1 2), (2 3), (3 4)}:S 4 ) The Cayley graph Cay({(1 2), (1 3), (1 4)}:S 4 ) Base case listings Example (maximal) domino game Example of finding an Euler cycle in a directed multigraph The six twocolor necklaces with 4 beads Output of the FKM algorithm (read down columns) The De Bruijn graph for k = 2 and n = The LFSR corresponding to the polynomial x 4 + x An unlabelled graph, it s canonic labelling, and it s parent The tree of unlabelled graphs on four vertices Tree of tournaments for n The connected graph K 4 e with edges labelled The spanning trees of K 4 e The tree graph of K 4 e
19 xviii LIST OF FIGURES
20 List of Tables 4.1 The numbers b(s, d) when m = Restricted tail numbers R(n, m) for 1 n + m Binomial coefficients ( n k) for 0 k The numbers T (n, k) = k ( 2n k ) 2n k k for 1 k Stirling numbers of the second kind { n k} for 1 k The number p(n, k) of numerical partitions of n into k parts for 1 k Eulerian numbers for 1 k xix
Mathematics for Algorithm and System Analysis
Mathematics for Algorithm and System Analysis for students of computer and computational science Edward A. Bender S. Gill Williamson c Edward A. Bender & S. Gill Williamson 2005. All rights reserved. Preface
More information1.1 Logical Form and Logical Equivalence 1
Contents Chapter I The Logic of Compound Statements 1.1 Logical Form and Logical Equivalence 1 Identifying logical form; Statements; Logical connectives: not, and, and or; Translation to and from symbolic
More informationIt is not immediately obvious that this should even give an integer. Since 1 < 1 5
Math 163  Introductory Seminar Lehigh University Spring 8 Notes on Fibonacci numbers, binomial coefficients and mathematical induction These are mostly notes from a previous class and thus include some
More informationTwo General Methods to Reduce Delay and Change of Enumeration Algorithms
ISSN 13465597 NII Technical Report Two General Methods to Reduce Delay and Change of Enumeration Algorithms Takeaki Uno NII2003004E Apr.2003 Two General Methods to Reduce Delay and Change of Enumeration
More informationMathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson
Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement
More informationCatalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni versity.
7 Catalan Numbers Thomas A. Dowling, Department of Mathematics, Ohio State Uni Author: versity. Prerequisites: The prerequisites for this chapter are recursive definitions, basic counting principles,
More information2.3 Scheduling jobs on identical parallel machines
2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed
More informationAnswer: (a) Since we cannot repeat men on the committee, and the order we select them in does not matter, ( )
1. (Chapter 1 supplementary, problem 7): There are 12 men at a dance. (a) In how many ways can eight of them be selected to form a cleanup crew? (b) How many ways are there to pair off eight women at the
More informationORDERS OF ELEMENTS IN A GROUP
ORDERS OF ELEMENTS IN A GROUP KEITH CONRAD 1. Introduction Let G be a group and g G. We say g has finite order if g n = e for some positive integer n. For example, 1 and i have finite order in C, since
More informationChapter 3. Distribution Problems. 3.1 The idea of a distribution. 3.1.1 The twentyfold way
Chapter 3 Distribution Problems 3.1 The idea of a distribution Many of the problems we solved in Chapter 1 may be thought of as problems of distributing objects (such as pieces of fruit or pingpong balls)
More informationFoundations of Logic and Mathematics
Yves Nievergelt Foundations of Logic and Mathematics Applications to Computer Science and Cryptography Birkhäuser Boston Basel Berlin Contents Preface Outline xiii xv A Theory 1 0 Boolean Algebraic Logic
More informationLinear Codes. Chapter 3. 3.1 Basics
Chapter 3 Linear Codes In order to define codes that we can encode and decode efficiently, we add more structure to the codespace. We shall be mainly interested in linear codes. A linear code of length
More informationCOUNTING INDEPENDENT SETS IN SOME CLASSES OF (ALMOST) REGULAR GRAPHS
COUNTING INDEPENDENT SETS IN SOME CLASSES OF (ALMOST) REGULAR GRAPHS Alexander Burstein Department of Mathematics Howard University Washington, DC 259, USA aburstein@howard.edu Sergey Kitaev Mathematics
More informationWhy? A central concept in Computer Science. Algorithms are ubiquitous.
Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online
More informationSAMPLES OF HIGHER RATED WRITING: LAB 5
SAMPLES OF HIGHER RATED WRITING: LAB 5 1. Task Description Lab report 5. (April 14) Graph Coloring. Following the guidelines, and keeping in mind the assessment criteria, using where appropriate experimental
More informationSample Problems in Discrete Mathematics
Sample Problems in Discrete Mathematics This handout lists some sample problems that you should be able to solve as a prerequisite to Computer Algorithms Try to solve all of them You should also read
More informationDiscrete Mathematics. Hans Cuypers. October 11, 2007
Hans Cuypers October 11, 2007 1 Contents 1. Relations 4 1.1. Binary relations................................ 4 1.2. Equivalence relations............................. 6 1.3. Relations and Directed Graphs.......................
More informationWe give a basic overview of the mathematical background required for this course.
1 Background We give a basic overview of the mathematical background required for this course. 1.1 Set Theory We introduce some concepts from naive set theory (as opposed to axiomatic set theory). The
More informationU.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra
U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009 Notes on Algebra These notes contain as little theory as possible, and most results are stated without proof. Any introductory
More informationDiscrete Mathematics & Mathematical Reasoning Chapter 6: Counting
Discrete Mathematics & Mathematical Reasoning Chapter 6: Counting Colin Stirling Informatics Slides originally by Kousha Etessami Colin Stirling (Informatics) Discrete Mathematics (Chapter 6) Today 1 /
More informationDiscrete Mathematics Problems
Discrete Mathematics Problems William F. Klostermeyer School of Computing University of North Florida Jacksonville, FL 32224 Email: wkloster@unf.edu Contents 0 Preface 3 1 Logic 5 1.1 Basics...............................
More informationInformation Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay
Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture  17 ShannonFanoElias Coding and Introduction to Arithmetic Coding
More informationMathematics Course 111: Algebra I Part IV: Vector Spaces
Mathematics Course 111: Algebra I Part IV: Vector Spaces D. R. Wilkins Academic Year 19967 9 Vector Spaces A vector space over some field K is an algebraic structure consisting of a set V on which are
More informationMichal Forišek: Early beta verzia skrípt z ADŠ
Časová zložitosť II Michal Forišek: Early beta verzia skrípt z ADŠ In this part of the article we will focus on estimating the time complexity for recursive programs. In essence, this will lead to finding
More informationGraph Theory Problems and Solutions
raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is
More informationGenerating Elementary Combinatorial Objects
Fall 2009 Combinatorial Generation Combinatorial Generation: an old subject Excerpt from: D. Knuth, History of Combinatorial Generation, in prefascicle 4B, The Art of Computer Programming Vol 4. Combinatorial
More informationCOMBINATORIAL CHESSBOARD REARRANGEMENTS
COMBINATORIAL CHESSBOARD REARRANGEMENTS DARYL DEFORD Abstract. Many problems concerning tilings of rectangular boards are of significant combinatorial interest. In this paper we introduce a similar type
More informationChapters 1 and 5.2 of GT
Subject 2 Spring 2014 Growth of Functions and Recurrence Relations Handouts 3 and 4 contain more examples;the Formulae Collection handout might also help. Chapters 1 and 5.2 of GT Disclaimer: These abbreviated
More informationCHAPTER 5: MODULAR ARITHMETIC
CHAPTER 5: MODULAR ARITHMETIC LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN 1. Introduction In this chapter we will consider congruence modulo m, and explore the associated arithmetic called
More informationElements of Abstract Group Theory
Chapter 2 Elements of Abstract Group Theory Mathematics is a game played according to certain simple rules with meaningless marks on paper. David Hilbert The importance of symmetry in physics, and for
More informationOn the kpath cover problem for cacti
On the kpath cover problem for cacti Zemin Jin and Xueliang Li Center for Combinatorics and LPMC Nankai University Tianjin 300071, P.R. China zeminjin@eyou.com, x.li@eyou.com Abstract In this paper we
More informationLong questions answer Advanced Mathematics for Computer Application If P= , find BT. 19. If B = 1 0, find 2B and 3B.
Unit1: Matrix Algebra Short questions answer 1. What is Matrix? 2. Define the following terms : a) Elements matrix b) Row matrix c) Column matrix d) Diagonal matrix e) Scalar matrix f) Unit matrix OR
More informationMTH6109: Combinatorics. Professor R. A. Wilson
MTH6109: Combinatorics Professor R. A. Wilson Autumn Semester 2011 2 Lecture 1, 26/09/11 Combinatorics is the branch of mathematics that looks at combining objects according to certain rules (for example:
More informationCARDINALITY, COUNTABLE AND UNCOUNTABLE SETS PART ONE
CARDINALITY, COUNTABLE AND UNCOUNTABLE SETS PART ONE With the notion of bijection at hand, it is easy to formalize the idea that two finite sets have the same number of elements: we just need to verify
More informationGraph Theory Notes. Vadim Lozin. Institute of Mathematics University of Warwick
Graph Theory Notes Vadim Lozin Institute of Mathematics University of Warwick 1 Introduction A graph G = (V, E) consists of two sets V and E. The elements of V are called the vertices and the elements
More informationPrinciple of (Weak) Mathematical Induction. P(1) ( n 1)(P(n) P(n + 1)) ( n 1)(P(n))
Outline We will cover (over the next few weeks) Mathematical Induction (or Weak Induction) Strong (Mathematical) Induction Constructive Induction Structural Induction Principle of (Weak) Mathematical Induction
More informationCONTINUED FRACTIONS AND FACTORING. Niels Lauritzen
CONTINUED FRACTIONS AND FACTORING Niels Lauritzen ii NIELS LAURITZEN DEPARTMENT OF MATHEMATICAL SCIENCES UNIVERSITY OF AARHUS, DENMARK EMAIL: niels@imf.au.dk URL: http://home.imf.au.dk/niels/ Contents
More informationMathematical Induction
Chapter 2 Mathematical Induction 2.1 First Examples Suppose we want to find a simple formula for the sum of the first n odd numbers: 1 + 3 + 5 +... + (2n 1) = n (2k 1). How might we proceed? The most natural
More information1 Basic Definitions and Concepts in Graph Theory
CME 305: Discrete Mathematics and Algorithms 1 Basic Definitions and Concepts in Graph Theory A graph G(V, E) is a set V of vertices and a set E of edges. In an undirected graph, an edge is an unordered
More informationCost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:
CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm
More informationSets and Cardinality Notes for C. F. Miller
Sets and Cardinality Notes for 620111 C. F. Miller Semester 1, 2000 Abstract These lecture notes were compiled in the Department of Mathematics and Statistics in the University of Melbourne for the use
More informationRelations Graphical View
Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Introduction Recall that a relation between elements of two sets is a subset of their Cartesian product (of ordered pairs). A binary
More informationCryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur
Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. # 01 Lecture No. # 12 Block Cipher Standards
More informationMathematics of Cryptography
CHAPTER 2 Mathematics of Cryptography Part I: Modular Arithmetic, Congruence, and Matrices Objectives This chapter is intended to prepare the reader for the next few chapters in cryptography. The chapter
More informationInduction Problems. Tom Davis November 7, 2005
Induction Problems Tom Davis tomrdavis@earthlin.net http://www.geometer.org/mathcircles November 7, 2005 All of the following problems should be proved by mathematical induction. The problems are not necessarily
More informationVISUAL ALGEBRA FOR COLLEGE STUDENTS. Laurie J. Burton Western Oregon University
VISUAL ALGEBRA FOR COLLEGE STUDENTS Laurie J. Burton Western Oregon University VISUAL ALGEBRA FOR COLLEGE STUDENTS TABLE OF CONTENTS Welcome and Introduction 1 Chapter 1: INTEGERS AND INTEGER OPERATIONS
More informationMATHEMATICAL INDUCTION AND DIFFERENCE EQUATIONS
1 CHAPTER 6. MATHEMATICAL INDUCTION AND DIFFERENCE EQUATIONS 1 INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATHEMATICAL INDUCTION AND DIFFERENCE EQUATIONS 1 Introduction Recurrence
More informationThe UnionFind Problem Kruskal s algorithm for finding an MST presented us with a problem in datastructure design. As we looked at each edge,
The UnionFind Problem Kruskal s algorithm for finding an MST presented us with a problem in datastructure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints
More informationA Turán Type Problem Concerning the Powers of the Degrees of a Graph
A Turán Type Problem Concerning the Powers of the Degrees of a Graph Yair Caro and Raphael Yuster Department of Mathematics University of HaifaORANIM, Tivon 36006, Israel. AMS Subject Classification:
More informationSets and Subsets. Countable and Uncountable
Sets and Subsets Countable and Uncountable Reading Appendix A Section A.6.8 Pages 788792 BIG IDEAS Themes 1. There exist functions that cannot be computed in Java or any other computer language. 2. There
More informationTreerepresentation of set families and applications to combinatorial decompositions
Treerepresentation of set families and applications to combinatorial decompositions BinhMinh BuiXuan a, Michel Habib b Michaël Rao c a Department of Informatics, University of Bergen, Norway. buixuan@ii.uib.no
More informationCS420/520 Algorithm Analysis Spring 2010 Lecture 04
CS420/520 Algorithm Analysis Spring 2010 Lecture 04 I. Chapter 4 Recurrences A. Introduction 1. Three steps applied at each level of a recursion a) Divide into a number of subproblems that are smaller
More information3. Recurrence Recursive Definitions. To construct a recursively defined function:
3. RECURRENCE 10 3. Recurrence 3.1. Recursive Definitions. To construct a recursively defined function: 1. Initial Condition(s) (or basis): Prescribe initial value(s) of the function.. Recursion: Use a
More informationLecture Notes on Spanning Trees
Lecture Notes on Spanning Trees 15122: Principles of Imperative Computation Frank Pfenning Lecture 26 April 26, 2011 1 Introduction In this lecture we introduce graphs. Graphs provide a uniform model
More informationYou know from calculus that functions play a fundamental role in mathematics.
CHPTER 12 Functions You know from calculus that functions play a fundamental role in mathematics. You likely view a function as a kind of formula that describes a relationship between two (or more) quantities.
More informationINTRODUCTORY SET THEORY
M.Sc. program in mathematics INTRODUCTORY SET THEORY Katalin Károlyi Department of Applied Analysis, Eötvös Loránd University H1088 Budapest, Múzeum krt. 68. CONTENTS 1. SETS Set, equal sets, subset,
More informationLecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs
CSE599s: Extremal Combinatorics November 21, 2011 Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs Lecturer: Anup Rao 1 An Arithmetic Circuit Lower Bound An arithmetic circuit is just like
More informationThe Open University s repository of research publications and other research outputs
Open Research Online The Open University s repository of research publications and other research outputs The degreediameter problem for circulant graphs of degree 8 and 9 Journal Article How to cite:
More informationPlanar Tree Transformation: Results and Counterexample
Planar Tree Transformation: Results and Counterexample Selim G Akl, Kamrul Islam, and Henk Meijer School of Computing, Queen s University Kingston, Ontario, Canada K7L 3N6 Abstract We consider the problem
More informationStudent Name and ID Number. MATH 3012 Final Exam, May 3, 2013, WTT
MATH 30 Final Exam, May 3, 03, WTT Student Name and ID Number Note. The questions posed here appeared on the Spring 03 Final Exam, although in some instances, the format of the question has been altered.
More information4. Factor polynomials over complex numbers, describe geometrically, and apply to realworld situations. 5. Determine and apply relationships among syn
I The Real and Complex Number Systems 1. Identify subsets of complex numbers, and compare their structural characteristics. 2. Compare and contrast the properties of real numbers with the properties of
More informationGREEN CHICKEN EXAM  NOVEMBER 2012
GREEN CHICKEN EXAM  NOVEMBER 2012 GREEN CHICKEN AND STEVEN J. MILLER Question 1: The Green Chicken is planning a surprise party for his grandfather and grandmother. The sum of the ages of the grandmother
More informationThe LCA Problem Revisited
The LA Problem Revisited Michael A. Bender Martín Faracholton SUNY Stony Brook Rutgers University May 16, 2000 Abstract We present a very simple algorithm for the Least ommon Ancestor problem. We thus
More informationInduction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition
Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing
More informationTheorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.
Chapter 3 Trees Section 3. Fundamental Properties of Trees Suppose your city is planning to construct a rapid rail system. They want to construct the most economical system possible that will meet the
More informationCOLORED GRAPHS AND THEIR PROPERTIES
COLORED GRAPHS AND THEIR PROPERTIES BEN STEVENS 1. Introduction This paper is concerned with the upper bound on the chromatic number for graphs of maximum vertex degree under three different sets of coloring
More informationComplexity and Completeness of Finding Another Solution and Its Application to Puzzles
yato@is.s.utokyo.ac.jp seta@is.s.utokyo.ac.jp Π (ASP) Π x s x s ASP Ueda Nagao n nasp parsimonious ASP ASP NP Complexity and Completeness of Finding Another Solution and Its Application to Puzzles Takayuki
More informationLecture notes from Foundations of Markov chain Monte Carlo methods University of Chicago, Spring 2002 Lecture 1, March 29, 2002
Lecture notes from Foundations of Markov chain Monte Carlo methods University of Chicago, Spring 2002 Lecture 1, March 29, 2002 Eric Vigoda Scribe: Varsha Dani & Tom Hayes 1.1 Introduction The aim of this
More informationAlgorithms and Data Structures
Algorithm Analysis Page 1 BFHTI: Softwareschule Schweiz Algorithm Analysis Dr. CAS SD01 Algorithm Analysis Page 2 Outline Course and Textbook Overview Analysis of Algorithm PseudoCode and Primitive Operations
More informationAnswers to Homework 1
Answers to Homework 1 p. 13 1.2 3 What is the smallest value of n such that an algorithm whose running time is 100n 2 runs faster than an algorithm whose running time is 2 n on the same machine? Find the
More informationON DEGREES IN THE HASSE DIAGRAM OF THE STRONG BRUHAT ORDER
Séminaire Lotharingien de Combinatoire 53 (2006), Article B53g ON DEGREES IN THE HASSE DIAGRAM OF THE STRONG BRUHAT ORDER RON M. ADIN AND YUVAL ROICHMAN Abstract. For a permutation π in the symmetric group
More informationON THE COMPLEXITY OF THE GAME OF SET. {kamalika,pbg,dratajcz,hoeteck}@cs.berkeley.edu
ON THE COMPLEXITY OF THE GAME OF SET KAMALIKA CHAUDHURI, BRIGHTEN GODFREY, DAVID RATAJCZAK, AND HOETECK WEE {kamalika,pbg,dratajcz,hoeteck}@cs.berkeley.edu ABSTRACT. Set R is a card game played with a
More informationThe Mathematics of Origami
The Mathematics of Origami Sheri Yin June 3, 2009 1 Contents 1 Introduction 3 2 Some Basics in Abstract Algebra 4 2.1 Groups................................. 4 2.2 Ring..................................
More informationTheory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras
Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture No. # 31 Recursive Sets, Recursively Innumerable Sets, Encoding
More informationPrime Numbers. Chapter Primes and Composites
Chapter 2 Prime Numbers The term factoring or factorization refers to the process of expressing an integer as the product of two or more integers in a nontrivial way, e.g., 42 = 6 7. Prime numbers are
More informationMathematical Induction
Mathematical Induction (Handout March 8, 01) The Principle of Mathematical Induction provides a means to prove infinitely many statements all at once The principle is logical rather than strictly mathematical,
More informationConstruction of the Real Line 2 Is Every Real Number Rational? 3 Problems Algebra of the Real Numbers 7
About the Author v Preface to the Instructor xiii WileyPLUS xviii Acknowledgments xix Preface to the Student xxi 1 The Real Numbers 1 1.1 The Real Line 2 Construction of the Real Line 2 Is Every Real Number
More informationCOLLEGE ALGEBRA. Paul Dawkins
COLLEGE ALGEBRA Paul Dawkins Table of Contents Preface... iii Outline... iv Preliminaries... Introduction... Integer Exponents... Rational Exponents... 9 Real Exponents...5 Radicals...6 Polynomials...5
More informationFundamentals of Media Theory
Fundamentals of Media Theory ergei Ovchinnikov Mathematics Department an Francisco tate University an Francisco, CA 94132 sergei@sfsu.edu Abstract Media theory is a new branch of discrete applied mathematics
More informationLecture 3. Mathematical Induction
Lecture 3 Mathematical Induction Induction is a fundamental reasoning process in which general conclusion is based on particular cases It contrasts with deduction, the reasoning process in which conclusion
More informationPractice Final Exam Solutions
1 (1 points) For the following problem, the alphabet used is the standard letter English alphabet, and vowels refers only to the letters A, E, I, O, and U (a) ( points) How many strings of five letters
More informationSHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH
31 Kragujevac J. Math. 25 (2003) 31 49. SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH Kinkar Ch. Das Department of Mathematics, Indian Institute of Technology, Kharagpur 721302, W.B.,
More informationApproximating the entropy of a 2dimensional shift of finite type
Approximating the entropy of a dimensional shift of finite type Tirasan Khandhawit c 4 July 006 Abstract. In this paper, we extend the method used to compute entropy of dimensional subshift and the technique
More informationEfficient Recovery of Secrets
Efficient Recovery of Secrets Marcel Fernandez Miguel Soriano, IEEE Senior Member Department of Telematics Engineering. Universitat Politècnica de Catalunya. C/ Jordi Girona 1 i 3. Campus Nord, Mod C3,
More information136 CHAPTER 4. INDUCTION, GRAPHS AND TREES
136 TER 4. INDUCTION, GRHS ND TREES 4.3 Graphs In this chapter we introduce a fundamental structural idea of discrete mathematics, that of a graph. Many situations in the applications of discrete mathematics
More informationSolution of Linear Systems
Chapter 3 Solution of Linear Systems In this chapter we study algorithms for possibly the most commonly occurring problem in scientific computing, the solution of linear systems of equations. We start
More informationA Mathematical Analysis of The Generalized Oval Track Puzzle
Rose Hulman Undergraduate Mathematics Journal A Mathematical Analysis of The Generalized Oval Track Puzzle Samuel Kaufmann a Volume 12, no. 1, Spring 2011 Sponsored by RoseHulman Institute of Technology
More informationCS 4310 HOMEWORK SET 1
CS 4310 HOMEWORK SET 1 PAUL MILLER Section 2.1 Exercises Exercise 2.11. Using Figure 2.2 as a model, illustrate the operation of INSERTIONSORT on the array A = 31, 41, 59, 26, 41, 58. Solution: Assume
More informationChapter 2 Limits Functions and Sequences sequence sequence Example
Chapter Limits In the net few chapters we shall investigate several concepts from calculus, all of which are based on the notion of a limit. In the normal sequence of mathematics courses that students
More informationA simple existence criterion for normal spanning trees in infinite graphs
1 A simple existence criterion for normal spanning trees in infinite graphs Reinhard Diestel Halin proved in 1978 that there exists a normal spanning tree in every connected graph G that satisfies the
More informationOutline. NPcompleteness. When is a problem easy? When is a problem hard? Today. Euler Circuits
Outline NPcompleteness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2pairs sum vs. general Subset Sum Reducing one problem to another Clique
More informationx if x 0, x if x < 0.
Chapter 3 Sequences In this chapter, we discuss sequences. We say what it means for a sequence to converge, and define the limit of a convergent sequence. We begin with some preliminary results about the
More informationUtah Core Curriculum for Mathematics
Core Curriculum for Mathematics correlated to correlated to 2005 Chapter 1 (pp. 2 57) Variables, Expressions, and Integers Lesson 1.1 (pp. 5 9) Expressions and Variables 2.2.1 Evaluate algebraic expressions
More informationEnumerating possible Sudoku grids
Enumerating possible Sudoku grids Bertram Felgenhauer Department of Computer Science TU Dresden 00 Dresden Germany bf@mail.inf.tudresden.de Frazer Jarvis Department of Pure Mathematics University of Sheffield,
More informationIntroduction to Algorithms. Part 3: P, NP Hard Problems
Introduction to Algorithms Part 3: P, NP Hard Problems 1) Polynomial Time: P and NP 2) NPCompleteness 3) Dealing with Hard Problems 4) Lower Bounds 5) Books c Wayne Goddard, Clemson University, 2004 Chapter
More informationMATH 289 PROBLEM SET 1: INDUCTION. 1. The induction Principle The following property of the natural numbers is intuitively clear:
MATH 89 PROBLEM SET : INDUCTION The induction Principle The following property of the natural numbers is intuitively clear: Axiom Every nonempty subset of the set of nonnegative integers Z 0 = {0,,, 3,
More informationElementary Number Theory We begin with a bit of elementary number theory, which is concerned
CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,
More informationMATHEMATICAL ENGINEERING TECHNICAL REPORTS. An Improved Approximation Algorithm for the Traveling Tournament Problem
MATHEMATICAL ENGINEERING TECHNICAL REPORTS An Improved Approximation Algorithm for the Traveling Tournament Problem Daisuke YAMAGUCHI, Shinji IMAHORI, Ryuhei MIYASHIRO, Tomomi MATSUI METR 2009 42 September
More informationColoring Eulerian triangulations of the projective plane
Coloring Eulerian triangulations of the projective plane Bojan Mohar 1 Department of Mathematics, University of Ljubljana, 1111 Ljubljana, Slovenia bojan.mohar@unilj.si Abstract A simple characterization
More informationCS268: Geometric Algorithms Handout #5 Design and Analysis Original Handout #15 Stanford University Tuesday, 25 February 1992
CS268: Geometric Algorithms Handout #5 Design and Analysis Original Handout #15 Stanford University Tuesday, 25 February 1992 Original Lecture #6: 28 January 1991 Topics: Triangulating Simple Polygons
More information