1. ## Re: Levels

Tim

I will have a first stab at this:

<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold"> The give away is that there are 1024 levels in the game. If I was Mr Orange I would do the following: With my first check I would check the level by powers of 2

2^0=0
2^1=1
2^2=4

......

2^10=1024

This would mean that for the first trawl (F) through the check will take F minutes. This could potentially take 11 minutes if the virus is found at level 1024 so the minimum time to kill the virus would be 16 minutes.

Having done my first trawl I could determine that the virus could potentially be between the last check point level (A) and the current checkpoint level ([img]/forums/images/smilies/cool.gif[/img]. This would then allow me to check between A and B. This could take between 1 and 512 minutes.

1) Anything from 6 minutes to 8 hrs 32 minutes
2) Good chance
3) 32 levels

</span hide>

That is my starter for 10 but I have a feeling my thinking is flawed!!!!

2. ## Re: Levels

My initial reading of the puzzle yielded the following ...

<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">If I test level 1, then 2, 3, 4, etc then there is no problem. I lose my first life but I know the first level where the virus is active. I'm assuming that I need to remove the virus from that level and then all subsequent levels are ok. I'm also assuming that removing the virus from a higher (active) level is not good enough.</span hide>

Looking at your answer, then, if the virus is active at level <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">5 (say), then your results will show that it is not active at 4 but active at 8 and you will have no sure fire way of finding the first active level.</span hide>

3. ## Re: Levels

A point well noted sir. A fundamental flaw...I shall return to Excel worksheet and report later.

4. ## Re: Levels

OK Tim, thinking out of the box here

<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold"> I know the virus will be active in level 1024 so therefore I can deactivate at that level, there is nothing in the text that tells me I have to have to go UP from a clean to a virus infected area, just Once you correctly determine the level at which the virus is active. I therefore know without doubt that if I go to level 1024 I know the virus is active and kill it. therefore:

1) 6 minutes from start
2) Yes
3) As many as you want

</span hide>

5. ## Levels

<P ID="edit" class=small>(Edited by Ruff_Hi on 10-May-05 14:59. Corrected 'active' to 'activated' - one of the problems of copying a long puzzle from a mag)</P>The following puzzle was contained in the puzzle section of a mag that I regularly receive - I don't have an answer.

Mr Green, a disgruntled employee of a computer software company called GameShop, is given a lay-off notice. Having some grudge against the company's management, he decides to infect a recently written computer game Levels, with a virus that threatens to wipe out all the files on the GameShop's computer system. Sales of the game are vital to GameShop's survival, and the game cannot be pulled. Somebody needs to get into the coding and remove the virus. Mr Green, however, left a note to the virus tester, Mr Orange, telling him to read instructions carefully before proceeding.

Levels is a very simply game. A player wins the game if he or she completes 1,024 levels by collecting diamonds.

When Mr Orange turned on the game, the note from Mr Green appeared. It read as follows: "The virus I wrote does not affect the game at a number of consecutive levels, starting from level 1. However, beginning with a certain level and above, the virus is active and may damage the computer system. You have only two lives. If you test a level and there is no virus, you can test another level. If you hit the virus, you lose the first life. If you hit the virus on your second life, an irreversible process will start and GameShop will lose all its files. Once you correctly determine the level at which the virus is activated (I originally had 'active' here), you can kill the virus and the computer system will be saved. you have one hour to find the virus. The clock has started. Good luck!"

Mr Orange knows that it takes exactly one minute to test a single level for the presence of virus. In addition, it takes five minutes to deactivate the virus if it's found. Assuming no time is wasted between testing different levels, please answer the following questions:

1. <LI>When will his job be completed?
<LI>Will he be able to save the company's files?
<LI>What is the maximum number of levels the game can have so that one hour is just enough to detect the infected level and kill the virus?

6. ## Re: Levels

Yes, that works as the puzzle originally stood but (sorry to pull the rug out from under you here), I mis-typed part of the puzzle. It now reads "correctly determined the level at which the virus is activated" and I am taking that to mean "the first infected level".

Away you go, now!

7. ## Re: Levels

I know that I didn't mention that I was looking for a fully worked solution ... but, Steve, care to share your approach?

8. ## Re: Levels

After getting lucky and cleaning the virus out of the system. I found another virus and realized my logic was flawed!

Here is a better way:
When will his job be completed? <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold"> it depends on where the level has a virus. It could take 7 mins it could take the whole 60 mins</span hide>

Will he be able to save the company's files?
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">Yes, if he changes the logic that I used originally</span hide>

What is the maximum number of levels the game can have so that one hour is just enough to detect the infected level and kill the virus?
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">1540</span hide>

The "better logic":
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">
Test level 55. (1 min)
If found, check from 1 to 54 (1+ 1-54 = 2-55 mins), when found clean (7-60 mins)
If not found in 55 check in level 55+54 = 109 (2 min elapsed)
If found check from 56-108(2+ 1-53 = 3-55 mins) when found (8-60)
If not found in 109 check in level 109 + 53 =162 (3 min elapsed), continue decreasing so when found you will to back track so the one right before can be found in 55 mins (so with cleaning = 60 min)</span hide>

Steve

9. ## Re: Levels

<P ID="edit" class=small>(Edited by sdckapr on 10-May-05 19:23. Ignore this [post#=478398] has a better solution)</P>I did note a mistake the range for #1. It should be <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">7 - 527min (8hr 47 min)</span hide>
And #3 the max levels are <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">113</span hide>

I will correct my post.

My method is similar to Jerry's:
1)<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">Test the "base 2's" 2, 4, 8, 16, etc until you find the virus (lose 1 life).
Once you find the virus you know it is in a level that is larger than the last one tested and less than or equal to the current level.
So you start 1 level past the highest "uninfected level" and move up one at a time until you find it.
Once you find it (and lose the 2nd life) you have 5 mins to clean it.

For example if the the level of the virus is25.
Test 2,4,8,16, (all clean, 4 mins), test 32 (5 mins total elapsed, virus found, lose life)
Test 17 -24 (all clean, 13 mins elapsed), test 25 (14 min elapsed,virus activated, 5 mins to deactivate = 19 total mins)

I did make a mistake the minimum is 7 not 6 min. If the virus is in level 1, you test level 2 (lose life, 1 min)) then you test level 1 (1 min) then clean (5 min) Total = 7 min

The max time is when the virus is in either 1023 or 1024 (same time):
Test 2,4,8,16,32,64,128,256,512,1024 (10 mins until lose life)
Test 513 - 1022 (10+511 = 521 mins)
Test 1023 (522 mins) if virus activated than 527 min total to clean
If the virus is not there then you know it is in 1028 and you can clean it (no need to test again)
</span hide>

2) Based on the methodology listed in 1, I determined the number that were <=60 mins and calculated the percentage

3) Based on #1, Found the value where all are <=60 mins:
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">113 levels:
Test 2,4,8,16,32,64,113 (max) (7 mins until lose life)
Test 65 - 112 (7+48 = 55 mins)
5 mins to clean 113</span hide>

Steve

10. ## Re: Levels

When will his job be completed?
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">Between 7 min and 8hr 47 min depending on the level</span hide>

Will he be able to save the company's files?
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">24% probability</span hide>

What is the maximum number of levels the game can have so that one hour is just enough to detect the infected level and kill the virus?
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">113 levels</span hide>

Steve

11. ## Re: Levels

I interpreted the line as if you find a level with virus, it takes a life. If you hit a level with a virus the second time, you can clean it, if it the first one with the virus, if it is not the first one then you you lose all the files....

So if the virus is in level 5, if you goto a level above 5 you lose a life, if you go to another one above 5 you lose all the files.
But if you goto a level above and lose a life, then move up to level 5 from an uninfected, when you get to 5 you can clean it.

If your interpretation is correct, then the only solution I see is:
<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">to clean every level starting at 1. You can clean 12 levels before times runs out. Any scheme that puts you past the "activation level" will lose a life and then you can't do anything else, since even if you knew the "activation level" going there or above loses everything...</span hide>

Steve

12. ## Re: Levels

Steve - both sound like solutions but I must say that I like the second - it really appeals. However, when I read the question, I interpreted this line...<pre> If you hit the virus on your second life, an irreversible
process will start and GameShop will lose all its files</pre>

... to mean that if you hit the virus after losing a life, then there is no saving the company files. I'm tossing around a <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">binary search</span hide> approach where I <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">clean every level</span hide> but I don't think that that will actually help as I don't think that I will know after <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">cleaning the level if it was infected or not.</span hide>

13. ## Re: Levels

My thinking was to <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold"> clean the middle level (512), it it was infected then the virus is between 1-512 else it is between 512-1024 and it halves your search area. You then clean the middle level again and half your search area again. You keep doing this until your search area is 1 level.</span hide> However, as I said, I don't think that this will work as I need to know if the level <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">was infected before I cleaned it.</span hide>

14. ## Re: Levels

But by your "interpretation", if 512 is affected and you clean it, it does nothing (you have to clean the lowest level infected) and you have lost a life and even if you went to the correct one next, it is too late since if you find it you lose the 2nd life...

My feeling on your interpretation of the puzzle that if you go to any level above the lowest infected, you have already lost a life and there is nothing you can do, since as soon as you hit another level with the virus it is too late.

That is the reason why I believe my interpretation is correct for the puzzle.
Steve

15. ## Re: Levels

Steve - I'm not happy with my approach (I cannot call it a solution as there are too many holes in it) either. I'm not sure if I clean a level it means that I lose a life (just another thing that is unclear with the wording of this particular puzzle).

Here is a solution (variation on your #2) that might work ...

<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">test level 12 (1 min / 1 mins total), if infected go back and clean levels 2 to 12 (55 min / 56 mins total)
if not infected then test level 23 (1 min / 2 mins total), if infected go back and clean levels 13 to 23 (55 min / 57 mins total)
if not infected then test level 34 (1 min / 3 mins total), if infected go back and clean levels 24 to 34 (55 min / 58 mins total)
if not infected then test level 45 (1 min / 4 mins total), if infected go back and clean levels 35 to 45 (55 min / 59 mins total)
if not infected then test level 56 (1 min / 5 mins total), if infected go back and clean levels 46 to 56 (55 min / 60 mins total)
if not infected then test level 66 (1 min / 6 mins total), if infected go back and clean levels 57 to 66 (50 min / 56 mins total)
if not infected then test level 76 (1 min / 7 mins total), if infected go back and clean levels 67 to 76 (50 min / 57 mins total)
if not infected then test level 86 (1 min / 8 mins total), if infected go back and clean levels 77 to 86 (50 min / 58 mins total)
...
if not infected then test level 326 (1 min / 50 mins total), if infected go back and clean levels 325 to 326 (10 min / 60 mins total)
if not infected then test level 327 (1 min / 51 mins total), if infected go back and clean levels 327 to 327 (5 min / 56 mins total)
if not infected then test level 328 (1 min / 52 mins total), if infected go back and clean levels 328 to 328 (5 min / 57 mins total)
if not infected then test level 329 (1 min / 53 mins total), if infected go back and clean levels 329 to 329 (5 min / 58 mins total)
if not infected then test level 330 (1 min / 54 mins total), if infected go back and clean levels 330 to 330 (5 min / 59 mins total)
if not infected then test level 331 (1 min / 55 mins total), if infected go back and clean levels 331 to 331 (5 min / 60 mins total)
</span hide>

I'm not saying that this is the solution, it all depends on your interpretation of the question, and some phrases in particular. Anyway, this solution shows that you can 'win' if the virus is in the first<span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold">311</span hide>levels.

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•