玩记忆作业 [英] Playing with memory homework

查看:74
本文介绍了玩记忆作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

玩记忆

信德(Sindhu)和阿利斯泰尔(Alistair)玩的是一个涉及随机序列的记忆游戏 1到10之间(包括1和10)的数字,一次调用一个.

每个玩家最多可以记住5个先前的数字.当被叫
号码存储在玩家的记忆中,该玩家将获得一个积分.如果不是,
玩家将被叫号码添加到他的记忆中,删除另一个号码
如果他的记忆已满.

两位玩家都以空洞的回忆开始.两个玩家总是添加新的
记忆中遗漏了数字,但是在决定时使用了不同的策略
删除哪个号码:

信德省(Sindhu)的策略是删除
中未拨打的电话号码 最长的时间.

Alistair的策略是删除内存中的号码,
最长的时间.

示例游戏:

Playing with memory

Sindhu and Alistair play a memory game involving of a sequence of random
numbers between 1 and 10, inclusive, that is called out one at a time.

Each player can remember up to 5 previous numbers. When the called
number is in a player''s memory, that player is awarded a point. If it''s not,
the player adds the called number to his memory, removing another number
if his memory is full.

Both players start with empty memories. Both players always add new
missed numbers to their memory but use a different strategy in deciding
which number to remove:

Sindhu''s strategy is to remove the number that hasn''t been called in the
longest time.

Alistair''s strategy is to remove the number that''s been in the memory the
longest time.

Example game:

Turn Callednumber Sindhu's memory Sindhu's score Alistair's memory Alistair's score
1	1	  1	           0	         1	            0
2	2	  1,2	           0	         1,2	            0
3 	4	  1,2,4	           0	         1,2,4	            0 
4	6	  1,2,4,6	   0	         1,2,4,6	    0
5 	1	  1,2,4,6	   1	         1,2,4,6	    1
6	8	  1,2,4,6,8	   1	         1,2,4,6,8	    1
7	10	  1,4,6,8,10	   1	         2,4,6,8,10	    1
8	2	  1,2,6,8,10	   1	         2,4,6,8,10	    2
9	4	  1,2,4,8,10	   1	         2,4,6,8,10	    2
10	1	  1,2,4,8,10	   2	         1,4,6,8,10	    3
<blockquote class="FQ"><div class="FQA">Quote:</div>


用S表示Sindhu的得分,用A表示Alistair的得分.

该游戏共有20个被叫号码,其属性全部为
数字将被称为相等的次数(每次20次,每次2次
标注).

给定一个序列中的20个被叫号码,请按序列中最早的顺序确定这场比赛的赢家.


Denoting Sindhu''s score by S and Alistair''s score by A.

The game is for a total of 20 called numbers, with the property that all
numbers would be called equal number of times (2 times each across 20
call-outs).

Given a set of 20 called numbers in a sequence, identify the winner of this game the earliest in the sequence.

推荐答案

我们不做作业:因为某种原因.在这里,您可以考虑自己被告知的内容,并尝试理解它.也可以在那里帮助您的导师识别您的弱点,并将更多的注意力放在补救措施上.

自己尝试,您可能会发现它并不像您想的那样困难.
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think.


这篇关于玩记忆作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆