Light Bulb problem number 2 (a bit harder): bulb one of three states: blue red or off

Jomo

Elite Member
Joined
Dec 30, 2014
Messages
4,033
There is a light in another room that can be in one of three states: blue red or off

In your room, you have two buttons numbered 1 and 2 that control the state of the light. The state of light changes according to the diagram below.

Untitled3.jpg


  • If you press button 1, then the light changes to the next state clockwise around the diagram.
  • If you press button 2 while the light is blue or red, the state of the light will not change.
  • If you press button 2 while the light is off the light will change to blue

You want to make sure that the light is off but since the light is in another room, you do not know what state the light is currently in.

What is the shortest sequence of button presses that will guarantee that the light will be off?
 
Last edited:

aaaa

New member
Joined
Jun 29, 2019
Messages
1
There is a light in another room that can be in one of three states: blue red or off

In your room, you have two buttons numbered 1 and 2 that control the state of the light. The state of light changes according to the diagram below.

View attachment 9551


  • If you press button 1, then the light changes to the next state clockwise around the diagram.
  • If you press button 2 while the light is blue or red, the state of the light will not change.
  • If you press button 2 while the light is off the light will change to blue
You want to make sure that the light is off but since the light is in another room, you do not know what state the light is currently in.

What is the shortest sequence of button presses that will guarantee that the light will be off?
dont know
 

Subhotosh Khan

Super Moderator
Staff member
Joined
Jun 18, 2007
Messages
19,081
There is a light in another room that can be in one of three states: blue red or off

In your room, you have two buttons numbered 1 and 2 that control the state of the light. The state of light changes according to the diagram below.

View attachment 9551


  • If you press button 1, then the light changes to the next state clockwise around the diagram.
  • If you press button 2 while the light is blue or red, the state of the light will not change.
  • If you press button 2 while the light is off the light will change to blue
You want to make sure that the light is off but since the light is in another room, you do not know what state the light is currently in.

What is the shortest sequence of button presses that will guarantee that the light will be off?
Can you press 1 and 2 together - and over-load the circuit - and trip the circuit-breaker -- and you are done......
 

Romsek

Full Member
Joined
Nov 16, 2013
Messages
396
The sequence of button pushes (2,1,1,2,1,1) will turn the light off regardless of the initial state.
There is no sequence shorter than 6 elements that will do this.

Thus 6 is the desired answer.

Mathematica is a truly tremendous tool.
 

Romsek

Full Member
Joined
Nov 16, 2013
Messages
396
The sequence of button pushes (2,1,1,2,1,1) will turn the light off regardless of the initial state.
There is no sequence shorter than 6 elements that will do this.
12734
 
Last edited:

JeffM

Elite Member
Joined
Sep 14, 2012
Messages
3,932
In state 0, the bulb may be in b, r, or o state. Pushing button 2 will change o to b, but leave b and r unchanged.

Thus state 1 is either b or r.

Push button 1 twice. If state 1 was b, state 2 is o. If state 1 was r, state 2 is b.

Push button 2. If state 2 was o, state 3 is b. If state 2 was b, state 3 remains b. In other words, state 2 is b.

Push button 1 twice. State 4 is o.

The sequence is 2, 1, 1, 2, 1, 1. So the number of pushes is 6.
 

JeffM

Elite Member
Joined
Sep 14, 2012
Messages
3,932
Upon reflection, I realize that the problem requires a proof that no series of pushes < 6 will guarantee an off state. I am not sure that my answer gives such a guarantee. (Perhaps romsek's does do that; I must admit to not understanding what he is doing.)
 

Jomo

Elite Member
Joined
Dec 30, 2014
Messages
4,033
Not bad, it only took 13 month for my post to be responded to. Should I take this personally?
 
Last edited:

JeffM

Elite Member
Joined
Sep 14, 2012
Messages
3,932
Not bad, it only took 13 month for post to be responded to. Should I take this personally?
Not really. I like puzzles, but I do not necessarily have time to devote to them.
 

Romsek

Full Member
Joined
Nov 16, 2013
Messages
396
Upon reflection, I realize that the problem requires a proof that no series of pushes < 6 will guarantee an off state. I am not sure that my answer gives such a guarantee. (Perhaps romsek's does do that; I must admit to not understanding what he is doing.)
I checked for lengths shorter than 6 in the sheet but did not show that part.

What my sheet does is very simple. It generates all the possible button press sequences of a given length
and applies these to each of the initial conditions. It looks for a control sequence that generates Off
for all 3 initial states.
 

JeffM

Elite Member
Joined
Sep 14, 2012
Messages
3,932
I checked for lengths shorter than 6 in the sheet but did not show that part.

What my sheet does is very simple. It generates all the possible button press sequences of a given length
and applies these to each of the initial conditions. It looks for a control sequence that generates Off
for all 3 initial states.
Well that was the only way I saw to do it. I was doing things without a computer so I was too lazt to try that.
 
Top