
HARD PUZZLE: 100 Switches & 100 Lights Puzzle
video description
But assuming you're not willing to do that I have an optimal solution, if you run the -warm- test only on the first switching then stop, because an -on- in any previous test means it'll always test warm, then do only on/off from there, you can test 96 in 6 trips.
But this method leaves 5 switches that never get flipped, the one code: 000000 and the four not assigned combinations so if instead we take one of the four unassigned switches and flip them for a warm test on bits 2-6 when we enter the room and check only the bulbs labeled with only 0's and find the one that's warm, we will have uniquely identified which unassigned switch goes to which bulb, we can find the remaining 4, actually 5 that way bringing our total to 101 in 6 trips
I know you can get a lot more optimal with the number of lightbulbs than this and I challenge the logic master to find out just how many. you can incorporate a w/2 combination into your 6 bit system only if that 2 is the first non-zero bit. How many combinations are possible? Can we get it down to 5 entries?
Date: 2023-11-15
Comments and reviews: 29
Michael
At the beginning he says, -There is nothing related to HITTING of a light. - Perhaps what he said was -heating-. If we assume that, no, he meant something else, you could break the switches into three groups instead of two; one group we turn off, the second we turn on for a few minutes and then turn off, the third we turn on. Then we enter the room, we can distinguish the second group from the first by checking which is still warm from being turned on. In this fashion, we can categorize all 100 lights in 5 steps instead of 7.
reply
At the beginning he says, -There is nothing related to HITTING of a light. - Perhaps what he said was -heating-. If we assume that, no, he meant something else, you could break the switches into three groups instead of two; one group we turn off, the second we turn on for a few minutes and then turn off, the third we turn on. Then we enter the room, we can distinguish the second group from the first by checking which is still warm from being turned on. In this fashion, we can categorize all 100 lights in 5 steps instead of 7.
reply
Ryad
7 trips.
Paused at 29 seconds. As soon as I saw this i remebered the 3 lights puzzle lets see it is is similar then i will explain the 3 light puzzle. at 1 minute im thinking you could do things by halves. 50 on 50 off mark as set 1 25 on 25 off set 2 (now 4 sets of 25. 3 trips) oh wait, can we remeber which were on and off? Do can we take photos? 50 on 50 off set 1 25 on from those that were off and 25 off from those that were on 2 trips 4 sets. Repeat 8 sets 3 trips. repeat. 16 sets 4 trips 32 - 5, 64 - 6. 7 trips boss.
reply
7 trips.
Paused at 29 seconds. As soon as I saw this i remebered the 3 lights puzzle lets see it is is similar then i will explain the 3 light puzzle. at 1 minute im thinking you could do things by halves. 50 on 50 off mark as set 1 25 on 25 off set 2 (now 4 sets of 25. 3 trips) oh wait, can we remeber which were on and off? Do can we take photos? 50 on 50 off set 1 25 on from those that were off and 25 off from those that were on 2 trips 4 sets. Repeat 8 sets 3 trips. repeat. 16 sets 4 trips 32 - 5, 64 - 6. 7 trips boss.
reply
Christian
Here is another variant:
A landline company has laid down 500 pairs (1000 copper wires, alas they forgot to label them so they can't connect their clients.
All you have is a line tester (an instrument that can tell you if a copper cable is broken.
Find a way to label each cable uniquely at the two locations while minimizing the number of trips. What is the minimal number of trips?
Hint: It's way smaller than one may think!
reply
Here is another variant:
A landline company has laid down 500 pairs (1000 copper wires, alas they forgot to label them so they can't connect their clients.
All you have is a line tester (an instrument that can tell you if a copper cable is broken.
Find a way to label each cable uniquely at the two locations while minimizing the number of trips. What is the minimal number of trips?
Hint: It's way smaller than one may think!
reply
Bernhard
Hello, nice try. But you can reduce the steps eventuaally? What if- what if you do add another check? Instead of just switching on/off you also could turn 1/3 on for a minute, so some lamps will heat on. Then switch off 1/3 enter the room and check the warm lamps! If some lamps are still warm, you know that those are part of the group 3. How much steps are now required? Give it a try and maybe another video solution. :-) Yoirs-Bernhard
reply
Hello, nice try. But you can reduce the steps eventuaally? What if- what if you do add another check? Instead of just switching on/off you also could turn 1/3 on for a minute, so some lamps will heat on. Then switch off 1/3 enter the room and check the warm lamps! If some lamps are still warm, you know that those are part of the group 3. How much steps are now required? Give it a try and maybe another video solution. :-) Yoirs-Bernhard
reply
Abbey
I think there is an optimization being ignored in the puzzle. When a light is on, it emits heat. Why not turn on one half of the switches, STAY IN THE ROOM FOR 30 MINUTES, then turn off half of the switches that are turned on, run to the other room, and then touch and mark all of the lights that feel warm. So instead of using a binary tree of value, you can effectively create a trinary tree instead and make less trips.
reply
I think there is an optimization being ignored in the puzzle. When a light is on, it emits heat. Why not turn on one half of the switches, STAY IN THE ROOM FOR 30 MINUTES, then turn off half of the switches that are turned on, run to the other room, and then touch and mark all of the lights that feel warm. So instead of using a binary tree of value, you can effectively create a trinary tree instead and make less trips.
reply
merantau22
How about using triary number:
1. Divide the switches into 3 groups (let say group 0, 1, and 2)
2. Switch on the group 2
3. After some time, switch on the group 1
4. F-CKIN QUICKLY go the the room
5. Now each of the lights has one off these states: off (group 0, only on (group 1, and on+warm (group 2. Mark each light based on its state
you will need less trip. only 5 trips to map the 100 lights
reply
How about using triary number:
1. Divide the switches into 3 groups (let say group 0, 1, and 2)
2. Switch on the group 2
3. After some time, switch on the group 1
4. F-CKIN QUICKLY go the the room
5. Now each of the lights has one off these states: off (group 0, only on (group 1, and on+warm (group 2. Mark each light based on its state
you will need less trip. only 5 trips to map the 100 lights
reply
Augustin
You can do better
You can do only 5 trips
You let 33 switches off
You turn 33 switches on for a pretty long time then you switch them off
Finally you switch the 34 last on
You get in the room
If the light is off and cold write 0
If the light is off and hot write 1
If the light is on write 2
By repeating this process you get only 5 trips
Qed
reply
You can do better
You can do only 5 trips
You let 33 switches off
You turn 33 switches on for a pretty long time then you switch them off
Finally you switch the 34 last on
You get in the room
If the light is off and cold write 0
If the light is off and hot write 1
If the light is on write 2
By repeating this process you get only 5 trips
Qed
reply
cglacet
The question is not answered yet, you basically just proved that 2-7 > 100, you used that to show that you could solve the problem with at most 7 moves. But your question asked for the minimum number of moves, so you still need to prove that you can't solve the problem with 6 moves or less (hint, proving that 2-6 < 100 will not suffice to complete the proof.
reply
The question is not answered yet, you basically just proved that 2-7 > 100, you used that to show that you could solve the problem with at most 7 moves. But your question asked for the minimum number of moves, so you still need to prove that you can't solve the problem with 6 moves or less (hint, proving that 2-6 < 100 will not suffice to complete the proof.
reply
Swaggles
My initial thought was to set up a recursive function similar to merge sort, just didn't understand how. Marking their state which gives them a unique identifier is great. In code this would be a strong, and on every trip you += the string with the binary value. Then just check the string values to return on base case
reply
My initial thought was to set up a recursive function similar to merge sort, just didn't understand how. Marking their state which gives them a unique identifier is great. In code this would be a strong, and on every trip you += the string with the binary value. Then just check the string values to return on base case
reply
Wyatt
Here's an outside-the-box solution for n=3: First, flip one switch. After maybe 5 minutes (at least long enough to let the bulb heat up) switch it off and another on. Now go in: there's one that's on (our switch 2) and between the two others, feel one. If it's still warm, it's switch 1, and otherwise switch 3.
reply
Here's an outside-the-box solution for n=3: First, flip one switch. After maybe 5 minutes (at least long enough to let the bulb heat up) switch it off and another on. Now go in: there's one that's on (our switch 2) and between the two others, feel one. If it's still warm, it's switch 1, and otherwise switch 3.
reply
Dominik
If the lights are classic light bulbs (not led) you can simplify further by using the fact that bulbs produce heat. So switch on 2/3 wait 5 minutes and change half of these to off before walking in. Then you have three stages on, off (but warm) and off (cold. This should reduce the number of walk ins further.
reply
If the lights are classic light bulbs (not led) you can simplify further by using the fact that bulbs produce heat. So switch on 2/3 wait 5 minutes and change half of these to off before walking in. Then you have three stages on, off (but warm) and off (cold. This should reduce the number of walk ins further.
reply
Bart
Smart, just 100 in base 2(binary) takes up 7 digits(to get unique values.
Even more fun if the lightbulbs give you 3 states. The classic solution of bulbs that heat up. You turn on the light, turn it off again and go feel if the bulb is warm(gotta be quick though.
This would require only 5 trips.
reply
Smart, just 100 in base 2(binary) takes up 7 digits(to get unique values.
Even more fun if the lightbulbs give you 3 states. The classic solution of bulbs that heat up. You turn on the light, turn it off again and go feel if the bulb is warm(gotta be quick though.
This would require only 5 trips.
reply
Alex
Depending on how well the bulbs retain heat you can do slightly better. 5 moves. For each step: Turn a third of them on, wait until they heat up, turn them off and them turn another third on. Go inside and quickly test which off lights are still hot. That should give log3(100) or 4. 19. moves
reply
Depending on how well the bulbs retain heat you can do slightly better. 5 moves. For each step: Turn a third of them on, wait until they heat up, turn them off and them turn another third on. Go inside and quickly test which off lights are still hot. That should give log3(100) or 4. 19. moves
reply
Martin
It always amazing how people need to make a over complicated situation. You will never run into this problem in a real world problem. thus, it is useless. For example this problem doesn't prohibit equipment being used in the experiment, thus the actual answer is 1.
reply
It always amazing how people need to make a over complicated situation. You will never run into this problem in a real world problem. thus, it is useless. For example this problem doesn't prohibit equipment being used in the experiment, thus the actual answer is 1.
reply
amitava
you're thinking the bulb has 2 states on and off so the lowest trips is log 100 base 2, which is over 6. 64 so 7 trips, but bulbs heat up too! so if u count a heating state, this can be done in log 100 base 3 so in just 5 trips.
reply
you're thinking the bulb has 2 states on and off so the lowest trips is log 100 base 2, which is over 6. 64 so 7 trips, but bulbs heat up too! so if u count a heating state, this can be done in log 100 base 3 so in just 5 trips.
reply
pimpinjc
Wrong! The right answer is 8 times. If you have at least one non-functioning bulb, your strategy falls apart. Therefore, the first trip is to flip all switches on and enter the room to confirm each light is lit.
reply
Wrong! The right answer is 8 times. If you have at least one non-functioning bulb, your strategy falls apart. Therefore, the first trip is to flip all switches on and enter the room to confirm each light is lit.
reply
Manoj
Now that we understand the logic. If we want to write a program for it. It can be done by dividing the number of switches by 2 power n, until the value is 1 or less than 1. Least value of n will be the answer
reply
Now that we understand the logic. If we want to write a program for it. It can be done by dividing the number of switches by 2 power n, until the value is 1 or less than 1. Least value of n will be the answer
reply
Alpha
two trips: I will take one video turning on all switches and I will take another video in the room while turning lights on outside the room and then go into the room with that video. You get the point.
reply
two trips: I will take one video turning on all switches and I will take another video in the room while turning lights on outside the room and then go into the room with that video. You get the point.
reply
Whole
I did this in a few seconds:
import math
print(math. ceil(math. log2(100)
# > 7
That's because I was already in front of my PC. You could also think 2-6 = 64 < 100 < 2-7 = 128 therefore 7.
reply
I did this in a few seconds:
import math
print(math. ceil(math. log2(100)
# > 7
That's because I was already in front of my PC. You could also think 2-6 = 64 < 100 < 2-7 = 128 therefore 7.
reply
data
What if I tell you you can do it 5 rounds? Simple lighted bulbs become hot when lighted for abperiod of time. After switching off just check which one is hot. Rather than two categories we will have 3.
reply
What if I tell you you can do it 5 rounds? Simple lighted bulbs become hot when lighted for abperiod of time. After switching off just check which one is hot. Rather than two categories we will have 3.
reply
Adrian
Could do it in 5 trips: just combine with another famous puzzle of 3 switch 3 bulb: each trip you can distinguish 3 states: on, off-but-warm, and off. 5 trips could give you 243 distinct values.
reply
Could do it in 5 trips: just combine with another famous puzzle of 3 switch 3 bulb: each trip you can distinguish 3 states: on, off-but-warm, and off. 5 trips could give you 243 distinct values.
reply
Merigold
Pragmatic real life solution: You need two persons. One is in the room and the other operates the switchboard. (The apprentice goes into that room and the master operates the switchboard)
reply
Pragmatic real life solution: You need two persons. One is in the room and the other operates the switchboard. (The apprentice goes into that room and the master operates the switchboard)
reply
Rajeesh
Name first Switch
0000001 - L1
0000010 - L2
0000011 - L3
.
.
. - L100
There is 7 columns. On/Off each column one time and mark light.
Power of Binary Numbers -
reply
Name first Switch
0000001 - L1
0000010 - L2
0000011 - L3
.
.
. - L100
There is 7 columns. On/Off each column one time and mark light.
Power of Binary Numbers -
reply
Pedro
This is really incredible. I would probably never think of this binary mapping, but at least I instantly noticed that 7 is the first power of 2 that is higher than 100 (2-7=128)
reply
This is really incredible. I would probably never think of this binary mapping, but at least I instantly noticed that 7 is the first power of 2 that is higher than 100 (2-7=128)
reply
Aaron
what if we consider the heat generated by the lights into this problem, then we can have on state, off state, and off state with heat. that would make it 5 trips to the room.
reply
what if we consider the heat generated by the lights into this problem, then we can have on state, off state, and off state with heat. that would make it 5 trips to the room.
reply
Dominik
By your method you should be able to distinguish A maximum of 2-7=128 lights. By mine 5 walkins are enough as 3-5 (which is 243 ) is larger than 100.
reply
By your method you should be able to distinguish A maximum of 2-7=128 lights. By mine 5 walkins are enough as 3-5 (which is 243 ) is larger than 100.
reply
Dimitris
By playing with the temperature you can do it even with 4 trips! Even if was 256 lighting.
Open cold open hot close cold close hot
reply
By playing with the temperature you can do it even with 4 trips! Even if was 256 lighting.
Open cold open hot close cold close hot
reply
$ky
We can also mention all the bulbs with numbers on glass and when we switch on it will gives light with that we can mention the switches na.
reply
We can also mention all the bulbs with numbers on glass and when we switch on it will gives light with that we can mention the switches na.
reply
Amri
Think logically? I like to lazy simple think. just call 1 person to enter room, and we check 1 by 1. So the answer just 1/2 trip I think.
reply
Think logically? I like to lazy simple think. just call 1 person to enter room, and we check 1 by 1. So the answer just 1/2 trip I think.
reply
Add a review, comment
Other channel videos















