Jump to content
BrainDen.com - Brain Teasers
  • 0


wolfgang
 Share

Question

A devil force developed a programe intending to destroy 52 countries.

Each country had been given a button with number( 1 to 52),forming a circle,with an (ABORT) button between number 52 and 1,these buttons are on a circular rotating disk.This disk will rotate randomly(either clockwise or anti- clockwise)according to a given programe,the programe can manage howmany steps should the disk rotates only and can not control the direction of the rotation,by reaching any number ,that button will be activated and a land having that number will be vanished!,The original programe was on (ABORT)as a start point,given an order...( Go ONE step)!.

If you were able to reach this programe, and able to change it, i.e. change the steps to be moved and to select the start position, how can you save maximal number of countries,knowing that:

1-Clockwise rotation means going (for example)from number 3 ,2,1,abort,52,51.....,where as anti-clockwise,goes from

3,4,5,6......

2-You can control the steps to be moved,and should be done only once,when the programe begins,it will never stop.

3-The rotation will randomly begins either clockwise or anti-clockwise,and will be fixed to that wise(i.e. only at the start will be at random).

4-The maximal steps to be given must not exceed 52 steps.

5- If the progame reachs a country which was already destroyed,it will no more obay your programe and will move step by step to destroy all the remaining countries.

6- The start point will not be destroyed at the most begining.

7- The programe can also use the button numbers as a guide.

8-The only way to stop the programe is by reaching the (ABORT)button.

9-There should be a given number of steps given,or the programe will move step by step(i.e. NO.. move 0 steps).

Enjoy saving the world!

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

You can be sure to save 26 countries with many strategies.

Here's one: Start at 1 and step 2. In one direction,

you hit 3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,

39,41,43,45,47,49,51,ABORT, killing 25 countries (saving 27).

In the other direction, you hit 52,50,48,46,44,42,40,38,36,

34,32,30,28,26,24,22,20,18,16,14,12,10,8,6,4,2,ABORT,

killing 26 countries (saving 26). This is the best that

can be done.

Link to comment
Share on other sites

  • 0

You can be sure to save 26 countries with many strategies.

Here's one: Start at 1 and step 2. In one direction,

you hit 3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,

39,41,43,45,47,49,51,ABORT, killing 25 countries (saving 27).

In the other direction, you hit 52,50,48,46,44,42,40,38,36,

34,32,30,28,26,24,22,20,18,16,14,12,10,8,6,4,2,ABORT,

killing 26 countries (saving 26). This is the best that

can be done.

You did understand the problem very well!...but your strategy gives alot of losses!

Link to comment
Share on other sites

  • 0

I guess...

any starting point n and step size 2n

Thats not correct!...e.g. If you start at Number 2,so according to your programe the move will be 4 steps each time:

2,6,10,14,18,22,26,30,34,38,42,46,50,1,5.......till all the contries are destroyed!

and is the same with the other direction.

Link to comment
Share on other sites

  • 0

The programe will not respond to...(Go to ABORT),and in this case, the disk will move one step at a time,destroying all the countries.

And to make me more clear,the programe will work like this:

(START)..Read your given programe...move accordingly the given steps....reach the next target(destroy it)....read again your programe....move .....next target(destroy it)....read...move...destroy......and so on...till it reachs the (ABORT)...END.

Link to comment
Share on other sites

  • 0

"2-You can control the steps to be moved,and should be done only once,when the programe begins,it will never stop." seems to conflict with "7- The programe can also use the button numbers as a guide."

If the step count is changable then

Start Point = 1

If button number odd move 1

If button number even move 51

Start at 1 and move 1 to ABORT or 2

If 2 then it will move 51 to ABORT

Worst case is one country gone.

edit - this is assuming "If you were able to reach this programe, and able to change it, i.e. change the steps to be moved and to select the start position" means I can set the starting position.

Edited by curr3nt
Link to comment
Share on other sites

  • 0

The program dictates the number of steps to be moved

n = starting point

the initial starting point is 26

the program says the number of steps = 52 - n

I believe this will lead to..

clockwise ABORT is reached on first turn, saving all countries

counter-clockwise country 52 is destroyed, then the program will compute move 0 steps, which will cause it to immediately step 1 - landing on ABORT only losing one coutnry, #52

Link to comment
Share on other sites

  • 0

"2-You can control the steps to be moved,and should be done only once,when the programe begins,it will never stop." seems to conflict with "7- The programe can also use the button numbers as a guide."

If the step count is changable then

Start Point = 1

If button number odd move 1

If button number even move 51

Start at 1 and move 1 to ABORT or 2

If 2 then it will move 51 to ABORT

Worst case is one country gone.

edit - this is assuming "If you were able to reach this programe, and able to change it, i.e. change the steps to be moved and to select the start position" means I can set the starting position.

very good!

Link to comment
Share on other sites

  • 0

The program dictates the number of steps to be moved

n = starting point

the initial starting point is 26

the program says the number of steps = 52 - n

I believe this will lead to..

clockwise ABORT is reached on first turn, saving all countries

counter-clockwise country 52 is destroyed, then the program will compute move 0 steps, which will cause it to immediately step 1 - landing on ABORT only losing one coutnry, #52

very clever aproach !

Link to comment
Share on other sites

  • 0

N = positions = 53

B = button number

X = steps = ABS(MOD(B+1,2)*N-B)

---Excel formula - ABS = Absolute Value and MOD(x,y) is x MOD y

---Formula nets B if odd and 53-B if even

The worst cases are 2 and 51 going the "wrong way". (+) is adding the steps and (-) is subtracting the steps.

2 step 51 => (+)ABORT or (-)4

4 step 49 => (-)8

8 step 45 => (-)16

16 step 37 => (-)32

32 step 21 => (-)11

11 step 11 => (-)ABORT

51 step 51 => (+)49 or (-)ABORT

49 step 49 => (+)45

45 step 45 => (+)37

37 step 37 => (+)21

21 step 21 => (+)42

42 step 11 => (+)ABORT

As the button number approaches 26/27 the counts get smaller.

26 step 27 => (+)ABORT or (-)52

52 step 1 => (-)51

51 step 51 => (-)ABORT

27 step 27 => (+)1 or (-)ABORT

1 step 1 => (+)2

2 step 51 => (+)ABORT

Unknown starting position best case is 0 lost and worst case 5 lost.

Edited by curr3nt
Link to comment
Share on other sites

  • 0

N = positions = 53

B = button number

X = steps = ABS(MOD(B+1,2)*N-B)

---Excel formula - ABS = Absolute Value and MOD(x,y) is x MOD y

---Formula nets B if odd and 53-B if even

The worst cases are 2 and 51 going the "wrong way". (+) is adding the steps and (-) is subtracting the steps.

2 step 51 => (+)ABORT or (-)4

4 step 49 => (-)8

8 step 45 => (-)16

16 step 37 => (-)32

32 step 21 => (-)11

11 step 11 => (-)ABORT

51 step 51 => (+)49 or (-)ABORT

49 step 49 => (+)45

45 step 45 => (+)37

37 step 37 => (+)21

21 step 21 => (+)42

42 step 11 => (+)ABORT

As the button number approaches 26/27 the counts get smaller.

26 step 27 => (+)ABORT or (-)52

52 step 1 => (-)51

51 step 51 => (-)ABORT

27 step 27 => (+)1 or (-)ABORT

1 step 1 => (+)2

2 step 51 => (+)ABORT

Unknown starting position best case is 0 lost and worst case 5 lost.

Still not sufficiant...you can make a programe contains more than single order.

Link to comment
Share on other sites

  • 0

Still not sufficiant...you can make a programe contains more than single order.

I was trying to take your problem further by removing the ability of setting the starting position. So rotation and starting position would be unknown.

You think there is a better way to do it if another unknown is added?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...