Your use of the JSTOR archive indicates your acceptance of the Terms & Conditions of Use, available at http://www.jstor.org/page/ info/about/policies/terms.jsp JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms of scholarship. For more information about JSTOR, please contact support@jstor.org.

Mathematical Association of America is collaborating with JSTOR to digitize, preserve and extend access to The American Mathematical Monthly. http://www.jstor.org

This content downloaded from 129.199.129.11 on Fri, 15 Jan 2016 20:56:55 UTC

All use subject to JSTOR Terms and Conditions restrictourattentionto lists suchthat0 < aj < n foreveryj andsuchthEaj=ti k) modn is minimizedwhenk = O.Webeginby characterizinsguchlists.

For0 < k < n, thevalueof (aj + k) modn is aj + k ifaj < n - k andis aj + k n if aj > n - k. Thus m

Q((aj +k) modn) = j=1 m aj +mk-(/ln-i j=l +/n-2 +... + in-k) n, where/ui is the multiplicityof i in the list a. Hencethe minimumis achievedwhen k = 0 if andonly if mk n /Ln-I + n-2 + . . . + /n-k < for 1 < k n-1.

(*)

Since ]=1 a = subjectto (*) and n ~l(n -i-)ni, ourproblemis to minai1ximize

(n - i),n-i -i,_tn-i= m. For 1 < k < n, let ,n-k = Lmk/n] - Lm(k- 1)/nJ.

These values satisfy (*) with equality.Also feasible. Furthermore, whenever /tn-1, ..,/l satisfy (*), we have E Yi=ln-i k=l ji,-k = m, so these values are < Lmk/nj= E=1 in-i. Thus n-i yj(n -- =Z-i i=1 n-1 k E Yn- i k=l i=1 n-1 k Z k=l i=1

n-I - = L i(n )n-i

i=1

WWeheaavveepprroovveeddthaatttheeannsswweerris 5,n--E1k=1Lmk/n].Thissumhasthe valueclaimed, as can be seen by applyingformula(3.32) of R. L. Graham,D. E. Knuth,and 0.

PatashnikC,oncreteMathematics2,nd ed., Addison-WesleyR,eading,MA, 1994,p. 94.

Editorialcomment.A countingargumentgives a directproof of nk-- Lmk/nJ=

((m - )(n - 1) + gcd(m,n) - 1). Considerthe positiveintegerpoints with first coordinateless thann thatlie on or belowthe linejoiningthe originand (n, m). By symmetryh,alf the integerpointsin an (n - 1)-by-(m- 1) rectanglethatareoff the line arecaptureda,ndtherearegcd(m,n) - 1 pointsin thisrectangleon theline.

Also solved by D. Beckwith, R. Chapman(U. K.), D. Donini (Italy), J. H. Lindsey II, O. P. Lossers (The Netherlands),A. Nijenhuis, M. A. Prasad(India), J. Simpson (Australia),GCHQ Problems Group (U.K.), NSA ProblemsGroup,andthe proposer.

ExploringAll BinaryMazes 10720[1999,264].ProposedbyDonaldE.KnuthS,tanfordUniversityS,tanfordC, A.

A "binarymaze"is a directedgraphin whichexactlytwo arcsleadfromeachvertex, one labeled0 andone labeled1. If bl, b2,... , bmis anysequenceof Osand ls andv is anyvertex,let vblb2,... , b, be thevertexreachedby beginningat v andtraversing arcslabeledblb2,... , bminorder.A sequenceblb2,... , bmof OsandIs is a universal explorationsequenceof ordern if, for everystronglyconnectedbinarymazeon n verticesandeveryvertexv, the sequence( v, vbl, vblb2,.. , vbl ... bm)includes everyvertexof themaze.Forexample,01 is a universalexplorationsequenceof order 2, andit canbe shownthat0110100is universaolf order3. (a) Provethatuniversalexplorationsequencesof all ordersexist. (b)* Finda good estimatefor the asymptoticlengthof the shortestsuchsequenceof ordern. 60

() THE MATHEMATICAL ASSOCIATION OF AMERICA [Monthly 110 Solution by O. P Lossers, Eindhoven University of Technology, Eindhoven, The Netherlands. We show that there is a universal exploration sequence of length less than n22n log n and none of length less than 2"-1.

For a randombinary sequence b with length m(n - 1)2n-1 (where m will be determined later), we compute an upper bound on the expected numberof triples (G, u, v) such that G is a binary maze on n vertices and u and v are points in G such thatthe trip starting at u that follows b does not visit v. When m is large enough, the expectation is less than 1, and some such sequence is universal.

For a fixed triple (G, u, v) and a random b of this length, we bound the probability that following b from u does not reach v. In G, there is a path from u to v of length at most n - 1. Hence the probability that the initial segment of n - 1 steps does not visit v is at most 1 - 21-n. Given that we have not reached v after n - 1 steps, in the next n - 1 steps we have the same bound on the probability of not reaching v. After the full length of b, the probability that we have not reached v is at most (1 - 21-n)m2 -, which is bounded by e-m.

Since there are at most (n2)n mazes on n vertices and at most n2 pairs of vertices in each such maze, there are at most n2n+2 possible bad triples. Linearity of expectation now yields n2n+2e-m as an upper bound on the expected number of bad triples.

Choosing m > log(n2n+2)= (2n + 2) log n makes the expectation less than 1. With m chosen in this way, the length of our sequence is less than n22n log n, and some such sequence is universal.

For the lower bound, we construct a maze G(a), where a = ao, ... , an-2 is an arbitrarybinary sequence of length n - 1. The vertices are the integers 0, ... , n - 1.

We place an arc labeled ai from i to i + 1, an arc labeled 1 - ai from i to 0, and arcs labeled 0 and 1 from n - 1 to 0. To reach n - 1, a walk must follow n - 1 specified steps in order;if it ever deviates, it returnsto 0. We can reachn - 1 from 0 by following b only if a occurs as a consecutive string in b.

A universalsequence of ordern thereforemust contain all sequences of length n - 1 as consecutive strings. Hence its length is at least 2"-1 + n - 2.

In the argumentsfor both bounds, it seems that a more careful analysis might yield an extra factor of n, so the true answer may be somewhere aroundn2n.

Also solved by R. J. Chapman(U. K.), S. S. Kim (Korea),J. H. Lindsey II, S. C. Locke, R. Martin,C. A. Subramanian,P. Weiner,GCHQProblemsGroup,and the proposer.

Three Recurrences for a Single Sequence 10860 [2001, 271]. Proposed by Emeric Deutsch, Polytechnic University, Brooklyn, NY.Let G (x) = x. Show that the recurrencerelations

Gn(x)

GnGn(x) = ( \j=1

Gj x) ( j=1l ( Gj (x)

and , i-1 n-I

( i=1 \j=1

Gj (x) /G (x)) ) all for n > 2, define the same sequence of polynomials in x. (Vacuous products are 1.) Solution by Doyle Henderson, Omaha, NE. We solve (1) and then show thatits solution also solves (2) and (3).

PROBLEMASNDSOLUTIONS (1) (2) (3) 61