Тёмный

GOOGLE Interview Question || Puzzle : 12 Men On An Island || Hard Logic Puzzle 

LOGICALLY YOURS
Подписаться 298 тыс.
Просмотров 1,3 млн
50% 1

GOOGLE technical interview puzzle : This puzzle is asked in the software or technical porgramming Google interviews. This video explains the questions or requirements and two different answers.
It's a hard logic riddle.
-----------------------------------------------
You can find the solution with 4 men at this google drive link below:
drive.google.c...
-----------------------------------------------
This interview puzzle has a mind blowing GOOGLE twist inside, so watch the complete video as you will see a smarter approach to solve this puzzle.
PUZZLE :
There are 12 men on an island. Eleven weigh exactly the same amount but one of them is either heavier or lighter than others. There is a see-saw on the island which can be used to find out the odd man, but the catch here is that you can use the see-saw only 3 times.
So using the see-saw only 3 times... Your task is to find out
- the odd man (i.e. the man with different weight).
- and Also find out if the odd man is heavier or lighter.
There exists several variations of this interview puzzle such as:
- 12 (twelve) balls and 3 (three) weighing/scale
- 12 marbles and 3 scale
- Twelve coins and three weighing (12 coins riddle)
In all these variations the intention is to identify the defective object by using the scale only three times. Also, you would need to figure out if the defective object is lighter or heavier compared to others.
This google interview coding question or puzzle was also featured in a TV series called Brooklyn 99 (Brooklyn Nine-Nine ) in the same format of 12 men as in this video.
Google is known for asking tricky puzzles and hard riddles in the interviews. They check the optimization skills of a candidate with his approach of solving a puzzle. If a candidate has good optimization skills then it will benefit the organization in writing optimized programming code that eventually improves the response time of software applications and websites.
In the video I have explained a natural approach followed by a fresh approach which is expected by google interviewer. I also have explained why the first approach is not upto the mark for google and how we can arrive at the second approach in most logical way possible.
So if you are preparing for google interview questions for software engineer then you can watch all google puzzles on my channel.
You are most welcome to share puzzle, math problems or any topics for upcoming videos.
Gmail : logicreloaded@gmail.com
Facebook(message) : / mohammmedammar
Also try these hard google puzzles:
100 Doors Puzzle || Hard Puzzle for genius minds
• 100 Doors Puzzle || Ha...
5 Pirates PUZZLE (Version 2) | 100 Gold Coins 5 Pirates
• 5 Pirates PUZZLE (Vers...
Gold Chain Puzzle || Beautiful Logic Puzzle || 149 links
• Gold Chain Puzzle || B...

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1,2 тыс.   
@murali18
@murali18 4 года назад
It's a war between space and time complexity. Earlier days memory was too costly but we had time, hence we had less space consuming but more time consuming apps. But now space is cheap but time is costly, that's why we are having more space consuming and less time consuming apps. Dynamic Programming literally means using more space to reduce the time required for computation. So it's simple, the first approach takes more time but less space, and the second approach takes more space but less time. The solution depends relative to the problem always which is why we don't have 1 definite solution for all. Both the approaches are correct and you would get a job if you are able to explain it.
@LOGICALLYYOURS
@LOGICALLYYOURS 4 года назад
Murali... that was a valuable suggestion/thought to understand that the present era has changed a lot, and now everything is about time (responsive design).
@andrewshirley9240
@andrewshirley9240 4 года назад
I wonder if you could get away with O(n) space with this algorithm. The original algorithm still needs O(n) space, because that's the only way to compare weights in this scenario. Here, the naive approach is to load in all weight mappings in advance for O(cubedroot(n)*n) space. But if you could somehow determine the final #/h/l mapping without having to back-reference the list and count L/R/= signs, then it's pretty trivial to switch to O(n) space by loading in one weighing at a time.
@danielbinns2802
@danielbinns2802 4 года назад
For the 1st riddle cant u split the group in half (6 on each side) then let the men get off in pairs (1from each side) until its is balanced then u will know which pair was uneven and have 2 suspects. Now balance 1 of the suspects against any of the other 10 we know r normal weight and if he is same weight then with ur last attempt at balance him against any of the remaining eleven to tell if he is lighter or heavier if suspect 1 was uneven u would have observed if he is lighter or heavier and still had 1 attempt remaining
@alidhan1299
@alidhan1299 4 года назад
@@danielbinns2802 No, because each time you remove a pair, you are weighing a different combination which means it counts towards the 3 times you can weigh a combination.
@danielbinns2802
@danielbinns2802 4 года назад
@@alidhan1299 the riddle said u can only use the seesaw 3 times it did not say that u can only weigh different combinations 3 times and if they get on the seesaw they have to come off it. I'm just giving them a specific order to come off instead of having them all come off at once. Same can be done for the order they go on the seesaw because they can all simultaneously go on so I would observe the weights while they go on or get off. This is my way of thinking outside the box
@gblargg
@gblargg 3 года назад
I puzzled over and gave up. The first solution is so amazing how it saves every bit of useful information from each step to combine later to reach a result quickly. The second solution washes all that away and looks at the general problem, showing how it all just falls together naturally and without anything special. The richness of the solutions to such a simple problem are what brings me back to mathematics every time. So much hidden wonder. Even though I didn't solve it myself I found this inspiring.
@georgemcaneny5632
@georgemcaneny5632 3 года назад
If we weren’t all so awkward we could simply ask the people their weights, thus eliminating the need for a seesaw
@Akpersonal4
@Akpersonal4 3 года назад
@Panso Pe ink gir gai Having extra or less weight doesn't make you an imposter.
@maak4733
@maak4733 3 года назад
@Panso Pe ink gir gai Don't forget ,they are man, and man don't get shy telling their weight
@awekeningbro1207
@awekeningbro1207 3 года назад
That is only fair if the imposter cannot lie or he turns into a chicken.
@OskaIvanovichSmirnov
@OskaIvanovichSmirnov 3 года назад
Imagine the question was about coins. You can't ask a coin for its weight.
@ajvinoski6924
@ajvinoski6924 3 года назад
@@OskaIvanovichSmirnov but the question isn't about coins, why would we need to imagine a completely different scenario
@rameshkiran1597
@rameshkiran1597 4 года назад
I solved this puzzle in other way around 12 yrs back.. W-weigh, we give number to each on Scenario 1, W1: four on each side 1234-5678 if it is balanced then it is simple to find the odd one from remaining 4, as follows W2: keep a person(12) aside n weigh like this 9,10-11, 1, if it is balanced then compare 12 with 1, ll know whether he is lighter n heavier. If it isn't balnced, and tilting towards 9,10 means either one of them is heavier r 11 is lighter, then W3:compare 9&10, which way it goes is the heavier one, if balanced 11 is lighter. Scenarios 2: W1: 1,2,3,4 - 5,6, 7,8 unbalanced n shifted towards 1234, W2: 1,2,5 - 3,6,9 if still shift to 1,2,5 it means either one from 1&2 is heavier r 6 is lighter.. Then compare 1&2 which side it tilts is the heavier if balanced 6 is lighter. If 1,2,5- 3,6,9 is balanced means eeither 4 is heavier r one from 7&8 is lighter, then compare 7 with 8. if in Scenario 2 balance shifted to 3,6,9 side that means either 3 is heavier r 5 is lighter... Compare any one from 3&5 with normal one to get to know the odd one...
@qc1okay
@qc1okay 4 года назад
Ramesh Kiran's solution (almost same as mine) seems to be the best solution, so I've written it up below in clearer terms ("W#n" means the nth weighing): W#1: Weigh 1,2,3,4 vs. 5,6,7,8. If W#1 is balanced (odd one is 9,10,11,12), then: W#2: Weigh 9,10 vs. 11,1. A. If balanced, then W#3: weigh 12 vs. 1 to see whether 12 is light or heavy. B. If unbalanced, then W#3: weigh 9 vs. 10; if W#2 had 9,10 heavier, then whichever side is heavier in W#3 is the heavy one (or if W#3 balanced, 11 is light); or if W#2 had 9,10 lighter, then whichever side is lighter in W#3 is the light one (or if W#3 balanced, 11 is heavy). -------------- If W#1 has 1,2,3,4 heavier: W#2: Weigh 1,2,5 vs. 3,6,9: A. If 1,2,5 heavier (1 heavy or 2 heavy or 6 light), then W#3: weigh 1 vs. 2; whichever side is heavier is the heavy one (or if balanced, 6 is light). B. If 3,6,9 heavier (3 heavy or 5 light), then W#3: weigh 3 vs. 12 to see whether 3 heavy (if balanced, then 5 is light). C. If W#2 balanced (4 heavy or 7 light or 8 light), then W#3: weigh 7 vs. 8; whichever side is lighter is the light one (or if balanced, 4 is heavy). -------------- If W#1 has 1,2,3,4 lighter, then the process is same as above, switching corresponding numbers.
@rameshkiran1597
@rameshkiran1597 4 года назад
Thanks buddy@qc1okay
@noellerhee463
@noellerhee463 4 года назад
Isn’t this a ted Ed puzzle
@cjfdnqkn4374
@cjfdnqkn4374 3 года назад
Noelle Rhee yup
@pradeepkamjula1923
@pradeepkamjula1923 3 года назад
@@qc1okay Y these many scenarios , It's simple 11 are having equal weight 1 guy is over weight 3 times we have to use that sea saw 1) first divide the 12 members into 2 grps 6-6 weight them one side shall be heavier. 2)take the heavier grp ie 6 ....now divide them again into 3-3 as grps and again weigh them .you will get the heavier grpWho are only 3 3) Now of those 3 members tell two members to be on seasaw ..... If they weight equal ....then the 3 Rd guy is the different one . And if any one of those 2 are weighing heavier ......he is the guy as other all 11 members are of equal weight.
@loklokeshava9725
@loklokeshava9725 4 года назад
When we are going to attend for aptitude classes.....we can easily test the trainer by giving this question....🙋‍♂️
@ANILKUMAR-cc3lb
@ANILKUMAR-cc3lb 3 года назад
Evarikaina ichavaa aa question?
@anirudhsinghi4037
@anirudhsinghi4037 3 года назад
Are you going to attend English classes?
@MuhammadShafique-yr6hl
@MuhammadShafique-yr6hl 3 года назад
teachers are also watching this video
@SkittleJawnz
@SkittleJawnz 4 года назад
My answer: Google search which man is heavier or lighter since all of their data is online
@lakshmangamers1280
@lakshmangamers1280 3 года назад
😂
@kaimadamantonyshejin2034
@kaimadamantonyshejin2034 3 года назад
Searching answer in Google to get job at Google😂😂
@akxyn5010
@akxyn5010 3 года назад
You don't get any info abt 12 men on a deserted island. That's sad
@cl759
@cl759 3 года назад
🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣
@mysticdragonex815
@mysticdragonex815 3 года назад
@@kaimadamantonyshejin2034 You need to know how your company works before joining it. (Works has dual meaning here)
@nickwisely2581
@nickwisely2581 4 года назад
for the first few minutes, "Ahh I got this, simply do it as TedEd has explained". the second explanation, "Ohh wait, what was that? how could you... but... nevermind."
@LOGICALLYYOURS
@LOGICALLYYOURS 4 года назад
But i believe, even the first approach is not easy.. if compared with TedEd... because in their version of puzzle we don't have to figure out the DEFECT (if the object is heavier or lighter).
@aps9369
@aps9369 3 года назад
@@LOGICALLYYOURS when 2 set of four men left , try with balancing 1-1 in
@grayfurt95
@grayfurt95 3 года назад
@@LOGICALLYYOURS In this problem there is a trick that is "lever" thats why I would just say it cannot be solved. Cuz as you can imagine at seesaw the nearest man close to the middle, will be the lightest. But its true just for this question.
@snuscaboose1942
@snuscaboose1942 3 года назад
@@grayfurt95 Even if you factor in the lever, that implies that the force of a person's weight is relative to their position on the scale, as long as people or objects being weighed are evenly distributed along the scale on the scale and both sides have the same number of people, the problem is still solvable. If all people on the scale weigh the same, it will balance. If a single lighter or heavier person is on the scale, it will be uneven regardless of the outlier's position as there will be a difference in the total amount of downward force between the two sides of the scale.
@Akashkumar-ot1sw
@Akashkumar-ot1sw 3 года назад
@@LOGICALLYYOURS bro I actually found a realistic way to solve
@zilvarro5766
@zilvarro5766 3 года назад
I think in general you should balance the following three quantities as good as possible in every step (while making sure Left and Right contain the same number of people by filling up with Confirmed Persons): A) 2 * Unknowns Outside + Suspects Outside B) Unknowns Inside + Heavy Suspects Left + Light Suspects Right C) Unknowns Inside + Light Suspects Left + Heavy Suspects Right If not perfectly possible you should prefer to have the Inside a bit larger. Reasoning: This optimizes the worst possible outcome of the scaling step.
@coffeecuppepsi
@coffeecuppepsi 3 года назад
I did group of 4 vs 4. Then shift out 3 pleople from the left and shift in three to the right. Weigh again. By tracking which way scale tilts you can tell which group of three has lighter/hevier person. If last guy is left alone just weigh him against anyone else. .
@kamineetoshniwal6864
@kamineetoshniwal6864 4 года назад
I want to get job in Google After watching this video,this has totally inspired me
@manassinha9145
@manassinha9145 3 года назад
Please complete the sentence...
@durancoley
@durancoley 3 года назад
Inspired you to ……?
@sshaa115
@sshaa115 4 года назад
First I might be slow But when there's an upload I click so fast I glow!
@muhammadahmed-hi9bu
@muhammadahmed-hi9bu 4 года назад
Well after strong focusing on the procedure I still do not understand nothing 😂
@IitDelhi_2025
@IitDelhi_2025 3 года назад
Ya bro,same here with me🥴I made the first method myself and then I didn't get the second one explained by him😑
@manassinha9145
@manassinha9145 3 года назад
Don't apply for the job at google.... Hope you understand this..
@ko-Daegu
@ko-Daegu 3 года назад
@@manassinha9145 you don’t need to Ans to actually get a job
@adlerdoesstuff1872
@adlerdoesstuff1872 3 года назад
that means you understand everything if you don't understand nothing
@johannesvanderhorst9778
@johannesvanderhorst9778 11 месяцев назад
My first solution had a slight difference: in the second weighting, on both sides I put two suspects to be heavy and one suspect to be light. This removes case 2b and adds an additional case 2c.
@wernerviehhauser94
@wernerviehhauser94 4 года назад
The big problem that threw me off track when I first was confronted with this problem in the late 90s is the amount of if/then/else branching you have to do. And if you know the 9 ball / 1 heavier problem, it actually makes it harder for you to solve this since you start off trying to solve it the same way, which does not work.
@danielleza908
@danielleza908 6 месяцев назад
I've seen this question many times before Google even existed...This is a famous puzzle.
@justsomeguywithawoodenstic3684
@justsomeguywithawoodenstic3684 3 года назад
The solution i came up with : Just devide them into 2 equal groups and place them on the seesaw Then let them jump down one by one , 1 man from each side at the same time When the pair with oddman jumps down the seasaw will be balanced Then we know one of them is heavier or lighter For the 2nd time Just weigh one of them with a normal man If he is the oddman we will know And if the seesaw balances then the other man is odd And we just have to weigh him with a normal to know if he is heavier or lighter
@Abhishek-dp5tc
@Abhishek-dp5tc 3 года назад
You can't perform such jumping
@illuminaut
@illuminaut 3 года назад
every time you let people jump off the seesaw you are essentially weighing the remaining people, counting against the three weightings that are allowed.
@theman5007
@theman5007 3 года назад
haha;;{{)) love it,... yeah, you're right,...
@saiprakash163
@saiprakash163 4 года назад
The hell of a question and hell of an explanation.. we need to get to the 2nd approach to make computers work... Hoping to get these type of puzzles 🤛
@heiko3169
@heiko3169 4 года назад
This puzzle actually gives a glimpse into how an AI model is trained. It compares known data to the test data. ;-)
@eriktrimble8784
@eriktrimble8784 3 года назад
Actually, the 2nd "solution" is a great example of poor optimization - that is, optimizing the WRONG THING. The 2nd solution only works better on an ideal machine - one which has no performance limits based on data set size, and no memory performance limits. Such machines, of course, don't exist in the Real World, and thus, the optimization done in the 2nd solution will perform significantly worse than a solution that uses the 1st solution as it's base algorithm, but which is tuned to understand how limits of hardware affect actual computation.
@toddsstuff1268
@toddsstuff1268 3 года назад
@@eriktrimble8784 for optimization, both explanations in the video are wrong. Elimination by consistent half is always mathematically the fastest procedure for narrowing. and also finds the Odd man in three steps in this situation. this approach would not always tell the weight of the odd man. but it would be more proficient to weight the odd man at the end instead of considering the weight of everyone during the process.
@workbyme4874
@workbyme4874 11 месяцев назад
I created the same puzzle to challenge myself when I was a high school student back to 50 years ago. 12 coins with one fake without knowing it is heavier or lighter, the measurement tool is a balance scale. The solution I found was divided them into 3 groups, 4 each. 1,2,3,4 5,6,7,8 and, 9,10 ,11,12. The first measurement is to place 1,2,3,4 on left side and 5,6,7,8 on right side. If it is balanced, 9,10,11,12 has one fake coin, it's easy to find it with 2 measurements. If it is not balanced, then the tricky part is to do a rotation. Left side to be 1,6,7,8 right side to be 5,10,11,12. Then you'll find 2,3,4 or 6,7,8 or 1,5 has a fake coin in it. You can easily find it with 3rd measurement. Then I ask myself what is the maximum coin I can inspect with 4 measurements? How about 5 and more? Then I found the answer is 12*3^(n-3). I read most of the comments, I like the one solution to use 3x3 grid.
@David_K_Booth
@David_K_Booth 10 месяцев назад
I remember reading a solution in verse to the 12 coin problem in the early 1970s, possibly by H E Dudeney: "F" set the coins out in a row And chalked on each a letter, so To form the words: F AM NOT LICKED (An idea in his brain had clicked) And now his mother he'll enjoin: MA, DO / LIKE ME TO / FIND FAKE / COIN !
@Akashkumar-ot1sw
@Akashkumar-ot1sw 3 года назад
2nd way is take 11 mens first one in COM of see saw and 5 on left 5 on right then If one of them weighs more take those 5 mens (also as we know the middle one is not the odd men so we discard that man) and 2nd time make them sit 2 on left and 2 on right one on the middle and If this time also the more wighted 2 mens left take the COM one out take these 2 mens out. Then in last attempt you will get to know that who is more in weight definitely cuz this time only 2 mens are left and also the man which was left at first would not be the man with odd weight cuz if he was then there would be case 1 which I answered in the comment already Hope it helps 👍👍
@AmritEdits13
@AmritEdits13 4 года назад
I ask this puzzles I'm my tution and no one is able to answer
@stupidrainbo
@stupidrainbo 3 года назад
You're your tution?
@summertimevideos8110
@summertimevideos8110 3 года назад
Put 6 on both sides, find the heavier one then put 3 each from the heavier side. Once u find the heavier 3, put 2 of them on the scale, if one of them is heavier, then u found ur guy, if u don't its the third dude
@sathishnoone5862
@sathishnoone5862 2 года назад
What,if the odd one is lighter?
@gameonyolo1
@gameonyolo1 4 года назад
But when given in an interview, how much time do we have to answer and do we get pen and paper?
@haio7710
@haio7710 3 года назад
We get pen 🖊️ and paper 📓 but only three minutes
@Ħæïķăł
@Ħæïķăł 3 года назад
@@haio7710 Three?!!! No thx
@guitaek4100
@guitaek4100 3 года назад
Jesus did anyone ever solved it without knowing the solution beforehand?
@svilenacarapica4491
@svilenacarapica4491 3 года назад
@@guitaek4100 Ofc not. Thats why youll never have a riddle on a job interview. It doesnt provide any info about the candidate. Its pointless. Talking as a Psychologist.
@guitaek4100
@guitaek4100 3 года назад
@@svilenacarapica4491 Interesting. In my job interview I had a riddle (not google) I didn't found the solution my own however I found an own (not as good as) solution. I guess it should test you wether you're creative. So why do you think it's pointless?
@lennartbjorksten707
@lennartbjorksten707 3 года назад
This puzzle features prominently in the climax of Piers Anthony's book "With a Tangled Skein", which I read about thirty years ago. The protagonist had made a bet with Satan and was weighing demons. Obviously the puzzle was a memorable one, since I still remember it!
@TomCee53
@TomCee53 2 года назад
I had forgotten that until you mentioned it. Piers Anthony is one of my favorite authors. Thanks for the memory.
@Shafiat07
@Shafiat07 3 года назад
I use only two time, first time 6-6. One side wight is large, Split the large 3-3. 3-3 using seesaw. There are equal the odd one is lighter to others, 3-3 are not eqal the odd one is heavier.
@avlieox
@avlieox 2 года назад
You're hired👌
@Shafiat07
@Shafiat07 2 года назад
@@avlieox thanks bro
@satvik333S3
@satvik333S3 3 года назад
Thank you very much sir for sharing such a important and valuable problem with solution and all your videos helped me a lot in improving my knowledge and I am now able to ace many of the aptitude test and I am really thankful to you a lot sir and plz keep posting videos. I am your big fan sir
@LOGICALLYYOURS
@LOGICALLYYOURS 3 года назад
I'm really happy to see your comment. Much appreciated:)
@satvik333S3
@satvik333S3 3 года назад
Thank you sir
@oz25
@oz25 10 месяцев назад
Whilst the maths is very impressive, I would be asking...1/How do you know one man weighs diferently before the exercise starts if they haven't alteady been weighed? 2/Why can we only weigh three times? 3/Why do we need to know who has a different weight? 4/What are the men doing on the island?Knowing why you are doing something/the purpose of the data is also important. Logic. X
@sushantkanojiya8342
@sushantkanojiya8342 4 года назад
Okay, Now I got why I am not in Google. 🙄😟😅😂
@RapidReveal541
@RapidReveal541 3 года назад
My solution. Put half men on each side. It will either R or L. Now, each side put a man down so they come down in pair. See when the seesaw become balance. The last pair is the one having odd man. Weigh one of them with one normal man. You got your answer dude. Even with 100 men you only need 2 weighing.
@DCice13
@DCice13 4 года назад
Someone needs to make a game with all these difficult logic games. Ooo and in VR
@lilledirr
@lilledirr 3 года назад
I came up with a totally diferent approach. If the defenition of using the scale is to put objects on it to see the result I would: 1, Place everyone on the midle and ask one person on each side to walk to the end. The scale will be balanced until we find the odd one. then we have two candidates. 2, Compare the first candidate to the control group in the midle. 3, Compare the second one to the control group if needed.
@TheJacklikesvideos
@TheJacklikesvideos 2 года назад
Man, everyone thinks they've stumbled into greatness pretending constant adjustment and observation is a single instance of weighing.
@baronfam8747
@baronfam8747 3 года назад
All 12 on the seesaw, 6 on each side. Then have one from each side step off. Repeat until there's a change. Once the change is found have all step off and the two that caused the change to get on one side with two others on the other side. Have one from each side step off. Change? Then the one that stepped off on the affected side is guilty. No change? The other is. I've used the seesaw twice. To use the seesaw you have to load it and then unload it. The load/unload process happened two times.
@PsyQoBoy
@PsyQoBoy 3 года назад
It's basically a mathematical induction of finding out the Imposter in Among Us.
@HowlingDeath
@HowlingDeath Год назад
First divide group in 6 and 6 balance them, Heavier group of 6, balance them in 2 groups of 3 3rd balancing: keep one man aside, balance 2 folks, if they are same weight, then person aside is odd or ... But i dont find if odd one is heavier or lighter
@ws_zilch
@ws_zilch 4 года назад
Damn..... It was totally awesome.. tho i was lost
@ChannelMath
@ChannelMath Год назад
Puzzle extension (Information theory): The puzzle asks you for 4.58496 bits of information (1 out of 12 people is log2(12) bits, plus one bit for whether the person is heavier or lighter). How many bits does weighing get you? Since it can show if two sides weigh the same, it seems to tell you 1 out of 3 possibilities, or log_2(3) = 1.58496 bits, and so 3 weighings give 3 times the info, or 4.75489 bits. since 4.75489 is just greater than the 4.58496 bits you are asked for, a solution possible, but just barely. Is this a correct Information theory analysis? and if so, does it prove it's possible to solve the riddle? And if so, what does it say (if anything) about how likely a random strategy is to yield enough information for a solution?
@BinJWu
@BinJWu 9 месяцев назад
Interesting. The calculation will also indicate that 13 is possible with 3 weighings, which is indeed true if one extra known non-odd person is available (so you don’t have same numbers on left and right scales).
@babuvigneshm4947
@babuvigneshm4947 4 года назад
Simply we measure the footprint in a seashore to know the weigh of a odd man ,no need see saw
@jessicataylor7174
@jessicataylor7174 4 года назад
Wouldn't that indicate pressure though, not weight? They would have to have exactly the same size feet and the sand be perfectly the same density across the beach.
@babuvigneshm4947
@babuvigneshm4947 4 года назад
@@jessicataylor7174 yeah you are correct...
@rameshkiran1597
@rameshkiran1597 4 года назад
If there is very minor difference.. You can't? In case instead of men balls are given.. ?
@alidhan1299
@alidhan1299 4 года назад
Ah, there's always that smartass who thinks he's thinking outside the box. It's a riddle that specifically asks you to use the seesaw, its not asking you to find the differemt weight using any means possible. Otherwise just ask the men about their weight lol.
@michaelginsburg5279
@michaelginsburg5279 3 года назад
Old problem. Great one. Took me 6 months. Took my sister 10 minutes without paper and pencil.
@jaylev85
@jaylev85 Год назад
i paused at 58 sec, already figured it out. took about 90sec of thinking, does that mean I'm hired?? Three observations: 6v6, 3v3, 1v1
@xcoder1122
@xcoder1122 3 года назад
Great interview question... if your are applying to a job where you'll later on will solving logic puzzles. Yet I bet, 99.9% of all Google employees never are going to have to do anything like that, not even if they work 40 years for the company. Wouldn't it make more sense to ask them questions that really relate to what they will be doing on their new job?
@kittyhumphries
@kittyhumphries 3 года назад
Good point. It's better to ask shorter questions and those closer to the type of work they are actually going to be doing, otherwise you're burning interview time. The original poster is taking 20 minutes to explain this elegant generalized solution, he probably thought about this for hours, and that's not something you can expect a candidate to come up with in 10-20 minutes. Also if this is to help people with interviews, it should give tips on how to answer it to show they are committed to solving it for themselves as opposed to Goggling the solution.
@Vdevelasko
@Vdevelasko 3 года назад
I've finally managed to do it. Man, that was really hard, but what a satisfaction, I can hardly believe I came up with the solution xd
@clarkt9925
@clarkt9925 3 года назад
I hear you David! I knew there was a perspective to approach from, I kinda created my own math language to write out the hypothetical situations. Once you really understand the rules, it seems super simple. At first I wanted to be creative with unequal numbers of men/not even using the seesaw. But even after trial and error, I think anyone can slowly learn how this puzzle works. Glad you figured it out! I usually feel like I can’t solve some problems, but yes very satisfying!
@zilvarro5766
@zilvarro5766 3 года назад
Here is a simpler algorithm for the general case: For each step, balance the Positions in such a way that 2 * Unknowns + 1 * Suspects is the same no matter what the scale does. (If not perfectly possible, place the remainder ON the scale.) This does not account for cases where there are not enough Confirmed Persons to make sure both sides of the scale have the same number of persons.
@coraxster
@coraxster 3 года назад
Working solution. I've solved this puzzle the same way.
@Fernando_Cabanillas
@Fernando_Cabanillas 3 года назад
My first answer would be to ask each of the men their weight, then if that doesnt lend results, I would start analysing it mathematically
@madhanbalaji196
@madhanbalaji196 3 года назад
Where or in which real-life system this algorithm can be used. I'm just curious
@stefanpodgorsek7687
@stefanpodgorsek7687 3 года назад
It is not, they just want to find a person with right problem solving thinking that souts for the position they are hiring.
@surelock3221
@surelock3221 3 года назад
@@stefanpodgorsek7687 What if my problem solving skills are average but I binged watched all the Ted-Ed puzzle/riddle videos, and just happened to see the one about finding the counterfeit coin in a pile of 12 coins using a scale?
@southerncoyote
@southerncoyote 3 года назад
It is more of a test to see if you can recognize a situation that can be solved with a hash map
@MarrionClarkeHermano
@MarrionClarkeHermano 7 месяцев назад
Had a different solution; Group into 3's, so 4 groups. Weigh one group to another (W1), then choose either one to weigh against a third group (W2). This identifies which group is odd and will tell if its an overweight/underweight group. If both W1 and W2 balances the three groups, then odd one's the 4th group. If One group is either overweight or underweight in both weighings against the 2 groups, then its the odd one. You are then left with the odd group comprised of 3 people, weigh one of them against another and you will know who among the 3 is overweight/underweight. seems a bit simpler.
@kartik-agarwal
@kartik-agarwal 4 года назад
Amazing
@TerjeMathisen
@TerjeMathisen 3 года назад
The classic version of this puzzle, which is at least 50 but more probably closer to 100 (?) years old, uses ball bearing balls, i.e. they all look & feel the same but one of them is slightly wrong, either heavier or lighter. What is the minimum number of weighings needed? Since each weighing can be used to split the men/balls into three groups (heavy/light/ok), we get 3 to the 3rd power or 27 as the maximum amount of information that it is possible to get in 3 rounds, and since this is larger than the 24 (12*2) possible outcomes, it is theoretically solvable. I do remember spending quite a bit of time actually finding a working solution back around 1970. :-)
@flowbeus
@flowbeus 3 года назад
Great video, I'd like to see a more generalized solution with the max number of men for each number of weighings, but this seems much more difficult
@atrus3823
@atrus3823 9 месяцев назад
I solved this another way, but I'm not sure it actually works, and I'm pretty sure it is not generalizable. You split the 12 men into 2 groups of 6 and weight them (1). There must be one lighter group. We'll track the lighter group. The problem is symmetrical, so I don't need to cover all possibilities. Then split the 12 men into 2 different groups of 6 where only 3 members of either new group overlap with either old group. Weigh these 2 groups against each other (2). Based on this, we have narrowed it down to only 3 possible men where the lighter one could be. We weight two of them at random (3). If they are the same, the one not weighed is the lighter one. If one is lighter, it is the lighter one. You might wonder, what if one is heavier? We'll know after the first two weighings if the odd man out is lighter or heavier. Please let me know if I missed something.
@dear_imran
@dear_imran 3 года назад
I actually understood nothing but feeling Smoorrt😂
@getchrismo
@getchrismo Год назад
Split into 2 groups of 6, then heaviest group into 2 groups of 3, then get the heaviest 3 and get 2 men to stand on the seesaw. If unbalanced that’s the heaviest guy, if balanced, the man not on the seesaw is heaviest.
@dave8226
@dave8226 3 года назад
This is a good puzzle. You can solve it for 13 if you don’t need to know whether the odd man out is heavier or lighter. One can solve for 14 men if you have a 15th man that you know ahead of time isn’t the odd one out. Classic riddle.
@abdullahhadi6564
@abdullahhadi6564 3 года назад
Me(when he said there is a twist at the end):are they blind???..... Can't they figure out just by seeing!!! Lol i was wrong.. 😂😂
@davidtipton514
@davidtipton514 4 года назад
Great presentation and a very good explanation of the google solution! As a computer programmer I often use these kinds of solutions in programs.
@noeldunn126
@noeldunn126 11 месяцев назад
I have not read all comments, so this may be covered already. The puzzle clearly makes the simplification of not taking account of the distance of individual men from the fulcrum. Further away from fulcrum greater lever arm, and vice versa. If this simplification were removed, this would make things way harder. Maybe it should be noted in the intro that somehow all men stand at equal distance from fulcrum - thus eliminating the effect of differing lever arms (force x distance)
@donsurlylyte
@donsurlylyte 10 месяцев назад
right, that's why it is shit. if they had used a balance scale instead of a seesaw it would be different.
@donsurlylyte
@donsurlylyte 10 месяцев назад
and a point for you for pointing that out.
@sagarbhowmick7274
@sagarbhowmick7274 4 года назад
3 friends A B and C,C knows how much time A and B individually watched Titanic movie.C said, between a and b, one of them watched the movie 1time more... A said B= video watched one time more than me? B replied- No,Did You? A said- No,but i got it, how much time you watched Titanic movie. B said,- O really? Then I also know how much time you watched Titanic movie... Question is how much times A and B watched Titanic movie?
@belajarsudoku
@belajarsudoku 4 года назад
A: once B: twice
@belajarsudoku
@belajarsudoku 4 года назад
But I think this one is also a possibility A: twice B: three times isn't it?
@anksssssssss
@anksssssssss 4 года назад
If b didn't know that at start how many times a watched , how could he ans the first question ?
@belajarsudoku
@belajarsudoku 4 года назад
@@anksssssssss I think the writer meant to write "A to B: Did you know whether you watch video more than me?"
@rajanganger5942
@rajanganger5942 9 месяцев назад
Heavier or Lighter, thats more tricky,if it just stated only one condition then the puzzle is very easy to solve Lets assume its Lighter. Split into 3 groups of 4 people A,B,C. 1. Put groups A and B on seasaw, if they way same then Group C has the lighter person, if not its one group on seawsaw. Lets assume its group C. 2. Lets divide group C in 2, 2 persons on each side on seesaw. The lighter persons are kept, others discarded. 3. Your left with 2 people, put them on the seasaw, the person who is ligtest is your answer. But if the person has option of both being heavier or lighter at same time im stuck. Doing it in 3 passes is hard.
@jenniferelkins
@jenniferelkins 9 месяцев назад
It took me about 2 hours but I solved it! Well, the first way. Not the one with the tables that you can scale up as needed.
@answerbase5854
@answerbase5854 Год назад
very easy! it took me about 10 seconds to figure out how to solve. is this really a google interview question?
@ramaprasadghosh717
@ramaprasadghosh717 4 года назад
Appreciable effort
@jvcbrasil
@jvcbrasil Год назад
Fantastic. almost 1 and a half hour, but my nephew and I solve it!! :)))
@OmeganKryist
@OmeganKryist 4 года назад
I get the optimized approach and I even get how you get to it but... I would never just think that up on the fly. Pretty smart though.
@ToddHowardWithAGun
@ToddHowardWithAGun 4 года назад
Is this just a disguised quicksort question?
@AnonYmous-mc5zx
@AnonYmous-mc5zx 4 года назад
Walks into interview. Interviewer: "Alright I think that went well, I think we can get you onboarded for the job." Me: "Sounds good!" Interviewer: "But the paperwork is behind...one of these three doors." Me: *"God damnit Monty why can't you leave me alone?!"*
@LionEagleOx
@LionEagleOx 3 года назад
Six on one side, six on the other. Kick the lighter side, then three on one side, and three on the other. After that, just weigh two of the three guys left. Either the heavier guy will tip the seesaw, or he is the one on the side, and the two on the seesaw are equal.
@KerryCarleton
@KerryCarleton 3 года назад
is there another possible correct answer? Weighing 5 on each side. If equal, weigh two left off scale. if not equal, weigh two on each side from five that were heaviest on first weighing. if equal, 5th is the heaviest. if not equal, weigh two with one on each side from the heavy side of second weighing. Right?
@ammaruddinkhan9261
@ammaruddinkhan9261 3 года назад
I correctly attempted this question but im glad to watch through ur vedio again
@Athrun000
@Athrun000 4 года назад
I guess i'm not working for Google in this lifetime then
@happinesstan
@happinesstan 3 года назад
All twelve people can't board the scale at the same time, so theoretically you can weigh each individual in the first use of the scales. You could at least boil it down to two people. Then weigh the two, individually, against one of the others.
@oscorpio2278
@oscorpio2278 10 месяцев назад
I used to be able to solve this kind of logical problems effortlessly 12 years ago, I even figured 3^x for the minimum number of weights for any given number, but now i feel dull and impatient, damn did i became old
@rahul2000
@rahul2000 Год назад
easy 1st 6-6 then 3-3 and lastly then from the heavier group we will only take 1-1 and the remaining 1 person would not be included if the seesaw balanced the the remaining person is the heavier one and if not than we will know the heavier one based on the seesaw itself simple
@rownakmondal
@rownakmondal 4 года назад
I think this is your longest video ever...
@LOGICALLYYOURS
@LOGICALLYYOURS 4 года назад
Yes Rownak, you're right!
@parthsolanki5741
@parthsolanki5741 3 года назад
you can also divide 12 people into two groups of 6 people 1) balance 6 and 6 and whichever is higher select that group 2) now balance 3 and 3, select whichever is higher 3) now you have 3 people, now balance only two people if it balances out then it is the third person who is havier, if it is not balanced then you have found that person.
@parthsolanki5741
@parthsolanki5741 3 года назад
if it is 100 people then minimum 3 and maximum 6
@AttilaAsztalos
@AttilaAsztalos 3 года назад
Turns out I'm not interested in any job that throws puzzles at you when hiring.
@jayceh
@jayceh 3 года назад
Yah fuck logical reasoning
@iyappanr7527
@iyappanr7527 3 года назад
It is a very easy buzzle, Divide 12 into 6 and 6,, 1) 6 on one side and another 6 on other side of see saw.. Now we know only one group has higher lesser weight 2) now divide 6 men into 3 group 2 groups on the see saw, we can find which group has high or less weight 3) from 2 men group one and one Higher or lesser weight person find out
@LunnarisLP
@LunnarisLP 3 года назад
We actually had this as exercise in university, module was called "Information theory". It's pretty easy once you understand the system behind it.
@Raghuvaran13899
@Raghuvaran13899 3 года назад
Which university you are?
@ashwanimahaur1
@ashwanimahaur1 11 месяцев назад
I have a better solution: make 2 groups of 6-6each and wiegh them on the sea saw , the group that's heavier or lighter will be the odd group , now deselect 2 random people from the odd group and wiegh the 4 people left 2-2 each side , if the sea aaw balances , then the 2 deselected people shall be weighed and one will be normal while the other heavier or lighter ( we'll know heavy or light as when we weighed the first time with 6-6. We'll know if it was heavy or light) , if it doesn't balance out , then wiegh the group thats odd this time of two and you shall have the heavy or light one
@lvrsvid
@lvrsvid Год назад
Divide the 12 men into two groups of 6, eliminate the heavier group, then repeat the process with the remaining 6 until you have 3, weigh two of them, and if they balance, the third person is the lightest; otherwise, the lighter side in any weighing contains the lightest person.
@SeaScoutDan
@SeaScoutDan Год назад
The person could be heavier or lighter. If the different guy is heavier, he just got eliminated in the 1st step. You will end up with saying 3rd person is lightest, when he is actually the equal weight.
@gonzalotapia1250
@gonzalotapia1250 3 года назад
In fact, you can test 15 people the seesaw. In a y case, If the seesaw is balanced, then the man off the seesaw is different. 1) 7 Men per side 2) 3 Men per side 3) 1 man per side.
@Naruto03108
@Naruto03108 4 года назад
👍👍
@Ravikumar-op1fw
@Ravikumar-op1fw 10 месяцев назад
My simple brain got simple answer. Divide 12 people into 2groups 6 each and keep them on seasaw, obviously it wouldn't be balanced so on the next use pick the hevier side and divide into 2 groups with 3 each. Then after pick 2 from the hevier side, if one of them is hevier the he is the odd one else the remaining 1 is odd one of the group😅
@zorandrndarevic1444
@zorandrndarevic1444 3 года назад
This is thinking in programming and algoritmic way and not use other properties of ballance and see-saw. I know how to do this in only 2 measurements :) Also in just one step if you use ideas outside of excell tables:) It's possible and much easier and absolutely accurate and no matter of number of items. HR interviews are not always designed well.
@sharan9993
@sharan9993 3 года назад
So how to do it
@zorandrndarevic1444
@zorandrndarevic1444 3 года назад
Hint: the relationship between the different inclination (and balance) of the seesaw and potential positions can be taken into account and thus identify the side but also the exact location of the person who differs in weight. distance is an important factor and affects the slope, but it also reveals place of different weight (whether person x is closer or farther from the support affects the slope) and this will indicate exactly where it is. So, even one is enough but second can be used as proof or to eliminate at least 4 people for second measurment.
@jaidevtyagi1033
@jaidevtyagi1033 3 года назад
Yeah that's only okay. Solved it.
@lakshyaagarwal4044
@lakshyaagarwal4044 4 года назад
Thanks man. It was an amazing puzzle
@slayervii2280
@slayervii2280 3 года назад
Assuming all of the men got the same volume, you could invent a liquid of which you could control the density, make a huge pool filled with the liquid set at highest density. Put all the men in the pool and start dropping the density. At some point either all of them minus one would sink or only one will sink. If it's only 1 person that sink that one is heavier if all of them minus one sink, the one that stayed is the lighter. 0 weighting needed 😂😂😅
@mujtabanadeem3901
@mujtabanadeem3901 3 года назад
Outta the box!
@manusarda
@manusarda 2 года назад
invent the liquid? why don't you just use digital weighing scale.
@johannesvanderhorst9778
@johannesvanderhorst9778 11 месяцев назад
Why inventing a liquid? They are on an island, so you can use the sea as the liquid. If the men won't sink, let each of them take some amount of sand and/or stones to increase their density until some of them will sink. If the men do sink at once, ask them to hold their breath at such a level that some of them will float. If this can't make them float, they must be so muscular that they must be able to make some swimming movements aiding them to float.
@gnanaprabhu968
@gnanaprabhu968 3 года назад
*I have a simpler approach make 6 men stand on either side and then ask exactly one man on either side to get down one by one and wait for the instance of balancing of the see saw. Once we find out the the pair which on leaving makes the seesaw balanced and now we have only 2 suspects. The take any one of them and compare with any identical man and we can arrive at the solution very easily!!*
@benYMSB
@benYMSB 3 года назад
As a recruiter for google, I can assure you non of these are ever asked in an interview.
@vinaykamble1736
@vinaykamble1736 3 года назад
Hello sir, Can you give some idea about kind of questions asked in interview at google?
@vitaminprotein862
@vitaminprotein862 2 года назад
@@vinaykamble1736 Did you got the job ?
@TheJacklikesvideos
@TheJacklikesvideos 2 года назад
Ben has handled all hiring process at every facility.
@vitaminprotein862
@vitaminprotein862 2 года назад
@@TheJacklikesvideos Yes and jack is the janitor in google 😌
@benYMSB
@benYMSB 2 года назад
@@TheJacklikesvideos I set the questions across the continents. So yes. What’s your point?
@nachiketaprasad9000
@nachiketaprasad9000 3 года назад
I may have done something wrong while following the steps, but I'm getting the number of (L->H) != Number(L->L) and similarly for R as well in W3, just because I chose the 9th and the 8th as the heavy person instead of 9 and 7 as done in the video. I chose the the 8th because it was said that we could chose any 1 from both of them. Am I going wrong somewhere? Also, what about the cases which were discarded. I'm not able to understand that. Any help would be appreciated. Thanks in advance.
@AshwinMisra
@AshwinMisra 5 месяцев назад
Somebody send this video to Capt. Holt. He’ll finally get that lunch.
@srh2301
@srh2301 Год назад
After solving this logic puzzle within 5 minutes, Alan finally got the windows cleaning job at the Google headquarters...
@adlerdoesstuff1872
@adlerdoesstuff1872 3 года назад
how about you get a random thing and then put it on one side of the seesaw and put a person on the other side and then if one of them has a different result from the others then that's the odd one
@05khanha
@05khanha Год назад
It’s so simple. Divide in half… Weigh 6 and 6. Then divide heavier into 3 and 3. Then pick 2 of the three and weigh them you have your answer…
@AbhishekKumar-zg4si
@AbhishekKumar-zg4si 3 года назад
Take 6-6 then 1 is heavier or lighter then take 3 -3 1 is heavier or lighter then 1-1 and 1 is rest either
@DavidGarcia-xn7hu
@DavidGarcia-xn7hu 3 года назад
three simple steps no numbering around, put all men randomly divided half and half in the weight (6 and 6), take all men that weight more thats 6, divide them randomly and take 3 and 3, weight them and choose the ones that weight more, take one of them radonmly out of the weight, and weight the other two, if they are equal the other one is the heavier, if not, then the one that weights more is the heavier
@amarbrguljak4357
@amarbrguljak4357 3 года назад
You can also do this by weighting 6-6 then do 3-3 from the heavier group and the last weighting you would weight 1-1 and 1 guy waiting
@vasileiosbravos1451
@vasileiosbravos1451 3 года назад
And what happens if the 3-3 is balanced ?
@ralphschraven339
@ralphschraven339 3 года назад
I had a different approach. First, write out all the possible combinations in trinary 000 001 002 ... 222 Then, identify the constraints relevant for weighing: Compare(0, 0) ==> irrelevant, continue Compare(0, 1) or Compare(0, 2) ==> Assignment possible, end comparisons Compare(1, 1) or Compare(2, 2) ==> Need a Compare(1, 2) in order to be valid assignment Compare(1, 2) ==> Need a Compare(1, 1) or Compare(2, 2) in order to be valid assignment Eliminate Compare("000", "000") beforehand. Now, you can iteratively assign men to combinations of seesaw-outcomes and cross out the combinations that are no longer valid to make sure all of them end up with a unique solution to the question at hand. 000? Not valid 001? Valid, eliminate 002 002? Invalid 010? Valid, eliminate 020 011? Valid, eliminate 022 012? Valid, eliminate 021 020? Invalid 021? Invalid 022? Invalid 100? Valid, eliminate 200 101? Valid, eliminate 202 102? Valid, eliminate 201 110? Valid, eliminate 220 111? Valid, eliminate 222 112? Valid, eliminate 221 120? Valid, eliminate 210 121? Valid, eliminate 212 122? Valid, eliminate 211 All options with 2 are exhausted In their example: 1: 110 [ X 220 ] 2: 112 [ X 221 ] 3: 202 [ X 101 ] 4: 200 [ X 100 ] 5: 201 [ X 102 ] 6: 121 [ X 212 ] 7: 210 [ X 120 ] 8: 122 [ X 211 ] 9: 011 [ X 022 ] 10: 020 [ X 010 ] 11: 021 [ X 012 ] 12: 001 [ X 002 ] This leaves us with a possible 13th member that is either weighed L, L, L (111) or R, R, R (222). I think the mapping method is a little more elegant, but my method is more straightforward to code into an Excel sheet or programming language and simply generalize to any specific set of parameters that still follows the problem's methodology. Really nice exercise, especially because it doesn't demand explicit prior knowledge of coding or algorithmic approaches! Very nice.
@superaws50
@superaws50 3 года назад
at 20:51 , 12 can also be identified as an odd man that's heavier, and 4 can be identified as the odd man that's lighter, or am I missing something?
@ytlongbeach
@ytlongbeach Год назад
1. weigh 3 vs 3 from the 12 if unstable, 2a. weigh 1 vs 1 from the heavier group if stable, it's the third guy, otherwise, it's the heavier of the two 2b. weigh the 3 vs 3 that weren't weighed previously 3. weigh 1 vs 1 from the heavier group if stable, it's the third guy, otherwise, it's the heavier of the two NEXT !
@TerryAVanguard
@TerryAVanguard 3 года назад
I can firgure it out 100% with 4 uses of the seesaw But I will only get it right 90% of the time with 3 uses Agg Haven't given up yet but its frustrating
@TerryAVanguard
@TerryAVanguard 3 года назад
So close, feel stupid Never mind
@LOGICALLYYOURS
@LOGICALLYYOURS 3 года назад
Great attempt though :)
@bjarnieinarsson3472
@bjarnieinarsson3472 8 месяцев назад
Ok.. six and six, second time, three and three. Then you weight one and one. If they are equal, then the odd one is different, otherwise the result of third weight.
@praveensingh5532
@praveensingh5532 3 года назад
Sir we will divide 12 mens in two groups then we place 6 men on one side and 6 men on another side then we can find which group is heaviour now we again devide heaviour group 6 men into two then we place them on si- saw now we will able to find which group is hevaiour and we will get the heaviour group and now we have three people we will place two people on different side of si-saw if they are balanced then the remainig people is heviour and if they are not balanced then we will also find who is the heavy person
@axelelpro
@axelelpro 3 года назад
6vs6 en take the heavier group. Then 3vs3. And take the heavier group. Now choose 2 folks and put them on the scale. If one is heavier that’s it. If the have the same weight the the other one is the heavier.
Далее
Can You Solve The 4 Hats Logic Puzzle?
4:39
Просмотров 810 тыс.
С какого года вы со мной?
00:13
Просмотров 191 тыс.
+1000 Aura For This Save! 🥵
00:19
Просмотров 10 млн
Офицер, я всё объясню
01:00
Просмотров 3,5 млн
How to NOT Fail a Technical Interview
8:26
Просмотров 1,4 млн
12 Riddles to Check if You Can Escape from Dangers
11:35
Prisoner Hat PUZZLE || 10 Prisoners || RED & BLUE Hats
5:55
С какого года вы со мной?
00:13
Просмотров 191 тыс.