




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
HowtoChooseaRandomSudokuBoardJoshuaCooperUSCDepartmentofMathematicsRules:Placethenumbers1through9inthe81boxes,butdonotletanynumberappeartwiceinanyrow,column,or3
3“box”.Youstartwithasubsetofthecellslabeled,andtrytofinishit.137874859281668712847181375965428326159924761347533129465875394596137223695844296ASudokupuzzledesignerhastwomaintasks: 1.Comeupwithaboardtouseasthesolutionstate. 2.Designatesomesubsetoftheboard’ssquaresastheinitiallyexposed numbers(“givens”).Forexample:1378748592816687128471813756542832615992476134753312946587539459613722369584429691378748592816687128471813759We’regoingtofocusontask#1:HowtochooseagoodSudokuboard?BOARDPUZZLECELLCOLUMNROWBOXSTACKBANDGIVENNotallboardsarecreatedequal.Somemakelousypuzzles:888888888999999999222222222333333333444444444111111111555555555777777777666666666ItwouldbepreferabletogeneraterandomSudokuboardswhendesigningapuzzle.Furthermore,therearemanymathematicalquestionsonecanaskaboutthe“average”Sudokuboardthatrequirethatwebeabletogeneraterandomones.Forexample:1.Howoftenarethe1and2intheupper-left3X3boxinthesamecolumn?3.Whatistheprobabilitythatthepermutationof{1,…,9}thatthefirsttworowsprovideiscyclic?1397874654283261591567923481567923481567923482.Whatistheaveragelengthofthelongestincreasingsequenceofnumbersthatappearinanyrow?Furthermore,therearemanymathematicalquestionsonecanaskaboutthe“average”Sudokuboardthatrequirethatwebeabletogeneraterandomones.Forexample:1.Howoftenarethe1and2intheupper-left3X3boxinthesamecolumn?2.Whatistheaveragelengthofthelongestincreasingsequenceofnumbersthatappearinanyrow?3.Whatistheprobabilitythatthepermutationof{1,…,9}thatthefirsttworowsprovideiscyclic?4.Whataboutthe“generalizedSudokuboard”?Forexample,16X16:Furthermore,therearemanymathematicalquestionsonecanaskaboutthe“average”Sudokuboardthatrequirethatwebeabletogeneraterandomones.Forexample:1.Howoftenarethe1and2intheupper-left3X3boxinthesamecolumn?2.Whatistheaveragelengthofthelongestincreasingsequenceofnumbersthatappearinanyrow?3.Whatistheprobabilitythatthepermutationof{1,…,9}thatthefirsttworowsprovideiscyclic?4.Whataboutthe“generalizedSudokuboard”?Forexample,16X16:Inordertogetanapproximateanswertothesequestions,onecould: a.)Generatelotsofrandomexamples. b.)Computetherelevantstatisticforeachofthem. c.)Averagetheanswers.Thisgeneraltechniqueiscalledthe“MonteCarlo”method.Itisveryusefulformathematicalexperimentation,anditcomesupallthetimeinappliedmathematics(usuallytoapproximatesomesortofintegral).Attempt#1:Fillanemptyboardwithrandomnumbersbetween1and9.IftheresultisnotavalidSudokuboard,discardtheresultandtryagain.Problem#1:ThechancesthatarandomboardisactuallyaSudokuboardisabout3X10-56.Evenifwecouldcheckatrillionexampleseverysecond,itwouldstilltake7X1025timeslongerthantheuniversehasbeenaroundbeforeweexpecttoseeasinglevalidboard.Attempt#1b:Eachrowisactuallyapermutation(i.e.,nonumberoccurstwice),sogenerate9randompermutationsuntilavalidSudokuboardresults.Problem#1:ThechancesthatarandomboardisactuallyaSudokuboardisabout6X10-29.Again,evenifwecouldcheckatrillionexampleseverysecond,itwouldstilltake500billionyearsbeforeweexpecttoseeasinglevalidboard.Attempt#1c:Startwithanemptyboard.Randomlychooseanunoccupiedlocationandfillitwitharandomnumber,chosenfromamongthosethatcanlegallylivethere.Problem#1:Wemayrunoutoflegalmoves!Problem#2:Noteveryboardisequallylikelytoemergefromthisprocess.Attempt#1caddendum:Okay,sojuststartoverifyougetstuck.
Despitethisfact,mostboardgeneratingsoftwareoutthereusesthisstrategy.Attempt#2:GenerateallSudokuboardsandpickoneuniformlyatrandomfromthelistofallofthem.Problem#1:Thereare6,670,903,752,021,072,936,960(~6.7×1021=6.7sextrillion)differentSudokuboards(Felgenhauer-Jarvis2005).Evenat4bitspersymbol,thistranslatestoabout270billionterabytes=approx.$18trillion($68per1TBharddrive,saysGoogle)=approx.130%ofUSannualGDPProblem#2:Thisgeneralizesverypoorlytolargerboards.(Thereareabout6×109816X16boards>>numberofatomsintheknownuniverse.)Attempt#3:GeneratealistofonerepresentativeofeachorbitofSudokuboardsunderthenaturalsymmetries:rotation,transposition,permutingsymbols,permutingrowswithinahorizontalband,permutingcolumnswithinaverticalband,permutinghorizontalbands,andpermutingverticalbands.Attempt#3:GeneratealistofonerepresentativeofeachorbitofSudokuboardsunderthenaturalsymmetries:rotation,transposition,permutingsymbols,permutingrowswithinahorizontalband,permutingcolumnswithinaverticalband,permutinghorizontalbands,andpermutingverticalbands.Theoperations:1.Permutingtherowsandcolumnsofeachband/stack(X3!6)IIIIIIABC2.PermutingbandsI,II,andIII,andandstacksA,B,andC(X3!2)3.Permutingthenumbers/colors(X9!)Attempt#3:GeneratealistofonerepresentativeofeachorbitofSudokuboardsunderthenaturalsymmetries:rotation,transposition,permutingsymbols,permutingrowswithinahorizontalband,permutingcolumnswithinaverticalband,permutinghorizontalbands,andpermutingverticalbands.Theoperations:1.Permutingtherowsandcolumnsofeachband/stack(X3!6)2.PermutingbandsI,II,andIII,andstacksA,B,andC(X3!2)3.Permutingthenumbers/colors(X9!)4.Rotatingtheboard(X2)IIIIIIABCAttempt#3:GeneratealistofonerepresentativeofeachorbitofSudokuboardsunderthenaturalsymmetries:rotation,transposition,permutingsymbols,permutingrowswithinahorizontalband,permutingcolumnswithinaverticalband,permutinghorizontalbands,andpermutingverticalbands.Theoperations:1.Permutingtherowsandcolumnsofeachband/stack(X3!6)2.PermutingbandsI,II,andIII,andstacksA,B,andC(X3!2)3.Permutingthenumbers/colors(X9!)4.Rotatingtheboard(X2)IIIIIIABCgenerateagroupoforder1,218,998,108,160.Thenumberoforbitsofthisgroup(i.e.,thenumberof“trulydistinct”boards)=5,472,706,619.Attempt#3:GeneratealistofonerepresentativeofeachorbitofSudokuboardsunderthenaturalsymmetries:rotation,transposition,permutingsymbols,permutingrowswithinahorizontalband,permutingcolumnswithinaverticalband,permutinghorizontalbands,andpermutingverticalbands.Problem#1:Youcan’tjustpickauniformlyrandomchoiceoforbit:someorbitsarebiggerthanothers.Infact,youhavetochoosethemwithprobabilityproportionaltotheirsizes.Thismeansdoingabigcomputationusing“Burnside’sLemma.”Problem#2:Again,thisscalesverypoorly.Thenumberoforbitsforthe16X16boardisapproximately2.25×1071.Stillridiculouslylarge.Attempt#4:Startwithsome
Sudokuboardandmakesmall,randomchangesforawhile.Theresultshouldbeclosetouniformlyrandom.Thisgeneralstrategyisknownasa“randomwalk”or“Markovchain.”WhenpairedwithMonte-Carlotypecalculations,wehave“MarkovChainMonteCarlo”,orMCMC.Whyisitcalleda“randomwalk”?Whyisitcalleda“randomwalk”?Whyisitcalleda“Markovchain”?AndreyMarkov(АндрейАндреевичМарков)1856–1922Considerthe4X4case(thereare288boards,butonly2essentiallydistinctones!)1234341223414123What“smallchanges”canwemaketogetbetweenthem?1234341221434321Considerthe4X4case(thereare288boards,butonly2essentiallydistinctones!)1234341223414123What“smallchanges”canwemaketogetbetweenthem?123434122341412322134341213414123213434121342422312343412214343211234341223414123221343412134141232134341213424223123434122341412322134341213414123213434121342422321343411134242132134342113424213Allwedidwasrelabeltheboardbyswitching1’sand2’s!It’snothardtoseethateachelementgofGcanbefactoreduniquelyintoaproductofarelabeling
L,acolumnpermutationC,arowpermutationR,and(possibly)aquarter-turnQ:wherej
=
0or1.1234341223414123323434122341412343214112234141233214143223414123Prop.Ifthesequenceofmovesterminatesbeforereachingeveryvertex,theresultisatrulydifferentsudokuboard.Proof.LetGbethegroupofLatinsquareisotopies:thegroupgeneratedbyrelabelings,rotations,andallrowandcolumnpermutations(notjustin-bandorin-stack).Supposej=0.WhetherornotLflipsthecolorsredandblue,someoneofthesecyclesisflipped,whileanotherisnot.SupposethatginG0exchangessomeredsandblues,butnotall–andotherwisefixesthecontentofeverycell.NotethattheSudoku
isotopygroupG0
isasubgroup
of
G.WritegasBypermutingrowsandcolumnstogrouptogethercyclesofredsandblues,wegetthattheactionofglookssomethinglike:gThesequenceofrowandcolumnpermutationsrequiredtoflipthecolorseitherreversesrowsorcolumns.oncbedjfhglimakabdeghijklnocfmbcehinmnldogfoaTherefore,therelabeling
Lmustpermutesymbolsa—o.Butthischangesthecontentsofothercells–acontradiction.It’seasytocheckthej=1caseaswell(anddealwiththecaseswherethecyclesareonly4or6inlength).But,doeseverySudokuboardhaveacyclethatterminates“early”?Torestate:DefineagraphHonthesetofcellswithacompletesubgraphineachrow,column,andbox.Colorverticesaccordingtothecontentsofthecells.DefineHijtobethesubgraphofHinducedbyverticesofcoloriandj.Conjecture:ForanySudokuboard,thereareaniandajsothatHijisdisconnected.But,doeseverySudokuboardhaveacyclethatterminates“early”?Torestate:DefineagraphHonthesetofcellswithacompletesubgraphineachrow,column,andbox.Colorverticesaccordingtothecontentsofthecells.DefineHijtobethesubgraphofHinducedbyverticesofcoloriandj.Question:CanonegetfromanySudokuboardtoanyotherviaasequenceofsuchmoves?(Ifso,thenthisMCMCstrategywillwork!)Conjecture:ForanySudokuboard,thereareaniandajsothatHijisdisconnected.Attempt#5:Relaxalinearprogram.Usetheedgesoftheresultingpolytopeasthe“moves”tomakeintherandomwalk.Writexijkforavariablethatindicateswhetherornotcell(i,
j)isoccupiedbycolork.(Soxijk
=1ifso,xijk=0ifnot.)Then,lettingi,j,andkvaryover{1,…,9}wehavethefollowingconstraintsthatdescribeavalidSudokuboard.Attempt#5:Relaxalinearprogram.Usetheedgesoftheresultingpolytopeasthe“moves”tomakeintherandomwalk.Writexijkforavariablethatindicateswhetherornotcell(i,
j)isoccupiedbycolork.(Soxijk
=1ifso,xijk=0ifnot.)Then,lettingi,j,andkvaryover{1,…,9}wehavethefollowingconstraintsthatdescribeavalidSudokuboard.Attempt#5:Relaxalinearprogram.Usetheedgesoftheresultingpolytopeasthe“moves”tomakeintherandomwalk.Writexijkforavariablethatindicateswhetherornotcell(i,
j)isoccupiedbycolork.(Soxijk
=1ifso,xijk=0ifnot.)Then,lettingi,j,andkvaryover{1,…,9}wehavethefollowingconstraintsthatdescribeavalidSudokuboard.forj,k=1,…,9fori,k=1,…,9fori,
j=1,…,9Attempt#5:Relaxalinearprogram.Usetheedgesoftheresultingpolytopeasthe“moves”tomakeintherandomwalk.Writexijkforavariablethatindicateswhetherornotcell(i,
j)isoccupiedbycolork.(Soxijk
=1ifso,xijk=0ifnot.)Then,lettingi,j,andkvaryover{1,…,9}wehavethefollowingconstraintsthatdescribeavalidSudokuboard.Thesetoftheseequationsdefinesanintegerprogram,thesetofwhosesolutionscorrespondexactlytovalidSudokuboards.form,n=0,1,2;k=1,…,9forj,k=1,…,9fori,k=1,…,9fori,
j=1,…,9Attempt#5:Relaxalinearprogram.Usetheedgesoftheresultingpolytopeasthe“moves”tomakeintherandomwalk.Writexijkforavariablethatindicatesw
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 全麻患者围手术期的护理
- 拍卖网络平台合同
- 外国人士租赁协议
- 工程项目建材合作合同
- 商品质量问题检测与解决合同(2篇)
- 工程项目招投标管理
- 地基与基础材料合同
- 数字货币使用协议
- 幼儿园春季传染病知识预防
- 拍卖工作人员责任协议
- 万科客户满意度调查及方案
- 2024-2030年中国乳腺疾病预防与治疗行业供求分析及投资战略研究报告
- 《25 黄帝的传说》公开课一等奖创新教学设计及反思
- 人教A版(新教材)高中数学选择性必修第三册学案:习题课 两个计数原理及排列组合
- 配网标准化建设技术规范(福建电网)
- 半导体芯片产品供应链分析
- 挑战杯调研报告正文
- 《天润乳业公司偿债能力存在的问题及对策9000字》
- 电动摩托车项目可行性实施报告
- 中建“大商务”管理实施方案
- 甲壳素、壳聚糖材料
评论
0/150
提交评论