版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 歷史學(xué)師范就業(yè)方向解析
- 新生入園家長培訓(xùn)制度
- 填埋場人員培訓(xùn)制度
- 商混企業(yè)人員培訓(xùn)制度
- 庫房新員工培訓(xùn)制度
- 培訓(xùn)機(jī)構(gòu)相關(guān)規(guī)章制度
- 發(fā)改局保密培訓(xùn)制度
- 駕校駕駛員崗前培訓(xùn)制度
- 宜賓市教師培訓(xùn)制度
- 培訓(xùn)課程結(jié)業(yè)管理制度
- 清欠歷史舊賬協(xié)議書
- 臨床創(chuàng)新驅(qū)動下高效型護(hù)理查房模式-Rounds護(hù)士查房模式及總結(jié)展望
- 乙肝疫苗接種培訓(xùn)
- 心衰患者的用藥與護(hù)理
- 食品代加工業(yè)務(wù)合同樣本(版)
- 車間管理人員績效考核方案
- 安全生產(chǎn)應(yīng)急平臺體系及專業(yè)應(yīng)急救援隊(duì)伍建設(shè)項(xiàng)目可行性研究報(bào)告
- 浙江省杭州市北斗聯(lián)盟2024-2025學(xué)年高二上學(xué)期期中聯(lián)考地理試題 含解析
- 醫(yī)用化學(xué)知到智慧樹章節(jié)測試課后答案2024年秋山東第一醫(yī)科大學(xué)
- 中國傳統(tǒng)美食餃子歷史起源民俗象征意義介紹課件
- 醫(yī)療器械樣品檢驗(yàn)管理制度
評論
0/150
提交評論