/
RemarksonSeparatingWordsErikDDemaine1SarahEisenstat1JereyShallit2andDa RemarksonSeparatingWordsErikDDemaine1SarahEisenstat1JereyShallit2andDa

RemarksonSeparatingWordsErikDDemaine1SarahEisenstat1JereyShallit2andDa - PDF document

jones
jones . @jones
Follow
342 views
Uploaded On 2021-09-27

RemarksonSeparatingWordsErikDDemaine1SarahEisenstat1JereyShallit2andDa - PPT Presentation

Howeverbyabriefcomputationweseethatno2stateDFAcanseparatethesetwowordsSosep100000103NotethatsepwxsepxwbecausethelanguageofaDFAcanbecomplementedbyswappingtherejectandacceptstatesWeletSnmaxw6xjwjjxjns ID: 887451

proof lcm jxj logn lcm proof logn jxj nsep forexample thensep states modp sep comput dlogn shallit inform robson

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "RemarksonSeparatingWordsErikDDemaine1Sar..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1 RemarksonSeparatingWordsErikD.Demaine1,S
RemarksonSeparatingWordsErikD.Demaine1,SarahEisenstat1,Je®reyShallit2,andDavidA.Wilson11MITComputerScienceandArti¯cialIntelligenceLaboratory,32VassarStreet,Cambridge,MA02139,USA,fedemaine,seisenst,dwilsong@mit.edu2UniversityofWaterloo,Waterloo,ONN2L3G1,Canada,shallit@cs.uwaterloo.caAbstract.Theseparatingwordsproblemasksforthesizeofthesmall-estDFAneededtodistinguishbetweentwowordsoflength·n(byacceptingoneandrejectingtheother).Inthispaperwesurveywhatisknownandunknownabouttheproblem,considersomevariations,andproveseveralnewresults.1IntroductionImagineacomputingdevicewithverylimitedpowers.Whatisthesimplestcomputationalproblemyoucouldaskittosolve?Itisnottheadditionoftwonumbers,norsorting,norstringmatching|itistellingtwoinputsapart:dis-tinguishingtheminsomeway.Takeasourcomputationalmodelthedeterministic¯niteautomatonorDFA.Asusual,itconsistsofa5-tuple,M=(Q;§;±;q0;F),whereQisa¯nitenonemptysetofstates,§isanonemptyinputalphabet,±:Q£§!Qisthetransitionfunction(assumedtobecomplete,orde¯nedonallmembersofitsdomain),q02Qistheinitialstate,andFµQisasetof¯nalstates.WesaythataDFAMseparateswandxifMacceptsonebutrejectstheother.Giventwodistinctwordsw;xweletsep(w;x)bethenumberofstatesinthesmallestDFAacceptingwandrejectingx.Forexample,theDFAbelowseparates0010from1000.0, 10101 However,byabriefcomp

2 utation,weseethatno2-stateDFAcanseparate
utation,weseethatno2-stateDFAcanseparatethesetwowords.Sosep(1000;0010)=3.Notethatsep(w;x)=sep(x;w),be-causethelanguageofaDFAcanbecomplementedbyswappingtherejectandacceptstates.WeletS(n)=maxw6=xjwj;jxj·nsep(w;x).Theseparatingwordsproblemistodeter-minegoodupperandlowerboundsonS(n).Thisproblemwasintroduced25yearsagobyGoral·c¶³kandKoubek[5],whoprovedS(n)=o(n).ItwaslaterstudiedbyRobson[7,8],whoobtainedthebestupperboundsofar:S(n)=O(n2=5(logn)3=5).Asanadditionalmotivation,theseparatingwordsproblemcanbeviewedasaninverseofaclassicalproblemfromtheearlydaysofautomatatheory:giventwoDFAsacceptingdi®erentlanguages,whatlengthofwordsu±cestodistinguishthem?Moreprecisely,giventwoDFAsM1andM2,withmandnstates,respectively,withL(M1)6=L(M2),whatisagoodboundonthelengthoftheshortestwordacceptedbyonebutnottheother?Theusualcross-productconstructionquicklygivesanupperboundofmn¡1(makeaDFAforL(M1)\L(M2)).Buttheoptimalupperboundofm+n¡2followsfromtheusualalgorithmforminimizingautomata.Furthermore,thisboundisbestpossible[9,Thm.3.10.6].ForNFAstheboundisexponentialinmandn[6].Fromthefollowingresult,alreadyprovedbyGoral·c¶³kandKoubek[5],weknowthatthechallengingcaseofwordseparationcomesfromwordsofequallength:Proposition1.Supposejwj;jxj·nandjwj6=jxj.Thensep(w;x)=O(logn).Furthermore,thereisanin¯niteclassofexamp

3 leswheresep(w;x)=­(logn).Weusethefollowi
leswheresep(w;x)=­(logn).Weusethefollowinglemma[10]:Lemma1.If0·i;j·nandi6=j,thenthereisaprimep·4:4lognsuchthati6´j(modp).Proof.(ofProposition1)Let'sprovetheupperbound.Ifjwj6=jxj,thenbyLemma1thereexistsaprimep·4:4lognsuchthatjwjmodp6=jxjmodp.Henceasimplecycleofpstatesservestodistinguishwfromx.Fortheotherdirection,we¯rstrecallthatasequence(pi)i¸0issaidtobeultimatelyperiodicifthereexistintegersr¸0;s¸1suchthatpi=pr+iforalli¸s.Inthiscasesiscalledthepreperiodandrtheperiod.NowweclaimthatnoDFAwithnstatescandistinguish0n¡1from0n¡1+lcm(1;2;:::;n):Toseethis,letpi=±(q0;0i)fori¸0.Thenpiisultimatelyperiodicwithperiod·nandpreperiodatmostn¡1.Thuspn¡1=pn¡1+lcm(1;2;:::;n).Since,fromtheprimenumbertheorem,wehavelcm(1;2;:::;n)=en(1+o(1)),the­(logn)lowerboundfollows.¤ Example1.Supposejwj=22andjxj=52.Thenjwj´1(mod7)andjxj´3(mod7).SowecanacceptwandrejectxwithaDFAthatusesacycleofsize7,asfollows:0. 10. 10. 10. 10. 10. 10. 1Inwhatfollows,then,weonlyconsiderthecaseofequal-lengthwords,andwerede¯neS(n)=maxw6=xjwj=jxj=nsep(w;x).Thegoalofthepaperistosurveywhatisknownandunknown,andtoexaminesomevariationsontheoriginalproblem.OurmainnewresultsareTheorems2and3.Notation:inwhatfollows,ifxisaword,weletx[j]denotethej'thsymbolofx(sothatx[1]isthe¯rstsymbol).2IndependenceofalphabetsizeAswehavede¯nedit,S(n)couldcon

4 ceivablydependonthesizeofthealphabet§.Le
ceivablydependonthesizeofthealphabet§.LetSk(n)bethemaximumnumberofstatesneededtoseparatetwolength-nwordsoveranalphabetofsizek.Thenwemighthaveadi®erentvalueSk(n)dependingonk=j§j.Thefollowingresultshowsthisisnotthecasefork¸2.Thisresultwasstatedin[5]withoutproof;wesupplyaproofhere.Proposition2.Forallk¸2wehaveSk(n)=S2(n).Proof.Supposex;yaredistinctlength-nwordsoveranalphabet§ofsizek�2.Thenxandymustdi®erinsomeposition,sayfora6=b,x=x0ax00;y=y0by00;forjx0j=jy0j. Nowmapato0,bto1andmapallotherlettersof§to0.ThisgivestwonewdistinctbinarywordsXandYoflengthn.IfXandYcanbeseparatedbyanm-stateDFA,thensocanxandy,byrenamingtransitionsoftheDFAtobeover§nbandfbginsteadof0and1,respectively.ThusSk(n)·S2(n).ButclearlyS2(n)·Sk(n),sinceeverybinarywordcanbeconsideredasawordoverthelargeralphabet§.SoSk(n)=S2(n).¤3AveragecaseOnefrustratingaspectoftheseparatingwordsproblemisthatnearlyallpairsofwordscanbeeasilyseparated.Thismeansthatbadexamplescannotbeeasilyproducedbyrandomsearch.Proposition3.Considerapairofwords(w;x)selecteduniformlyfromthesetofallpairsofunequalwordsoflengthnoveranalphabetofsizek.ThentheexpectednumberofstatesneededtoseparatewfromxisO(1).Proof.Withprobability1¡1=k,tworandomly-chosenwordswilldi®erinthe¯rstposition,whichcanbedetectedbyanautomatonwith3states.Withprobability(1=k)(1¡1

5 =k)thewordswillagreeinthe¯rstposition,bu
=k)thewordswillagreeinthe¯rstposition,butdi®erinthesecond,etc.Hencetheexpectednumberofstatesneededtodistinguishtworandomly-chosenwordsisboundedbyPi¸1(i+2)(1=k)i¡1(1¡1=k)=(3k¡2)=(k¡1)·4.¤4LowerboundsforwordsofequallengthFirstofall,thereisalowerboundanalogoustothatinProposition1forwordsofequallength.Thisdoesnotappeartohavebeenknownpreviously.Theorem1.NoDFAofatmostnstatescanseparatetheequal-lengthbinarywordsw=0n¡11n¡1+lcm(1;2;:::;n)andx=0n¡1+lcm(1;2;:::;n)1n¡1.Proof.Inpictures,wehave0-cycle1-cycle0-tail1-tail Moreformally,letMbeanyDFAwithnstates,letqbeanystate,andletabeanyletter.Letpi=±(q;ai)fori¸0.Thenpiisultimatelyperiodicwithperiod·nandpreperiod(\tail")atmostn¡1.Thuspn¡1=pn¡1+lcm(1;2;:::;n).Itfollowsthatafterprocessing0n¡1and0n¡1+lcm(1;2;:::;n),Mmustbeinthesamestate.Similarly,afterprocessing0n¡11n¡1+lcm(1;2;:::;n)and0n¡1+lcm(1;2;:::;n)1n¡1;Mmustbeinthesamestate.Sonon-statemachinecanseparatewfromx.¤Wenowproveaseriesofverysimpleresultsshowingthatifwandxdi®erinsome\easy-to-detect"way,thensep(w;x)issmall.4.1Di®erencesnearthebeginningorendofwordsProposition4.Supposewandxarewordsthatdi®erinsomesymbolthatoccursdpositionsfromthestart.Thensep(w;x)·d+2.Proof.Lettbeapre¯xoflengthdofw.Thentisnotapre¯xofx.Wecanacceptthelanguaget§¤usingd+2states;suchanautomatonacceptswandrejectsx.¤Fore

6 xample,toseparate01010011101100110000fro
xample,toseparate01010011101100110000from01001111101011100101wecanbuildaDFAtorecognizewordsthatbeginwith0101:0, 11010(Transitionstoadeadstateareomitted.)Proposition5.Supposewandxdi®erinsomesymbolthatoccursdpositionsfromtheend.Thensep(w;x)·d+1.Proof.LettheDFAMbetheusualpattern-recognizingautomatonforthelength-dsu±xsofw,endinginanacceptingstateifthesu±xisrecognized.ThenMacceptswbutrejectsx.StatesofMcorrespondtopre¯xesofs,and±(t;a)=thelongestsu±xoftathatisapre¯xofs.¤ Forexample,toseparate11111010011001010101from11111011010010101101wecanbuildaDFAtorecognizethosewordsthatendin0101:00110110104.2FingerprintsDe¯nejwjaasthenumberofoccurrencesofthesymbolainthewordw.Proposition6.Ifjwj;jxj·nandjwja6=jxjaforsomesymbola,thensep(w;x)=O(logn).Proof.Bytheprimenumbertheorem,ifjwj;jxj=n,andwandxhavekandmoccurrencesofarespectively(k6=m),thenthereisaprimep=O(logn)suchthatk6´m(modp).Sowecanseparatewfromxjustbycountingthenumberofa's,modulop.¤Analogously,wehavethefollowingresult.Proposition7.Ifthereisapatternoflengthdoccurringadi®erentnumberoftimesinwandx,withjwj;jxj·n,thensep(w;x)=O(dlogn).4.3PairswithlowHammingdistanceThepreviousresultshaveshownthatifwandxhavedi®ering\¯ngerprints",thentheyareeasytoseparate.Bycontrast,thenextresultshowsthatifwandxareverysimilar,thentheyarealsoeasytoseparate.The

7 HammingdistanceH(w;x)betweentwoequal-len
HammingdistanceH(w;x)betweentwoequal-lengthwordswandxisde¯nedtobethenumberofpositionswheretheydi®er.Theorem2.Letwandxbewordsoflengthn.IfH(w;x)·d,thensep(w;x)=O(dlogn). Proof.Withoutlossofgenerality,assumexandyarebinarywords,andxhasa1insomepositionwhereyhasa0.Considerthefollowingpicture:1nidi4i3i2i1y=x=¢¢¢¢¢¢01Leti1i2:::idbethepositionswherexandydi®er.NowconsiderN=(i2¡i1)(i3¡i1)¢¢¢(id¡i1).ThenNnd¡1.Bytheprimenumbertheorem,thereexistssomeprimep=O(logN)=O(dlogn)suchthatNisnotdivisiblebyp.Soij6´i1(modp)for2·j·d.De¯neap;k(x)=0@Xj´k(modp)x[j]1Amod2.ThisvaluecanbecalculatedbyaDFAconsistingoftwoconnectedringsofpstateseach.WeusesuchaDFAcalculatingap;i1.SincepisnotafactorofN,noneofthepositionsi2;i3;:::;idareincludedinthecountap;i1,andthetwowordsxandyagreeinallotherpositions.Soxcontainsexactlyonemore1inthesepositionsthanydoes,andhencewecanseparatethetwowordsusingO(dlogn)states.¤5Specialclassesofwords5.1ReversalsItisnaturaltothinkthatpairsofwordsthatarerelatedmightbeeasiertoseparatethanarbitrarywords;forexample,itmightbeeasytoseparateawordfromitsreversal.Nobetterupperboundisknownforthisspecialcase.However,westillhavealowerboundof­(logn)forthisrestrictedproblem:Proposition8.Thereexistsaclassofwordswforwhichsep(w;wR)=­(logn)wheren=jwj.Proof.Considerseparatingw=0t¡110t¡1+lcm(1;2;:::t)fr

8 omwR=0t¡1+lcm(1;2;:::t)10t¡1:Then,asbefo
omwR=0t¡1+lcm(1;2;:::t)10t¡1:Then,asbefore,noDFAwith·tstatescanseparatewfromwR.¤ Mustsep(wR;xR)=sep(w;x)?No,forw=1000,x=0010,wehavesep(w;x)=3butsep(wR;xR)=2:OpenProblem1Is¯¯sep(x;w)¡sep(xR;wR)¯¯unbounded?5.2ConjugatesTwowordsw;w0areconjugatesifoneisacyclicshiftoftheother.Forexample,theEnglishwordsenlistandlistenareconjugates.Istheseparatingwordsproblemanyeasierifrestrictedtopairsofconjugates?Proposition9.Thereexistain¯niteclassofpairsofwordsw;xsuchthatw;xareconjugates,andsep(w;x)=­(logn)forjwj=jxj=n.Proof.Consideragainw=0t¡110t¡1+lcm(1;2;:::t)1andw0=0t¡1+lcm(1;2;:::t)10t¡11:¤6NondeterministicseparationWecande¯nensep(w;x)inanalogywithsep:thenumberofstatesinthesmallestNFAacceptingwbutrejectingx.Theredonotseemtobeanypublishedresultsaboutthismeasure.Nowthereisanasymmetryintheinputs:nsep(w;x)neednotequalnsep(x;w).Forexample,thefollowing2-stateNFAacceptsw=000100andrejectsx=010000,sonsep(w;x)·2.00, 10However,aneasycomputationshowsthatthereisno2-stateNFAacceptingxandrejectingw,sonsep(x;w)¸3. OpenProblem2Isjnsep(x;w)¡nsep(w;x)junbounded?AnaturalquestioniswhetherNFAsgivemoreseparationpowerthanDFAs.Indeedtheydo,sincesep(0001;0111)=3butnsep(0001;0111)=2:However,amoreinterestingquestionistheextenttowhichnondeterminismhelpswithseparation|forexample,whetheritcontributesonlyaconstantfact

9 ororthereisanyasymptoticimprovementinthe
ororthereisanyasymptoticimprovementinthenumberofstatesrequired.Theorem3.Thequantitysep(w;x)=nsep(w;x)isunbounded.Proof.Consideronceagainthewordsw=0t¡1+lcm(1;2;:::;t)1t¡1andx=0t¡11t¡1+lcm(1;2;:::;t)wheret=n2¡3n+2,n¸4.WeknowfromTheorem1thatanyDFAseparatingthesewordsmusthaveatleastt+1=n2¡3n+3states.NowconsiderthefollowingNFAM:0000000000001loopofn¡1statesloopofnstatesThelanguageacceptedbythisNFAisf0a:a2Ag1¤,whereAisthesetofallintegersrepresentablebyanon-negativeintegerlinearcombinationofnandn¡1.Butt¡1=n2¡3n+162A,ascanbeseenbycomputingt¡1modulon¡1andmodulon.Ontheotherhand,everyinteger¸tisinA.Hencew=0t¡1+lcm(1;2;:::;t)1t¡1isacceptedbyMbutx=0t¡11t¡1+lcm(1;2;:::;t)isnot.NowMhas2n=£(pt)states,sosep(x;w)=nsep(x;w)=­(pt)=­(plogjxj),whichisunbounded.¤OpenProblem3Findbetterboundsonsep(w;x)=nsep(w;x). Wecanalsogetan­(logn)lowerboundfornondeterministicseparation.Theorem4.NoNFAofnstatescanseparate0n2¡11n2¡1+lcm(1;2;:::;n)from0n2¡1+lcm(1;2;:::;n)1n2¡1:Proof.AresultofChrobak[1],ascorrectedbyTo[11],statesthateveryunaryn-stateNFAisequivalenttooneconsistingofa\tail"ofatmostO(n2)states,followedbyasinglenondeterministicstatethatleadstoasetofcycles,eachofwhichhasatmostnstates.Thesizeofthetailwasprovedtobeatmostn2¡2byGe®ert[3].NowweusethesameargumentasforDFAsabove.¤OpenProblem4Findbetterboundsonn

10 sep(w;x)forjwj=jxj=n,asafunctionofn.Theo
sep(w;x)forjwj=jxj=n,asafunctionofn.Theorem5.Wehavensep(w;x)=nsep(wR;xR).Proof.LetM=(Q;§;±;q0;F)beanNFAwiththesmallestnumberofstatesacceptingwandrejectingx.NowcreateanewNFAM0withinitialstateequaltoanysinglestatein±(q0;w)\Fand¯nalstateq0,andallothertransitionsofMreversed.ThenM0acceptswR.ButM0rejectsxR.ForifM0acceptedxRthenMwouldalsoacceptx,sincetheinputstringandtransitionsarereversed.¤7Separationby2DPDA'sIn[2],theauthorsshowedthatwordscanbeseparatedwithsmallcontext-freegrammars(andhencesmallPDA's).InthissectionweobserveProposition10.Twodistinctwordsoflengthncanbeseparatedbya2DPDAofsizeO(logn).Proof.Recallthata2DPDAisadeterministicpushdownautomaton,withend-markerssurroundingtheinput,andtwo-wayaccesstotheinputtape.Givendis-tinctstringsw;xoflengthn,theymustdi®erinsomepositionpwith1·p·n.UsingO(logp)states,wecanreachpositionpontheinputtapeandacceptif(say)thecorrespondingcharacterequalsw[p],andrejectotherwise.Hereishowtoaccesspositionpoftheinput.Weshowhowtogofromscanningpositionitoposition2iusingaconstantnumberofstates:wemoveleftontheinput,pushingtwosymbolspermoveonthestack,untiltheleftendmarkerisreached.Nowwemoveright,poppingonesymbolpermove,untiltheinitialstacksymbolisreached.Usingthisasasubroutine,andapplyingittothebinaryexpansionofp,wecan,usingO(logp)states,reachpositionpoft

11 heinput.¤ 8PermutationautomataWeconclude
heinput.¤ 8PermutationautomataWeconcludebyrelatingtheseparatingwordsproblemtoanaturalproblemofalgebra.Insteadofarbitraryautomata,wecouldrestrictourattentiontoautomatawhereeachletterinducesapermutationofthestates(\permutationautomata"),assuggestedbyRobson[8].HeobtainedanO(n1=2)upperboundinthiscase.Forann-stateautomaton,theactionofeachlettercanbeviewedasanelementofSn,thesymmetricgrouponnelements.Turningtheproblemaround,then,wecouldask:whatistheshortestpairofdistinctequal-lengthbinarywordsw;x,suchthatforallmorphisms¾:f0;1g¤!Snwehave¾(w)=¾(x)?Althoughonemightsuspectthattheanswerislcm(1;2;:::;n),forn=4,thereisashorterpair(oflength11):00000011011and11011000000.Nowif¾(w)=¾(x)forall¾,then(ifwede¯ne¾(x¡1)=¾(x)¡1)wehavethat¾(wx¡1)=theidentitypermutationforall¾.Callanynonemptywordyovertheletters0;1;0¡1;1¡1anidenticalrelationif¾(y)=theidentityforallmorphisms¾.Wesayyisnontrivialifycontainsnooccurrencesof00¡1and11¡1.Whatisthelength`oftheshortestnontrivialidenticalrelationoverSn?RecentlyGimadeevandVyalyi[4]proved`=2O(pnlogn).9AcknowledgmentsThankstoMartinDemaineandAnnaLubiw,whoparticipatedintheopenproblemsessionatMITwheretheseproblemswerediscussed.WethanktheDCFS2011refereesfortheirhelpfulsuggestions.References1.M.Chrobak.Finiteautomataandunarylanguages.Theoret.Comput.Sci.,47:149{158,198

12 6.Erratumin302:497{498,2003.2.J.Currie,H
6.Erratumin302:497{498,2003.2.J.Currie,H.Petersen,J.M.Robson,andJ.Shallit.Separatingwordswithsmallgrammars.J.Automata,Languages,andCombinatorics,4:101{110,1999.3.V.Ge®ert.Magicnumbersinthestatehierarchyof¯niteautomata.Inform.Comput.,205:1652{1670,2007.4.R.A.GimadeevandM.N.Vyalyi.Identicalrelationsinsymmetricgroupsandseparatingwordswithreversibleautomata.InF.M.AblayevandE.W.Mayr,editors,5thInt'lComputerScienceSymposiuminRussia,CSR2010,volume6072ofLectureNotesinComputerScience,pages144{155.Springer-Verlag,2010.5.P.Goral·c¶³kandV.Koubek.Ondiscerningwordsbyautomata.InL.Kott,editor,Proc.13thInt'lConf.onAutomata,Languages,andProgramming(ICALP),vol-ume226ofLectureNotesinComputerScience,pages116{122.Springer-Verlag,1986.6.A.Nozaki.Equivalenceproblemofnon-deterministic¯niteautomata.J.Comput.SystemSci.,18:8{17,1979. 7.J.M.Robson.Separatingstringswithsmallautomata.Inform.Process.Lett.,30:209{214,1989.8.J.M.Robson.Separatingwordswithmachinesandgroups.RAIROInform.Th¶eor.App.,30:81{86,1996.9.J.Shallit.ASecondCourseinFormalLanguagesandAutomataTheory.Cam-bridgeUniversityPress,2009.10.J.ShallitandY.Breitbart.AutomaticityI:Propertiesofameasureofdescriptionalcomplexity.J.Comput.SystemSci.,53:10{25,1996.11.A.W.To.Unary¯niteautomatavs.arithmeticprogressions.Inform.Process.Lett.,109:1010{1014,

Related Contents


Next Show more