Jump to content
BrainDen.com - Brain Teasers
  • 0

Lanterns of Eden.


witzar
 Share

Question

In the Garden of Eden, there is a circular pathway, where the Angel and the Devil enjoy an infinite stroll, walking side by side. There are lanterns placed along the pathway (a finite number of them). Each lantern can be in one of two states: on or off. The Angel, a servant of light, has control over the illuminated lanterns. Whenever they pass such a lantern, the Angel decides whether it remains on or off. Conversely, the Devil, a servant of darkness, has control over the lanterns that are dark, and can change their states as they pass.

To alleviate their boredom, the Angel and the Devil decide to play a game. The Angel's objective is to bring all the lanterns into complete order, winning immediately if either all lanterns are turned on or all lanterns are turned off. To ensure the game eventually concludes, the celestial beings agree that the game ends if the lanterns return to a previously encountered state. In this case, the Devil is declared the winner.

Now, the question is: Who will emerge victorious, and what strategy ensures the win?

Link to comment
Share on other sites

Recommended Posts

  • 1

There's a solution that I find simple and elegant enough to be satisfying

In my explanation, I'm going to think of the lanterns as numbered. The first lantern our celestial beings come to after starting the game will be Lantern 0. The next will be Lantern 1, then L2, L3 and so on. The last lantern can be referred to as LT, with T = Total number of lanterns minus 1. Each time they walk round the lanterns and return to L0 will be referred to as a circuit.

So who wins?

  Reveal hidden contents

So what's the winning stragegy?

  Reveal hidden contents

But how can we prove the strategy will always work for any number of lanterns?

  Reveal hidden contents

I just want to give a big thank you to witzar for posting the problem - I really enjoyed this one!

Link to comment
Share on other sites

  • 0
  Reveal hidden contents

 

Edited by harey
Link to comment
Share on other sites

  • 0
  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

Let's consider how the game might go for some small numbers of lanterns.

 

If there is only one lantern, then the Angel wins immediately, regardless of it's state.

If there are two lanterns, then there are four cases (of initial state of the lanterns):

off, off : The Angel wins immediately.

on, on The Angel wins immediately.

on, off : The Angel switches the first lantern off, and wins immediately after.

off, on : The Devil has a choice what to do with the first lantern. If the Devil switches it on, then he loses immediately after. If the Devil leaves it off, then the Angel switches the second lantern off, and wins immediately after.

 

 

Edited by witzar
Link to comment
Share on other sites

  • 0
  On 2/8/2024 at 3:22 AM, witzar said:

Please note the Angel has two ways od winning:

1. Turn all lanterns on.

2. Turn all lanterns off.

Expand  

Since the Angel cannot turn ON a lantern that is currently OFF (only the Devil can do that), as long as there is at least one lantern in the OFF state from the beginning, the Angle cannot win by having all lanterns ON. This would require the Devil to turn ON the final lantern that will deliver the win to the Angel. Assuming the Devil wants to win, this will never happen, so the only way the Angel can win in practice is when all the lanterns are OFF. 

 

  On 2/8/2024 at 3:43 AM, witzar said:

Let's consider how the game might go for some small numbers of lanterns.

 

If there is only one lantern, then the Angel wins immediately, regardless of it's state.

If there are two lanterns, then there are four cases (of initial state of the lanterns):

off, off : The Angel wins immediately.

on, on The Angel wins immediately.

on, off : The Angel switches the first lantern off, and wins immediately after.

off, on : The Devil has a choice what to do with the first lantern. If the Devil switches it on, then he loses immediately after. If the Devil leaves it off, then the Angel switches the second lantern off, and wins immediately after.

 

 

Expand  

These are some trivial and uninteresting examples and I'm not sure how they help.

Link to comment
Share on other sites

  • 0
  On 2/8/2024 at 4:42 AM, k-man said:

These are some trivial and uninteresting examples and I'm not sure how they help.

Expand  

These trivial examples show that for small values of N (the numbers of lanterns) the Angel wins.

You seem to be claiming that that the Devil wins for larger values of N, and that all it takes is two OFF lanterns that are not adjacent.

So lets analyze the case of three lanterns that are initially OFF, ON, OFF.

If the Devil does not switch the 1st lantern ON, then the Angel switches the 2nd lantern OFF, winning immediately after.

If the Devil switches the 1st lantern ON, the the Angel does not switch the 2nd lantern, and the Devil cannot switch the 3rd lantern as this would lose immediately.

So after the first "pass" the lanterns are in state ON, ON, OFF, and from here the Angel wins by flipping the first two lanterns.

But maybe this case is also "trivial and uninteresting", but then what is the smallest N where the Devil can actually win, and what is the initial state?

Link to comment
Share on other sites

  • 0

Edit: Oops.  I guess switch to 1 meaning off and 0 meaning on to match the story.

Who wins?

  Reveal hidden contents

Ugly Strategy with not much intuition as to how/why it works.  (Obviously, I don't consider this as the answer...)

  Reveal hidden contents

Yay code

  Reveal hidden contents

Code output for 4 lanterns

  Reveal hidden contents

5 lanterns

  Reveal hidden contents

6 lanterns

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

On the "ugly strategy"

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

sorted configurations with 6 lanterns (and added devil best choices I omitted before)

  Reveal hidden contents

5 lanterns

  Reveal hidden contents

4 lanterns

  Reveal hidden contents

3 lanterns

  Reveal hidden contents

Edit: Another thing of note.  The devil and angel both choose between the same 2 options once each (except the choice between 000...00 and 000...01 for angel and 111...10 and 111...11 for devil, due to angel win conditions).

Link to comment
Share on other sites

  • 0

recreating the results of the code...

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0
  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

I couldn't follow that, harey.

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

@EventHorizonMy post is unrelated to yours.

The number of lamps is not important, just a little bit more that those I quote.

"Let's start with one lantern lit, i.e. 33.":

This is not a binary number, it is the 33rd lantern assuming the starting position is the 1st lantern (conveniently chosen), following the lantern 32 and followed by the lantern 34.

Link to comment
Share on other sites

  • 0

First, let's nail down the definition of configuration so we know exactly when the devil wins.

It cannot simply be the state of the lanterns, since not changing a lantern on a given step would then repeat the configuration.

So the location of the devil and angel need to be part of it.  There are two ways I see of incorporating this.

  1. Include which lantern number the devil and angel are at and the string of lantern states.  Which could be notated by a location marked in a string of lantern states (e.g., "01101;001") or a number and the string (6,01101001).
  2. The lantern numbers don't matter, just look forward from the lantern the angel and devil are at (e.g., ";00101101").  And then you don't need the location marker ";" because it is always at the front.

Option 1 has more states, lanterns x 2^lanterns compared to just 2^lanterns.  Let's choose option 2 since less states means more of a chance of repeat and gives the devil a better chance.  That is the notation I used for my code.

  On 1/28/2024 at 11:35 PM, harey said:

I assume that if they make a turn without changing the state of any lantern. a "previously encountered state" occurs (otherwise, they could walk around endlessly).

Expand  

I notice that you use the word "turn" to sometimes mean one whole stroll around all the lanterns.  That is something that threw me off a little.  I'd call that a revolution or a full rotation.

Alright, time to put the devil in his place.

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

Here's an example from my code's 6 lantern output:

111110 <one lit lantern (interpret 0 as "on" and 1 as "off")
111101 <one lit lantern

You suppose the devil turns the lantern 5 on. But what if he turns the lantern 4 and not 5 on?

111110 <one lit lantern (interpret 0 as "on" and 1 as "off")
111010 your turn

 

P.S. I am not touchy (did not even think it could be interpreted this way), but I think things over. In the last time, I wrote a lot of nonsense, i.e. my first answer.

Link to comment
Share on other sites

  • 0
  On 2/26/2024 at 11:07 PM, harey said:

P.S. I am not touchy (did not even think it could be interpreted this way), but I think things over. In the last time, I wrote a lot of nonsense, i.e. my first answer.

Expand  

Good.  Yeah, I overthink everything and can get rather paranoid.

  On 2/26/2024 at 11:07 PM, harey said:

You suppose the devil turns the lantern 5 on. But what if he turns the lantern 4 and not 5 on?

111110 <one lit lantern (interpret 0 as "on" and 1 as "off")
111010 your turn

Expand  
  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0
  On 3/6/2024 at 10:44 PM, phil1882 said:

actually this seems pretty straight forward to me, the angel simply turns off all lit lanterns and wins.

Expand  
  Reveal hidden contents

 

Link to comment
Share on other sites

  • 0

I had this solution in mind, unfortunately, it fails because of repeated situations.

Starting situation: 6 lanterns, only lantern 6 is lit.

First round:
lantern 1: no action
lantern 2: devil turns it on
remaining lanterns: angel does not do anything (If the devil turns a lantern on before the angel has turned any off, then the angel should just do nothing on that circuit. )

Situation: Lanterns 2 and 6 are lit

2nd round:
lantern 1: no action
lantern 2: angel turns it off (on each circuit, turn off all lit lanterns until the devil turns an unlit lantern on)

Now, only the lantern 6 is lit: the game ends if the lanterns return to a previously encountered state

What am I missing?

Link to comment
Share on other sites

  • 0
  On 3/24/2024 at 2:40 PM, witzar said:

 My intention was to define repetition (Devil's win) as a repeated state of the lanterns and a repeated position of Devil and Angel, but looks like I failed to do it properly. My apologies.

Expand  

 

  Reveal hidden contents
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.

 Share

  • Recently Browsing   0 members

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