Universal Cycles. Yu She. Wirral Grammar School for Girls. Department of Mathematical Sciences. University of Liverpool

Similar documents
Symmetric polynomials and partitions Eugene Mukhin

UNIT CIRCLE TRIGONOMETRY

The Binomial Distribution

Week 3-4: Permutations and Combinations

Figure 2. So it is very likely that the Babylonians attributed 60 units to each side of the hexagon. Its resulting perimeter would then be 360!

Episode 401: Newton s law of universal gravitation

2 r2 θ = r2 t. (3.59) The equal area law is the statement that the term in parentheses,

Chapter 3 Savings, Present Value and Ricardian Equivalence

The force between electric charges. Comparing gravity and the interaction between charges. Coulomb s Law. Forces between two charges

Saturated and weakly saturated hypergraphs

An Introduction to Omega

Semipartial (Part) and Partial Correlation

Spirotechnics! September 7, Amanda Zeringue, Michael Spannuth and Amanda Zeringue Dierential Geometry Project

Continuous Compounding and Annualization

CHAPTER 10 Aggregate Demand I

Nontrivial lower bounds for the least common multiple of some finite sequences of integers

Displacement, Velocity And Acceleration

1240 ev nm 2.5 ev. (4) r 2 or mv 2 = ke2

Financing Terms in the EOQ Model

Questions & Answers Chapter 10 Software Reliability Prediction, Allocation and Demonstration Testing

On Some Functions Involving the lcm and gcd of Integer Tuples

Vector Calculus: Are you ready? Vectors in 2D and 3D Space: Review

STUDENT RESPONSE TO ANNUITY FORMULA DERIVATION

Graphs of Equations. A coordinate system is a way to graphically show the relationship between 2 quantities.

Concept and Experiences on using a Wiki-based System for Software-related Seminar Papers

Experiment MF Magnetic Force

est using the formula I = Prt, where I is the interest earned, P is the principal, r is the interest rate, and t is the time in years.

4a 4ab b (count number of places from first non-zero digit to

FXA Candidates should be able to : Describe how a mass creates a gravitational field in the space around it.

The LCOE is defined as the energy price ($ per unit of energy output) for which the Net Present Value of the investment is zero.

Converting knowledge Into Practice

Coordinate Systems L. M. Kalnins, March 2009

Gauss Law. Physics 231 Lecture 2-1

Over-encryption: Management of Access Control Evolution on Outsourced Data

Carter-Penrose diagrams and black holes

Voltage ( = Electric Potential )

Things to Remember. r Complete all of the sections on the Retirement Benefit Options form that apply to your request.

Skills Needed for Success in Calculus 1

INITIAL MARGIN CALCULATION ON DERIVATIVE MARKETS OPTION VALUATION FORMULAS

Reduced Pattern Training Based on Task Decomposition Using Pattern Distributor

Ilona V. Tregub, ScD., Professor

MULTIPLE SOLUTIONS OF THE PRESCRIBED MEAN CURVATURE EQUATION

How To Find The Optimal Stategy For Buying Life Insuance

2. TRIGONOMETRIC FUNCTIONS OF GENERAL ANGLES

How to create RAID 1 mirroring with a hard disk that already has data or an operating system on it

The Role of Gravity in Orbital Motion

Mechanics 1: Work, Power and Kinetic Energy

Software Engineering and Development

Fast FPT-algorithms for cleaning grids

Quantity Formula Meaning of variables. 5 C 1 32 F 5 degrees Fahrenheit, 1 bh A 5 area, b 5 base, h 5 height. P 5 2l 1 2w

Model Question Paper Mathematics Class XII

Physics HSC Course Stage 6. Space. Part 1: Earth s gravitational field

Comparing Availability of Various Rack Power Redundancy Configurations

VISCOSITY OF BIO-DIESEL FUELS

Define What Type of Trader Are you?

An Efficient Group Key Agreement Protocol for Ad hoc Networks

Lecture 16: Color and Intensity. and he made him a coat of many colours. Genesis 37:3

Risk Sensitive Portfolio Management With Cox-Ingersoll-Ross Interest Rates: the HJB Equation

Chris J. Skinner The probability of identification: applying ideas from forensic statistics to disclosure risk assessment

Uncertain Version Control in Open Collaborative Editing of Tree-Structured Documents

The Supply of Loanable Funds: A Comment on the Misconception and Its Implications

Supplementary Material for EpiDiff

Approximation Algorithms for Data Management in Networks

Explicit, analytical solution of scaling quantum graphs. Abstract

Comparing Availability of Various Rack Power Redundancy Configurations

Problem Set # 9 Solutions

Multiple choice questions [70 points]

Top K Nearest Keyword Search on Large Graphs

12. Rolling, Torque, and Angular Momentum

Deflection of Electrons by Electric and Magnetic Fields

Determining solar characteristics using planetary data

Physics 235 Chapter 5. Chapter 5 Gravitation

Experiment 6: Centripetal Force

Mechanics 1: Motion in a Central Force Field

Do Vibrations Make Sound?

How to recover your Exchange 2003/2007 mailboxes and s if all you have available are your PRIV1.EDB and PRIV1.STM Information Store database

Lab M4: The Torsional Pendulum and Moment of Inertia

PAN STABILITY TESTING OF DC CIRCUITS USING VARIATIONAL METHODS XVIII - SPETO pod patronatem. Summary

Lesson 7 Gauss s Law and Electric Fields

How To Write A Theory Of The Concept Of The Mind In A Quey

Loyalty Rewards and Gift Card Programs: Basic Actuarial Estimation Techniques

Gravitation. AP Physics C

AN IMPLEMENTATION OF BINARY AND FLOATING POINT CHROMOSOME REPRESENTATION IN GENETIC ALGORITHM

Towards Automatic Update of Access Control Policy

Thank you for participating in Teach It First!

Gravitational Mechanics of the Mars-Phobos System: Comparing Methods of Orbital Dynamics Modeling for Exploratory Mission Planning

Definitions and terminology

The transport performance evaluation system building of logistics enterprises

METHODOLOGICAL APPROACH TO STRATEGIC PERFORMANCE OPTIMIZATION

AMB111F Financial Maths Notes

Cloud Service Reliability: Modeling and Analysis

Mining Relatedness Graphs for Data Integration

Voltage ( = Electric Potential )

Lab #7: Energy Conservation

An Analysis of Manufacturer Benefits under Vendor Managed Systems

Integer sequences from walks in graphs

Separation probabilities for products of permutations

Magnetic Field and Magnetic Forces. Young and Freedman Chapter 27

YARN PROPERTIES MEASUREMENT: AN OPTICAL APPROACH

ON THE (Q, R) POLICY IN PRODUCTION-INVENTORY SYSTEMS

Transcription:

Univesal Cycles 2011 Yu She Wial Gamma School fo Gils Depatment of Mathematical Sciences Univesity of Livepool Supeviso: Pofesso P. J. Giblin

Contents 1 Intoduction 2 2 De Buijn sequences and Euleian Gaphs 2 2.1 Constucting a De Buijn Sequence............................ 2 2.2 Euleian Gaphs...................................... 5 2.3 Fleuy s Algoithm..................................... 6 2.4 The numbe of De Buijn sequences........................... 6 2.5 Constuction using Modula Aithmetic......................... 7 2.6 Applications of De Buijn sequences........................... 9 3 Pemutations 10 3.1 Univesal Cycles fo Pemutations............................ 10 4 Multiplying Univesal Cycles 13 5 Patitions of a Set 16 5.1 Univesal Cycles of Patitions of a Set.......................... 16 5.2 Bell Numbes........................................ 22 5.3 The Exponential Geneating Function of Bell Numbes................. 23 5.4 Stiling Numbes of the Second Kind........................... 25 6 Patitions of a numbe 26 7 Acknowledgements 31 1

1 Intoduction De Buijn sequences ae sequences whee each possible binay / tenay / quatenay... sequence of length n appeas exactly once. Univesal cycles ae genealisations of De Buijn sequences to othe combinatoial stuctues such as pemutations and patitions of a set. Although univesal cycles do not exist fo patitions of a numbe, this was an inteesting extension to the poject. 2 De Buijn sequences and Euleian Gaphs Fo a given alphabet whee each digit can take k diffeent values, a De Buijn sequence B(k,n) is a sequence of numbes in which evey possible set of n digits appeas exactly once. Example In the case of a binay De Buijn sequence of ode 3 (meaning each subsequence has length 3) whee each digit is eithe 0 o 1: The 8 possible sets of 3 digits ae: 000, 001, 011, 111, 110, 101, 010, 100 A De Buijn sequence B(2,3) would be: 00011101 By unning a window of length 3 along the above sequence, we can see that each of the possible tiplets appeas exactly once (this includes going aound the cone at the end of the sequence to obtain the tiplets 010 and 100). A De Buijn sequence has length =k n as each digit can take k diffeent values and thee ae n digits in each set (called an n-tuple). Fo the example above, the sequence has length 2 3 = 8. 2.1 Constucting a De Buijn Sequence De Buijn sequences can be constucted fom diected Euleian Gaphs. Consideing the case k = 2 and n = 3: To find a De Buijn sequence of ode 3, we wite down all the possible binay sets of length 2 and use them as the vetices of the gaph. 00, 01, 11, 10 We daw aows fom a vetex to a second vetex when the second digit of the fist vetex is the same as the fist digit of the second vetex. These aows can also stat and finish at the same vetex, as in the case of the vetices 00 and 11 as the second digit of both these vetices ae the same as the fist digit. By labelling an aow AB (tavelling fom vetex A to vetex B) with the digits in vetex A as well as the last digit of vetex B o the fist digit of vetex A as well as the digits in vetex B (the same sequence of digits) and finding an Euleian cycle aound the gaph, a De Buijn sequence can be found. Fo any vetex A, thee ae 2 aows leaving the vetex because the sequence is binay, meaning thee ae 2 choices fo the next digit in the sequence (i.e. 0 and 1), which will be satisfied by joining vetex A to 2 othe vetices. Similaly, thee will be 2 aows enteing vetex A because thee ae 2 choices fo the pevious digit in the sequence (i.e. 0 and 1), which will be satisfied by joining 2 othe vetices to vetex A. Theefoe, the numbe of aows enteing the vetex equals the numbe of aows leaving the vetex the vetices ae all even. We can wite out all the binay 3-tuples by witing out each binay 2-tuple and adding the digit 0 to the end, then witing out each binay 2-tuple again and adding the digit 1 to the end. This is effectively the same pocess as the one used when dawing and labelling the aows of the gaph, so each of the aows is distinct and epesents a unique binay 3-tuple. As a esult of the way we 2

000 001 00 010 100 01 10 101 011 11 110 111 Figue 1: Digaph fo the constuction of B(2,3) have constucted the gaph, the last 2 digits of any aow enteing a given vetex ae the same as the fist 2 digits of any aow leaving the same vetex. To wite out a De Buijn sequence fom the gaph, we find a oute which tavels along each aow exactly once and etuns to the stating vetex (this is called an Euleian cicuit). We wite out the labels on each aow as we tavel along it, deleting the 2 digits fom the end of the fist aow that ae epeated at the stat of the second aow. Fo the gaph above, a suitable oute would be: 000, 001, 011, 111, 110, 101, 010, 100. This gives the De Buijn sequence B(2,3): 00011101 To find a De Buijn sequence of ode 4, we epeat the above pocess using the binay sets of length 3 as the vetices of the gaph and labelling the aows between vetices with sequences of 4 digits. Thee ae still 2 paths enteing and 2 paths leaving each vetex, but the vetices of the gaph fo B(2,4) now have the same labels as the aows of the gaph fo B(2,3). This new gaph N is fomed by doubling the oiginal gaph N. In this case, an Euleian cicuit fo the gaph would be: 0000, 0001, 0011, 0111, 1111, 1110, 1100, 1001, 0010, 0101, 1011, 0110, 1101, 1010, 0100, 1000. This gives the De Buijn sequence B(2,4): 0000111100101101. Similaly, the simplest gaph fo De Buijn sequences fo k = 2 (when n = 2) has only 2 vetices, with each vetex labelled with just 1 digit i.e. one is labelled 0 and the othe 1. In this case thee is only one Euleian cicuit (if the vetex fom which we stat does not matte): 00, 01, 11, 10. This leads to the (only) De Buijn sequence B(2,2): 0011 This method can also be used when k 2. Fo k = 3 and n = 3, the vetices of the gaph ae all the possible combinations of 2 digits whee each digit can take one of the 3 values 0, 1 o 2. Thee ae 3 2 = 9 such combinations so the gaph has 9 vetices. The aows ae dawn and labelled in the same way as befoe and an Euleian cicuit aound the gaph is found. The De Buijn sequence in this case would have length 3 3 = 27. An Euleian cicuit would be: 011, 111, 112, 121, 210, 101, 012, 120, 201, 010, 102, 021, 211, 110, 100, 002, 022, 221, 212, 122, 222, 220, 202, 020, 200, 000, 001. This gives the De Buijn sequence B(3,3): 011121012010211002212220200. 3

0000 0001 000 1000 1001 001 100 0010 0100 010 0011 0101 1010 1100 1011 101 1101 011 0110 110 0111 111 1110 1111 Figue 2: Digaph fo the constuction of B(2,4) 00 0 01 10 1 11 Figue 3: Digaph fo the constuction of B(2,2) A gaph to find B(k,n) can be constucted in the same way fo any k and n values and will always have the following popeties: k n 1 vetices k n aows k aows enteing each vetex (in degee = k) k aows leaving each vetex (out degee = k) 4

111 012 11 011 112 110 211 101 121 01 10 21 12 210 010 212 102 021 100 221 001 122 002 022 00 02 22 000 222 020 202 200 220 201 120 20 Figue 4: Digaph fo the constuction of B(3,3) each vetex is even 2.2 Euleian Gaphs An Euleian gaph is a gaph in which an Euleian cicuit can be found. To ensue that this method woks fo De Buijn sequences of any k and n values, we must pove that an Euleian cicuit can always be found fo the gaphs we use to constuct De Buijn sequences. Theoem 1 Let D be a connected digaph. Then D is Euleian if and only if the out degee of each vetex equals the in degee. Poof 1. If D is Euleian, the out degee of each vetex equals the in degee. If D has an Euleian cicuit, we can tavel along the cicuit using each aow exactly once and etun to ou stating point. Wheneve we pass though a vetex of G thee is a contibution of 1 to both the in degee and the out degee of the vetex (meaning they ae the same) - this includes the initial vetex, which we etun to at the end of the cicuit. Since each in and out aow of D is used just once, the in and out degee of each vetex is the same. 2. If the out degee of each vetex equals the in degee, the gaph is Euleian. Conside a connected digaph whee each vetex is even: A 1 A 2 whee the in degee = out degee fo each vetex Stat at any vetex and follow diected paths to othe vetices. When a vetex A i is eached, thee ae 2 possible situations: 1. Thee is an aow out of A i, in which case follow this aow. 2. Thee is no edge out of A i as the in degee of each vetex equals the out degee, this vetex A i must have been eached befoe (i.e. the path stated at A i ) as we have followed all edges out of A i. This means a diected cycle C has been fomed in the gaph. 5

As thee ae a finite numbe of vetices, situation 2 must at some point aise, so it is always possible to find a diected cycle C in the gaph. Let D be a gaph whee the out degee and in degee of each vetex ae equal and the total numbe of aows = m. D contains a diected cycle C. When m = 0, D consists of one vetex only and it is theefoe Euleian. Assume tue fo any connected digaph whee m < n. Now conside a digaph with n aows. Delete the edges of the diected cycle C fom D. The esulting digaph H has m < n and evey vetex H has an in degee = out degee, theefoe each component of H is Euleian. By following the diected cycle C, taking Euleian tails fo the components of H when we meet them and etuning to cycle C, we can find an Euleian tail fo the gaph. This explains why De Buijn sequences always exist fo any k,n as they ae fomed fom Euleian cicuits of gaphs whee the vetices ae even and of ode n 1. 2.3 Fleuy s Algoithm Fleuy s algoithm is a way of finding an Euleian cicuit in an Euleian gaph. In the case of De Buijn sequences, this will be a diected gaph with aows instead of edges connecting the vetices. 1. Choose a stating vetex u. 2. At each stage, tavese any available edge, choosing a bidge (an edge whose emoval disconnects a vetex fom the est of the gaph) only if thee is no altenative. 3. Afte tavesing each edge, ease it (also ease any vetices of degee 0 which esult) and then tavese anothe available edge. 4. Stop when thee ae no moe edges - an Euleian cicuit has been found. 2.4 The numbe of De Buijn sequences Thee is moe than one De Buijn sequence when n > 2 o k > 2 and these can be found by taking diffeent Euleian cicuits in the appopiate digaph. The numbe of distinct binay sequences, whee the evese of a sequence is counted as a diffeent sequence but cyclic pemutations ae egaded as the same, is P n = 2 2n 1 n. Let the numbe of diffeent Euleian cicuits in an Euleian gaph N be denoted by N. Similaly, the numbe of Euleian cicuits in N (the doubled gaph of N) is denoted by N. It was poved by N.G. de Buijn in [2] that N = 2 m 1 N whee m is the ode of N (N has m vetices and 2m aows). This esult can be used to pove the numbe of De Buijn sequences fo any value of n when k = 2. Theoem 2 The numbe of binay De Buijn sequences P n = 2 2n 1 n Poof When n = 1, P 1 = 1(this is evident fom the gaph) Using the fomula: P 1 = 2 21 1 1 = 2 0 = 1 Theefoe the fomula is tue fo n = 1. Assume tue fo n y. 6

We must now pove it is tue fo n = y + 1, i.e. P y+1 = 2 2y y 1 A De Buijn sequence of ode n can be found fom an Euleian gaph of ode 2 n 1, so fo a De Buijn sequence whee n = y + 1 we must conside an Euleian gaph of ode 2 y. N y 1 has ode 2 y 1 and can can be used to constuct a De Buijn sequence of ode y N y has ode 2 y and is theefoe the doubled vesion of N y 1 P = N y = N y 1 = 2 m 1 N y 1 = 2 2y 1 1 2 2y 1 y = 2 2 2y 1 y 1 = 2 2y y 1 We have shown that the fomula fo P is coect fo n = 1 and that if it is tue fo n = y, then it is also tue fo n = y + 1. Theefoe it is tue, by induction, fo all n 1. This esult was extended by T. van Aadenne-Ehenfest and N. G. de Buijn in [1] and thee is now a fomula fo the numbe of distinct De Buijn sequences fo any values of k and n: P = k! kn 1 n 2.5 Constuction using Modula Aithmetic An altenative way of finding a De Buijn sequence when k = 2 was given in [6]. Fo a given n and stating with a 1 = 2 n 1, a sequence of numbes can be geneated by epeatedly substituting the pevious numbe in the sequence into the fomula: If fo some i j, a i = 2a j, then in this case: a i+1 2a i (mod 2 n ) a i+1 2a i + 1 (mod 2 n ) This means that if the fist fomula gives a numbe aleady geneated, then add 1 to this numbe to obtain the next numbe in the sequence, substituting this new numbe back into the fist equation to obtain futhe numbes in the sequence. All these numbes of the sequence should be witten in binay fom (to base 2 with 3 digits - put 0s befoe the numbe if thee ae fewe than 3 digits) and consecutive numbes in the sequence will join togethe to fom a De Buijn sequence B(2,n). Fo n = 3, we have mod 2 3 = 8. This means that if the numbe 8, we take the emainde when it is divided by 8. Anothe way to think of this would be a clock with 8 hous on the face - when it is 9 o clock the clock face looks the same as it does when it is 1 o clock i.e. 9=1 (mod 8). a 1 = 2 3 1 = 8 1 = 7 = 111(in binay fom) a 2 = 2 7 = 14 = 6 = 110 a 3 = 2 6 = 12 = 4 = 100 (hee we can do 2 6 instead 2 14 as it is simple and both calculations give the same answe mod 8) a 4 = 2 4 = 8 = 0 = 000 a 5 = 2 0 = 0 which has aleady been geneated a 5 = 0 + 1 = 1 = 001 a 6 = 2 1 = 2 = 010 a 7 = 2 2 = 4 which has aleady been geneated a 7 = 4+1 = 5 = 101 a 8 = 2 5 = 10 = 2 which has aleady been geneated a 8 = 2 + 1 = 3 = 011 We can now stop as we have obtained the fist 2 n numbes in the sequence needed to fom a De Buijn sequence. Putting these numbes togethe and omitting the ovelapping digits between consecutive numbes (including the last 2 digits which ovelap with the fist 2 digits) gives the sequence B(2, 3): 11100010. 7

Why does this method wok? Effectively, fo a given n, we ae geneating the numbes 0 to 2 n 1 in a special ode which means that when they ae witten in binay fom, the fist n 1 digits of a numbe ae the same as the last n 1 digits of the numbe geneated befoe it. This popety must hold in ode fo the constuction of a De Buijn sequence to be possible. When using this method only the fist 2 n numbes need to be geneated as the De Buijn sequence will have length 2 n. Because we ae using modula aithmetic mod 2 n and do not allow epeated numbes to be counted in the sequence, this means the fist 2 n numbes geneated must be the numbes 0 to 2 n 1. Multiplying a i by 2 to find a i+1 shifts the last n 1 digits of a i one place to the left (like multiplying by 10 in base 10), so consecutive numbes geneated by the fist fomula always ovelap by n 1 digits. The fist fomula alway esults in a numbe ending in 0 so to obtain altenative endings i.e. a last digit of 1 we add 1 to 2a i (fomula 2). This does not affect the fist n 1 digits of the numbe, so it still ovelaps with the pevious numbe geneated. We must be caeful with the choice of a 1 because othewise we may need to add 1 twice consecutively to a i to get a numbe which has not peviously been geneated. This would mean the numbe geneated would not ovelap with the pevious numbe in the sequence. Let us conside the lagest numbe to be geneated: 2 n 1, which is a numbe consisting of n 1 s when witten in binay fom. If the intege 2 n 1 is not at the beginning, then it must be peceded by 2 n 1 1 (binay fom: a 0 followed by n 1 1 s) and 2 n 2 (binay fom: n 1 1 s followed by a 0 ) must have aleady occued in the sequence so that we add 1 using fomula 2. Howeve, the numbe 2 n 2 must be peceded by eithe 2 n 1 o 2 n 1 1. This means that fo this method of constuction to wok, we must have a 1 = 2 n 1 o a 1 = 2 n 2. If we wee to stat with the second option fo a 1 athe than the fist, we would obtain the same sequence of numbes, except that the numbe 2 n 1 would be the last numbe geneated as opposed to the fist. Both values fo a 1 theefoe give the same De Buijn cycle. Fo n = 4, we have mod 2 4 = 16. a 1 = 2 4 1 = 16 1 = 15 = 1111 a 2 = 2 15 = 30 = 14 = 1110 a 3 = 2 14 = 28 = 12 = 1100 a 4 = 2 12 = 24 = 8 = 1000 a 5 = 2 8 = 16 = 0 = 0000 a 6 = 2 0 = 0 a 6 = 0 + 1 = 1 = 000 a 7 = 2 1 = 2 = 0010 a 8 = 2 2 = 4 = 0100 a 9 = 2 4 = 8 a 9 = 8 + 1 = 9 = 1001 a 1 0 = 2 9 = 18 = 2 a 1 0 = 2 + 1 = 3 = 001 a 11 = 2 3 = 6 = 0110 a 12 = 2 6 = 12 a 12 = 12 + 1 = 13 = 110 a 13 = 2 13 = 26 = 10 = 1010 a 14 = 2 10 = 20 = 4 a 14 = 4 + 1 = 5 = 010 a 15 = 2 5 = 10 a 15 = 10+1 = 11 = 1011 a 16 = 2 11 = 22 = 6 a 16 = 6+1 = 7 = 011 We now have the 2 n numbes needed to fom a De Buijn sequence B(2,4): 1111000010011010. Does this method wok fo k 3? To see if modula aithmetic could be used to constuct De Buijn sequences with lage alphabets i.e. k 3, I tied using this method to constuct B(3,2) by stating with a 1 = 3 n 1, witing numbes geneated in the sequence in tenay fom and adapting the pevious fomulae: If fo some i j, a i = 3a j, then in this case: a i+1 3a i (mod 3 n ) a i+1 3a i + 1 (mod 3 n ) 8

Fo k = 3,n = 2, we have mod 3 2 = 9. a 1 = 3 2 1 = 9 1 = 8 = 22 a 2 = 3 8 = 24 = 6 = 20 a 3 = 3 6 = 18 = 0 = 00 a 4 = 3 0 = 0 a 4 = 0 + 1 = 1 = 01 a 5 = 3 1 = 3 = 10 a 6 = 3 3 = 9 = 0 a 6 = 0 + 1 = 1 a 6 = 1 + 1 = 2 = 02 a 7 = 3 2 = 6 a 7 = 6 + 1 = 7 = 21 a 8 = 3 7 = 21 = 3 a 8 = 3 + 1 = 4 = 11 a 9 = 3 4 = 12 = 3 a 9 = 3 + 1 = 4 a 9 = 4 + 1 = 5 = 12 We now have the 3 n numbes needed to fom a De Buijn sequence B(3,2): 220010211. Theefoe the method has been successful in poducing a De Buijn sequence when k 2. Note how in this example, we wee able to add 1 twice consecutively, wheeas in the pevious example we only added 1 once to obtain a paticula numbe in the sequence. This is because in this example we wote the numbes in base 3, so could add 1 o 2 afte multiplying by 3 without changing the fist 2 digits of the final numbe geneated. This meant that the fist 2 digits of this numbe would still ovelap with the final 2 digits of the pevious numbe in the sequence. Adding 3 in this situation would have changed the second digit in the sequence, meaning it would no longe fully ovelap with the pevious numbe (a popety equied fo the fomation of a De Buijn sequence), but thee was no need to do this. Remak 3 I believe that this method could be extended fo all values of k, with a 1 = k n 1 and: a i+1 ka i (mod k n ) Unless fo some i j, a i = ka j, then in this case: a i+1 ka i + 1 (mod k n ) Howeve, a disadvantage of this method is that only one De Buijn sequence fo a given n and k can be fomed, wheeas the method of constuction using Euleian gaphs can be used to find all possible distinct De Buijn cycles by finding all the diffeent Euleian cicuits aound the gaph. 2.6 Applications of De Buijn sequences De Buijn sequences have many uses, including in the positioning of obots. If a obot is moving along a tack maked with a De Buijn sequence e.g.b(2,3), then by looking at the neaest 3 numbes in the sequence, the obot can detemine its location on the tack as each tiplet is unique. Euleian gaphs wee used to solve the famous poblem the Seven Bidges of Konigsbeg. The Russian city of Konigsbeg is located on the Rive Pegel. The city has 2 lage islands, which wee connected to the mainland aea by 7 bidges. The people of the city often wondeed whethe it was possible to coss each of the 7 bidges exactly once on a single oute, but Leonhad Eule poved that this was impossible. By dawing each land mass as a vetex of a gaph and the bidges as edges of the gaph, he showed that the esulting gaph was not Euleian and so cossing each bidge exactly once was not possible. De Buijn sequences can be used to minimise the effot needed to guess a code in locks that do not have an ente key but instead accept the last n digits enteed. Fo example, to ty all the possible combinations of a 4 digit PIN like code, a De Buijn sequence B(10,4) could be used. This univesal cycle would have length 10 4 and enteing digits in the ode given by the cycle would equie only 10 4 + 3 = 10003 pesses, wheeas tying all the possible combinations fo the code sepaately would take 10 4 4 = 40000 pesses. 9

De Buijn sequences also have applications in geneating sequences in DNA, with an alphabet consisting of the 4 types of nucleotide which make up DNA: adenine(a), thymine(t), cytosine(c), guanine(g). The uses of De Buijn sequences in cad ticks ae given in the section on multiplying univesal cycles. 3 Pemutations When consideing pemutations, it is the elative size of each digit which we ae concened with athe than the actual value of a digit. Fo example, fo pemutations of 3 digits, we can think of each of the 3 digits as being low (L), medium (M) o high (H). In this case the numbe of pemutations would be 3! = 6 and can be expessed by the lettes above as LMH, LHM, MLH, MHL, HLM, HML, which coespond to the numbe pemutations 123, 132, 213, 231, 312, 321. Fo pemutations of n objects, thee ae n! distinct pemutations as we have a choice of n values fo the fist digit, n 1 values fo the second digit and so on until thee is only one possible numbe left fo the nth digit. 3.1 Univesal Cycles fo Pemutations We say that the n-tuples a and b ae ode-isomophic, witten ā b if a i < a j b i < b j. Univesal cycles fo pemutations ae cycles of length n! whee each of the n! pemutations of n distinct integes is ode-isomophic to exactly one n-tuple in the cycle. That is to say, any n consecutive digits in the cycle will have a distinct elative size ode. A univesal cycle fo pemutations of n digits whee n 3 will consist of at least n + 1 digits. This is because if, fo example, we ty constucting a univesal cycle fo n = 3 using just 3 digits: 123 the next digit must be 1 as each symbol in a window of length 3 must be diffeent 1231 the next digit must be 2 12312 the next digit must be 3, but this means we have epeated the fist window of 3 symbols, so this is not a univesal cycle. The same poblem aises if we ty constucting a univesal cycle fo any n 3 with just n symbols the sequence always ends up epeating itself, so this cannot be done. It was poved in [5] that fo n 3, it is always possible to find a univesal cycle fo pemutations using exactly n + 1 symbols. The method of constuction of univesal cycles fo pemutations is simila to that used to fom De Buijn sequences as gaphs ae used. This time we use the n! pemutations of n integes as the vetices of the gaph. This gaph is called a tansition gaph. Next we wok out which vetices ae connected by dawing aows fom each vetex to the vetices whee the last n 1 digits of the oiginal vetex and the fist n 1 digits of the second vetex ae ode-isomophic. When n = 3, thee ae 3! = 6 pemutations and so the gaph has 6 vetices. We can stat with any 3 numbes (even non-integes) as we ae only concened with the elative size of the integes. e.g. 679,679 123. We conside the possible size of the next digit by looking at the last n 1 = 3 1 = 2 digits: 79x. x could lie in n 1 + 1 = n = 3 diffeent anges: 1. x < 7 < 9 79x 231 2. 7 < x < 9 79x 132 3. 7 < 9 < x 79x 123 This means thee ae n aows leaving and n aows enteing each vetex and a total of n n! aows 10

in the tansition gaph. 123 132 213 321 312 231 Figue 5: Tansition gaph fo n = 3 To fom a univesal cycle, we would need to take a Hamiltonian cicuit in the gaph (a path which visits each vetex exactly once, etuning to the stating vetex). Howeve, Hamiltonian cicuits ae difficult to find, especially fo moe complicated gaphs and thee is no way of knowing if such a path exists without tying out all the possible paths. To avoid this poblem, we convet the tansition gaph to an Euleian gaph by gouping togethe pemutations whee the fist n 1 digits ae ode-isomophic into new lage vetices. Thee should be (n 1)! vetices in the new gaph. 123 132 231 213 312 321 Figue 6: Euleian gaph fo n = 3 In the Euleian gaph, an aow fom a pemutation to a vetex means that it is possible to tavel fom that pemutation to all the pemutations in the vetex. Next we find an Euleian cicuit in the gaph, e.g. 231, 312, 123, 132, 321, 213, 231. Clealy, the maximum numbe of symbols we would need fo a sequence of length n! is n! and fo this example we will use the 3! = 6 lettes: abcdef. By unning windows of length n along the sequence of lettes and compaing this to the pemutations of length 3 in the Euleian cicuit, inequalities can be witten down to compae the elative sizes of the lettes. abc : 231 c < a < b bcd : 312 c < d < b cde : 123 c < d < e def : 132 d < f < e efa : 321 a < f < e fab : 213 a < f < b Combining these inequalities togethe gives: a and d can be combined and b and e can be combined whilst still satisfying all the inequalities, 11

c a d f b e so only 4 symbols wee needed fo the pemutation cycle (which is the least possible numbe as we need at least n + 1 = 3 + 1 = 4 symbols). Finally we wite down the numbes coesponding to the sequence abcdef to obtain the univesal cycle fo pemutations of length 3: 241243. This combining of lettes is not always possible and sometimes we ae foced to use moe than n+1 symbols. Fo the Euleian cicuit: 312, 231, 213, 123, 132, 321, 312 we have the inequalities: abc : 312 b < c < a bcd : 231 d < b < c cde : 213 d < c < e def : 123 d < e < f efa : 132 e < a < f fab : 321 b < a < f Combining these inequalities togethe gives: d < b < c < e < a < f so in this case none of the lettes can be combined and we get the univesal cycle: 523146. Remak 4 I found seveal Euleian cicuits in the gaph and conveted these into univesal cycles fo pemutations when n = 3 and an inteesting patten began to emege. As has aleady been mentioned, the numbe of symbols used in a univesal cycles fo n = 3 is a minimum of 4 and a maximum of 6. Howeve, I noticed that thee did not seem to be any cycles consisting of exactly 5 diffeent symbols. Looking at this poblem in moe detail, I found that the Euleian cicuits which led to a cycle using 4 symbols had 4 of what I thought of as good connections and cicuits with 4 good connections always led to a cycle with 4 symbols. These good connections occued when the final 2 digits of the fist pemutation wee exactly the same as the fist 2 digits of the second pemutation as opposed to being just ode-isomophic. These good connections seemed to lead to fewe symbols being needed fo the cycle as it meant some of the 6 lettes initially used could be combined. I also found that the Euleian cicuits which led to a cycle using 6 symbols had only 1 good connection and cicuits with 1 good connection always led to a cycle with 6 symbols. I thought that pehaps Euleian cicuits with 2 o 3 good connections would lead to a univesal cycle with 5 symbols. Howeve, I was unable to find such a cicuit in the gaph and theefoe think that pehaps it is not possible to obtain a 5 symbol cycle fo pemutations (obviously this excludes the case whee one of the numbe 4s in a cycle with 4 symbols is simply changed to a bigge numbe). In the tansition gaph below, the good connections ae those with dashed aows. This method can be used to constuct univesal cycles fo pemutations of 4 o moe objects. Fo n = 4, the tansition gaph has 3! = 6 vetices and the pemutations whee the fist n 1 = 4 1 = 3 digits ae ode-isomophic ae gouped in the same vetex. Aows ae dawn in the same way as befoe, with a single aow to a vetex epesenting paths to all the pemutations in that vetex. In this case, an Euleian cicuit would be: 1234, 2341, 2314, 3142, 1423, 4231, 3421, 3214, 2143, 1432, 12

312 231 123 321 132 213 4321, 4213, 2134, 1243, 2431, 4312, 3124, 1342, 2413, 4132, 1324, 3241, 3412, 4123, 1234. Using this to wite inequalities gives: a b c d e g h I j l m o n q s u v w a b c f k p t x 5 This in tun gives the univesal cycle: 123415342154213541352435. This cycle using the smallest possible numbe of diffeent symbols fo n = 4: 5. [5] gave an altenative method of constucting univesal cycles fo pemutations which guaanteed that the esulting cycle had the smallest possible numbe (n + 1) of diffeent symbols. This involves constucting sub cycles whee the pemutations had what I peviously called good connections. These sub cycles ae then connected togethe to fom a cycle of n! pemutations which can then be conveted into a univesal cycle of length n!. 4 Multiplying Univesal Cycles Multiplying togethe 2 univesal cycles x and y which have lengths R and S espectively is possible when one of the cycles with window length k finishes with a block of k epeated symbols. The 13

method fo doing this was given in [4]. The 2 univesal cycles being multiplied togethe need not have the same window length but in most cases they do. Multiplying these cycles togethe gives a cycle of pais of length RS, with values fom x on the top ow and values of y on the bottom. If both univesal cycles have window length k, each k consecutive pais in the poduct cycle will be unique (i.e. a unique combination of the top and bottom ows). The cycles multiplied togethe can be of diffeent types, e.g. a De Buijn sequence can be multiplied with a univesal cycle fo pemutations. When a pemutation cycle fo 3 objects: 241243 is multiplied by a De Buijn sequence fo binay stings of length 3: 11101000, we get: 2 4 1 2 4 3 2 4 1 2 4 3 2 4 1 2 4 3 2 4 1 2 4 3 1 1 1 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 0 1 2 4 1 2 4 3 2 4 1 2 4 3 2 4 1 2 4 3 2 4 1 2 4 3 1 1 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 0 0 0 Running a window of length 3 along the poduct cycle gives a unique coupling of a low, medium, high pemutation with a binay sting of length 3. This poduct cycle can be used in cad ticks. It has a length of 48 so the 4 kings must be emoved fom a deck of 52 cads. Next, the pemutation cycle fo window length k on the top ow of the poduct is lifted so that it contains 6 distinct symbols athe than just 4 (lifting is the pocess of inceasing the alphabet of a univesal cycle whilst etaining the cycle s popeties). This is done by finding the highest digit (it may appea seveal times) and changing one appeaance of this digit to the numbe k!. Then we take the next highest digit (not including the k! digit) and change it to the digit k! 1. This pocess continues until thee ae as many distinct digits in the cycle as equied. Fo example, a univesal cycle fo pemutations of 3 objects is: 241243. Woking fom left to ight in the case of the same digit appeaing moe than once, we get: 261243 261253 261254 361254 (which now contains 6 diffeent digits). We now look at 2 adjacent copies of this cycle: 361254361254. Each digit 1 can be assigned eithe 1 o 2, each digit n can be assigned eithe the numbe 2n-1 o the numbe 2n up until the digit 6 can be assigned eithe 11 o 12. Choosing the lowe numbe fist in each case gives: 3 6 1 2 5 4 3 6 1 2 5 4 5 11 1 3 9 7 6 12 2 4 10 8 (We can change whethe we choose the lowe o highe of the 2 numbes to make the sequence look moe andom.) In the poduct cycle above, this patten is epeated 4 times so each of the 12 cads in each suit is included exactly once, with ed cads (Heats and Diamonds) fo 1 s in the De Buijn sequence on the bottom ow and black cads (Clubs and Spades) fo 0 s in the bottom ow. An example of a sequence which could be used fo a cad tick would be: 5 11 1 3 9 7 6 12 2 4 10 8 5 12 2 3 9 8 6 11 1 4 10 7 D H H S D C C C D D D S H S S C H D H C D S S D 6 12 1 4 10 8 5 11 2 3 9 7 5 11 2 3 10 8 6 12 1 4 9 7 D H C H C C S D H H S H C S C D H H S D S C C S By asking people to choose 3 adjacent cads in the sequence and finding out which cads ae ed, as well as which cads ae the highest and lowest, we can deduce the value and suit of each of the 3 cads chosen by efeing to the oiginal poduct sequence and then the lifted sequence. 14

Conside 2 cycles x and y of lengths R and S. If R and S ae elatively pime (have a highest common facto of 1), then to multiply the 2 cycles, simply wite down x S times and below wite down y R times. Fo example, to multiply a univesal cycle fo patitions of set of 4 numbes (x): daabbbbcbccbadb (R = 15) with a De Buijn sequence fo binay stings of length 4 (y): 1111001011010000 (S = 16), we simply wite out x 16 times and y 15 times as 15 and 16 ae co-pime. This gives the poduct consisting of 15 16 = 240 pais: d a a b b b b c b c c b a d b d a a b b b b c b c c b a d b... 1 1 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 1 1 0 1 0 0... Running a window of length 4 along this poduct gives a unique patition of a set of 4 elements plus binay sting of length 4 combination. If R and S ae not elatively pime, and thei highest common facto is d (d 1), then we have: R = d and S = sd whee and s ae co-pime. To obtain a cycle of RS pais: 1. wite down x S times 2. wite down y times 3. emove the last epeated digit in the epeated y sequence, foming the sequence y 4. wite down y a total of d times below the epeated sequence of x 5. add d of the digit emoved to the end of the epeated y sequence This gives a sequence of length: (S 1) d + d = Sd d + d = Sd = RS as equied. Fo example, to multiply a De Buijn sequence fo binay stings of length 2: 0011 by itself, R = S = 4, d = 4, R = S = 1 d. Fist, we wite down x 4 times: 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Next, wite down y once and emove the last 1 to fom y : 0 0 1 Finally, wite down y 4 times below the epeated sequence of x and add 4 1 s at the end to give the poduct sequence: 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 0 1 1 1 1 1 Running a window of length 2 along the poduct gives 16 unique 2 2 squaes. This pocess can be continued and the poduct cycle can be multiplied by anothe univesal cycle, fo example multiplying the De Buijn sequence fo n = 1: 01 by itself gives: 0 1 0 1 0 0 1 1 15

Multiplying the poduct by 01 again gives: Multiplying the poduct by 01 again gives: and so on. 5 Patitions of a Set 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 A patition of any set A consisting of n elements {... n} is fomed when A is divided into subsets which ae mutually exclusive (have no elements in common) and collectively contain all the elements in the set. Each subset must be non-empty (must contain at least 1 element fom the set). A patition of a set can be expessed by using vetical bas to show the sepaation of elements of the set into subsets. The subsets ae independent of ode, meaning the ode in which the sepaate subsets of a patition ae witten and the ode of the elements within a subset do not matte. Fo example, the set A{} has 15 patitions, which can be witten as: 1 234 1 2 34 1 2 3 4 1234 2 134 1 3 24 3 124 1 4 23 4 123 2 3 14 12 34 2 4 13 13 24 3 4 12 14 23 The numbe of patitions of a set with n elements is given by the Bell numbes B n. 5.1 Univesal Cycles of Patitions of a Set Univesal cycles of patitions of a set with n elements can be fomed. These univesal cycles ae vey diffeent fom those fomed fo pemutations and De Buijn sequences. They usually consist of a sequence of B n lettes. When a window of length n is moved along the sequence, we numbe each lette in the window 1 to n fom left to ight. If the lettes of 2 o moe numbes ae the same, this means these numbes ae in the same subset in the patition. This means that if 2 numbes coespond to diffeent lettes in the sequence, these 2 numbes ae in sepaate subsets. The method used to constuct these univesal cycles is simila to that used to poduce univesal cycles of pemutations and De Buijn sequences as we must again use Euleian gaphs. Fist, we constuct a tansition gaph by witing down the patitions of the set as the vetices of the gaph. Aows ae dawn fom one vetex to anothe vetex when the elationship between the numbes 2 to n of the fist vetex is the same as the elationship between the numbes 1 to n 1 in the second vetex (in tems of whethe o not they ae in the same subset of the patition). 16

Fo the case whee n = 3, we ae constucting a cycle fo patitions of the set {1 2 3}. Thee ae 5 patitions of this set: 1 23 1 2 3 2 12 123 3 12 These patitions ae the 5 vetices of the tansition gaph. The vetex 123 would be epesented by the lettes aaa as all 3 numbes ae in the same patition and when dawing aows fom this vetex we look at the the numbes 2 to n = 3 which ae epesented by aa. This can be followed by eithe aaa o aab which coespond to the vetices 123 and 12 3 so aows can be dawn fom the oiginal vetex to these vetices. It is impotant to note that the actual lettes that epesent a patition ae not of geat impotance - it is whethe these lettes ae the same o diffeent that mattes. Fo example, an aow could be dawn fom 1 2 3 (abc) to 1 23 (abb). 123 1 23 2 13 3 12 1 2 3 Figue 7: Tansition gaph fo patitions of a set with 3 elements This tansition gaph is then conveted to anothe gaph by gouping togethe patitions whee the fist n 1 numbes have the same elationship to fom a lage single vetex. This means the new gaph will have B n 1 vetices. Once again an aow fom a patition to a vetex means that it is possible to tavel fom that pemutation to all the pemutations in the vetex. 123 3 12 1 2 3 1 23 2 13 Figue 8: Euleian gaph fo patitions of a set with 3 elements Next, we must find an Euleian cicuit in this gaph. Fo n = 3 the only 2 possible cicuits ae: 123, 3 12, 2 13, 1 2 3, 1 23, 123 and 123, 3 12, 1 2 3, 2 13, 1 23, 123. 17

Finally we need to lift the Euleian cicuit to a univesal cycle. This is done by assigning x Bn symbols to the numbes in the patitions and witing equalities to show whethe o not these symbols ae equal (i.e. whethe they ae in the same subset of a patition). Fo each patition, the numbes ae eaanged in inceasing ode, then we look at whethe o not thei coesponding symbols should be equal. x 1 x 2 x 3 x 4 x 5 x 1 x 2 1 2 3 3 1 2 2 1 3 1 2 3 1 2 3 x 1 x 2 x 3 x 4 x 5 x 1 x 2 1 2 3 3 1 2 1 2 3 2 1 3 1 2 3 Figue 9: Lifting Euleian cicuits fo n = 3 Fo the fist Euleian cicuit, we obtain the following set of equalities: x 1 = x 2 = x 3 x 2 = x 3 x 4 x 3 = x 5 x 4 x 4 x 5 x 5 x 1 x 1 x 4 x 1 = x 2 x 5 Howeve, this leads to a contadiction, as we can deduce that x 5 x 1 = x 3 = x 5. Theefoe we conclude that this paticula Euleian cicuit cannot be lifted successfully to fom a univesal cycle. Fo the second Euleian cicuit, we obtain the following set of equalities: x 1 = x 2 = x 3 x 2 = x 3 x 4 x 3 x 4 x 4 x 5 x 5 x 3 x 4 = x 1 x 5 x 1 = x 2 x 5 Howeve, this also leads to a contadiction, as we can deduce that x 4 = x 1 = x 3 x 4. We conclude that this Euleian cicuit cannot fom a univesal cycle. As thee ae only 2 Euleian cicuits fo the gaph of patitions of a set of 3 elements and we have shown that neithe can be used to fom a univesal cycle, we have poved by exhaustion that no univesal cycles exist fo patitions of a set of 3 elements. Univesal cycles fo patitions of a set of 4 elements do exist and can be constucted by skipping the tansition gaph and dawing the Euleian gaph staight away and combining the patitions in which the numbes 1 to n 1 = 4 1 = 3 have the same elationship into a single lage vetex. Dawing aows between the vetices in the same way as in the pevious example gives an Euleian gaph with 5 vetices and 15 aows. In [3] it was stated that in ode to pevent equalities leading to a contadiction and to guaantee an Euleian cicuit can be lifted to fom a univesal cycle, a sequence of patitions called a beake must occu in the Euleian cicuit. Using the beake they gave: 1 4 23, 12 34, 1 234, 1234, 4 123, I found an Euleian cicuit fo the gaph and used it to poduce a univesal cycle fo n = 4. The Euleian cicuit was: 18

1 3 24 1 2 34 2 3 14 2 4 13 2 134 13 24 1 4 23 14 23 1 234 4 123 1234 3 4 12 3 124 12 34 Figue 10: Euleian gaph fo patitions of a set with 4 elements 1 4 23, 12 34, 1 234, 1234, 4 123, 3 124, 13 24, 2 134, 14 23, 3 4 12, 1 2 3 4, 2 3 14, 1 3 24, 2 4 13, 1 2 34, 1 4 23. x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x 15 x 1 x 2 x 3 1 4 2 3 4 1 2 3 3 1 2 4 1 3 2 4 2 1 3 4 1 4 2 3 3 4 1 2 2 3 1 4 1 3 2 4 2 4 1 3 Figue 11: Lifting an Euleian cicuit fo n = 4 This gave the set of equalities: x 1 x 2 = x 3 x 4 x 1 x 4 x 2 = x 3 x 4 = x 5 x 3 x 4 = x 5 = x 6 x 4 = x 5 = x 6 = x 7 x 5 = x 6 = x 7 x 8 x 6 = x 7 = x 9 x 8 x 7 = x 9 x 8 = x 10 x 8 = x 10 = x 11 x 9 19

x 9 = x 12 x 10 = x 11 x 10 = x 11 x 12 x 13 x 10 = x 11 x 13 x 11 x 12 x 13 x 14 x 11 x 13 x 11 x 14 x 12 x 14 x 12 = x 15 x 13 x 14 x 12 = x 15 x 14 x 13 x 14 = x 1 x 15 x 13 x 15 x 14 = x 1 x 15 x 2 x 14 = x 1 x 2 x 2 = x 3 x 15 x 1 x 2 = x 3 x 1 I assigned a lette to each goup of x symbols which wee equal: a : x 2 = x 3 b : x 4 = x 5 = x 6 = x 7 = x 9 = x 12 = x 15 c : x 8 = x 10 = x 11 d : x 14 = x 1 e : x 13 I found that e could be combined with a whilst still satisfying all the equalities. This meant that the univesal cycle fo n = 4 would only contain 4 lettes as opposed to 5. Finally, I wote out the lettes coesponding to each x symbol when the x symbols wee aanged in ode. This gave the univesal cycle: daabbbbcbccbadb. Remak 5 Based on the popeties of the beake given in [3], I tied to constuct a diffeent beake fo n = 4. The oiginal beake has the popeties: x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 1 4 2 3 4 1 2 3 Figue 12: Popeties of the oiginal beake x 1 x 2 = x 3 x 4 x 1 x 4 x 2 = x 3 x 4 = x 5 x 3 x 4 = x 5 = x 6 x 4 = x 5 = x 6 = x 7 x 5 = x 6 = x 7 x 8 In [3], it is claimed that the inclusion of such a beake in an Euleian cicuit will always lead to a cicuit which can be lifted to fom a univesal cycle. The eason given fo this is that a x symbol occuing befoe x 1 e.g. x 15 cannot be foced to be eithe equal o unequal to an x symbol afte x 7. This is tue when looking at the beake alone. Howeve, the patitions fom a cicuit, so when the full cicuit of patitions ae witten out, it will be possible to deduce whethe o not most, if not all the x symbols ae equal o unequal. Fo example, in the constuction of a univesal cycle fo n = 4 above, it was possible to deduce fom the full set of equalities that x 15 x 8. Theefoe it would seem that this claim is not tue. 20

I constucted the following beake which has the same popeties as the oiginal beake, except the equalities ae evesed: 1 234, 1234, 4 123, 12 34, 1 4 23 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 4 1 2 3 1 4 2 3 Figue 13: Popeties of diffeent beake x 1 x 2 = x 3 = x 4 x 2 = x 3 = x 4 = x 5 x 3 = x 4 = x 5 x 6 x 4 = x 5 x 6 = x 7 x 5 x 6 = x 7 x 8 x 5 x 8 This beake was successful when used in the Euleian cicuit: 1 234, 1234, 4 123, 12 34, 1 4 23, 3 124, 13 24, 2 4 13, 1 3 24, 2 134, 14 23, 3 4 12, 1 2 3 4, 2 3 14, 1 2 34, 1 234 giving the univesal cycle: daaaabbcbcaccab. Howeve, when put in the Euleian cicuit: 1 234, 1234, 4 123, 12 34, 1 4 23, 3 4 12, 2 3 14, 1 2 3 4, 1 3 24, 2 4 13, 1 2 34, 14 23, 3 124, 13 24, 2 134, 1 234 this cicuit could not be lifted successfully. x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x 15 x 1 x 2 x 3 4 1 2 3 1 4 2 3 3 4 1 2 2 3 1 4 1 3 2 4 2 4 1 3 1 4 2 3 3 1 2 4 1 3 2 4 2 1 3 4 Figue 14: Failue using the new beake Which gave the equalities: x 1 x 2 = x 3 = x 4 21

x 2 = x 3 = x 4 = x 5 x 3 = x 4 = x 5 x 6 x 4 = x 5 x 6 = x 7 x 5 x 6 = x 7 x 8 x 5 x 8 x 6 = x 7 x 8 x 9 x 6 = x 7 x 9 x 7 = x 10 x 8 x 9 x 7 = x 10 x 9 x 8 x 9 x 10 x 11 x 8 x 10 x 8 x 11 x 9 x 11 x 9 x 10 = x 12 x 11 x 9 x 11 x 10 = x 12 x 11 x 13 x 10 = x 12 x 13 x 13 = x 14 x 11 x 12 x 13 = x 14 x 12 x 12 = x 15 x 13 = x 14 x 13 = x 14 = x 1 x 15 x 14 = x 1 x 15 = x 2 x 1 x 15 = x 2 = x 3 Howeve, this leads to the contadiction that x 5 x 6 = x 7 = x 10 = x 12 = x 15 = x 2 = x 3 = x 4 = x 5. We conclude that this Euleian cicuit cannot fom a univesal cycle. The evesal of equalities compaed to the oiginal beake should not affect the beake s effectiveness, yet in this case it failed to wok. This casts futhe doubt on the effectiveness of beakes and it would seem that beakes need to be defined in moe detail to guaantee they always wok. 5.2 Bell Numbes We aleady know that the numbe of patitions of a set with n elements is given by the Bell numbes B n. Conside a set of n + 1 numbes: {1 2 3...n+1}. If n + 1 is on its own in a subset, thee ae B n ways to patition the emaining n elements in the set. This can be witten as: ( n) 0 Bn as by definition ( n 0) is equal to 1. If n + 1 is with 1 othe element in a subset, thee ae ( n 1) = n ways of choosing this othe element fom the n available elements in the set and thee ae B n 1 ways of patitioning the emaining n 1 elements in the set. This means the numbe of patitions which contain such a subset can be witten as: ( n 1) Bn 1. If n + 1 is with 2 othe elements in a subset, thee ae ( n 2) ways of choosing the othe 2 elements and thee ae B n 2 ways of patitioning the emaining n 2 elements in the set. This means the numbe of patitions which contain such a subset can be witten as: ( n 2) Bn 2.. Thee ae ( n n 1) B1 patitions which contain a subset whee n + 1 is with n 1 othe elements in a subset. Thee ae ( n n) B0 patitions which contain a subset whee n+1 is with n othe elements in a subset. (By definition, B 0 = 1, so thee is only one patition containing all the elements in a single subset.) Theefoe the Bell numbes satisfy the ecuence elation: ( B n+1 = n =0 ( ) n B = n due to the symmety of combinations: n =0 ( ) n n ( ) n B Using this fomula, we can calculate the fist few Bell numbes: B 0 = 1 22 = n!!(n )! = ( )) n

B 1 = B 0 = 1 B 2 = B 0 + B 1 = 1 + 1 = 2 B 3 = B 0 + 2B 1 + B 2 = 1 + 2 1 + 2 = 1 + 2 + 2 = 5 B 4 = B 0 + 3B 1 + 3B 2 + B 3 = 1 + 3 1 + 3 2 + 5 = 1 + 3 + 6 + 5 = 15 B 5 = B 0 + 4B 1 + 6B 2 + 4B 3 + B 4 = 1 + 4 1 + 6 2 + 4 5 + 15 = 1 + 4 + 12 + 20 + 15 = 52 and so on The Bell tiangle can be used to geneate Bell numbes (like Pascal s tiangle can be used to geneate binomial coefficients). B 0 B 1 B 2 B 3 B 4 B 5 1 1 2 1+1 2 3 5 5 7 10 15 The fist tem in each ow is the same as the last tem in the pevious ow. 15 20 27 37 52 52... Each tem (apat fom the fist in evey ow) is obtained by adding the pevious tem in the ow and the tem above the pevious tem Figue 15: Finding Bell numbes using the Bell tiangle 5.3 The Exponential Geneating Function of Bell Numbes A geneating function is a fomal powe seies whee the coefficients of x n give infomation about the numbes in a sequence a n an infinite seies whee the vaiable x is geneally egaded as a place holde athe than assigned an actual value. Geneating functions ae vey useful as they can epesent sequences as functions and can be used to solve counting poblems. Thee ae 2 main types of geneating functions: odinay geneating functions and exponential geneating functions. The odinay geneating function G(x) fo an infinite sequence (a 0,a 1,a 2,a 3...) would be: G(x) = a 0 + a 1 x + a 2 x 2 + a 3 x 3... The exponential geneating function E(x) fo the same sequence would be: E(x) = a 0 + a 1 1! x + a 2 2! x2 + a 3 3! x3... In this case, thee is an exponential geneating function fo the Bell numbes B n. Theoem 6 The exponential geneating function of the Bell numbes is e ex 1, i.e. the coefficient of xn n! in the powe seies expansion of e ex 1 is the numbe of patitions of a set of n elements. 23

Poof We aleady know the ecuence elation fo Bell numbes: B n+1 = n =0 ( ) n B B n = n 1 =0 ( ) n 1 To find B 1 (which is the coefficient of x), we diffeentiate the exponential geneating function y = E(x) and take the value of the function when x = 0. The kth Bell numbe B k should equal the kth deivative y (k) of e ex 1 when x = 0. When n = 1, we know that B 1 = 1 y = e ex 1 lny = ln(e ex 1 ) lny = (e x 1) 1 1 y dy dx = ex dy dx = yex When x = 0, dy dx = 1 eex e x = e e0 1 e 0 = e 0 e 0 = 1 1 = 1 tue fo n = 1 Assume tue fo n = k, i.e. ( ) k 1 y (k) = e x k 1 y () =0 hee e x = 1 as we put x = 0 to obtain the Bell numbes We need to pove it is tue fo n = k + 1, i.e. ( ) k k y (k+1) = e x y () =0 B y (k+1) = d ( dx k 1 e x =0 ( ) k 1 )y () ( ) ( ) k 1 = e x k 1 k 1 y () + e x k 1 y (+1) =0 =0 [( ) ( ) ( ) ( ] k 1 k 1 = e x y (0) k 1 k 1 k 2 + y () + y (k) k 1 + )y (+1) 0 k 1 =1 =0 ( ) ( ] k 1 = e [y x (0) k 1 k 1 + y () k 1 + )y () + y (k) 1 =1 =1 [( ) ( } k 1 = e {y x (0) k 1 k 1 + + )]y () + y (k) 1 =1 24

( ] k 1 = e [y x (0) k + )y () + y (k) =1 ( ) k k = e x y () =0 We have shown that the esult is tue fo n = 1 and that if it is tue fo n = k then it is also tue fo n = k + 1. Theefoe it is tue, by induction, fo all n 1. Poof *Hee the popety used was: = ( ) k = ( ) k 1 + 1 ( ) k 1 + 1 ( ) k 1 ( ) k 1 (k 1)! ( 1)!(k )! + (k 1)!!(k 1)! = (k 1)! (k 1)!(k ) +!(k )!!(k )! = (k + )(k 1)!!(k )! = k(k 1)!!(k )! k! =!(k )! ( ) k = 5.4 Stiling Numbes of the Second Kind A second way of finding the numbe patitions of a set ae using the Stiling numbes of the second kind. { n } k = the numbe of ways of patitioning a set with n elements into k non-empty subsets. Think of an element n in a set with n elements: If n is on its own, the numbe of patitions = { n 1 k 1}. If n is not on its own, it is pat of one of the k subsets fomed fom n 1 elements, the numbe of patitions = k { n 1} k. Theefoe the Stiling numbes of a second kind have the popety: { } { } { } n n 1 n 1 = k + k k k 1 { } n n B n = k k=0 25

6 Patitions of a numbe A patition of a numbe is a way of epesenting a non negative intege n as the sum of positive integes called pats, with these pats witten in non inceasing ode. e.g. n = a + b + c whee a b c The patition function p(n) is the numbe of distinct ways of witing n as the sum of positive integes, whee the ode of the pats does not matte. To find p(n), we can use the geneating function of patitions of a numbe: k=1 1 1 x k Using the binomial expansion, this can be witten as: (1 + x + x 2 + x 3...)(1 + x 2 + x 4 + x 6...)(1 + x 3 + x 6 + x 9...)... This expansion is only valid when 1 < x < 1, but because we do not usually assign values to x in geneating functions, we do not need to woy about the issue of convegence. The coefficient of x k is the numbe of patitions of the numbe k. Patitions can be epesented by Fees diagams which show the pats of each patition. Fo example, the Fees diagams below show the 22 patitions fo when k=8. 3+3+2 3+3+1+1 3+2+2+1 3+2+1+1+1 8 7+1 6+2 6+1+1 3+1+1+1+1+1 2+2+2+2 2+2+2+1+1 2+2+1+1+1+1 5+3 5+2+1 5+1+1+1 2+1+1+1+1+1+1 4+4 4+3+1 4+2+2 4+2+1+1 4+1+1+1+1 1+1+1+1+1+1+1+1 The above patitions can be categoised: Figue 16: Patitions of 8 (i) The pats ae all odd i.e. each pat of the patition is an odd numbe: 7+1, 5+3, 5+1+1+1, 3+3+1+1, 3+1+1+1+1+1, 1+1+1+1+1+1+1+1 Thee ae 6 such patitions. 26