范文一:五年级奥数第二讲-九宫格与砝码
天骄思维拓展训练
一、 以结果为导向—逆向思维
例 1:玩玩小游戏:大家一起来抢 8
这里有 8个数字,从左到右依次是:
1 、 2、 3、 4、 5、 6、 7、 8
规则:两个人轮流依次从左到右抢数字, 规定 :1次可以抢 1个数字或两个数字; 必须依次抢,不能跳抢。谁能抢先抢到 8,谁就是胜利!!!
二、 砝码问题
例 1、 有 1克、 2克、 4克、 8克、 16克砝码若干个,要在天平上一次秤出 23克 物品、请写出五种使用砝码的不同方法。
例 2、 有一架天平和一个 50克的砝码, 如果要得到 150克的糖果, 只许秤两次, 应该如何秤?
例 3、 有八个西瓜,期中一个是有毒瓜,有毒瓜比没毒瓜重 0.1千克。有一架 天平,你只能秤两次,你能秤出哪个瓜有毒?
例 4 有 6个形状相同的零件, 其中有一个次品的重量轻一些, 你能不能用一 架天平秤两次就把次品找出来呢?
例 5 有 10箱钢珠每个重 10克,每箱 600个,如果这 10箱钢珠中有 1箱次品, 次品钢珠每个重 9克,现在只有一个台秤,要找出这箱次品最少要秤几 次呢?
三、九宫格闯关
赏识教育,激发孩子无限潜能!
范文二:数独九宫格
请将数字1―9分别填入每个方格中,要求每个数字在每行、每列和每个小九宫格只能出现一次。请把6个黄色格子中的数字相加之和填在81页答题卡中,于12月31日前寄出,以邮戳为准(或登录www.省略都市心情频道参与网上答题),就有机会赢得奥尔莱薇完美修护眼霜。
中国论文网 http://www.xzbu.com/6/view-24747.htm
10人×360元
奥尔莱薇完美修护眼霜
西印苦香树根青春补水精华。熟龄眼部肌肤问题的完美解决方案。珍贵的西印苦香树根提取物,强化肌肤弹力纤维,有效提拉紧致,重塑眼部轮廓。大洋洲阳光燕麦葡聚糖有效增强弹性细胞活力,加强眼周肌肤柔软度和含水量,淡化眼纹。
你知道吗
祖冲之是中国南北朝时代著名数学家、天文学家、物理学家。他特别爱好研究数学。也喜欢研究天文历法。
我国历代都有研究天文的官,并且根据研究天文的结果来制定历法。到了宋朝的时候,历法已经有很大进步,但是祖冲之认为还不够精确。他根据长期观察的结果,创制出一部新的历法,叫做“大明历”(“大明”是宋孝武帝的年号)这种历法测定的每一回归年(也就是两年冬至点之间的时间)的天数,跟现代科学测定的相差只有50秒:测定月亮环行一周的天数,跟现代科学测定的相差不到1秒,可见它的精确程度了。
公元462年,祖冲之请求宋孝武帝颁布新历,但是却遭到了反对,认为祖冲之擅自改变古历,是离经叛道的行为。直到祖冲之死了10年之后,他创制的大明历才得到推行。
试一试
有三个桶,两个大的可装8斤的水,一个小,的可装3斤的水,现在有16斤水装满了两桶8斤的桶,小桶空着,如何把这16斤水分给4个人并且每人4斤?(没有其他任何工具,4人自备容器,分出去的水不可再要回来)。
范文三:九宫格口诀
已解决问题
收藏
转载到QQ空间
九宫格有一个口诀是什么
[ 标签:九宫格,口诀 ]
好像是什么‘四维挺出’什么的.. 望哥哥姐姐们发发慈悲 给小弟一个答案吧
问题补充 2009-10-19 11:53
举一个例子行么 这样比较好理解
|?媔倶,忲徦 回答:4 人气:4 解决时间:2009-10-24 14:16
满意答案
“一居上行正中央,
依次斜填切莫忘;
上出框时向下放,
右出框时向左放;
排重便在下格填,
右上排重一个样。”
回答人的补充 2009-10-19 11:47 所谓一居上行正中央说的是1在第一行的正中,依次
斜填切莫忘说的是一直向右上方填,
上出框时往下填是斜填到方框上面去了,就放在这竖行的最下边,
右出框时左边放是说斜填到右框外面,就在横行左边放,
排重便在下格填是斜填上面有数字了,就在自己的下面放,
右上排重一个样就是右上格上面没有格子了,就和排重一样,放在自己的下面。
回答人的补充 2009-10-19 11:54
4 11 6
9 7 8
8 3 10
回答人的补充 2009-10-19 11:56 第一步:最小的数永远位于最上行最中间格~ 第二步:上右边出界,下一个数字(第二小的数字)填入右列最下格~
第三步:上右边出界,将下一个数字(第三小的数字)填入最左列上一格~~
第四步:这个数的右上已有数了,将下一个数字填入上一个数字的下面~
第五步:将这个数的下一个数填入右上格~
第六步:将这个数的下一个数填入右上格~
第七步:右上边出界,将下一个数字填入最左列上一格~ 第八部:右上边出界,将下一个数字填入右列最下格~ 第九部:最大数字永远位于最下行最中间格~ 比如:1~~9排列:
第一步: 1
4 2
7 5 3
8 6
9
第二步: 9
4 2
7 5 3
8 6
1
第三步: 9
4 2
3 5 7
8 6
1
第四步: 4 9 2
3 5 7
8 1 6
回答人的补充 2009-10-19 11:57 简单的九宫格方法:
九子斜排 上下对易 左右相亘 四围挺出
范文四:九宫格
一、胸腹部九宫按摩法的理论根据:图1、2、3 按摩胸腹部防治五脏六腑疾病 (2008-02-22 07:06:49)
转载
标签:
健康
一、胸腹部九宫按摩法的理论根据:图1、2、3
图1洛书图(九宫)·灵龟
公元前2000多年传说在洛河出现一只灵龟,背上刻有九宫(用点点表示)、被称为“洛书”。有口诀曰:“九宫之义,法以灵龟,四二为肩,八六为足,左三右七,戴九履一,五居中央”。在人体的头、面、手、足、胸腹、背、四肢等各部位均可找出九宫穴位(或窍点)。九宫连通五脏六腑并与五行及星座相对应。河图洛书上说:天上有九宫(9个星
座)与河图对应,地上有九宫与洛书对应。五行五脏及星座相对应:肾,水—北极星座。肝,木—河北星。心,火—天纪星座。脾,土—五帝星座。肺, 金—七公星座。还有“四结”星座,“天渊”星座,“华盖”星座,“虎贲”星座,共九个星座。
图2 九 宫 格
人体胸腹部连环九宫格的说明:
A 、1、2、3、4、5、6、7、8、9是胸部九宫,一、二、三、四
五、六、七、八、九是腹部九宫。因为胸腹部要连续按摩,故称
为胸腹部连环九宫按摩法。
B 、6与二是肝区:右肋下胸腹部结合部。8与四是脾区:左肋下胸腹部结合部。1与九:是以上腹部中脘穴为中心的胃区。这三个穴区均可认为属胸腹部连接处,故即算胸部九宫也算腹部九宫。
C 、根据人体胸腹部连环九宫格及相关穴位(或穴区)绘制了胸腹部九宫连环按摩法示意图(见图3)。
二、胸腹部九宫连环按摩法防治疾病的机理:(见图4)
胸腹部是诸多经脉及穴位的聚集地。直接循行在胸腹部的经络是:任脉,肾经, 胃经, 肝经, 脾经, 肺经, 心包经, 胆经共八条经脉。除任脉是单穴外其他经络都是双穴,如只按单穴来计算在胸腹部就有74个穴位。 胸腹部正中线是任脉:天突→曲骨21穴(按摩天突、胸腺、膻中、中脘、神阙、关元时这21穴都可直接触动到)。
胸部:距胸部正中线2寸有肾经6穴。距中线4寸是胃经六穴(包括直接按摩到的乳中、乳根)。距中线6寸有肺经2穴(直接按摩的云门、中府)。距中线6寸还有脾经(中府直下)4穴。直接按摩或触动到的还有:乳头外1寸心包经的“天池”穴。乳下2、5寸距胸部正中线4寸有肝经“期门”穴。期门直下1. 2寸有胆经“日月”穴。
腹部:距腹部正中线0.5寸是肾经11穴(按摩腹部的任脉时这11穴都可直接触动到)。距腹部正中线2寸有胃经12穴(天枢、归来等,转揉大腹时都触动了)。距腹部正中线3.5寸是脾经“冲门”穴(大腿根部)。距腹部正中线4寸是脾经的腹哀、大横、腹结、府舍4穴。腹侧部有“带脉穴”直上1.8寸肝经的“章门”穴及胆经的“带脉,五枢,维道”3穴。
胸腹部连环九宫按摩法,是用手掌或梅花指(五指合并)在胸腹部的穴位及穴区进行较大面积的转揉。此按摩法可直接或间接的按摩触动到胸腹部的所有穴位、穴区,可以打通胸腹部的八条经络。依据中医“通则不痛”之理,此按摩法可以防治五脏六腑的疾病。
三、胸腹部九宫穴位及穴区主治的病症及按摩方法:(见图4图5)
1、4宫与2宫,云门及中府穴,肺经,连心肋。云门在锁骨外沿,距前正中线6寸。中府在云门下1寸。主治:咳嗽,哮喘,胸胁痛,肺炎,肺结核,支气管炎,心绞痛,肋间神经痛,肩臂痛。按摩法:用五指并拢为梅花指在该穴区转揉。
2、9宫天突穴:任脉,嗓子眼,连肺胃。主治:咽喉肿痛,失语,咳喘,止呕。急性咳喘可即按即停。按摩法:用梅花指或中食指按揉嗓子眼。
3、3宫与7宫,乳根、乳中、天池三角区,连心胸肋。天池穴, 属手厥阴心包经, 在腋下三寸, 乳后一寸。乳根穴属胃经,乳中下1寸(乳中不直接按摩)。按摩该三角区域,作用是宽胸理气,止咳平喘,降逆止呕。主治:胸闷,胸胁痛,,咳嗽痰喘,呕吐,可改善乳腺组织营养,防治乳腺炎及乳腺增生,对女性可以重塑胸部、改善乳房的松驰、外扩
现象。按摩法:用一只手的虎口扣住乳根可双手叠压转揉。
4、5宫膻中穴,任脉,两乳头中间。脾、肾、小肠、三焦经与任脉会穴。作用是利气宽胸,止咳化痰。主治:胸闷,胸痛,心痛,咳嗽,哮喘,肋间神经痛,乳腺炎,乳汁不足,返酸、呕逆。按摩法:用梅花指压住穴位转揉。
5、8宫与四宫,左肋下胸腹交界处叫脾区,主要器官是脾脏和胰腺。胰腺、脾脏和胃是相连在一起的。胃的左侧是脾脏,胃床大部分在胰腺上:脾主运化,胰腺分泌胰岛素和胰高血糖素,对于保持血糖正常有重要意义。主治:脾胃病,糖尿病及其连带病症。按摩法:用左手小鱼际(小指下面的手掌面)抠住左肋下,再用右手叠压在左手上转揉。 6、6宫与二宫,右肋下胸腹交界处叫肝区。肝胆互为表里其肝疏泄功能与胆汁分泌排泄、脾胃消化有关。肝气郁,则纳呆、嗳气、呕吐、腹胀、泄泻等。肝湿热,胆液外溢则黄疸。肝气盛郁,则头痛、头晕、易怒、耳鸣耳聋、目赤等。肝区的期门穴(乳头下第6肋间隙、前正中线旁开4寸)、章门穴(侧腹部11肋游离端下法下方)可治疗:腹痛、胀、泻,呕吐,肝炎,肝硬化,黄疸,肋间神经痛,肝脾肿大、腹水,胆囊炎、胆石症等。所以该区可防治肝胆及连带病症。按摩法:用左手小鱼际(小指下面的手掌面)抠住右肋下,再用右手叠压在左手上转揉。 7、1宫与九宫胃区(中脘穴:腹部之任脉,脐上4寸,小肠、三焦、胃经与任脉会穴)。作用是消食利气,健脾和胃,宽中开胃。主治:胃痛,腹痛,腹泻,消化不良,呕吐,吞酸,便秘,吐血,便血,急慢性胃肠炎,胃及12指肠溃疡,肠梗阻,哮喘,神经衰弱。按摩法:在脐
上4寸,用双手掌叠压或梅花指转揉。
8、三宫与七宫,腹中部,神阙穴左右侧,距脐中2—4寸(3—5指)。包括“天枢、大横、腹结”区域。天枢穴:胃经,平脐中,距脐中左右2寸。大横穴:脾经,平脐中,距脐中左右各4寸。腹结穴:脾经,大横穴下1.3寸。该区域主治:绕脐腹痛、腹胀、腹泻,消化不良,便秘,痢疾,肠道寄生虫病,肠麻痹,月经不调,痛经,阑尾炎,癔症。按摩法:在天枢、大横、腹结三角区,用双手掌叠压或梅花指转揉。
9、五宫,神阙穴区(包括肚脐正中的“神阙穴”及脐上1寸的水分”,脐下1寸的“阴交”,脐下1.5寸的“气海”):属任脉。“神阙”禁针可灸,“阴交”孕妇不用针、可灸,“神阙”主治:虚脱,休克,腹痛腹胀,腹泻,便秘,脱肛,腹部水肿,细菌性痢疾,肠粘连,痔疮。“水分”(脐上1寸)主治:腹痛、腹胀、腹泻、肾炎水肿、肝硬化腹水。“阴交”(脐下1寸)主治:腹痛、泄泻、月经不调、痛经、崩漏、带下、阴痒、不孕症、疝气、水肿、细菌性痢疾、功能性子宫出血。“气海”(脐下1.5寸)主治:腹痛,腹泻,虚脱,哮喘,遗精,阳痿,月经不调,痛经、带下、子宫脱垂、功能性子宫出血、产后恶露不尽,不孕症,疝气,遗尿,脱肛,尿潴留,泌尿系感染,肠麻痹,胃下垂、尿崩症,神经衰弱。按摩法:用双手掌在肚脐处叠压转揉。
10、八宫与六宫,归来、气冲、冲门三角区(归来穴:胃经,脐下4寸、距正中线2寸。气冲穴:胃经,归来穴下1寸。冲门:脾经,腹股沟外侧距曲骨3.5寸,)主治:小腹痛,外阴痛,月经不调,不孕,子宫脱垂,子宫内膜炎,白带多,阴茎痛,遗精,睾丸炎,疝气,阳痿,
痔痛,小便不利,睾丸炎。按摩法:在左右大腿根与小腹交界区,用左或右手的小鱼际(小指下面的手掌面)压住该区,再用另一只手叠压在上面助力转揉。也可用梅花指转揉。
11、一宫,关元、中极区。关元穴:任脉,脐下3寸,就是丹田。中极穴:任脉,关元下1寸,膀胱经的募穴。均为肝脾肾经与任脉的会穴。主治:昏迷,虚脱,遗精,阳痿,早泄,疝气,小腹痛,月经不调,痛经,闭经,子宫出血,带下,子宫脱垂、功能性子宫出血、滞产、产后宫缩痛。阴痒,遗精,遗尿、小便不通、尿频、尿急、尿痛、尿路感染,腹泻,脱肛。作用是扶正,生阳,温调气血,利湿。按摩法:用双手掌叠压转揉,或用梅花指转揉。
12、胸腺区(免疫区):锁骨中间天突穴直垂下来,一短带状,紧靠任脉两侧,约四指宽的长度,就是胸腺。按摩胸腺的意义:胸腺位于胸骨后面,胸骨上端,左右两肺之间,紧靠心脏,呈灰赤色,火柴盒大小, 扁平椭圆形,由淋巴组织构成,青春期前发育良好,40岁过后就会逐渐萎缩.但是只要经常不断的刺激它,就会保持活跃的状态,可提高免疫力,防癌,不易生病。按摩法:见五。
13、转揉大腹(大肠区),以肚脐为中心距肚脐3-5指处转揉大腹:(见图5)、按照大肠的自然走向按摩。自右侧小腹开始向上↑(升结肠)经“天枢”等胃经穴位到近右肋下面转向左(横结肠)经“中脘穴”到左肋下面然后转向下↓(降结肠)经胃经的“归来穴”等一直到左小腹底部,再向右转→经曲骨上面又到小腹右侧。大肠区的“器官”是大肠,所经经络是胃经及肾经和任脉,故转揉大腹可以疏通大肠区,可治疗腹
痛、腹胀、腹泻,便秘,脱肛,腹部水肿,细菌性痢疾,肠粘连及胃肠部的多种疾病。按摩法:见五。
四、主要防治的疾病:肺热咳喘,心脏不适,胸闷胁痛,脾胃虚弱,消化不良,肝气不舒,腹涨、腹痛、腹泻,糖尿病,高血压,大便秘结及男科妇科疾病等。可以说通过九宫按摩可增强人体呼吸、心血管、消化、泌尿等系统的功能,防治五脏六腑的疾病,并有减肥功效。
五、两种按摩法:参照图3、4.5
(一)米字型按摩法:参照图3。不分时间。
(A )、按摩顺序是:9→1→3→7→4→6→2→8→5→九→一→三→七→四→六→二→八→五。
(B )、按摩次数与顺逆:所有穴位都是先顺时针转揉36圈,再逆时针转揉24圈,然后点压两秒钟以上。(按摩时想着在胸腹部掛着一块表, 就知道顺逆了)
(C )、按摩九宫后剁搓摩擦胸腺:在任脉两侧1.5 — 2寸(两三指)处,用双手指自上至下剁搓摩擦各50次(或从嗓子眼直垂下来到膻中一线剁搓摩擦100次),力度要适中,不可用蛮力。
(D )最后转揉大腹:双手叠压自右侧小腹开始向上↑转揉,到近右肋下面转向左(横结肠)经“中脘穴”到左肋下面然后转向下↓(降结肠)经胃经的“归来穴”等一直到左小腹底部,再向右转→经曲骨上面又到小腹右侧,就这样要顺时针转36圈。然后双手在左右肋下面“稍用力”向下↓拍搓24次,一直搓到小腹。
(二)九宫按摩法:
(A )、时间:夜11时、→午11时定为上午, 午11时→晚11时为下午。
(B )、上午按摩(自下到上按摩九宫,再自上到下按摩胸腺及大腹)按摩顺序是:先由(一)宫开始→经(二、三、四、五、六、七、八) 宫→(九)宫(腹部—自关元到胃区),接着按摩(1)宫→经(2、3、4、5、6、7、8) 宫→(9)宫(胃区→天突穴)的顺序按摩(这样肝、脾、胃区先后按摩了两遍),按摩每个穴位后要点压两秒钟以上,最后按摩胸腺及大腹。
( C )、下午按摩(自上到下按摩九宫,再自上到下按摩胸腺及大腹),按摩顺序是:先由(9)宫→(1)宫(胸部--自天突穴到胃区),接着按(九)宫→(一)宫(胃区→关元)的顺序按摩(肝、脾、胃区先后按摩了两遍),按摩每个穴位后点压两秒钟以上,最后按摩胸腺大腹。
(D )、九宫的按摩次数与顺逆:单数×9的倍数、要顺时针转揉、《如按摩7或七宫×9﹦63次,要顺时针转揉》;双数×6的倍数、要逆时针转揉、《如按摩4及四宫×6=24次,要逆时针转揉》。
(E )、按摩九宫后剁搓摩擦胸腺:在任脉两侧1.5 — 2寸(两三指)处,用双手指自上至下剁搓摩擦各50次(或从嗓子眼直垂下来到膻中一线剁搓摩擦100次),力度要适中,不可用蛮力。
(F )、最后转揉大腹:双手叠压自右侧小腹开始向上↑转揉,到近右肋下面转向左(横结肠)经“中脘穴”到左肋下面然后转向下↓(降结肠)经胃经的“归来穴”等一直到左小腹底部,再向右转→经曲骨上面又到小
腹右侧,就这样要顺时针转36圈。然后双手在左右肋下面“稍用力”向下↓拍搓24次,一直搓到左小腹。
说明:请每天按摩两次。
范文五:九宫格问题
School of Computer Science
Artificial Intelligence
Semester 1 2010
Assignment 1
Released March 22nd 2010
Due May 3rd 2010 5pm
This assignment is modelled on the EightPuzzle.
Specifically, you should model a game of sliding numbered tiles (numbered
1,2,3,4,5,6,7,8) on a 3x3 grid containing one blank (empty space). In the physical game, a tile adjacent to the blank is slid into the blank position at any one move. Thus the “blank tile” (or hole) and the tile chosen to slide, swap positions. It is easier to describe this by saying that the “blank tile” moves “Left” or “Right” or “Up” or “Down” (of course if the blank tile is against the boundary, not all 4 moves are possible).
The goal is to have the tiles in order (raster scan – left to right, top to bottom) with the blank space at the bottom right corner.
1 2 3 4 5 6
7 8
The first fact to note is that not all starting configurations are solvable. In fact, it can be shown that half of the board configurations are a valid starting position – you can solve the game starting from there, and half are not.
For larger versions of this game it is generally not feasible to solve the game by “brute force” exhaustive search. However, for a game this size there are only 9! – factorial 9 – possible board configurations. This is 362880 possible board configurations. But, as stated above, only half of these are valid configurations. Note – if a configuration can be reached from another, within a sequence of valid moves from start to end, then that configuration can be a start configuration and visa versa).
Thus it is feasible to do exhaustive search on this game.
On the following website
the claim is made that the following two start positions are the worst possible – requiring 31 moves to solve (it’s known the average is about 20).
2 5 4
3 1
6 4 7
8 5
3 2 1
Question 1: Is the claim correct? (are they solvable and do they require 31 moves – you don’t have to show they are the worst).
You are to tackle this by writing a program (however if you can prove it mathematically I’d be very impressed!).
Concept of Inversions:
If we ignore the blank and write the numbers in raster scan order – we have a permutation of the numbers 1..8. e.g., the board
6 4 7
8 5
3 2 1
becomes 6 4 7 8 5 3 2 1
We encode this as an inversion vector – for each number we count the number of successive numbers “out of order” with it – i.e., smaller than it.
This is 5 3 0 0 3 2 1 0 for the above.
claims that for odd sized boards (since this board is 3x3 this is the case here) the test for whether a board is solvable is to add up the entries in the inversion vector and test whether the result is even. (see also ) Question 2: Is this correct?
Question 3: How efficient is A* search with the number of misplaced tiles heuristic? That is, on average how many board states does it expand compared with brute force (uninformed) search to get the optimal path? If you don’t write a very efficient program you may find that answering this question takes too much run-time (and/or memory). If you can’t get a very efficient program then at least generate games you know can be short (a few moves) and gather some statistics.
Approach to Answer the Questions.
You are to answer the above questions by writing a Java program.
You are to use text for input and output representing the game – with 9 being the number representing the blank.
So, if a program takes first of the claimed worst starting positions (given above) as input to initialise a board position, it would be initialised using the text file with contents: 8 6 7
2 5 4
3 9 1
(three lines of text, each number separated by a single space – or a newline).
Moves are described by a single (uppercase) letter – U for Up, D for down, L for left, and R for Right.
Thus a partial output of part of the game play may be:
1 2 3
4 9 5
7 8 6
R
1 2 3
4 5 9
7 8 6
D
1 2 3
4 5 6
7 8 9
i.e.,
state of play (board layout)
action
state of play after action
action
state of play after action
…….
You are to produce a Java program with the following specifications:
The file holding the main class will be called EightPuzzle.class
The execution will be tailored by command line options.
java EightPuzzle –s searchtype –h heuristictype –m maxnodes <>
will take the input (in any text file – such as startposition.txt – that has the above 3 line formatted description of a starting board state) and try to find the shortest moves to go from that position to the desired end position – i.e., play the game.
Switch –m is followed by an integer, maxnodes, that specifies the maximum number nodes in the search tree that is expanded.
Switches –s and –h are followed by strings that cause the play to adopt a particular search strategy and a particular heuristic, respectively.
You have to provide support for the following searches methods (the strings should have the obvious meanings/associations):
BreadthFirst (with branch order L D U R) where repeated board positions encountered in the search ARE detected and not followed again (become leaf nodes of the search tree). ASTAR where repeated board positions ARE NOT detected, and the heuristics should include CountMissplacedTiles (and the order of branches, should each branch at the same level evaluate to being equally likely, will be L D U R; should the current lowest score be obtained by branches at different levels of the tree, the branch closest to root will be chosen).
(of course, BreadthFirst doesn’t need - and therefore ignores – the heuristic switch option if it is given).
When run (i.e., by combinations of:
java EightPuzzle –s searchtype –h heuristictype –m maxnodes < startposition.txt="" )="" your="" program="" should="" output="" the="" board="" state,="" action,="" board="" state,="">
of the best found solution (it may be the only found solution!) by that run, in the format given above for describing output.
When run, your program should only output the final found solution (to standard out) in the format described by the partial output above. If it did not find a solution but
terminated because of hitting the maximum nodes expanded, then it should simply output the string:
Not Found
Since part of the assessment of the performance of your code will involve automated running, collection of output, and evaluation: you MUST stick exactly to the above
description about naming (exact naming) and modes of operation. Of course, you can add extra switches (such as for tracing/debugging) but you MUST support the above described switches exactly as described.
You can use any source code that you find on the web or books etc. (but you must acknowledge where you obtained it – providing a url). Of course, you can’t enlist the support of someone else – and you can’t pay someone to do the assignment for you (or otherwise have someone help!) You must indicate changes you made by providing Java source files for any code you wrote/changed. If it is based on code from another source (including translating into Java from code you saw in another language) you must clearly indicate the source in comments in the header of the file and clearly describe the nature and extent of changes you made. Thus, for example, it is NOT sufficient to simply say “this code is based on X” – you need to say to what extent – if you changed specific lines then highlight specific lines with comments.
You may find code from an assignment for this subject in 2006 useful. You may also find the aima library useful.
Note: don’t blindly use these codes – the game described has some differences in the end or target configuration and in the way the input and output representations are given – as a start!
Check the course website (particularly also the forum) regularly – there will be a record of questions about the assignment and answers provided. If you’re stumped, check there first and then try to ask questions in the consultation periods set aside. Emailed questions when you’ve genuinely tried to solve the issue but failed – are also ok.
Submission :
The submission should be by the automark web submission – see separate instructions for the procedure.
Your submission should be a set of files (can include a directory structure with files in subdirectories). However:
1. Your executable main class MUST be in the top directory of your tree and it MUST be named exactly as given above. It must be capable of running with the syntax for executing from the command line – as given above – so long as the CLASSPATH includes your top directory. That is, other than those in a standard Java distribution, any required class files have to be included. DON’T simply
copy all class files from a large distribution (e.g., aima-java) into your svn
repository (and hence into your assignment submission) – marks will be deducted for clearly extraneous files in the submission.
2. You must have a pdf file in the top directory that is your report (see below)
3. You must include all files you wrote/modified (as .java files)
4. Do not include extraneous files – files your final solution does not need/use
5. Your report should be short but it MUST contain enough information so that your solution can be recompiled (including url’s so any required libraries for building can be located). There should be a short description of experiments you ran and the observations you made (that is – answers to the three questions with some statistics/reasons). This includes your assessment of whether the two quoted
starting positions are solvable and require at least 31 moves, as well as a
comparison of ASTAR with exhaustive search (average over repeated runs of the code with different start positions).
Further Hints:
You can ignore what follows but you will likely find it useful.
If you don’t test for repeated board positions in exhaustive search, you’ll likely run out of memory. How many states would it generate/examine if the longest path is actually 31?
Testing for repeated board states involves some form of search of those generated so far.
A “dumb” implementation of this will be very costly. Your program could run for far too many hours.
There is a cheap way to do search (in constant time) if there is a way to enumerate the states. That is to simply keep an array, indexed by states, with a flag in the array for visited states.
How do you enumerate permutations (a state of the board is simply a permutation of
1..9)?
For an answer see -
What we want is a mapping from a permutation to a number between 0..362,879. There are two steps:
1. Calculate the inversion vector (see above) but this time NOT ignoring the space.
2. Use the entries of the inversion vector as digits in the factoradic represesentation.
Example: Take the board
6 4 7
8 5
3 2 1
This is represented by the permutation
6 4 7 8 5 9 3 2 1
This is converted to the inversion vector:
5 3 4 4 3 3 2 1 0
This is converted to the factoradic
5*8!+3*7!+4*6!+4*5!+3*4!+3*3!+2*2!+1*1!+0*0!
=5*40320+3*5040+4*720+4*120+3*24+3*6+2*2+1*1+0*1
Simple question to answer – what is the representation for the permutation 1 2 3 4 5 6 7 8 9?
Simple question to answer – what permutation gets mapped to 362,879?
Last hint – since every move is reversible, we can find all solvable states by starting from the goal and using exhaustive search with detected repeated states until we run out of moves to try. Likewise, if you want to generate legal start positions you can either: a) generate a random permutation of 1..9 and test for legality (assuming the above stated test works!) or you can run the game backwards using randomly generated moves.
转载请注明出处范文大全网 » 五年级奥数第二讲-九宫格与砝