HARD PUZZLE : 100 Switches & 100 Lights Puzzle

  Рет қаралды 133,645

LOGICALLY YOURS

LOGICALLY YOURS

3 жыл бұрын

This Brilliant Riddle would test your brain power.
There are 100 lights in a huge room. A switch panel outside the room has 100 switches each corresponding to one light in the room.
But none of the switches or lights are labelled, so it's extremely difficult to identify which switch turns on which light.
You are standing outside of the room... and your task is to map each switch to its corresponding light using a marker pen.
You have to do this mapping in minimum number of trips to the room.
Initially, all the switches are turned off.
What's the minimum number of times you need to enter the room to complete the mapping of each switch to its corresponding light.
Please note a few points:
(To check the state of a light, you must enter the room, you cannot check it from outside.)
(There is nothing related to heating of a light... everything here is perfectly logical)
So.
Pause the video..... and think logically.
and here is a hint for you.
(Hint : Surprisingly, the answer is a smaller number)
This video explains this puzzle the best way. You will certainly learn the optimal way and the best approach of solving difficult puzzles.
Of course it's a difficult riddle, but I encourage you to take your own time and try to solve this challenging riddle.
Also try these mind blowing puzzles:
100 Doors Puzzle || Hard puzzle for Genius minds
• 100 Doors Puzzle || Ha...
Which Tank Will Fill Up First? || Solution || VIRAL PUZZLE
• Which Tank Will Fill U...
Can you solve the Tricky Puzzle || The Clever Commuter || Logical Puzzle
• Can you solve the Tric...
You can follow my facebook page of Logically Yours( Mohammed Ammar ):
/ mohammmedammar

Пікірлер: 314
@AkshayKumar-fc9zs
@AkshayKumar-fc9zs 3 жыл бұрын
I cracked campus interview 2 years back using your questions. Thanks for uploading.
@pedrosil77
@pedrosil77 3 жыл бұрын
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)
@bm-ub6zc
@bm-ub6zc 2 жыл бұрын
mee too
@syocaw
@syocaw 2 жыл бұрын
haha same here. I instantly paused the video and figured out the rest
@vladx3539
@vladx3539 Жыл бұрын
sure you did
@helaluddin-bo9kr
@helaluddin-bo9kr 4 ай бұрын
same here
@alexortiz9777
@alexortiz9777 3 жыл бұрын
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
@fangbeer
@fangbeer 3 жыл бұрын
Was about to post a similar base 3 approach
@charlesreed5839
@charlesreed5839 3 жыл бұрын
First move- fire the electrician.
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
😀
@bharathram7245
@bharathram7245 8 ай бұрын
Epic one 😂😂
@andrewchallen5008
@andrewchallen5008 3 жыл бұрын
Same solution really but start by labelling all the switches 1-100 in binary. Turn them all on according to the first digit of the label. Go in room and write 0 next to the off ones and 1 with light on. Repeat for all 7 digits, and on the final trip write the 100 digits on in decimal. Make a note which ones are on so you can turn them off before you go home.
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Yup! Perfect. I have put a slide of this approach at 6:01
@andrewchallen5008
@andrewchallen5008 3 жыл бұрын
It occurred to me that I wouldn't need to take a note of the numbers to turn them off, it's just the ones that are "on". Also if done as described there the last round would be all the even numbers. But... What if the switches were not labelled on/off, and some of the lights are already on? I have an upper limit for the number of times I'd have to enter the room but I'm not sure if there's a way to get the number down?
@stephenJpollei
@stephenJpollei 3 жыл бұрын
I'm surprised that you wouldn't label them 0 to 99 . More generally you can label the switches with any numbers between 0 and 127 as long as each label is unique. You can skip numbers or put them in any order.
@agytjax
@agytjax 6 ай бұрын
Instead of this dividing and sub-dividing and ensuring that the switches have achieved "unique values", another simpler way to understand the solution : The no. of trips is CEIL(log2 (100)) = 7 Mark all the switches as 1 thru 100 1. In the first trip, switch ON only those switches that leaves a remainder of zero when divided by 2^1 (2) On the bulbs, mark as 0, if it does not glow and as 1, if it glows 2. In the 2nd trip, switch ON only those switches that leaves a remainder of zero when divided by 2^2 (4) On the bulbs, mark as 0, if it does not glow and as 1, if it glows beside the earlier marking from left to right. For e.g 10 or 11 or 01 or 00 3. In the 3rd trip, switch ON only those switches that leaves a remainder of zero when divided by 2^3 (8) On the bulbs, mark as 0, if it does not glow and as 1, if it glows beside the earlier marking from left to right. For e.g 110 or 111 or 101 or 100 Do this for 7 Iterations. On each of the bulbs, convert the binary numbers that you have written down (like 0000011) to its decimal equivalent and add plus 1. That would give the corresponding switch number !
@manojmathai4497
@manojmathai4497 3 жыл бұрын
Really love your videos. Would really appreciate if you increase the frequency of your videos to at least once a week. Great content. Keep up the good work. Regards
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Many thanks Manoj, and trust me I am really sorry for the delay... but you won't have any delays from now on :)
@rafaelliman8167
@rafaelliman8167 3 жыл бұрын
I thought we would "touch the lights to see if they're still hot" Y'know, when you just turn the lights on & touch it, it's still cold. Wait for a few moments until it turns hot. Then when you turn it off, it's still hot. But then I watched your already brilliant solution. After even more thinking, I realize I could COMBINE it with that thought I just wrote. How about that? To explain it further, there are FOUR states: Hot/On, Hot/Off, Cold/On, Cold/Off. So divide the switches to FOUR groups. Turn the Hot/On & Hot/Off groups on, and wait for a few moments. Then turn the Hot/Off group off, turn the Cold/On group on, & immediately enter. Touch the either on/off lights to know if they're hot/cold & label them with values according to the right state. Again, there are FOUR states, so there are FOUR labels/values, for example A (Hot/On), B (Hot/Off), C (Cold/On), D (Cold/Off). Then for every group that have the same value, divide them to 4 groups again & do the same thing. (Reset all the lights to off firsthand & wait till they're cold for a clean slate.) Then put the next right label to each of the lights (in perspective, the switches & lights will have values like AA, AB, BB, BD, CA, CD, BA, DC, etc). Repeat until all lights have unique values (like you said). So the system used isn't binary, but QUATERNARY. This way, ONLY FOUR TRIPS are required (because 4^3=64100).
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Hi Rafi.... I truly appreciate that you performed this calculation combining the two logics. It was so clean and easy to understand..... Kudos !! Since I had already uploaded a video based on heating concept... I too thought of combining the two logics. However, for this video, I thought of keeping it an individual logic, so I mentioned right in the beginning that 'there is nothing related to heating of a light'. But now after reading your explanation... I must prepare a dedicated video where we can have just 32 BULBS (to make it more easy to understand for the viewers) and combine the two logics.
@rafaelliman8167
@rafaelliman8167 3 жыл бұрын
@@LOGICALLYYOURS oh yeah....... i checked the video again....... yeah you clearly said "nothing related to heating of a light"........ i didn't pay attention at first 'cos earlier it sounded a bit incomprehensible......... so i didn't know, then i immediately thought, "is this related to that puzzle where you touch the lights?", without realizing that you said it doesn't count. Oh well, guess my answer is if it does. Still it's a brilliant puzzle.
@vangildermichael1767
@vangildermichael1767 3 жыл бұрын
@@LOGICALLYYOURS I thought of your approach, (like that puzzle with 3 lights). But the (temperature) variable, leaves to much room for me to err. I can't tell what is hot or not. For most people Your (log base (4) works well). As I got older I lost my sense of warm, cold, hungry, not hungry, or even tired. The (warm, not warm) would leave (way) to much room for error. For my shitty perception. BUT, technically your 4^4=256 would work better.
@mohamedhusam8189
@mohamedhusam8189 3 жыл бұрын
If we allowed this I can also say that I have I thermometer which calculates the temperatures very precisely then I can find it in one step
@rafaelliman8167
@rafaelliman8167 3 жыл бұрын
@@vangildermichael1767 I have a feeling you're actually trying to reply to ME?
@kuga5197
@kuga5197 3 жыл бұрын
I love your videos, and I was waiting for the new videos for so long. I hope you can make it faster.Keep up the great work, sir.
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Thanks a lot bro :) I am now working hard to upload frequently. By the way, a very fresh, very easy yet a trickiest riddle is on its way. Will be published on Sunday.
@saadkhondoker1921
@saadkhondoker1921 3 жыл бұрын
It's easy if you can find a trick. There are 2 conditions. On and off. [Let n = 100.] If we write (100-1) = 99 in 2 digit number system we get 1100011 which is a 7 digit number. So every switch of the board can be labeled with different numbers using 7 digit numbers of binary (if n had been a power of 2 then we would assign n equal to 0). Now first we assign numbers to the switch. Then every time before we go to check, we turn all the lights on which has 1st digit 1. Then we go to check. We write 1 under the switched on lights and 0 under the off. We continue this process for 7 times. Viola! We have marked all the switches and bulbs with the same marking in binary. In short we use log 100 base 2 and we round the number to the next one if there is decimal. Log 100 base 2 is 6.64 so we make it 7. If there were a third condition possible (like on or off) then the answer would be log 100 base 3 rounded up to the next number.
@RipETe18CoDbO69
@RipETe18CoDbO69 3 жыл бұрын
There can be a third condition. You can turn on X lights for a while, and then turn them OFF and turn on X lights. You will have, in this concrete case, 33 lights on, 34 lights off, and 33 hot bulbs. You can do it in 5 trips at the end.
@anubhavajmera8017
@anubhavajmera8017 3 жыл бұрын
The moment you say 7 trips ,I got that how you get the answer
@kartikpanjabi6801
@kartikpanjabi6801 3 жыл бұрын
Me too, bro 😅
@cricketcoachingforchildren4446
@cricketcoachingforchildren4446 3 жыл бұрын
Explanation is superb. I came across this some time back. Very interesting puzzle. Please Upload the chess puzzle as soon as possible.
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Thank you sir... I will certainly work on the chess miniature.
@orrbezalely3332
@orrbezalely3332 3 жыл бұрын
Its really nice to see how after seeing many problems of this type you start to answer them instinctively. For example this question I instantly thought about binary and that 100 different numbers can be represented with 7 bits in binary. Thanks a lot for the questions!
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
You are absolutely right. When we see that we have to store a greater amount of information in a smaller space, BINARY is the fist keyword that comes to mind.
@disguisedhell
@disguisedhell 3 жыл бұрын
I knew that it was 7 as 2^6 is largest power of 2 less than 100 and therefore we would need at least 7 bits including 2^0. The involvement of binary can be known instantly as each switch can be on or off indicating assigning 0 or 1.
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Perfect!
@Simple_Simon_UK
@Simple_Simon_UK 3 жыл бұрын
Surprisingly, I saw the answer. Might have something to do with the fact I wrote Assembly code for years and like the binary chop!
@arnabdasgupta5695
@arnabdasgupta5695 3 жыл бұрын
Love all your videos.They are all excellent but this one blew my mind
@akhils5055
@akhils5055 3 жыл бұрын
Loved this approach
@tonyhedgewolf
@tonyhedgewolf 3 жыл бұрын
Fantastic, thank you 😀
@wyattstevens8574
@wyattstevens8574 8 ай бұрын
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.
@arquamkhan2362
@arquamkhan2362 3 жыл бұрын
It's just amazing 💥💥
@chapmanchapman3994
@chapmanchapman3994 3 жыл бұрын
We can use 3 state to reduce the trip. Turn on the light a while and off it. Then we have: 1. the light is on; 2.the light is off with heat; 3.the light is off but cold. 3^5 > 100. Therefore, only 5 trip.
@Raju_Sharma852
@Raju_Sharma852 3 жыл бұрын
Yes then you need to by a stair and have to touch all the light before they would get cool.
@manusarda
@manusarda 3 жыл бұрын
Puzzle already stated in begining that it has nothing to do with heating of light
@tombratcher6938
@tombratcher6938 3 жыл бұрын
"You cant use the heating of the light". Someone used base 3, huh
@richardbloemenkamp8532
@richardbloemenkamp8532 3 жыл бұрын
That is true. There is another logic puzzle, where you turn on one switch for some time and then turn it off and then go into the room to check which light is warm. 3^5 is 243, therefore entering the room 5 times should be enough. Before entering the first time you turn on 1:67 for a few minutes and then turn off 34:67 and then enter the room. Each light gets a 0 (on) a 1 (off warm) or a 2 (off cold). Next time you turn on 1:20 and 34:54 and 67:87 and then after 5 min you turn of 11:20 and 44:54 and 77:87. You enter the room and give each light the second ternary digit: 0 (on) a 1 (off warm) or a 2 (off cold). etc.
@sylwestersmal1524
@sylwestersmal1524 3 жыл бұрын
It depends on assumption that bulbs are warm long enough to check 100 of them. if you make assumption that also warming up takes enough time to check 100 - then you can add another state (on warm) and makem it 4^4. :)
@martink.7497
@martink.7497 3 жыл бұрын
Just do it all in 2 runs - turn all of them on and then one by one turn them off. The hottest is the last and otherwise (the coldest = first). Second run just to make sure.
@anothercommonman4177
@anothercommonman4177 3 жыл бұрын
Marvelous trick bro. Love It. A lot of thanks
@prasaddamale5984
@prasaddamale5984 3 жыл бұрын
I started with minimum number of switches, like from 1 and tried counting the minimum number of trips upto 10 switches. After analysing the pattern as if you have 1 or 2 switches you require minimum 1 trip, if you have 3 to 4 switches you require 2 trips, if you have 5 to 8 switches, you require minimum 3 trips and then I just tried once for 10 switches and I was sure about the minimum number of trips should come equal to 4. So, by finding minimum number of trips for 1 to 10 switches, I predicted the formula and got the answer. I liked your explanation a lot. Thank you for giving so much of food for thought. All the best😀 keep posting such good puzzles. Thanx a lot.😀
@argsahoo
@argsahoo 3 жыл бұрын
What if we do it like this: minimum no. of trips = ceil(log(n)) [where, n is the total number of switches] If we take the ceiling value of log(n) it should give us the ans. I took a few test examples and it worked. With this the time complexity will reduce to O(1). Please correct me if I am wrong.
@orrbezalely3332
@orrbezalely3332 3 жыл бұрын
That is right. Just make sure its base 2 not 10 xD.
@argsahoo
@argsahoo 3 жыл бұрын
@@orrbezalely3332 yupp
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Yup!! that looks good... As Orr mentioned, it base 2 :) I have mentioned it in terms of powers of 2 at 6:01 .
@vikassinghpatel989
@vikassinghpatel989 3 жыл бұрын
But time complexity will be O(logn)
@orrbezalely3332
@orrbezalely3332 3 жыл бұрын
@@vikassinghpatel989 Yeah as O(log n)=O(log2 n). They only differ by a constant
@spencerkeene6493
@spencerkeene6493 3 жыл бұрын
This would probably be the fastest method but assuming we aren’t looking for speed and purely are looking for fewest trips you could solve this in less than 7 trips. Assuming the lights also produce heat, you can turn 1/3 on to let them heat up then turn them off and turn a different 1/3 on before you walk in. Then instead of splitting the lights up into 2 groups (on/off) you split them into 3 groups (on/off and cool/off and hot). This allows you to map them all in 5 moves. Assuming you can check all the lights temperature fairly quickly, you can additionally break them down into 4 groups by turning on 1/2 the lights to let them warm up then then turn off 1/2 of those lights and turn on 1/2 of the lights already off before you walk in. This splits the lights into 4 groups (on and cool or slightly warm/on and hot/off and hot/off and cool). This allows you to map all the lights in only 4 trips.
@sratnatozmrde
@sratnatozmrde 3 жыл бұрын
0:49 just listen
@jaiadheedhan
@jaiadheedhan 3 жыл бұрын
It's a amazing puzzle. Initially I thought it might take more number of trips. Later I solved with more brain efforts. Thanks for the brain challenge.
@BharatAcharyaEducation
@BharatAcharyaEducation 3 жыл бұрын
Brilliant 🤩
@abdulwaquar5255
@abdulwaquar5255 3 жыл бұрын
On seeing the hint, I was able to solve the puzzle in two min. Thanks for this great puzzle❤️
@swagglesmcgee7357
@swagglesmcgee7357 Жыл бұрын
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
@judesalles
@judesalles 3 жыл бұрын
What a neat puzzle. Excellent explanation. 🇧🇷
@sheeraz1022
@sheeraz1022 3 жыл бұрын
Quite interesting. Thanks for sharing.
@jessicataylor7174
@jessicataylor7174 3 жыл бұрын
You're all too smart for me lol 😊 I'd be way too paranoid that some of those lights weren't working even when switched on, that my logic was flawed, or that I'd made a mistake somewhere. I'd definitely be asking a pal to stand in the room with a mobile phone telling me which light changed instead haha. I get the feeling half my life is doing things 'the long way' 😁
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
haha... i was hoping to get a straight forward approach from you :)
@jessicataylor7174
@jessicataylor7174 3 жыл бұрын
@@LOGICALLYYOURS I guess the real puzzle is how did I even pass maths? I'm certainly capable of problem solving...but rarely within the given rules! 😄
@suman-majhi
@suman-majhi 3 жыл бұрын
This is a log(N) base 2 solution😂😂... love it ❤️❤️
@kunalbatham2130
@kunalbatham2130 3 жыл бұрын
Another great puzzle from amar , keep up the amazing work ❤️❤️🔥🔥
@spartacusrebel
@spartacusrebel 3 жыл бұрын
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...
@MatticusNicholas
@MatticusNicholas 3 жыл бұрын
Almost always have someone working with you that you can just phone while they are in one room and you another.
@spartacusrebel
@spartacusrebel 3 жыл бұрын
@@MatticusNicholas Yeah. Single trip
@meetshah2288
@meetshah2288 3 жыл бұрын
Good one. Love your videos
@sreemanohar5443
@sreemanohar5443 3 жыл бұрын
Cheak the switch trip number of ""Switch 96 and Switch 97""
@bagasadifirdaus9278
@bagasadifirdaus9278 3 жыл бұрын
Haha
@suman-majhi
@suman-majhi 3 жыл бұрын
dont worry... its editing mistake... but he is right
@sreemanohar5443
@sreemanohar5443 3 жыл бұрын
@@suman-majhi i know it and i made this comment to re edit his mistake
@kanurihemasatyasaidurgapraveen
@kanurihemasatyasaidurgapraveen 3 жыл бұрын
Superb logic👌👌
@saeedbawazeer9636
@saeedbawazeer9636 3 жыл бұрын
The first thing that came to my mind was using 20 trips. Divide into rows and columns. You’d get a 2D coordinate system.
@durgeshmishra6007
@durgeshmishra6007 3 жыл бұрын
I too used the same logic, but 18 as after 9 trips in both row and column traversal what's left must be the 10th.
@malvoliosf
@malvoliosf 3 жыл бұрын
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.
@ramaraobonagiri9365
@ramaraobonagiri9365 3 жыл бұрын
Good solution, thank you.
@tanishqagarwal6778
@tanishqagarwal6778 3 жыл бұрын
Amazing Video👍🏻👍🏻🔥
@nobody8522
@nobody8522 2 жыл бұрын
For 2 switch = 1 trip For 10 switch = 4 trip For 100 switch = 7 trip For 1000 switch = 10 trip It's so simple => (2^x = number of switch) => x=ln(no of switch)÷ln 2 This video was so helpful, thank you
@garmo1968
@garmo1968 3 жыл бұрын
I'm still working through the combinations mentally but I should be able to map all 100 lights with 6 trips instead of 7 by remembering the solution for 3 lights. The system doesn't have to be entirely binary cause there's a third option if you work quick. By turning the light on for a while then turning it back off when you enter the room you'll have two lights off and one light on, but of the two off, one will be warm. So if you introduce a "off but warm" notation to every test you can test 243 lights in 5 trips provided you're willing to wait for all bulbs to cool down to starting temp (you did say minimal entries not minimal time) 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?
@garmo1968
@garmo1968 3 жыл бұрын
update: after waking up and getting coffee, i've mapped 63 lights onto 5 room entries (up from the previous method of 50) with the notation that you can only track "off but warm" on the lights that had previously never been turned on. so if we have to enter the room a 6th time i'm up to 127 mapping combinations, looks like with this method of using warm check, the number of lightbulbs you can check will always be 1 fewer light bulb than if you were allowed one extra entry to the room 2^(n+1)-1 instead of 2^n. so while the puzzle solution maps 128 light bulbs entering the room 7 times, this one maps 255 lightbulbs with the same 7 entries
@aaronchunghl
@aaronchunghl 3 жыл бұрын
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.
@diveshsharma5691
@diveshsharma5691 3 жыл бұрын
Awesome 💯
@dimitriskontoleon6787
@dimitriskontoleon6787 3 жыл бұрын
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
@matteovergentini5484
@matteovergentini5484 2 жыл бұрын
The minimum number of times is 5. If as a strategy you divide the lights in (hot /on, hot off, cold on, cold off).
@realistivity
@realistivity 3 жыл бұрын
Nice puzzle! I feel the 12 men on island puzzle (google interview puzzle) is much harder.
@ericprudhomme2312
@ericprudhomme2312 Жыл бұрын
So it’s the number of times you can divide it by 2 until you get to 1 , but when it’s an odd number you add 1 before you divide it by 2
@areebasameen7832
@areebasameen7832 3 жыл бұрын
Amaizing 👌🏻
@cricketcoachingforchildren4446
@cricketcoachingforchildren4446 2 жыл бұрын
Fantastic puzzle and superb explanation.
@shoofiquestionsanswers9135
@shoofiquestionsanswers9135 3 жыл бұрын
There is something that you can use to minimize the number of required step less than 7 by considering the fact the light is energy and will make the temperature of lamp increased by the way you can simply feel it using your hand. For example, if I have 3 lamps on off mode: I will switch one on, the second one switch on for a small period of time, then switches off again, while the last one I will keep it on off mode. Then by entering the room,, I will see one is on and two are off, but by touching both of the two off lamps off I will feel one is more hotter, so I can distinguish three lamps by one move. Merging this with the idea of binary number that you used should minimize the number of movements. Regards, Ala Zayed
@SrikanthSrinivasamadhavan
@SrikanthSrinivasamadhavan 3 жыл бұрын
Amazing...great idea...
@danik0011
@danik0011 Жыл бұрын
On 1:45, i figured out, that for n bulbs / switches, you can do it in binary log of n checks (rounded up).
@kychanne110
@kychanne110 3 жыл бұрын
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 .....
@FrankAnzalone
@FrankAnzalone 3 жыл бұрын
I started from the other end with the odd switches 1 3 5 7 9 with a 1 in the least significant bit
@abdullahalnayem1849
@abdullahalnayem1849 3 жыл бұрын
This one is good!
@suhurabmohamed8557
@suhurabmohamed8557 3 жыл бұрын
Fantastic solution
@jashandeepsingh2216
@jashandeepsingh2216 3 жыл бұрын
This man deserves more subscribers
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Thanks Jashandeep for the wishes. I'll keep trying my best :)
@programaths
@programaths 3 жыл бұрын
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!
@tamilazhagana9123
@tamilazhagana9123 3 жыл бұрын
How did u editing like this...which software r u using for this
@rameshkiran1597
@rameshkiran1597 3 жыл бұрын
Good one👍 ammar.. I am able to solve this in almost same method but labeled it differently, Instead of using binary I used alphabets and numericals alternatively... For first trip I used A and B, second trip it will be A1, A2, B1 &B2.. for third trip A1x, A1y, A2x, A2y like that, for fourth A1x1, A1x2... like that.
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Yup... you got it right!!
@vikassinghpatel989
@vikassinghpatel989 3 жыл бұрын
R.I.P for those programmers who can solve 1500* dp problems, but unable to crack this. 🤣🤣
@BGMI_eSports_
@BGMI_eSports_ 3 жыл бұрын
I solved it bro
@BGMI_eSports_
@BGMI_eSports_ 3 жыл бұрын
Even though I am a 11th student
@vikassinghpatel989
@vikassinghpatel989 3 жыл бұрын
Nice bro... Btw! Your name resembles Code 'N' code youtube channel. Do you watch him?
@BGMI_eSports_
@BGMI_eSports_ 3 жыл бұрын
@@vikassinghpatel989 no I haven't even heard his name.. I have thought this name for my channel 😅
@pushkarsingh5540
@pushkarsingh5540 3 жыл бұрын
@@BGMI_eSports_ can you please send the program here buddy....😅😅
@nagaresujit1480
@nagaresujit1480 3 жыл бұрын
Amazing puzzle
@sajeethvark7673
@sajeethvark7673 3 жыл бұрын
Very nice puzzle 👍👍
@waelsy123
@waelsy123 3 жыл бұрын
You can do it by 5 visits, simply by creating 3 groups: on, off and off but warm bulb => 3^5 more than enough
@abdullahothman8090
@abdullahothman8090 Жыл бұрын
nice soln , I didn't solve any yet but I enjoy your riddles, keep the good work
@abhinavabhishek340
@abhinavabhishek340 3 жыл бұрын
For any n number of switches , cheak for a minimum number k for which 2^k is greater than n .then k will the number of minimum trips
@bibabeatmann
@bibabeatmann 3 жыл бұрын
i'd still prefer entering the room 100 times since it would take more time to keep track for 100 lights
@lokeshloki8801
@lokeshloki8801 3 жыл бұрын
Ur explations are very good and exlent And one more thing please mention which math theroy your using which help us Thankyou..
@KotaSarat52
@KotaSarat52 3 жыл бұрын
mapping is fine but how could you identify which switch belong to which light by jst entering room and not checking its switch...i dont get it....could you pls explain for my better understanding
@jagadishpalle4037
@jagadishpalle4037 3 жыл бұрын
You can try this way. If you know Binary search then it will be clear. Have you ever played this game where computer will guess your selected/wished number by simply asking 2 or 3 times like below : " hey, does your seleced number present in these numbers? " You can check answers for these things then it will help you in solving these kind of questions.
@bm-ub6zc
@bm-ub6zc 2 жыл бұрын
But you said there was a much faster algorithm? Could you link that as a video too?
@amitavamozumder73
@amitavamozumder73 3 жыл бұрын
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.
@rahilsanghavi9347
@rahilsanghavi9347 3 жыл бұрын
That was brilliant
@subhammondal3796
@subhammondal3796 3 жыл бұрын
Great video first I felt the three switches three bulb puzzle. Then I umderstood❤❤❤
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Shubham... in fact when a puzzle has switches and lights, our first instinct would be the heating concept. So i put the condition in the start that it's not a heating based puzzle.
@mohanapriyav9460
@mohanapriyav9460 3 жыл бұрын
is there any shortcut for this question using binary numbers for that given decimal number of bulbs and switches so that we can find quickly without splitting that half again and again to bring individual binary number for each bulb since it takes time for numbers like 10000000.so i need a shortcut to find individual number.for example binary number of 100 is 1100100 in this 7 bit is enough to make 100,,so 7 trips are needed like that i need a shortcut
@jagadishpalle4037
@jagadishpalle4037 3 жыл бұрын
Convert given bulbs count in 2 powers. That is the answer. 2^x >= 10000000. Here x is the answer. So find least possible value of X.
@studypurpose5253
@studypurpose5253 3 жыл бұрын
Simply use Binary Search technique by supposing On =1 and Off = 0
@anandmohansingh7044
@anandmohansingh7044 3 жыл бұрын
Not going to lie but at the starting I was doubting your method 😅 but you explained it very well 👍❤️
@datasave7636
@datasave7636 3 жыл бұрын
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.
@tharundharmaraj9045
@tharundharmaraj9045 3 жыл бұрын
You are unique sir.
@rockytechz5477
@rockytechz5477 3 жыл бұрын
This was one of the hardest puzzles on your channel according to me.
@mugilanchandran6623
@mugilanchandran6623 2 жыл бұрын
by seeing this puzzle's solution, i realised how dumb am i
@LOGICALLYYOURS
@LOGICALLYYOURS 2 жыл бұрын
haha, no need to feel dumb... Many people fail to solve binary puzzle first time. Later you'll be able to correlate binary based problems very easily.
@bhawanagoyal5986
@bhawanagoyal5986 3 жыл бұрын
Only one move. Video call someone outside room and ask the person to switch on and off the switches when you are inside.
@dastagirwajahat
@dastagirwajahat 3 жыл бұрын
0:43 can I turn on switches from inside the room.
@mohamedkandeel6553
@mohamedkandeel6553 3 жыл бұрын
lol
@Triplex5014
@Triplex5014 3 жыл бұрын
I love this, binary numbers are so powerful!
@mathersi52
@mathersi52 3 жыл бұрын
Number of states ^ x => total switches ... X is number of minimum trips. So 200 switch can be done in 8 trips.
@zohaibmaqbool
@zohaibmaqbool 8 ай бұрын
Amazing solution 👍
@akshaysatav2431
@akshaysatav2431 3 жыл бұрын
How can you find thats type of interesting puzzles??
@user-tt5ev6so3s
@user-tt5ev6so3s 8 ай бұрын
Love it!
@dominikauer5125
@dominikauer5125 3 жыл бұрын
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.
@slayervii2280
@slayervii2280 3 жыл бұрын
What if I told you you can have each switch/light in 3 states making it 5 trips instead. The third state would be recently switched off light, the bulb would be hot but off. This would technically take more time to feel the heat of each switched off light and waiting between trips so the bulbs would cool down but the question was about trips anyway.
@manusarda
@manusarda 3 жыл бұрын
Video wapis se dekh le ek baar. Usne pehle hi bol diya tha ki heating se related nhi hai.
@sujaljain42069
@sujaljain42069 3 жыл бұрын
Is there any method by P and C?
@divyaprasadsinghdev274
@divyaprasadsinghdev274 2 жыл бұрын
Mostly, the light bulbs and switch board panel are always aligned...so if the panel is arranged as a 25x4 matrix and the light bulbs are arranged in the same way, then by just switching on the first switch, we can see whether the first bulb or the last bulb is glowing and so, get to know the switches for each bulb....for people thinking, bulbs and switches won't be arranged...just a hint, electricians are not dumb and the question didn't say that I can't assume ✌️
@zwagig1761
@zwagig1761 3 жыл бұрын
This problem is similar to find the poisoned bottle problem with limited testing. That problem and this problem both require binary solutions.
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
You're right. They are similar.
@zwagig1761
@zwagig1761 3 жыл бұрын
@@LOGICALLYYOURS Keep up the great work
@toonstore1056
@toonstore1056 Жыл бұрын
ECE engineers be like: welcome to my world!!!
@emem2756
@emem2756 3 жыл бұрын
That was nicely solved
@manik_.a
@manik_.a 3 жыл бұрын
Awesome 👍
@tonyhaddad1394
@tonyhaddad1394 3 жыл бұрын
I solved but in a harder way to memorise if i am realy doing this puzzle but same methode . I laybel all button from 1 to 100 first i turn on 50 and i label on lights 1 to 50 turn on and 51 to 100 turn next 1to25 and so on but when i have see 1 to 25 light turn on i have change the lable which is turn on of 25 lights on and so on but im not allowd to change beacause i have only pen your methode is 100% correct with the rule thanx to this amazing puzzle sorry about my english im an arabic boy
@LOGICALLYYOURS
@LOGICALLYYOURS 3 жыл бұрын
Thanks Tony.... And yes, you can do it the way you explained.
@nandangowda7975
@nandangowda7975 3 жыл бұрын
Technology is improved bro I will just use camera to see which bulb turns on when I flick each switch 😅😂
Google Interview Riddle - 3 Friends Bike and Walk || Logic and Math Puzzle
8:47
New model rc bird unboxing and testing
00:10
Ruhul Shorts
Рет қаралды 25 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 12 МЛН
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 82 МЛН
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
100 Doors Puzzle || Hard Puzzle for Genius minds
6:30
LOGICALLY YOURS
Рет қаралды 249 М.
Torch and 8 Batteries Puzzle || Think outside the box
5:23
LOGICALLY YOURS
Рет қаралды 256 М.
GOOGLE Interview Question || A Probability Puzzle || Hard Logic Puzzle
13:14
The Coolest Hat Puzzle You've Probably Never Heard (SoME2)
14:22
Going Null
Рет қаралды 104 М.
Can you solve the prisoner hat riddle? - Alex Gendler
4:35
TED-Ed
Рет қаралды 29 МЛН
Solving A Classic Google Interview Logic Puzzle
9:03
MindYourDecisions
Рет қаралды 8 МЛН
Can You Solve The 4 Hats Logic Puzzle?
4:39
MindYourDecisions
Рет қаралды 745 М.
Solve this puzzle to get into Oxford ?!
5:29
MindYourDecisions
Рет қаралды 7 МЛН
The SAT Question Everyone Got Wrong
18:25
Veritasium
Рет қаралды 12 МЛН
The Sudoku Trick All Expert Solvers Know
17:53
Cracking The Cryptic
Рет қаралды 2,9 МЛН
New model rc bird unboxing and testing
00:10
Ruhul Shorts
Рет қаралды 25 МЛН