7/30/2019 Maths Less Travelled
1/224
Making a computer out of dominoes?
Posted on October 10, 2012
WhenImentionedcarryingoutcomputationalprocesseswitharoomfullofdominoes ,Iwasntkidding.Matt
Parkerisplanningtobuildadominocomputer attheManchesterScienceFestivalattheendofthemonth.The
ManchesterScienceFestivalbloghasanicewriteupexplainingtheproject.
HeresavideoofMattexplaininghowadominoANDgateworks (twochainsofdominoescomein,andone
goesout;theoutgoingdominoeswillfallonlyif bothincomingchainsdo).UnfortunatelyitseemsIcantembed
videosonthisblog,atleastnotwithoutgivingwordpresssomecash=(,soyoullhavetoactuallyclickthatlink
towatchthevideo,butitstotallyworthit(trustme).
IwishIcouldgoseeit,butitsabitfarforme.Any MathLessTraveledreadersintheUKwhocanactuallygowatchthecomputerinactionandreportback?
Posted in computation, links, video | Tagged computer, domino, festival, Manchester, Matt Parker, science | 3 Comments
Factorization diagramsPosted on October 5, 2012
InanidlemomentawhileagoIwroteaprogramtogenerate"factorizationdiagrams".Heres700:
Itseasytosee(Ihope),justbylookingatthearrangementofdots,thatthereare intotal.
HereshowIdidit.First,afewimports:afunctiontodofactorizationofintegers,anda librarytodrawpictures
(yes,thisisthelibraryIwrotemyself;Ipromisetowritemoreaboutitsoon!).
The Math Less Traveled
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
of 224 10/16/12 1
7/30/2019 Maths Less Travelled
2/224
> module Factorization where
>
> import Math.NumberTheory.Primes.Factorisation (factorise)
>
> import Diagrams.Prelude
> import Diagrams.Backend.Cairo.CmdLine
>
> type Picture = Diagram Cairo R2
TheprimeLayoutfunctiontakesanintegern(assumedtobeaprimenumber)andsomesortofpicture,and
symmetricallyarrangesncopiesofthepicture.
> primeLayout :: Integer -> Picture -> Picture
Thereisaspecialcasefor2:ifthepictureiswiderthantall,thenweputthetwocopiesoneabovetheother;
otherwise,weputthemnexttoeachother.Inbothcaseswealsoaddsomespaceinbetweenthecopies(equal
tohalftheheightorwidth,respectively).
> primeLayout 2 d
> | width d > height d = d === strutY (height d / 2) === d
> | otherwise = d ||| strutX (width d / 2) ||| d
Thismeanswhentherearemultiplefactorsoftwoandwecall primeLayoutrepeatedly,weendupwiththingslike
Ifwealwaysputthetwocopies(say)nexttoeachother,wewouldget
whichismuchclunkierandhardertounderstandataglance.
Forotherprimes,wecreatearegularpolygonoftheappropriatesize(usingsometrigIworkedoutonanapkin,
dontaskmetoexplainit)andpositioncopiesofthepictureatthepolygonsvertices.
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
2 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
3/224
> primeLayout p d = decoratePath pts (repeat d)
> where pts = polygon with { polyType = PolyRegular (fromIntegral p) r
> , polyOrient = OrientH
> }
> w = max (width d)(height d)
> r = w * c / sin (tau / (2 * fromIntegral p))
> c = 0.75
Forexample,heresprimeLayout 5appliedtoagreensquare:
Now,givenalistofprimefactors,werecursivelygenerateanentirepictureasfollows.First,ifthelistofprime
factorsisempty,thatrepresentsthenumber1,sowejustdrawablackdot.
> factorDiagram' ::[Integer]-> Diagram Cairo R2
> factorDiagram' [] = circle 1 # fc black
Otherwise,ifthefirstprimeiscalledpandtherestareps,werecursivelygenerateapicturefromtherestofthe
primesps,andthenlayoutpcopiesofthatpictureusingthe primeLayoutfunction.
> factorDiagram' (p:ps)= primeLayout p (factorDiagram' ps) # centerXY
Finally,toturnanumberintoitsfactorizationdiagram,wefactorizeit,normalizethereturnedfactorizationinto
alistofprimes,reverseitsothebiggerprimescomefirst,andcall factorDiagram'.
> factorDiagram :: Integer -> Diagram Cairo R2
> factorDiagram = factorDiagram'
> . reverse
> . concatMap (uncurry $ flip replicate)
> . factorise
Andvoila!Ofcourse,thisreallyonlyworkswellfornumberswithprimefactorsdrawnfromtheset
(andperhaps ).Forexample,heres121:FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
3 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
4/224
Arethere11dotsinthosecircles?13?Icantreallytellataglance.Andheres611:
Uhhwell,atleastitspretty!
Herearethefactorizationdiagramsforalltheintegersfrom1to36:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
4 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
5/224
Powersofthreeareespeciallyfun,sincetheirfactorizationdiagramsare Sierpinskitriangles!Forexample,heres
:
Po wersoftwoarealso fun.Heres :
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
5 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
6/224
[ETA:asanonpointsout,thisfractalhasanametoo:Cantordust!]
Onelastone:104.
IwishIknewhowtomakeawebsitewhereyoucouldenteranumberandhaveitshowyouthefactorization
diagrammaybeeventually.
(Incaseyouwerewondering, .)
Posted in arithmetic, pictures, primes, programming, recursion | Tagged diagrams, fact orization, Haskell | 50 Comments
What I Do: Part 0Posted on October 4, 2012
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
6 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
7/224
ThisisthefirstinaplannedseriesofpostsexplainingwhatIdoinmy"dayjob"asacomputersciencePhDstudent.
Theideaistowriteaseriesofpostsofincreasingspecificity,butallaimedatageneralaudience.
HaveyoueverwonderedwhatIactuallydoallday,otherthanwritethisblog?(Well,probablytheansweris
"no"since,asweallknow,peopleontheInternetdontactuallyhavereallives,inthesamewaythat
kindergartenteachersliveintheclosetintheirclassroom.)ButwhatIdowillactuallybequiteinterestingto
readersofthisblog,Ithink.
So,tostartoff:Iamacomputerscientist.Whatdoesthatmean?
WhatIdontdo
Letmebeginbysayingthat"computerscience"isactuallyaterriblenameforwhatIdo.Itsakintoan
astronomersayingtheystudy telescopescience ,oramicrobiologistsayingtheystudy microscopescience.Of
course,astronomersdontstudytelescopes,they usetelescopestostudystarsandsupernovas.Microbiologists
dontstudymicroscopes,they usemicroscopestostudycellsandDNA.AndIdontstudycomputers,I use
computerstostudywell,what?
Computation
Inabroadsense,whatcomputerscientistsstudyis computation,bywhichwemeanprocessesofsomesortthat
takesomeinformationandturnitintootherinformation.Questionsthatcanbeaskedaboutcomputation
include:
Whataredifferentwaysofdescribingacomputationalprocess?
Howcaninformationbestructuredtomakecomputationalprocesseseasiertowrite,moreefficient,ormore
beautiful?
Howcantwodifferentcomputationalprocessesbecompared?Whenisoneprocess"better"thananother?
Howcandifferentprocessesbecombinedintoalargerprocess?
Howcanwebesurethatsomeprocessreallydoeswhatwewantitto?
Whatsortsof"machines"canbeusedtoautomatecomputationalprocesses?
What(ifany)arethelimitationsofcomputationalprocesses?
Imsureotherquestionscouldbeaddedtothislist,butthesearesomeofthemostfundamentalones.
Noticethatnoneofthesequestionsinherentlyhaveanythingtodowithcomputers.A"computationalprocess"
couldbecarriedoutwithpilesofrocks,anabacus,paperandpencil(didyouknowthattheword"computer"
usedtorefertoapersonwhosejobitwastodocarryoutcomputationalprocesses?),a carefullysetuproomfull
ofdominoes,oracarefullysetuptesttubefullofDNA.Itsjustthatmoderncomputerscancarryout(most)
computationalprocessesmanyordersofmagnitudefasterthananyothermethodweknowof,sotheymake
exploringtheabovequestionspossibleinmuchdeeperwaysthantheywouldotherwisebe.Andindeed,the
mathematicalrootsofcomputersciencegobackmanyhundreds,eventhousandsofyearsbeforetheadventof
digitalcomputers.
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
7 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
8/224
So,Istudycomputation.Butasyoucanseefromthelistofquestionsabove,thatsstillincrediblybroad.Infact,
myresearchfocusesonthefirsttwoquestionsinthelistabove.InPart1Illdescribethosequestionsinabit
moredetail.Also,Imhappytotrytoansweranyquestionsleftinthecomments!
Posted in computation, meta | Tagged computation, computer sc ience, whatido | 5 Comments
CoM and Relatively PrimePosted on September 17, 2012
Acouplethingstodrawyourattentionto:
The90thCarnivalofMathematicsisupoveratWalkingRandomly.Theresquitealotofcoolstuffinthis
edition,gocheckitout!
ThefirstepisodeofRelativelyPrimeisup!Thisisaseriesofeightshowsallaboutthestoriesbehind
mathematicsproducedbySamuelHansen.Ihaventactuallyhadachancetolistentothefirstepisodeyet,
butIknowheflewallovertheworldinterviewingmathematiciansforthissoitoughttobeinteresting!I
alsohelpedfunditonKickstartersoImquiteexcitedtoseethefruits.
Posted in links | Tagged Carnival of Mathematics, episode, podcast, show | 1 Comm ent
Three new booksPosted on August 23, 2012
Athree-for-onetoday!HerearethreebooksIwantedtomentiontoyou,dearreader,foronereasonoranother.
AWealthofNumbers
BenjaminWardhaugh
PrincetonPresskindlysentmeareviewcopyofthisbook.Asan anthologyofpopularmathematicswritingfrom
the1500
stothepresent,itsnotthesortofbookIusuallyreviewherebutitsnonethelessfascinating.Thefeaturedexcerptsare,byturnsgripping,dull,lucid,incomprehensible,hilarious,irrelevant,andfun.Ididntlearn
awholelotofnewmathematicsbyreadingthisanthology,butitgavemesomeeye-openingperspectiveonhow
peoplehavethoughtandwrittenaboutmathematicsoverthelast500years.
DeadReckoning:CalculatingWithoutInstruments
RonaldW.DoerflerFollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
8 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
9/224
Theresalotofcontroversyovertheuseofcalculatorsandcomputersinmathclassrooms.Shouldtheybe
welcomedaslabor-savingdevicesthatallowstudentstoexploremathematicsinnewways,oreschewedas
crutchesthatturnstudentsintobutton-pushingautomatawithnorealunderstanding?Itsanimportantdebate,
butitseemstomethatthosewhoargueagainstcalculatorssometimeshaveanonethelessimpoverishedviewof
thealternative:justtheabilitytodothestandardWesternalgorithmsforthefourbasicarithmeticoperations,
andunderstandwhythealgorithmswork.
Thisbook(whichIreceivedasagiftaboutsixmonthsago)isntintendedtoenterthatdebatedirectlybutitis
afar-rangingsurveyofmethodsforpencil-and-paper(ormental)calculation.Therearegeneralalgorithms,of
course,(andnotjustforarithmetic,butforsquareroots,logarithms,trigfunctions)buttherearealsoallsorts
oftricksandspecialcaseswhicharisefrom,andengender,intimatefamiliaritywithnumbers.Isit"practical"?
Well,notreally.Butthatscertainlynotthepoint.Ihadsomuchfunreadingthroughthisbookandtryingoutall
thedifferentalgorithms:multiplyinginmyhead,computingsquarerootstomanydecimalplacesusingjusta
singlesheetofpaperHonestlyIdontrememberanyoftheactualalgorithmsanymore,butIcameawaywith
betternumbersenseandImayjustpullitoutandtrysomeofthealgorithmsagain.Eventuallysomeofthem
areboundtostick!
MathematicalLiteracyintheMiddleandHighSchoolGrades
FaithWallaceandMaryAnnaEvans
Imentionthisbookparticularlybecauseitcontains(inaboxonpage67)anessaybyyourstruly!Iwrote
somethingabouttheexperienceofwritingthisblogandinspiringreaderswithmathematicalbeauty.
Inolongerteachmiddleorhigh-schoolstudents,buttheideaofusingliteracytoinspireinterestinmathmakes
alotofsensetome(andofcourse,itsperfectlyapplicableatthecollegelevelaswell).Thereareallsortsof
interestingideasinheresomeofwhichIwillneveruse(discussingstatisticsandvotingvia AmericanIdol)but
othersofwhichIdlovetotrysomeday(usingbiographyorfictiontoinspiremathematicalinterest).
Posted in books, review | Tagged anthology, calculation, literacy | 2 Comments
Introduction to Mathematical Thinking with Keith Devlin
Posted on August 22, 2012
IjustlearnedfromDeniseatLetsPlayMath!thatKeithDevlinisgoingtobeteachingacourseonCoursera
calledIntroductiontoMathematicalThinking.Itsfreeandopentoanyonewithonlyabackgroundinhighschool
math.Lookslikeitshouldbequiteinterestingandperhapsofinteresttosomeofmyreaders!
Posted in links, teaching | Tagged Coursera, free, Keith Devlin, mathematical thinking, online | 1 Comment
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
9 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
10/224
Visualizing nim-like gamesPosted on August 16, 2012
Inspiredbythecommentsonthispost,IvehadsomeideasbrewingforawhileImjustonlynowgetting
aroundtowritingthemup.
Thetopicisvisualizingwinningstrategiesfor"nim-like"games.WhatdoImeanbythat?Byanim-likegameImean
agameinwhichtwoplayerstaketurnsremovingobjectsfromsomepiles(subjecttosomerules),andthelastplayertoplayisthewinner(or,sometimes,theloser).
Acutevariant,duetoPaulZeitz(andintroducedtomebySueVanHattum ),istothinkofapetshopwith
differenttypesofpets;playerstaketurnsvisitingthepetshopandbuyingsomepets,untilthestoreisalloutof
pets.
Forgameswithonlytwopiles,orapetstorewithonlytwotypesofpets,playingthegamecanalsobethought
ofasmakingmovesonasquaregrid.The -coordinaterepresents,say,thenumberofXoloitzcuintli,andthe
y-coordinatethenumberofYaks;thesquarewithcoordinates meansthatthepetstorehas xolosand
yaksleft.Buyingsomexoloscorrespondstomovingleft;buyingyaksmeansmovingdown;buyinganequal
numberofeachmeansmovingdiagonallydownandleft;andsoon.
Hereareafewexamplesofnim-likegames:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
0 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
11/224
Inthegameofnim,youmayonlybuyonetypeofanimaloneachturn(butyoucanbuyasmanyasyou
want).Onagrid,youareallowedtomoveanydistanceleftordown(butnotboth).
Theinterestingthingisthatwecanvisualizethewinningstrategyforthisgameinthefollowingway.
(ZacharyAbelhasamuchmoredetailedexplanationofthisidea .)Awinningpositionisasquarethat
guaranteesawinthatis,ifitisyourturnandyouareonawinningsquare,then(assumingyoumakethe
rightmoveandcontinuetoplayperfectly)youwillwinthegame.Illindicatewinningpositionsbylightgreensquares,likethis: .Alosingpositionisapositionsuchthatyoucantwinnomatterwhatmoveyou
make(assumingyouropponentplaysperfectly).Illindicatelosingpositionsbydarkbluesquares,likethis:
.Infact,thewinningpositionsareexactlythosefromwhichthere existsatleastonelegalmovetoalosing
position;andthelosingpositionsarethosefromwhich everylegalmoveistoawinningposition.
Hereswhatitlookslikefornim:
Nottooexciting,butitmakessense.Ifthepetstorehasanequalnumberofeachtypeofpetremaining,the
firstpersontomoveisgoingtolose:theirmovewillresultinanunequalnumberofpets( i.e.asquareoffthe
mainbluediagonal),andalltheiropponenthastodoisbuyanequalnumberoftheothertypeofpetto
restorebalance.Ultimatelythelosingplayerwillbeforcedtocleanthestoreoutofonetypeofpet,andthe
otherplayerthenwinsbycleaningthestoreoutoftheothertype.
InWythoffsgame,youmaybuyanynumberofasingletypeofanimal, oranequalnumberofboth.Onagrid,
youareallowedtomoveanydistanceleft,down,orata45degreeangleleftanddown.
Thevisualizationforthisgame,ofcourse,ismuchmoreinteresting:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
1 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
12/224
Youcanreadallaboutthefascinatinganalysisofthisgame(anditsvisualization)onZacharyAbelsblog .
Inacomment,MaxdescribedagamefromtheInternationalOlympiadinInformatics:
Youstartwitharectangle,andyoucancutiteitherverticallyorhorizontallyatintegersizes,each
timekeepingthelargerpiece;thegoalistoobtainaunitsquare(sothatyouropponentcantmove).
Itsnotasobvious,butthisisalsoanim-likegame.Thetwodimensionsoftherectanglecorrespondtothe
numberofpetsoftwodifferenttypes.Forexample,a rectanglecorrespondsto10xolosand7yaks.
Therectanglemustbecuteitherverticallyorhorizontally,meaningthatyoucanonlybuyonetypeofpeton
agiventurn.Theinterestingtwististhatyoumustkeepthe largerpieceresultingfromacut,whichis
equivalenttosayingthatyoumaybuyanynumberofpetsbutonly uptohalfthenumberofpetsthestore
currentlyhas.Forexample,ifthestorehas xolosand yaks,youmaybuyupto xolos,orupto yaks.Buyinganymorethanthatwouldcorrespondtocuttingtherectangleandkeepingthesmallerpiece,whichis
notallowed.
Naturally,Iwonderedwhatthevisualizationofthisgamelookslike.Ifiguredithadtobesomething
interesting,andIwasntdisappointed!Hereitis(notethatthebottom-leftsquarerepresents here,
whereasinthevisualizationsfornimandWythoffsgameitrepresented ):
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
2 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
13/224
Woah,neat!Itlooksasifthelosingsquaresfallalongdiagonallinesofslope forallintegern(thatis, , ,
, , ,andsoon)thoughthelinesdontallpassthroughtheorigin.Itsnotsurprisingthatthemain
diagonalconsistsofalllosingpositionsthestrategyisthesameasfornim;thefactthatonecanonlybuy
uptohalfofacertaintypeofanimaldoesntmakeanydifference.Ifitisyouropponentsturntomoveand
thestorehasanequalnumberofxolosandyaks,iftheybuyacertainnumberofyaksyoucanbuythesame
numberofxolos,andviceversa.Eventuallythestorewillhaveoneofeach,atwhichpointyouropponent
losessincetheycantbuyanymoreanimals(theywouldonlybeallowedtobuy,say,halfayak,butthepet
storehasthesensiblepolicyofnotchoppingpetsinhalftoomessy).
However,apparentlythereareadditionallosingpositionsotherthanthemaindiagonal.Forexample,
accordingtothegraph,ifthestorehas4xolosand19yaks,thenthenextplayertomoveisgoingtolose!
Youcanverifyforyourselfthatfromthispoint,theonlylegalmovesaretolightgreen(i.e.winning)
positions,andthatfromanyofthesepositionstheotherplayercanmakealegalmovetoanotherdarkblue
(i.e.losing)position,andsoon.
Somedirectionswecouldgofromhere:
Canyouthinkofanyvariantnim-likegamestoexplore?Ihaveaverygeneralprogramforcreatinggame
visualizationsliketheabove,soifyoudescribeavariantgameinthecommentsIwillbehappyto tryto
generateavisualizationforit.
Whataboutnim-likegameswiththree(ormore)piles?Tovisualizethestrategiesforthese,wehavetouse
three(ormore!)dimensions.Ihopetoeventuallycomeupwithawaytodothis,atleastforthreedimensions.Ihappentoknowthatnimismuchmoreinterestinginthreedimensionsthanintwo!
Canyouprovethatthevisualizationoftherectangle-cuttinggamereallylooksliketheabove?Canyoucome
upwithanicewaytocharacterizethewinningstrategy,oratleastthelosingpositions?
Posted in games, pattern, pictures | Tagged nim, strategy, visualization, Wythoff | 4 Comments
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
3 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
14/224
Searchable tiling databasePosted on August 2, 2012
Justalinktodaycheckoutthisawesome tilingdatabase!Itsgottonsofbeautifulplanetilings(with
informationandfurtherreadingabouteachone)andmanywaystosearchthroughthedatabase.Itsagreatway
tofindexamplesofparticularsymmetriesortypesoftilingsbutitsalsofuntojustoohandahhoverrandom
entriesfromthedatabase.
IwishIcouldrememberwhereIfirstcameacrossthis.
Posted in geometry, group theory, links, pattern, pictures | Tagged beauty, database, search, symmetry, tiling | 2 Comments
Book Review: The Enigma of the Spiral WavesPosted on July 14, 2012
TheEnigmaoftheSpiralWaves(SecretsofCreationVolume2)
wordsbyMatthewWatkins,picturesbyMattTweed
MatthewWatkinsandMattTweedhavedoneitagain!Ipreviouslywrotea(verypositive)
reviewofVolumeI thisbookisjustasengaging,ifnotmore.Itexplainsthe Riemann
Hypothesisoneofthebiggest,mostmysteriousopenquestionsinmathematicstodayingreatdetail.But,asonemightexpectafterreadingVolumeI,itremainsthoroughly
accessible,eventothosewithnotmuchmathematicalbackground.Asamathematical
writer,Ifinditincrediblyinspiring:itshowsthatwithenoughtimeandhardwork,itis
possibletoexplainverytechnicalideasinawaythatisaccessiblebutstilldetailedand
accurate.
So,whatistheRiemannHypothesis?Simplyput,itstatesthatthesolutionstothefunction
(where isacomplexnumber)allliealongacertainline.Butthatmakesitsoundboring,likesayingthataroller
coasterisamodeoftransportwithwheels.Beforereadingthisbook,though,Ididntknowmuchmorethan
that.Ihadntthefaintestidea whyitissointerestinganddeep,orwhyanyonewouldthinkthat solvingitwould
beworthonemilliondollars .Thisbookexplainsallthatandmore.ItturnsoutthattheRiemannHypothesisis
intimatelylinkedtothenatureoftheprimenumbers,whichare(still!)quitemysterious.Theyaredefinedby
suchasimplerule,butseemtobehavesoerratically!Whatsgoingon?
Ofcourse,therearewonderfulpicturestoo.Evenifyoureaditonlyfortheawesomepictures,itsstillworthit.FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
4 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
15/224
Highlyrecommendedforanyonewhowantsaglimpseintooneofthemostfascinatingandmysteriousopen
questionsinmodernmathematics!
Posted in books, open problems, primes, review | Tagged Reimann Hypothesis, s piral, waves | 1 Comment
Blockly
Posted on June 28, 2012
ItseemsthatGoogleisdevelopingagraphicalprogramminglanguagecalledBlockly,inspiredbyScratchbut
web-based,withtheabilitytocompiledowntoJavaScript,Dart,orPython(orrawXML,soyoucanprocessit
further).IcantsayImallthatexcitedaboutthelanguageitselfnothingnewthere,justthesameoldtired
imperativeprogrammingbutitsureisfun!Giveitatrycanyousolvethemaze ?Howbigofaprogramdoyou
need?
Posted in challenges, programming | Tagged Blockly, Google, graphical, maze, programming | 7 C omments
Picture this
Posted on June 13, 2012
Picturethis!isaverycoolinteractivethingy,madebyJasonDavies,intendedtogetstudents(oranyone,really)
thinkingaboutsomeinterestingmath.Goplayaroundwithitandseeifyoucanansweranyofthelisted
questions(oranyotherquestionsyoumightcomeupwithyourself).Itturnsouttobequiteintimatelyrelatedto
somethingIvewrittenaboutbeforebutIwontspoilitbysayingwhat(atleast,notyet=).
Posted in challenges, links, pattern, pictures | Tagged interactive, picture, rectangles, this | 6 Comments
How to explain the principle of inclusion-exclusion?Posted on June 11, 2012
Ivebeenremissinfinishingmy seriesofpostsonacombinatorialproof.Istillintendto,butImustconfessthat
partofthereasonIhaventwrittenforawhileisthatImsortofstuck.Thenextpartofthestoryistoexplain
thePrincipleofInclusion-Exclusion,butIhaventyetcomeupwithacompellingwaytopresentit.SoperhapsI
shouldcrowd-sourceit.IfyouknowaboutPIE,howwouldyoumotivateandpresentit?Ordoyouknowofany
linkstogoodpresentations?
Posted in combinatorics, meta | Tagged exclusion, inclusion, PIE, presentation | 7 Comments
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
5 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
16/224
Wythoffs game at Three-Cornered ThingsPosted on June 10, 2012
IvereallybeenenjoyingZacharyAbelsseriesofpostsonWythoffsgame[WythoffsGame:RedorBlue?;A
GoldenObservation;TheFibonacciestString;WythoffsFormula],overonhisblog Three-CorneredThings .The
Fibonaccinumbersshowupinthestrangestplaces!
Moregenerally,ifyouhaventseenZacharysblogbefore,gocheckitout.Ifyouenjoymyblog,Ithinkyoull
enjoyhistoo.
Posted in fibonacci, games, links | Tagged Wythoff's game | 7 Comments
Fibonacci multiples, solution 1Posted on June 9, 2012
Inapreviouspost,Ichallengedyoutoprove
If evenlydivides ,then evenlydivides ,
where denotesthe thFibonaccinumber( ).
Heresonefairlyelementaryproof(thoughitcertainlyhasafewtwists!).Picksomearbitrary andconsider
listingnotjusttheFibonaccinumbersthemselves,buttheirremainderswhendividedby .Forexample,lets
choose ,sowewanttolisttheremaindersoftheFibonaccinumberswhendividedby .
Herearethefirst17Fibonaccinumbers:
Andherearetheirremainderswhendividedby ,representedgraphically(red=1,orange=2,blankgap=
0):
Remainders of the first 17 F ibonacci numbers mod 3
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
6 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
17/224
Andindeed,aswewouldexpectifthetheoremistrue,everyfourthremainderiszero: isevenlydivisibleby
.Butthereseemstobeabitmorethanthatgoingonthepatternofremainderswegotisdefinitelynot
random!Letstry .Herearetheremainderswhenthefirst21Fibonaccinumbersaredividedby5:
The first 21 Fibonacci numbers mod 5
Hmm.Everyfifthremainderiszero,asweexpectedbuttheotherremaindersdontseemtofollowanice
patternthistime.
ordothey?Actually,ifyoustareatitlongenoughyoullprobablyfindsomepatternsthere!Nottomention
thatIhaventreallyshownyouenoughofthesequence.Herearetheremaindersofthefirst41Fibonacci
numberswhendividedby5:
First 41 Fibonacci numbers mod 5
Aha!Soitdo esrepeatafterall.Wejusthadntlookedfarenough.
Andjustf orfun,lets includesomeFibonaccinumbersmod .Theserepeatmuchmorequicklythanfor .
Fibonacci numbers mod 8
OK,nowthatwevetriedsomespecificvaluesof ,letsthinkaboutthismoregenerally.Whenlistingthe
remaindersoftheFibonaccinumbersdividedby ,theinitialpartofthelistwilllooklike
becausealltheFibonaccinumbersbefore areofcourselessthan ,sowhenwedividethemby theyare
simplytheirownremainder.Next,ofcourse, leavesaremainderofzerowhendividedbyitself.Thenwhat?
Well, bydefinition,soitsremaindermod is .OK,sofarwehave
Infact,theruleforfindingthenextremainderinthesequencewillbethesameastheruledefiningtheFibonacci
numbers,exceptthatwedoeverythingmod .Sothenextelementinthesequenceis again:FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
7 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
18/224
andnow,itseems,wearestuck!Whatdowegetwhenweadd ?Whoknows?
HereiswhereIwilldosomethingsneaky.Iamgoingtoreplacethesecondcopyof by ,likethis:
Huh!?Whatdoesthatevenmean?Surelywecanneveractuallygetanegativenumberasaremainderwhen
dividingby .Well,thatstrue,butfromnowon,insteadofstrictlywritingtheremainderwhen isdividedby
,Illjustwritesomethingwhichis equivalentto modulo .Thisisallthatreallymatters,sinceIjustwant
toseewhichpositionsareequivalenttozeromodulo .
So,theclaimisthat .Whyisthat?Well, ,andthenwecan
justsubtract frombothsides.
Thenwhat? ;then ,andsoon:wegettheFibonacci
numbersinreverse,withalternatingsigns!
Forexample,herearethefirstfewFibonaccinumbersmod8again,butaccordingtotheabovepattern,with
negativenumbersindicatedbydownwardspointingbars(andtheoriginalbarsshownmostlytransparent,for
comparison):
Seehowthecolorsofthebarsrepeatnow,butrunningforwardsthenbackwards?
If iseven,then willbepositive(asyoucanseeintheexampleabove);thatis,weget
Afterthispointweget ,andsoon,andthewholepatternrepeatsagain,asweveseen.
Whatif isodd?Then willbenegative,sowehavetogothroughonemorecyclewitheverythingnegated:
Thisexplainswhywehadtolookatalongerportionoftheremaindersmod5beforetheyrepeated.Heresmod
5again,withnegativesshowngraphically:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
8 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
19/224
Thecolorsofthebarsstillrepeat:forwards,thenbackwardsbutalternatingupanddown,thenforwardsbutall
upsidedown,thenbackwardsandalternating(buttheotherway).Butattheendwerebackto ,sothewhole
thingwillrepeatagain.
Inanycase,whether isoddoreven,thesepatternsofremainderswillkeeprepeatingforever,witha always
occurringevery positionsthatis,at ,so willalwaysbedivisibleby !
Thereareotherwaystoprovethisaswell;perhapsIllexplainsomeoftheminafuturepost.Itturnsoutthat
theconverseisalsotrue:if evenlydivides ,then mustevenlydivide .Idontknowaproofoffthetopof
myhead,butmaybeyoucanfindone?
Posted in fibonacci, modular arithmetic, number theory, pattern, pictures, proof, sequences | Tagged divisibility, fibonacci, proof, remainders | 5 Comments
Nature by NumbersPosted on June 6, 2012
Thishasbeenmakingtheroundsofthemathblogosphere(blathosphere?),butincaseyouhaventseenityet,
checkoutCristbalVilasawesomeshortvideo, NaturebyNumbers.EspeciallyappropriategiventhatIhave
beenwritingaboutFibonaccinumberslately(Illpostasolutionto thechallengesoon).
Posted in fibonacci, golden ratio, links, video | Tagged fibonacci, nature, numbers, phi, v ideo | 1 Comment
Fibonacci multiplesPosted on May 15, 2012
Ihaventwrittenanythinghereinawhile,buthopetowritemoreregularlynowthatthesemesterisoverI
haveaseriesoncombinatorialproofstofinishup,somebookstoreview,andafewotherthingsplanned.Butto
easebackintothings,heresalittlepuzzleforyou.RecallthattheFibonaccinumbersaredefinedby
.
Canyoufigureoutawaytoprovethefollowingcutetheorem?
If evenlydivides ,then evenlydivides .
(Incidentally,theexistenceofthistheoremconstitutesgoodevidencethatthecorrectdefinitionof is ,not
.)
Forexample, evenlydivides ,andsureenough, evenlydivides . evenlydivides ,andsure
enough, evenlydivides (inparticular,
).FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
9 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
20/224
Iknowoftwodifferentwaystoproveit;thereareprobablymore!NeitheroftheproofsIknowisparticularly
obvious,buttheydonotrequireanydifficultconcepts.
Posted in arithmetic, challenges, f ibonacci, number theory, pattern | Tagged divisibility, fibonacci | 12 C omments
Carnival of Mathematics 86
Posted on May 8, 2012
Welcometothe86th CarnivalofMathematics! issemiprime,nontotient,andnoncototient.Itisalsohappysince and .Infact,itisthe
smallesthappy,nontotientsemiprime(theonlysmallerhappynontotientis68whichis,ofcourse,86in
reversebut68isnotsemiprime).
However,themostinterestingmathematicalfactabout86(inmyopinion)isthatitisthelargestknowninteger
forwhichthedecimalexpansionof containsnozeros!Inparticular, .
Althoughnoonehasprovedit isthelargestsuch ,every upto (whichisquitealot,althoughstill
slightlylessthanthetotalnumberofintegers)hasbeencheckedtocontainatleastonezero.Theprobability
thatanylargerpowerof2containsnozerosisvanishinglysmall,givensomereasonableassumptionsaboutthe
distributionofdigitsinbase-tenexpansionsofpowersoftwo.
Eighty-sixisalsoapparentlysomesortofslangterminAmericanEnglish,butitreallyhasnothingtodowith
math,sowhocares?Onwardtothecarnival!Ihadalotoffunreadingallthesubmissions,andhavedecidedto
organizethemsomewhatthematicallythoughtheydontalwaysfitperfectly,sodontassumeyouwontbe
interestedinapostjustbecauseofmycategorization!
Art
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
20 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
21/224
ChristianPerfecthasstartedaseriesofpostsonthethemeofArtyMaths,withlinkstoartisticimagesand
videoswithamathematicalbent.Aboveisacoolexample,somesortofstellatedpolyhedronmadeoutof money
byKristiMalakoff(youcanfindmorehere).
KatieStecklessubmittedalinktoRobbyIngebretsensblogpostFirstDigital3DRenderedFilm(from1972)and
MyVisittoPixar.Katiesays,
Thisispossiblytheearliestexampleofacomputeranimation,andoneofitstwocreators,Edwin
Catmull,whowentontofoundPixar,iscreditedwithhavingwork[ed]out[the]mathtohandle
thingsliketexturemapping,3Danti-aliasingandz-buffering.Fascinatingtothinkhehadtoinventall
ofthatinordertodothis!
Robbysblogpost(andtheextensivecommentsonit)givealotmorecontextandfascinatingdetails.And,of
course,youcanwatchthevideoitself!
MikeCroucherofWalkingRandomlywritesaboutsomecoolmathematically-themedstainedglasswindows,and
wonderswhetheranyoneknows ofanyot hers.
Statistics/dataanalysis
ArthurCharpentierofFreakonometricswritesaboutNonconvexity,andplayingindoorpaintball:ifabunchofpeopleinanonconvexplayingareaareallholdingwaterpistolsandshootattheclosestperson,whodoesntget
wet?
KatieStecklessubmittedalinkto Data:itshowstoresknowyourepregnant ,anarticlebyMatthewLaneof
MathGoesPop!Everwonderhowcompaniescanpredictvariousthingsaboutyou(suchaswhetheryouare
pregnant!)basedonyourbrowsinghabitsandotherpubliclyavailabledata?Thisarticleexplainssomeofthe
basicmathunderlyingthissortofdatamining.
JohnCookofTheEndeavouranswersthequestion:Whatisrandomness?inRandomisasrandomdoes .Itturns
outthatthebestanswermightjustbetoavoidansweringatall!
Geometry
AugustusVanDusenof thinkingmachineblogsubmittedaposttitledSuperellipse,saying
IreadanarticleaboutSergelstorg,aplazainStockholm,beinganexampleofasuperellipse.WhenI
lookedupsuperellipseonWolframmathworld,InoticedthattheareaformulainvolvedgammaFollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
21 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
22/224
functions.Ithendecidedtoderivetheresultmyselftoseeifitcouldbesimplifiedandhowitwould
reducetothefamiliarformulafortheareaofanellipse.
FrederickKohofWhiteGroupMathematicssharesageometricsolutiontoanoptimizationproblem thatdoesnt
initiallyseemlikeithasanythingtodowithgeometry.
ZacharyAbelofThree-CorneredThings haswrittenaseriesofthreeexcursionsintothemiraculousand
interconnectedworkingsofthehumbletriangle:ManyMorleyTriangles,SeveralSneakyCircles,andThree-
CorneredDeltoids.ThesearesomeofmypersonalfavoritesfromthismonthsCarnival:chock-fullofsurprising
mathematicsandbeautifulillustrationsandanimations!
Teaching
ColinWrightwritesTheTrapeziumConundrum:howshouldatrapezium(akatrapezoidifyourefromtheUS)
bedefinedwithexactlyonepairofparallelsidesoratleastonepairofparallelsides?Moregenerally,howare
definitionsarrivedatandagreedupon?Theanswermaydependontheaudience.
KarenG.ofschoolaramamusesupontherelationshipbetweenlanguageandlearningplacevalueinherpost
LookingtoAsia.
OnherblogMathMamaWrites,SueVanHattumwritesabout LinearAlgebra:LeadingintotheEigenStuff.Sue
says,Imteachinglinearalgebraforthefirsttimeinoveradecade.Thathasmeantrelearningitadelightful
experience.
PaulSalomonofLostInRecursionwritesExponentsandtheScaleoftheUniversea21stCenturymathlesson ,
afunstoryabouthowaninitiallydrylessononexponentsturnedintoaremarkablelearningexperience.
Fun
AlistairBirdsubmittedalinktoEnormousIntegers,saying,
Itsstillacommonenoughmisconceptionthatpuremathematicsresearchmustbeaboutlargerand
largernumbers,butitsstillnicetosometimesplayuptothisstereotype,asJohnBaezsblogposton
AzimuthaboutEnormousIntegersdoes.Commentsareworthalooktoo.
PatBallewwritesonPatsBlogaboutPandigitalPrimes:exploringpandigitalprimesandfindingouthowhandy
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
22 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
23/224
Computerprogrammingskillsmightbe.
Quick,whatcomesnextintheseries ?Theanswer,asexplainedbySteven
Landsburgonhisblog,TheBigQuestions,maysurpriseyou!(ThankstoKatieStecklesforthesubmission, via
AlexandreBorovik.)
PaulSalomonofLostInRecursiondisplaysTheLostinRecursionRecursion.Canyoufigureoutwhatsgoing
onwithoutgettinglostintheTheLostinRecursionRecursionrecursion?
StuffThatDidNotFitInAnyOtherCategoryButIsStillAwesome
ColinBeveridgeofFlyingColoursMathssubmittedSecretsoftheMathematicalNinja:Thesurprisingintegration
ruleyoudontgettaughtinschool ,andwrites,
WhenIstumbledacrossthisrule,myreactionwaswhoa.Itsquick,itsextremelydirty,andits
surprisinglyaccurate.Thekindofthingthemathematicalninjadreamsof.
AndrewTaylorwritesaguestpost,ElectoralReformsandNon-TransitiveDice,onTheAperiodical,explaining
WhyChoosingaVotingSystemisHardintermsofasetofnontransitivedice.
PeterRowlett,of TravelsinaMathematicalWorld,opinesinhispost,Whatanicejobyouhave,thatapopular
rankinglistingmathematicianasoneofthetoptenbestjobsshouldntjustbeacceptedandrepeated
uncritically.
InherarticleHowcultureshapedamathematician,CarolClarkgivesaglimpseintothelifeandbackgroundof
mathematicianSkipGaribaldi.Shewrites:
Mathematiciansseetheworlddifferentlythanme.Iinterviewedamathematiciantogetaglimpseof
thatview,andlearnedhoweverythingfromfinearttopopularfilmsandbooksplayedaroleinshaping
thatview.
ThepreviousCarnivalofMathematicswashostedatTravelsinaMathematicalWorld;nextmonth,the87th
CarnivalwillbehostedbyMr.Chaseat RandomWalks,sostartgettingyoursubmissionsreadynow!Forlistsof
pastandfuturecarnivals,instructionsonsubmitting,andanswerstofrequentlyaskedquestions,seethe main
CarnivalofMathematicssite.ThenextMathTeachersatPlaycarnivalisalsocomingupsoon,witha submissionFollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
23 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
24/224
deadlineofthisFriday.
Posted in links | Tagged Carnival of Mathematics | 3 C omments
IllbehostingtheCarnivalofMathematics,andthesubmissiondeadlineiscomingupsoonTuesday,May1.Pleasesubmitsomething!Itcouldbe
somethingyouwrote,orsomethingsomeoneelsewrotethatyouenjoyed.Allmathematicsrangingfromelementarytoadvancediswelcome.
Posted on April 23, 2012
Book review: In Pursuit of the Traveling SalesmanPosted on April 7, 2012
Asmathematicalproblemsgo,thetravelingsalesmanproblem(TSP)is
araregem:itissimultaneouslyofgreattheoretical,historical,and
practicalinterest.Onthetheoreticalfront,itisawell-knownexampleof
theclassofNP-completeproblems,whichlieattheheartofthe million-
dollarPvsNPquestion(whichIstillintendtoexplainatsomepoint).
Historically,ithasbeenstudiedforalmost200years(givenasufficientlyinclusivedefinitionofstudy),andhasoccupiedaplaceinthepublic
consciousnessforatleastthelast50.Andthisgreathistoricalinterestis
partlyduetotheproblemspracticalsignificance.
So,whatisit?Givenasetofpointsintheplane(or,moregenerally,aset
ofpointswithdistancesspecifiedsomehowbetweeneachpairof
points),theproblemistodeterminethe shortestpathwhichvisitsevery
pointexactlyonceandthenreturnstothestartinglocation.Ofcourse,in
onesensethisiseasy:justlistallpossiblepathsandcomputethe
lengthofeach.Note,however,thatforasetof points,thereare
(thatis, )possiblepathsthatvisiteverypointonceandthenreturntothestart.Evenwithonly
points,thatsawhopping possiblepathsifyoucouldcomputethelengthof
onetrillionpathseverysecond,itwouldstilltake280millionmillenia(thats years,slightlylongerthan
Ivebeenalive)tocheckallofthem!Andthatsonly pointsinpractice,peoplewanttosolvetheTSPforsets
ofpointsmuchlargerthan .Sothepointisnotjusttosolvetheproblem;therealquestionis,canitbe
solvedefficiently?
Amazingly,nooneknows!Butthathasntstoppedpeoplefromcomingupwithextremelycleveralgorithmsthat
seemtoworkwellinpractice,onverylargesetsofpoints( i.e.thousands,oreventensofthousandsof
points)eventhoughtherearepathologicalinputsforwhichthesealgorithmsdoessentiallynobetterthan
justtryingeverypath.SothesealgorithmsconstituteagoodsolutiontotheTSPf romapracticalpointofview
butnotatheoreticalone!
WilliamCooksnewbook,InPursuitoftheTravelingSalesman:MathematicsattheLimitsofComputation,doesa
wonderfuljobpresentingthehistoryandsignificanceoftheTSPandanoverviewofcutting-edgeresearch.Itsa
beautiful,visuallyrichbook,fullofcolorphotographsanddiagramsthatenlivenboththenarrativeand
mathematicalpresentation.Anditincludesawealthofinformation(perhapsevenabit toomuchattimes;IgotFollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
24 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
25/224
lostinafewplaces).Butitactuallybillsitself,partly,asanintroductiontocutting-edgeideasinTSP
researchandIthinkoverallitsucceedsadmirably,explainingideasinwaysthatareaccessiblebutnot
patronizing.Readthisbookifyouwantafun,beautifullyillustratedintroductionto(thisonefascinatingpiece
of)theedgeofhumanknowledge!
Posted in books, computation, geometry, open problems, review | Tagged book review, salesman, TSP. traveling | 6 Comments
New Carnival of MathematicsPosted on April 5, 2012
TheCarnivalofMathematicshasbeenrevived!AbigthankstoMikeCroucherofWalkingRandomlyfor
organizingitforthepastfewyears,andto KatieSteckles,ChristianPerfect,andPeterRowlettfortakingover.
Thelatestedition,carnival#85(wow,hasitreallybeengoingthatlong?)isnowupatPeterRowlettsblog,
TravelsinaMathematicalWorld.Lotsofcoolstuffthere,sobesuretocheckitoutifyouhaventalready.
IllbehostingCarnival#86here,so pleasesubmitsomething!ThedeadlineisMay1st,andIllpostthecarnival
sometimetheweekafterthat.
Posted in links, meta | Tagged Carnival of Mathematics
Making our equation countPosted on March 3, 2012
[Thisispost#4inaseries;previouspostscanbefoundhere: Differencesofpowersofconsecutiveintegers ,
Differencesofpowersofconsecutiveintegers,partII ,Combinatorialproofs.]
Werestilltryingtofindaproofoftheequation
whichexpressesthef actthatacertainarithmeticprocedurealwaysseemstoresult,strangelyenough,inthe
factorialof .LasttimeIintroducedtheideaofusingacombinatorialproof,andgaveasimpleexampleinvolving
abinomialcoefficientidentity.
Inorderforthisideatoyieldanyfruit,weneedawaytointerpretthevariouspiecesoftheequationas counting
something.Letsgooverthepiecesonebyoneanddiscusssomewaystointerpretthemcombinatorially.
Factorial,permutations,andmatchings
Letsstartwiththeright-handside, .Thisoneisnottoohard: countsthenumberofpermutationsofobjects,thatis,thenumberofdifferentwaystotake distinctobjectsandarrangetheminanorderedlist.Why
isthat?Well,thereare objectswecouldchoosetoputfirst;oncewevemadethatchoice,thereare
remainingobjectswecouldchoosetogosecond;then choicesforthethirdobject,andsoon,foratotalof
choices.Forexample,herearethe differentpermutationsofsize :
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
25 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
26/224
However,theresanotherwaytothinkaboutpermutationswhichwillcomeinhandylater.Namely,wecanthink
ofapermutationasamatchingbetweentwosetsofsize .Youknow,likethosepuzzlesthatgivetwo
side-by-sidelistsandsaydrawalinematchingeachcartooncharacterwiththeirfavoritecheese!(or
whatever).Likethis:
Herewehaveamatchingbetweentwosetsofsize .Eachdotontheleftismatchedwithexactlyonedotonthe
right,andviceversa.
Whyarematchingsanotherwayofthinkingaboutpermutations?First,itsnottoohardtoseethattherearealso
matchingsbetweentwosetsofsize :wehave possiblechoicesofwhattomatchthefirstelementwith;
thenthereare choicesleftoverforwhattomatchthesecondelementwith,andsoon.
Butwecanalsoseeacorrespondencebetweenpermutationsandmatchingsmoredirectly.Startbylabelingthe
dotsontheleftofamatchingwithconsecutivenumbers:
Now,imagineeachnumbertravelingalongthecorrespondingrededgeuntilitreachesthedotontheother
side.Likethis:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
26 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
27/224
Seehowthe traveleddownthesteepedgetoendupatthefourthdotfromthetop;the traveledacrossthe
horizontaledgetostayinthesameposition;the traveleduptothetop;andsoon.
Whatwegetoutisalistofthenumbersfrom16insomeorder;inthisexampleweget .Inother
words,wecanviewamatchingasalittlephysicalmachinefortakingalistofobjectsandputtingtheminto
someparticularorder.
Hereareallthepermutationsofsize again,thistimevisualizedasmatchings.
Now,atthispointIamverytemptedtogooffonatangentexploringgrouptheory,symmetrygroups,andall
sortsofotherstuff,butIshallrestrainmyself(fornow!).
Binomialcoefficients
Anotherpieceoftheequationisthebinomialcoefficient .Butofcoursewealreadyknowwhatbinomial
coefficientscount isthenumberofwaystochoose thingsoutof ,thatis,thenumberofsize- subsetsof
asize- set.(Ialsotalkedaboutthislasttime .)
ExponentiationandfunctionsWhatabout ?Whatdoesthatcount?Itturnsoutthatexponentiationcorrespondstocountingfunctions:in
particular, isthenumberoffunctionsfromasetofsize toasetofsize .Whyisthat?Well,foreachofthe
elementsofthedomain,wehave choicesforwhereafunctioncouldsendit,andeachofthesechoicesis
independentsothetotalnumberofchoicesis .
Forexample,hereareallofthe functionsfromasize- settoasize- set:
Hmmmthislooksfamiliar!Notethatsomeofthesefunctionsarematchings,andsomearent.Perhapsyoure
startingtogetaninklingnowwhyIintroducedtheideaofpermutationsasmatchings
Allthepiecesarealmostinplacenow.TheonepieceoftheequationwestillhaventyettalkedaboutisthatFollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
27 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
28/224
mysterious .Itcertainlydoesntmakesensetointerpretthatasthenumberoffunctionsfromasetofsize
toasetofsizenegativeone,becauseofcoursethereisnosuchthingasasetwithanegativesize.Sohow
canweinterpretitcombinatorially?TheanswerliesinsomethingcalledthePrinc ipleofInclusion-Exclusion(or
PIEforshort),whichwillbethesubjectofmynextpost!
Posted in combinatorics, pictures | Tagged binomial coefficients, combinatorics, functions, m atching, permutation | 3 Comments
Combinatorial proofsPosted on February 17, 2012
Continuingfromapreviouspost,wefoundthatifwebeginwith thpowersof consecutiveintegersand
thenrepeatedlytakesuccessivedifferences,itseemslikewealwaysendupwiththefactorialof ,thatis,
.Wethenderivedanalgebraicexpressionfortheresultoftheiterativedifferenceprocedure.So
thegoalnowistoprovethat
thatis,
Now,itspossible(probable,infact)thatthiscanbeprovedbypurelyalgebraicmeans.Ifyoucomeupwith
suchaproofIwouldlovetoseeit!ButImustconfessthatIspentseveralhoursbangingmyheadagainstit
(algebraicallyspeaking)withoutmakinganyprogress.EventuallyIturnedtotheideaofacombinatorialproof.
WhatdoImeanbythat? Combinatoricsisthesubfieldofmathematicsconcernedwith counting.Theessenceofa
combinatorialproofistoshowthattwodifferentexpressionsarejusttwodifferentwaysofcountingthesame
setofobjectsandmustthereforebeequal.Ive describedsomecombinatorialproofsbefore,incountingthe
numberofwaystodistributecookies.
Asanothersimpleexample,considerthebinomialcoefficient identity
Itscertainlypossibletoprovethisalgebraically,byexpandingoutthebinomialcoefficients(using ),
butwecangiveamoreelegantproof,basedonthefactthat isthenumberofwaystochooseasubsetof
thingsoutofasetof things.Forexample,herearethe waystochoosethreethingsoutasetoffive:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
28 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
29/224
Considerthefirstelementofthesize- set.Everysubsetofsize eitherincludesthisfirstelement,oritdoesnt.
Thenumberofsize- subsetswhichdonotincludethefirstelementis ,sincethatsthenumberofwaystochoose thingsfromtheremaining elements.Thenumberofsize- subsetswhichdoincludethefirst
elementis ,becausetheycorrespondtochoosing oftheremaining things.Therefore
.
Heresanillustrationofhowthisworksintheparticularcasewhen and :
Noticehowthetensubsetsfromabovehavebeensplitintotwogroups:thefirstgroup,ontheleft,arethose
thatdontincludethefirstelement;youcanseethateachofthemcorrespondstooneofthe size- subsets
oftheremainingfourelements.Thesecondgroup,ontheright,arethosethatdoincludethefirstelement;each
correspondstooneofthe size- subsetsoftheremainingfourelements.
Sothatstheideaofacombinatorialproof.Andwewanttodosomethingsimilarfortheidentitywearetrying
toprovealthough,ofcourse,itsgoingtobeabitmoredifficult!
Youmighthavefuntryingtothinkaboutwhatacombinatorialproofof ourtargetequationmightlooklike;
althoughifyoudonthavemuchexperiencewithcombinatoricsyoumayhavetroublecomingupwithwhatsorts
ofthingsthetwosidesoftheequationmightbecounting!ThatswhatIlltalkaboutinmynextpost.
Posted in combinatorics, pictures, proof | Tagged binomial coefficients, combinatorial proof, identity | 12 Comm ents
Differences of powers of consecutive integers, part IIPosted on February 16, 2012
Ifyouspentsometimeplayingaroundwiththeprocedurefrom Differencesofpowersofconsecutiveintegers
(namely,raise consecutiveintegerstothe thpower,andrepeatedlytakepairwisedifferencesuntilreaching
asinglenumber)youprobablynoticedthecuriousfactthatitalwaysseemstoresultinafactorialinthe
factorialof ,tobeprecise.
Forexample:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
29 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
30/224
Severalcommentersfiguredthisoutaswell.Doesthisalwayshappen?Ifso,canweproveit?
Letsstartbythinkingaboutwhathappenswhenwedothesuccessive-differencingprocedure.Ifwestartwith
thelist ,thenweget .(Iwanttokeepthelettersinorder,whichiswhyIwrote insteadof .
Insteadofsubtractingthefirstvaluefromthesecond,wecanthinkofitasaddingthenegationofthefirstvalue
tothesecond.)Ifwestartwith ,weget
.
(Thenegationof is ;addingthisto yields .)From weget
Doyouseeanypatternsyet?Letsdoonemore.Fromtheabovecalculationwecanalreadyseethatdoingfour
iterationson willresultin (doyouseewhy?).Doingonefinaliteration
givesus
.
Hmm.Letsmakeatable.
Result
1
2
3
4
5
Iincludedonemorerow(whichyoucanverifyifyoulike).Nowdoyouseeapattern?Thecoefficientsseemto
betakenfromPascalstriangle,butwithalternatingsigns!
Infact,itsactuallynottoohardtoseewhythishappens.Ateachstepwetaketwooffsetcopiesoftheprevious
row(by"of fset"I meanthatthelettersareshif tedbyone,like and )andaddthenegationof
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
30 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
31/224
thefirsttothesecond.Sincethesignsarealternating,wereallyendup addingabsolutevaluesofthe
coefficients.Probablythebestwaytoreallyseethisisthroughanexample:
Noticehowweflipallthesignsinthefirstrow,sothattheymatchthesignsinthesecondrow.Butthisis
exactlyhowPascalstriangleisgeneratedeachrowisthesumofthepreviousrowwithitself,offsetbyone.
Now,intherealproblem,wedontstartwith ,butwiththe thpowersof consecutiveintegers.
Letscallthefirstinteger ,sothesequenceofconsecutiveintegersis .Giventhis,wecan
nowwritedownanexpressionforwhatweendupwithafterdoingtheiterateddifferenceprocedure:
Letsbreakthisdownabit.Weknowthatwegetasumof terms;thatsthe part(youcanreadmore
aboutsigmanotationhere ).Welluse toindextheterms.Wealsoknowthatthetermsalternatesign,sowe
needtoinclude raisedtosomepowerinvolving ;thelasttermisalwayspositive,soweuse ,whichis
equalto when .Thebinomialcoefficient givesusthe thentryonthe throwofPascalstriangle.Finally,ofcourse, isthe thpowerofoneoftheintegerswestartedwith.
Theclaim,therefore,isthat
AndIwillproveittoyou,withprettypictures,aspromised!
Posted in arithmetic, iteration, pascal's triangle | Tagged binomial coefficients, consecutive, difference, integers, powers | 3 Comments
1717 4-coloring with no monochromatic rectanglesPosted on February 9, 2012
Quick,whatsspecialaboutthefollowingpicture?
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
31 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
32/224
AsjustannouncedbyBillGasarch,thisisa gridwhichhasbeenfour-colored(thatis,eachpointinthe
gridhasbeenassignedoneoffourcolors)insuchawaythatthereareno monochromaticrectangles,thatis,no
fourgridpointsformingthecornersofanaxis-alignedrectangleareallofthesamecolor.Forexample,ifwe
changethetop-leftgridpointtored,wecanseeseveralmonochromaticrectanglespopup:
OrheresanotherversionwhereIrandomlypickedagridpointinthemiddle,changeditscolor,andsureenough,
moremonochromaticrectanglesresult:
Asyoucantryverifyingforyourself(andasIalsoverifiedusingacomputerprogram),therearenosuchmonochromaticrectanglesinthefour-coloringatthetopofthispost!(Ifyouwanttoplaywiththefour-coloring
yourself,hereitisinasimpledataformat.)
Forseveralyearsnooneknewifthiswaspossible,andBillhadofferedaprizeof$289(thats ,ofcourse)to
anyonewhocouldfindsuchafour-coloring.TheprizewillbecollectedbyBerndSteinbachandChristian
Posthoffyoucanfindmoredetailsin Billspost.Nooneyetknowsexactlyhowtheyfoundtheirfour-coloring,FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
32 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
33/224
butapparentlytheywillbepresentingapaperaboutitinMay.Illtrytowritemoreaboutitthen(ifI
understanditatall)!
Ifyoureinterestedinreadingmoreaboutthehistoryandmathbehindthisproblem(andtogetsomeintuition
forwhyitisdifficult),takealookatthesepostsbyBrianHayesonhisblog,bit-player: The1717challengeand
17x17:Anonprogressreport.IalsorememberseeingHeresafuninteractiveappletwhereyoucanplayaround
withtheproblem,createdbyMartinSchweitzer.
Posted in open problems, pattern, people, pictures | T agged 17x17, four-coloring, graph, grid, monochromatic, rectangles | 5 Comments
Book review: Nine Algorithms that Changed the FuturePosted on February 4, 2012
NineAlgorithmsthatChangedtheFuture:theIngeniousIdeasthatDriveTodays
Computers,byJohnMacCormick.PrincetonUniversityPress,2012.
Imoftenwaryofbookswrittenforgeneralaudiencesontechnicaltopics.Itsquite
difficulttowriteinawaythatisbothaccessibletoawideaudienceandtechnically
accurate.Manysuchbooksendupsacrificingaccuracyinthenameofaccessibility,
tryingtoconveyjusttheintuitionorgeneralsenseofsometopic,butoftenend
upgivingpeoplethewrongideainstead.
Iwasquitehappytofind,therefore,thatJohnMacCormicknailsit:9Algorithms
thatChangedtheFutureistechnicallyrightonthemoney,butmanagestoexplain
thingsinwaysthatarebothunderstandableandfun.Wanttounderstandhow
Googlerankssearchresults?OrhowAmazonmanagestoneverloseormessupyourorderinformation,even
thoughtheygethundredsofthousandsoforderseachdayand(asweallknow)networksandharddrivesare
unreliable?Everwonderhowyoucanordersomethingovertheinternetwithoutyourcreditcardnumberbeing
stolen?Orhowzipisabletomakeyourfilessmaller,seeminglybymagic?Evenifyouhaveneverwondered
aboutthesethings,perhapsIhavemadeyouwonderaboutthemjustnow.Andthatsexactlythepointofthis
book:therearequiteafewingeniousalgorithmicideasthatmostofusrelyon everydaythatwerarelyor
neverevenstoptowonderabout.
Forexample,Iactuallylearnedsomethingnew:Iknewaboutpublic-keycryptographybuthadneverreally
knownmuchaboutDiffie-Hellmankeyexchange,whichiswhatallowsyourwebbrowsertotalkto,say,
Amazonsserverssecurelyeventhoughtheyhavenevercommunicatedbefore.Its likehavingasecret
conversationincodewithapen-palwhomyouvenevermet,eventhoughlotsofpeoplearereadingyourmail.
Howcanyoueveragreeonasecretcodeinthefirstplacewithoutthepeoplereadingyourmailfindingout(and
hencebeingabletoreadallyoursubsequentcodedmessages)?Soundsimpossible,doesntit?Butitturnsout
thatitispossible,withsomecleverideas,whichMacCormickskillfullyexplainsusingafunmetaphorabout
mixingcolorsofpaint.
Eachchapterstartsoutverysimply,graduallybuildingupmorecomplexexamplesuntilyoureachafull
understandingofthealgorithmbeingexplained.AlongthewayMacCormickintroducesthetrickstheclever,FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
33 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
34/224
centralideasthatmakeeachalgorithmwork.Thewritingisexcellent:clear,precise,andfun.Ihighly
recommendthisbooktoanyonecuriousabouttheingeniousmathematicalandalgorithmicideasunderlying
someoftodaysmostubiquitoustechnology.
Posted in books, computation, review | Tagged algorithms, history, J ohn MacCormick
Computing with decadic numbersPosted on January 30, 2012
[Thisistheninth,and,Ithink,finalinaseriesofpostsonthe decadicnumbers(previousposts:Acuriosity,An
invitationtoafunnynumbersystem ,Whatdoes"closeto"mean?,Thedecadicmetric,Infinitedecadicnumbers,
Morefunwithinfinitedecadicnumbers,Aself-squarenumber,u-tube).]
Inapreviouspost,wefoundadecadicnumber
withthecuriouspropertythatitisitsownsquare,eventhoughitisobviouslynotzeroorone.Wethenderiveda
moreefficientalgorithmforgeneratingthedigitsof .HeressomeHaskellcode(explainedinthepreviouspost)
whichimplementsthemoreefficientalgorithm,whichIincludeherejustsothatthispostwillbeavalidliterate
Haskellfileinitsentirety.
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
34 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
35/224
> {-# LANGUAGE TypeSynonymInstances
> , FlexibleInstances
> #-}
>
> module Decadic2 where
>
> import Control.Monad.State
>
> -- State for incrementally constructing u_n.
> -- Invariant: curT = 10^n; un^2 = pn*curT + un
> data UState = UState { pn :: Integer
> , un :: Integer
> , curT :: Integer
> }
> deriving Show
>
> -- u_1 = 5; 5^2 = 25 = 2*10 + 5
> initUState = UState 2 5 10
>
> uStep :: State UState Int
> uStep =do
> u p t
> let d = p `mod` 10 -- next digit
> u' = d * t + u -- prepend the next digit to u
> p' =(p + 2*d*u + d*d*t) `div` 10 -- see above proof
>
> put (UState p' u' (10*t))-- record the new values
>
> return $ fromInteger d -- return the new digit
>
> type Decadic =[Int]
>
> u :: Decadic> u = 5 : evalState (sequence $ repeat uStep) initUState
Toroundthingsout,Idliketoshowoffsomeofthecoolthingswecandowiththis.First, asweknow,its
possibletodoarithmeticwithdecadicnumbers.Soletsimplementit!
Additionofdecadicnumbersisdonejustlikeadditionoftheusualdecimalnumbers:weaddcorresponding
places(i.e.,lineupthenumbersoneundertheotherandthenaddincolumns).
> plus :: Decadic -> Decadic -> Decadic
First,wehavespecialcasesforzero,representedbytheemptylistofdigits:inthosecaseswejustreturnthe
othernumberunchanged.
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
35 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
36/224
> plus [] n2 = n2
> plus n1 [] = n1
Next,toaddadecadicnumberwhosefirstdigitisxtoadecadicnumberwhosefirstdigitis y,wejustaddxandy
andthencontinueaddingrecursively.
> plus (x:xs)(y:ys)=(x+y) : plus xs ys
Ofcourse,werenotdone:thisdoesntdoanycarrying.Insteadofmodifyingour plusfunctiontodocarrying,we
justwriteafunctionnormalizewhichmakessureeveryplaceinadecadicnumberisbetween and ;itwillcome
inhandyformorethanjustaddition.
> normalize :: Decadic -> Decadic
Thenormalizefunctionsimplycallsarecursivehelperfunctionnormalize'whichkeepstrackofthecurrent"carry".
Thestartingcarry,ofcourse,iszero.
> normalize = normalize' 0
Tonormalizezero(theemptylist)whenthecurrentcarryiszero,justreturntheemptylist.
> where normalize' 0 [] = []
Withanonzerocarryandtheemptylist,wesimplyextendthelistwithaspecialzerodigitandcontinue
normalizing.
> normalize' carry [] = normalize' carry [0]
Inthegeneralcase,weaddthecurrentcarrytothenextdigitx,andcomputethequotientandremainderwhen
dividingthissumbyten.Theremainderisthenextdigitd,andthequotientisthenewcarrywhichgetspassed
alongrecursively.
> normalize' carry (x:xs)= d : normalize' carry' xs
> where(carry', d)=(carry + x) `divMod` 10
Andnowformultiplication,whichisbasedontheobservationthatzerotimesanythingiszero,andinthe
generalcaseFollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
36 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
37/224
.
> mul :: Decadic -> Decadic -> Decadic
> mul [] _= []
> mul _ [] = []
> mul (x:xs)(y:ys)= x*y : (map (x*) ys + (xs * (y:ys)))
Finally,wedeclareDecadictobeaninstanceofthe Numclass,whichallowsustousedecadicnumbersinthesame
waysthatwecanuseothernumerictypes:
> instance Num Decadic where
Toaddormultiplydecadicnumbers,usetheplusandmulfunctionsandthennormalize.
> n1 + n2 = normalize (plus n1 n2)
> n1 * n2 = normalize (mul n1 n2)
Tonegateadecadicnumber,subtractthelastdigitfrom10andtherestofthedigitsfrom9.
> negate [] = []
> negate (x:xs)= normalize $ (10-x) : negate' xs
> where negate' [] = repeat 9
> negate' (x:xs)=(9-x) : negate' xs
Finally,toconvertanintegerintoadecadicnumber,puttheintegerintoalistofoneelementand normalize.
> fromInteger = normalize . (:[]) . fromInteger
So,letstryit!Wellwantawaytodisplaydecadicnumbers:
> showDecadic :: Decadic -> IO ()
> showDecadic d = putStrLn . dots $ digits
> where d' = take 31 d
> dots | length d' | otherwise =("..." ++)
> digits = concat . reverse . map show . take 30 $ d'
Normaldecimalintegerscanalsobeusedasdecadicnumbers:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
37 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
38/224
*Decadic2> showDecadic 7
7
Heres :
*Decadic2> showDecadic u
...106619977392256259918212890625
Andheres ;ithadbetterbethesameas !
*Decadic2> showDecadic (u^2)
...106619977392256259918212890625
Well,lookslikeitsthesameforthefirst30digitsatleast!Wecanalsocompute .Remember,if then
,so shouldbeanotherself-squarenumber.Rememberhowwethoughttheremightbeaself-squarenumberendingin ?Well,thisisit!
*Decadic2> showDecadic (1-u)
...893380022607743740081787109376
*Decadic2> showDecadic ((1-u)^2)
...893380022607743740081787109376
Finally,wecancheckthat :
*Decadic2> showDecadic (u * (1-u))
...000000000000000000000000000000
Ifyourecall,thisisinsomesensethefundamentalreasonwhythedecadicnumbersactsofunny,becauseithas
zerodivisors:pairsofnumbers(like and ),neitherofwhichiszero,whoseproductisnonethelesszero.
Now,ifyouremember,fromevenfurtherback,whatgotusintothiswholedecadicmessinthefirstplace:
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
38 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
39/224
Inthatfirstpost,Isaid
ImanagedtoextendthispatternforafewmoredigitsbeforeIgotbored.Doesitcontinueforeveror
doesiteventuallystop?Isthereanydeepermathematicalexplanationlurkingbehindthissupposed
curiosity?Whatssospecialabout ?Dopatternslikethisexistforotherfunctions?
Well,bythispointIhopeitsclearthatthereisindeedadeepermathematicalexplanationlurking!Theequation
admitsthesolutions and ,butdoesitadmitanyotherdecadicsolutions?Noticethatgiven
,whichhas and assolutions,then (and )arealsosolutions:
.
Sointhiscaseweget
asasolution(theothersolutionisnotadecadicinteger).
Toimplementit,weneedawaytohalvedecadicnumbers(Illletyouworkoutwhatsgoingonhere):
> halve :: Decadic -> Decadic
> halve [] = []
> halve t@(s:_)
> | odd s = error "foo"
> | otherwise = halve' t
> where
> halve' [] = []
> halve' [x]=[x `div` 2]
> halve' (x:x':xs)=(x `div` 2 + adj) : halve' (x':xs)
> where adj | odd x' = 5
> | otherwise = 0
Andnowwecandefine
> q = halve (3*u - 1)
*Decadic2> showDecadic q
...159929966088384389877319335937
*Decadic2> showDecadic (2*q^2 - 1)
...159929966088384389877319335937
Woohoo!Thisclearlyshowsthatthepatterndoes,infact,continueforever.Italsoshowsusthat is
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
39 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
40/224
notparticularlyspecial:anyquadraticfunctionthatfactorsas ,attheveryleast,willleadtoapattern
likethis,andprobablylotsofotherequationsdotoo.
Ifyoureinterestedinreadingmore,hereswhereIgotsomeofmyinformation .Forexample,youcanread
abouthowthereisanothernumber ,definedbystartingwith anditerativelyraising
tothefifthpower(justaswedefined bystartingwith andsuccessivelysquaring),suchthat .Iteven
seemsthattheauthorofthatpage,GrardMichon,hasrecentlyaddedadiscussionofthisveryproblem,promptedbymyblogposts!Isnttheinternetgreat?
Posted in arithmetic, programming | Tagged computing, decadic, numbers | 2 Comments
Differences of powers of consecutive integersPosted on January 29, 2012
PatrickVennebushofMathJokes4MathyFolks recentlywroteaboutthefollowingprocedurethatyields
surprisingresults.Choosesomepositiveinteger .Now,startingwith consecutiveintegers,raiseeach
integertothe thpower.Thentakepairwisedifferencesbysubtractingthefirstnumberfromthesecond,the
secondfromthethird,andsoon,resultinginalistofonly numbers.Dothesamethingagain,resultinginnumbers,andrepeatuntilyouareleftwithasinglenumber.
Forexample,supposewechoose ,andstartwiththefiveconsecutiveintegers .Weraisethem
alltothefourthpower,givingus
Nowwetakepairwisedifferences: ,then ,andsoon,andwegetthe
newlist
Repeatingthedifferenceproceduregives
OK,soweget .Sowhat?
Well,ifyoutryenoughexamples,youmaynoticeasurprisingpattern.Illletyouplaywithitforawhile.Over
thecourseofafewfuturepostsIllexplainthepatternandprovethatitalwaysholdsbuttheproofwillbea
reallycoolcombinatorialone,withprettypictures!
Posted in arithmetic, pattern | Tagged consecutive, difference, integers, powers, surprising | 16 Comments
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
40 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
41/224
7/30/2019 Maths Less Travelled
42/224
7/30/2019 Maths Less Travelled
43/224
7/30/2019 Maths Less Travelled
44/224
> uStep :: State UState Int
> uStep =do
> u p t
> let d = p `mod` 10 -- next digit
> u' = d * t + u -- prepend the next digit to u
> p' =(p + 2*d*u + d*d*t) `div` 10 -- see above proof
>
> put (UState p' u' (10*t))-- record the new values
>
> return $ fromInteger d -- return the new digit
So,didwegainanything?Asaconcretecomparison,letsseehowlongittakestocompute .Usingourfirst,
simplecode,ittakes7.2seconds:
*Decadic> :set +s
*Decadic> length . show $ us !! 1000010001
(7.23 secs, 208746872 bytes)
(Ijusthaditprintthe numberofdigitsof toavoidwastingatonofspaceprintingouttheentirenumber.)
Andusingournewandhopef ullyimprovedcode?
*Decadic> length . show . un . flip execState initUState
$ replicateM_ 10000 uStep
10001
(1.55 secs, 225857080 bytes)
Only1.5seconds!Nice!
TheothernicethingaboutuStepisthatitspitsoutonedigitof atatime,whichwecanusetodefine asan
(infinite)listofdigitsasifthedigitswerecomingoneatatimedowna"tube",a -tube,onemightsaygetit,
a tubehehnevermind.
> type TenAdic =[Int]
>
> u :: TenAdic
> u = 5 : evalState (sequence $ repeat uStep) initUState
*Decadic> reverse $ take 20 u
[9,2,2,5,6,2,5,9,9,1,8,2,1,2,8,9,0,6,2,5]
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
44 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
45/224
Nifty!Nexttimetherealfunbegins,asIshowoffsomecoolthingswecandowithourshinynew
implementationof .
Posted in computation, c onvergence, infinity, iteration, modular arithmetic, number theory, programming | Tagged decadic, Haskell, idempotent, streaming, u | 2
Comments
Herbert Wilf: 13 June 1931 7 January 2012Posted on January 9, 2012
Iwassadtolearnthat HerbertWilfdiedyesterday.Long-timereadersofthisblogmayrememberhimasoneof
thediscoverersofthe Calkin-Wilftree,whichIwroteaboutinaten-partseriesofposts( 1,2,3,4,5,6,7,8,9,
10).
The Calkin-Wilf Tree
Healsowrotegeneratingfunctionology,atextbookaboutgeneratingfunctions,atopicnearanddeartomyheart
(whichIhopetowriteaboutheresomeday).
AlthoughhewasanemeritusprofessorattheUniversityofPennsylvania(whereIamcurrentlydoingmyPhD)I
sadlynevergotachancetomeethim.
Posted in people | Tagged Herbert Wilf | 1 Comment
A self-square numberPosted on January 4, 2012
[Thisistheseventhinaseriesofpostsonthedecadicnumbers(previousposts:Acuriosity,Aninvitationtoa
funnynumbersystem,Whatdoes"closeto"mean?,Thedecadicmetric,Infinitedecadicnumbers,Morefunwith
infinitedecadicnumbers).Iknowit'sbeenawhilesinceI'vewrittenonthistopic,soifyou'vebeenfollowing
along,youmightwanttogobackandrefreshyourmemory.]
Finally,aspromised,Icanshowyouthestrangenumber uwhichisitsownsquare(butwhich isntzeroorone!).Upuntilnowallthedecadicnumbersweveconsideredhavebeenequivalenttofamiliarrationalnumbers,but
zeroandonearetheonlyrationalnumberswhicharetheirownsquare;clearlyumustbesomethingquite
different!
Assumingthatsuchaucouldexistandassumingitsadecadicinteger,thatis,hasnodigitstotherightofthe
decimalpointletsthinkforaminuteaboutwhat ucouldpossiblybe.Forexample,whatcouldits lastdigitbe?FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
45 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
46/224
7/30/2019 Maths Less Travelled
47/224
Areyouseeingapattern?Letsmakeatableoftheresultssofar:
1 5 25
2 25 625
3 625 390625
4 0625 390625
5 90625 8212890625
WhydidIputsomenumbersinbold?Well,hopefullyyouvenoticedbynowthateachnumberintheleft-hand
columnalwaysseemstobeasuffixofthesquareofthepreviousnumber.Soperhapsthenextdigitwillbe8?
Sureenough, endsin .
Willthisalwayswork?Yes,infact,itwill,andhereswhy.Letslet denotethelast digitsof (so ,
,andsoon).Oncewehavefound ,wecansetupamodularequationtofindthenextdigit(thisisjustageneralizationofwhatwedidearlier):
Now, isclearlydivisibleby sot hattermgoesaway.Butwhatabout ?Itseemsthatweonly
knowitisdivisibleby ,notnecessarilyby .Ah,butwait!Weknowthat endswith ,andhenceis
divisibleby ;combiningthiswiththe givesusanotherfactorof !Sothistermgoesawaytoo,andweareleft
with
No w, (bydefinition),sosubtracting fromb othsidesleavesamultipleo f intheplaceof
(namely, withtherightmost digitssettozero).Butwecanalsogetridofallthedigitstotheleftofthe
stbecauseweareworkingmod .Dividingby wefindthat mustbeequaltothat stdigitof
.
Soherestheprocedure:startingwith ,define
Thatis,squarethecurrentnumberoflength andtakethelast digitstogetthenextnumber.Theaboveproofshowsthat
Ateverystepwewillhaveanumber whosesquareendswiththedigitsof ;
thisprocedurewillalwayswork;and
thisproceduregivestheuniquesequenceof withthispropertywhenstartingwith !
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
47 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
48/224
Sowehave
andsoon.
Sowhatis ?Itissimplythelimitofcarryingoutthisproceduretoinfinity!
Weknowthatanysuffixof ,whensquared,yieldssomethingendingwithitself.Soitmakessense(althoughit
takesabitofimagination!)thatsquaring itselfyields again.
Posted in arithmetic, infinity, iteration, modular arithmetic, proof | Tagged decadic, idempotent, self, square | 12 Comments
Four-figure offerPosted on December 1, 2011
Thisjustarrivedinmyinbox:
MynameisBeckyRaymond,ImaDomainBrokerageConsultantworkingonbehalfoftheownerof
traveled.comtosellthispremiumasset.
WhilesearchingonlineIcameacrossyourdomainmathlesstraveled.com;sincebothdomainshave
listingsunderarelatedkeywordIthoughtperhapsyourcompanymaybeinterestedinacquiring
traveled.com?Ifthisdomainisofinteresttoyou,pleasesubmitanofferinthefourfigurerangeand
abovetoqualifyasapotentialbuyer.
Surething,Becky!Hereismyfour-figureoffer:
Fig. 1. A graph of the first 1000 hyperbinary numbers.
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
48 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
49/224
Fig 2. Hasse diagram for the subsets of a five-element set.
Fig. 3: Proof that .
Fig. 4: Complete set of 15-bracelets.
Ihopeyouwillagreethatthisisaveryfinesetoffigures.Icouldprobablyaddacouplemorefigurestomyoffer
ifthatbecomesnecessary.
Ilookforwardtobeingtheproudowneroftraveled.com,theplacetogoforallyourmathematicaltravelneeds!
Posted in humor, meta | Tagged domain, four figure, offer | 7 Comments
Sigmas and sums of squaresPosted on November 29, 2011
CommenterRachelrecentlyasked,
FollowFollow
F o l l o w T h e M a t h L e s s
F o l l o w T h e M a t h L e s s
T r a v e l e d
T r a v e l e d
G e t e v e r y n e w p o s t d e l i v e r e d t o
G e t e v e r y n e w p o s t d e l i v e r e d t o
The Math Less Traveled | Explorations in mathema... http://mathlesstraveled.c
49 of 224 10/16/12 1
7/30/2019 Maths Less Travelled
50/224
Howwouldyoufindthesumof ?
Seehereforanexplanationofsigmanotationinthiscaseitdenotesthesum
Ofcourse,foranyparticularvalueof wecanjustpluginvaluesanddoabunchofadding.ButIinterpretRachelsquestiontomeancanwefindanalgebraicexpressionintermsof whichletsuscomputethesum
morequicklythanactuallyaddingtheindividualterms?
Letstry!
First,weobservethat
Why?Ifyouthinkaboutitabit,youcanseethatthesametermsshowupontheleftandtheright,justinadifferentorder:theleftsideis whereastherightsideis .
Sinceadditionisassociative( )andcommutative( )theseareequal.
Next,weobservethat
,
thatis, .Thisisbecausemultiplicationdistributesoveraddition.
So,wehave .
isjust copiesof ,soitisequalto .Ivewrittenbeforeabout ;itisequalto .Sofar,we
have
.
Whataboutthatpesky ?Canitbesimplifiedatall?
Itcan,andIknowofafewdifferentwaystofigureitout.Illshowyouone