教育実践総合センター紀要_第35号_本文_41-52_CS5.5.indd

Similar documents
关 于 学 生 手 册 的 说 明 为 规 范 南 开 大 学 现 代 远 程 教 育 学 院 各 项 教 学 教 务 管 理, 加 强 对 学 习 中 心 管 理 人 员 的 工 作 指 导, 特 汇 编 本 学 生 手 册 学 院 将 根 据 实 际 情 况, 不 断 修 订 完 善 该 学 生


Microsoft Word - 鄂卫办函[2009]64号.doc

全宋词1

& ((& ) ((

(Microsoft Word - \277\357\262\325\252\272\246\322\266q.doc)

附件三

< F20B4F2D3A1D7F7D2B5>

腊八粥的来历 南宋陆游诗云 今朝佛粥更相馈 反觉江村节 物新 说的就是腊八粥 可见 腊八节 吃 腊八 粥 的风俗 由来已久 每逢腊八这一天 不论是朝 廷 官府 寺院还是黎民百姓家都要做腊八粥 这一 天 人们还要祭祀祖先 众神并庆祝丰收 后来 逐 渐演变成吃腊八粥祝来年五谷丰登 对于腊八粥的来历说法也

Microsoft Word - 中耳的主要疾病~中耳炎.doc

女性健美保健(中).doc

Microsoft PowerPoint 台南一中-99高中宣導簡報

Microsoft Word - 第3章.doc

教 改 动 态 2011 年 03 期 总 第 3 期 上 层 传 音 1 刘 延 东 : 开 创 高 等 教 育 改 革 发 展 新 局 面 8 月 14 日, 中 共 中 央 政 治 局 委 员 国 务 委 员 刘 延 东 在 出 席 教 育 部 直 属 高 校 工 作 咨 询 委 员 会 第

育 部 分 則 由 陳 淑 貞 委 員 及 李 兆 環 委 員 共 同 執 行, 在 此 先 感 謝 各 位 委 員 及 學 者 專 家 之 參 與 二 目 前 評 論 報 告 初 稿 之 架 構 區 分 為 對 政 府 機 關 回 應 意 見 之 觀 察 優 點 及 待 改 進 事 項, 以 及

附 : 初 中 组 一 等 奖 (31 个 ): 天 河 外 国 语 学 校 中 山 大 学 附 属 中 学 番 禺 区 大 石 富 丽 中 学 广 东 实 验 中 学 附 属 天 河 学 校 花 都 区 实 验 中 学 增 城 区 凤 凰 城 中 英 文 学 校 广 州 市 执 信 中 学 花 都

58, ,769 51,911 74,666 35, , , , ,

保 险 公 司 金 富 月 盈 两 产 全 品 保 名 险 称 ( 分 红 型 ) 产 分 品 红 类 型 缴 费 年 类 缴 型 缴 10 费 年 期 缴 限 保 险 期 限 ( 年 ) 聚 富 2 号 两 全 保 险 ( 万 能 型 ) 万 能 型 趸 缴 趸 缴 6 年 龙 享 安 康 重 疾

untitled

880041_C_Unique_REDACTED_.indb

(1) (2) (3) 80% 1. 49% 51%


二零一五年施政報告 - 施政綱領 - 第三章 扶貧及為弱勢社群提供支援

<4D F736F F D20BACBB0B2C8ABD3EBB7C5C9E4D0D4CEDBC8BEB7C0D6CEA1B0CAAEB6FECEE5A1B1B9E6BBAEBCB C4EAD4B6BEB0C4BFB1EA2E646F63>

<4F4BBEFAA576A470BBA15FC160AAED E786C73>

辽宁铁~1

游戏攻略大全(十).doc

I

海底捞你学不会

YEN/MIAO CHING MS 27FEB DEL HKG

Microsoft Word - 02文本.docx


案件

義 和 團 及 兪 國 聯 軍 之 役 課 題 學 習 指 引 : A. 思 考 課 題 有 人 說, 義 和 團 及 兪 國 聯 軍 之 役 是 中 國 近 代 史 的 分 水 嶺, 你 同 意 嗎? B. 思 考 方 向 滿 清 政 府 的 管 治 威 信 思 考 是 否 已 不 信 任 滿 清

最新监察执法全书(一百五十五).doc

游戏攻略大全(三十四).doc

掌握健康 掌握人生


草莓实用技术(一)

Microsoft Word - 【襪子流浪記】.docx

最新监察执法全书(十一).doc

钓鱼技巧_二_.doc

动物的智慧(五)

学位〔2013〕37号

海关法规(七).doc

健康知识(一)

Microsoft Word - 人民萬歲_宋玉雯.docx

北京(一)

穨ecr6_c_2.PDF

i

园林植物卷(九).doc

城市园林(上).doc

家装知识(四)

苗木的种植_四_.doc

认识植物(一)

蟹的养殖技术(一)

药用植物种植技术(二)

特种养殖实用技术(七)

游戏攻略大全(五十三).doc

司法鉴定工作手册(十八)

外科疾病诊治(三)

动物杂谈_三_.doc

(3) (4) (1) (2) (d) V-2

外科疾病诊治(十九)

新时期共青团工作实务全书(一百四十八)

外科疾病诊治(五)

案件

养虾小常识_二_.doc

养虾小常识_三_.doc

铁路管理规程(三)


外科疾病诊治(二十七)

第四章 生活习俗

铁路管理规程(五)

园林植物卷(十三).doc

i

特种植物种植技术(二)

铁路运输(二)

苗木的种植_三_.doc


苗木的种植_四_.doc

北京(三)

2003年半年度报告正文.PDF

壹、學校背景

北 京 师 范 大 学 庆 祝 抗 日 战 争 胜 利 70 周 年 暨 纪 念 12.9 运 动 80 周 年 歌 咏 比 赛 掠 影 党 委 书 记 刘 川 生 指 挥 唱 校 歌 党 委 书 记 刘 川 生 分 别 为 获 得 一 等 奖 和 获 得 精 神 风 貌 奖 单 位 颁 奖 党 委


新設大学に対する留意事項(改善すべき点)の内容 神戸常盤大学 認可された大学の情報 基本計画書・教育課程等の概要

份 才 攻 击 ; 才 三 咳 4 拨 号 命 乡 ki 冬 冬 别 人 们 乃 199f. 10

國立花蓮高級工業職業學校教務會議暨

ENGG1410-F Tutorial 6

12天 本 會103年 模 範 郵 工 董 麗 珍 趙 美 珍 2人 參 加 梁 周昆法 歐陽陪興 林青豊 林秀蓮 曾文俊 甯鎮美 鄭麗娟 周肖梅 陳宏 103 年 11 月 23 日 板 橋 分 會 假 西 湖 渡 假 益 周 錦 燕 等12人 奉 准 升 遷 申 請 中 華 郵 政 村 舉 辦2


A Community Guide to Environmental Health

3. 反 映 : 4. 五 花 八 门 : 5. 慷 慨 : 6. 参 与 : 7. 慰 劳 : 8. 延 续 : 9. 珍 爱 : 10. 浪 漫 : 三. 找 出 下 列 每 组 词 中 的 近 义 词 或 同 义 词 : 节 日 节 气 节 令 时 节 习 俗 民 俗 仪 式 风 俗 文 献

Microsoft Word - 第一篇第三章_3.doc

( 含 要 ) 1-2 用 或 雇 用, 抑 或 有 無 俸 給 文 職 或 武 職, 政 官 或 事 官 均 屬 之, 其 不 以 具 備 人 資 格 為 限, 因 此 屬 於 最 廣 義 之 念 四 廣 義 念 之 依 服 24 條 之 規 定 : 本 於 受 有 俸 給 之 文 武 職, 及

医歯学概要

2008年1月11日に岩手県釜石沖で発生した地震(M4.7)について

<5B BECBB0EDB8AEC1F25D312D34B0AD5FC3E2BCAEBCF6BEF7C0DAB7E F31702E504446>

临沧师~1

Transcription:

宇都宮大学教育学部 教育実践総合センター紀要 第 35 号 2012 年 7 月 1 日 15 パズルと Mathematica 佐藤禎宏 ** 長縄直崇 * 宇都宮大学教育学部 ** 名古屋大学理学研究科 13 14 15 13 15 14 Range list0 = Range[16] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} m0 = Partition[list0,4] Yoshihiro Sato*, Naotaka Naganawa**: 15 Puzzle Yoshihiro Sato, Naotaka Naganawa : {{1,2,3,4},{5,6,7,8},{9,10,11,12}, 15 and Puzzle Mathematica and Mathematica * {13,14,15,16}} Faculty of of Education, Utsunomiya University University ** Graduate School of of Science, Nagoya Nagoya University University - 335 -

MatrixForm[ mat0 = m0 /. {16 -> " "} ] 9 10 11 13 14 15 12 MatrixForm[ m2 = {{1,2,3,4},{5,6,7,8},{9,10,11,16}, {13,14,15,12}}] list2 = Flatten[m2] {1,2,3,4,5,6,7,8,9,10,11,16,13,14,15,12} PermutationCycles Cycles cycles = PermutationCycles[list2] Cycles[{{12,16}}] PermutationReplace cycles list2 PermutationReplace[Range[16],cycles] {1,2,3,4,5,6,7,8,9,10,11,16,13,14,15,12} list2 == PermutationReplace[Range[16], cycles] True 8 7 6 5 16 15 14 13-336 -

= (10,11,12,13,14) 8 7 6 5 16 15 14 13 8 7 6 5 15 12 14 16 15 14 13 13 14 15 13 9 11 10 pl2cf (placement0 = Partition[Range[16], 4] /. {16 -> " "}) // MatrixForm initialcf = pl2cf[placement0] {1,2,3,4,8,7,6,5,9,10,11,12,15,14,13} (placement1={{1,2,3,4},{5,6,7,8}, {15," ",12,14},{13,9,11,10}}) // MatrixForm startcf = pl2cf[placement1] {1,2,3,4,8,7,6,5,14,12,13,10,15,11,9} findpermutationreplace permutationsignature initialcf startcf cycles1 = findpermutationreplace[initialcf, startcf] Cycles[{{9,14,11,13},{10,12}}] permutationsignature[cycles1] placement2 = {{1,2,3,4},{5,6,7,8}, {9,10,11,12},{13,15,14," "}}; startcf2 = pl2cf[placement2] {1,2,3,4,8,7,6,5,9,10,11,12,15,13,14} cycles2 = findpermutationreplace[initialcf, startcf2] Cycles[{{13,14}}] permutationsignature[cycles2] parityq parityq[placement0, placement2] i,j i,i+1, i = 1,..., 15-1 j,i i,j 1,8 2,7 3,6, 5,12, 6,11 7,10 9,16 10,15 11,14 PermutationGroup AlternatingGroup[15] 10,15 = (10,11,12,13,14) - 337 -

startcf pl2 = {{1,2,3,4},{5,6,7,8},{15,9,12,14}, {13, " ",11,10}}; cf2 = pl2cf[pl2] {1,2,3,4,8,7,6,5,10,13,14,11,15,12,9} 10,15 =findpermutationreplace[startcf, cf2] Cycles[{{10,11,12,13,14}}] effectmove manhattandistance iterate (desired=partition[range[16]/.{16->" "},4]) // MatrixForm 1,8 = Cycles[{{1, 2, 3, 4, 5, 6, 7}}]; 2,7 = Cycles[{{2, 3, 4, 5, 6}}]; 3,6 = Cycles[{{3, 4, 5}}]; 5,12 = Cycles[{{5, 6, 7, 8, 9, 10, 11}}]; 6,11 = Cycles[{{6, 7, 8, 9, 10}}]; 7,10 = Cycles[{{7, 8, 9}}]; 9,16 = Cycles[{{9, 10, 11, 12, 13, 14, 15}}]; 11,14 = Cycles[{{11, 12, 13}}]; list = 1,8 2,7 3,6, 5,12 6,11, 7,10, 9,16, 10,15 11,14 }; PermutationGroup[list] == AlternatingGroup[15] True GroupOrder GroupOrder[AlternatingGroup[15]]== 15!/2 True moves moves Left Right moves desired Up Left moves[desired] {"Up", "Left"} effectmove Left effectmove[desired, "Left"] // MatrixForm (firstmove = effectmove[desired, "Left", "Left", "Up", "Up"]) // MatrixForm manhattandistance desired firstmove - 338 -

manhattandistance[desired, firstmove] P0 moves m1, m2 P1, P2 effectmove P0 m1, m2 listscores P0 firstmoves m1 m2 P1 P2 secondmoves m11 m12 P11 P12 thirdmoves m111 m112 P111 P112 P1, P2 P0 P1 P2 m1 m2 listscores[p0] firstmoves ={{a,m1},{b,m2}} a b a < b firstmoves P11 P12 iterate[p0,firstmoves] secondmoves={{c,m1,m11},{d,m1,m12},{b,m2}}, c < d < b secondmoves P111 P112 thirdmoves iterate[p0,secondmoves] worthwhile bestscore try start = effectmove[desired, "Left", "Up", "Left"]; result = try[start, 10] The following solution was found {0, "Right", "Down", "Right"} puzseq = FoldList[effectmove[#1, #2] &, start, Rest[result]]; viewlolol[puzseq] Partition[RandomSample[Range[16]] /. {16 -> " "}, 4]; - 339 -

parityq[desired, realstart] 1 list1= Flatten[realstart /. {" " -> 16}]; list2= Flatten[desired /. {" " -> 16}]; perm1=findpermutationreplace[list1, list2] Cycles[{{1,15,8,10,16,11,9,6,5,14,2,12,3, 7,4}}] try try[realstart, 1000] Solution not found, best sequence was {28, "Right", "Up",, "Up", "Up"} moves newtryn result = newtryn[realstart] {0, "Down", "Left", "Up",..., "Right", "Right"} Length[Rest[result]] perm1 puzseq2cycles puzseq= FoldList[effectmove[#1, #2] &, realstart, Rest[result]]; cyclesset = puzseq2cycles[puzseq]; perm2=permutationproduct @@ cyclesset Cycles[{{1,15,8,10,16,11,9,6,5,14,2,12,3, 7,4}}] perm2 == perm1 True - 340 -

Appendix1 (1) (Configuration) pl2cfmat_list? MatrixQ : Modulerule, cellconf, blank, rule 1, 1 1, 1, 2 2, 1, 3 3, 1, 4 4, 2, 1 8, 2, 2 7, 2, 3 6, 2, 4 5, 3, 1 9, 3, 2 10, 3, 3 11, 3, 4 12, 4, 1 16, 4, 2 15, 4, 3 14, 4, 4 13; cellconf Positionmat, & Range15. rule; blank Positionmat, &" ". rule; If blank, 1, & cellconf (2) findpermutationreplacelst1_, lst2_ : Maplst1 &, FindPermutationlst2, lst1, 3 permutationsignatureperm_?permutationcyclesq : ApplyTimes, 1^Length Firstperm 1 parityqx_list? MatrixQ, y_list? MatrixQ : permutationsignaturefindpermutationreplacepl2cfx, pl2cfy Appendix2 15 [ 5 ] viewlolola_list : MapMatrixForm, TableSpacing 1, 1 &, a; desired Partition Range16. 16 " ", 4; (1) moves movescurrent_? MatrixQ : Moduleanswer, xdim, ydim, place, xpos, ypos, answer "Up", "Down", "Left", "Right"; ydim Lengthcurrent; xdim Lengthcurrent1; place Positioncurrent, " "; xpos place1, 2; ypos place1, 1; Ifxpos xdim, answer Dropanswer, 4; Ifxpos 1, answer Dropanswer, 3; Ifypos ydim, answer Dropanswer, 2; Ifypos 1, answer Dropanswer, 1; answer (2) effectmove effectmovea, b, " ", c_, d, e, "Right" : a, b, c, " ", d, e effectmovea, b, c_, " ", d, e, "Left" : a, b, " ", c, d, e effectmovea_, "Up" : TransposeeffectmoveTransposea, "Left" effectmovea_, "Down" : TransposeeffectmoveTransposea, "Right" effectmovea_list, b_string, c String : effectmoveeffectmovea, b, c - 341 -

(3) : manhattandistance manhattandistance::incompat "Manhattan distance can only be computed for matrices with tha same dimension"; manhattandistancex_list, y_list : Moduletemp, IfDimensionsx Dimensionsy, Messagemanhattandistance::incompat, temp MapFlattenPositiony, &, x, 2; temp temp MapFlattenPositionx, &, x, 2; temp TotalFlattenAbstemp (4) listscoresx_ : Modulemakemoves, ans, makemoves Mapeffectmovex, &, movesx; ans FlattenMapmanhattandistance1, desired &, makemoves; Transposeans, movesx worthwhilex, "Right", "Left" : False; worthwhilex, "Left", "Right" : False; worthwhilex, "Up", "Down" : False; worthwhilex, "Down", "Up" : False; worthwhilex : True bestscorex_list, y_list, delta_: 0.2 : Ifx1 y1 delta LengthResty LengthRestx, True, False iteratestart_, x_, y, z : Moduleendnode, newnodes, newseq, endnode effectmovestart, y; newnodes listscoresendnode; newseq MapJoinFirst, y, Rest &, newnodes; SortJoinSelectnewseq, worthwhile, z, bestscore; trystart_, n_ : Moduletemp, count, count 0; temp listscoresstart; Whiletemp1, 1 0 && count n, temp iteratestart, temp; count count 1; Ifcount n && temp1, 1 0, Print"Solution not found, best sequence was", Print"The following solution was found"; temp1 (5) findpermutationreplacelst1_, lst2_ : Maplst1 &, FindPermutationlst2, lst1, 3 tolistmat_ : Flattenmat. " " 16 puzseq2cyclespuzseq_ : MapThreadfindPermutationReplacetoList1, tolist2 &, Mostpuzseq, Restpuzseq - 342 -