Can you solve this interview question

Enough of these shitty threads. Let's actually do something productive for once

Attached: Screenshot_20190107_192252.png (596x251, 71K)

Other urls found in this thread:

en.m.wikipedia.org/wiki/Balance_puzzle
youtu.be/ZN48Ub3k8uE
twitter.com/NSFWRedditImage

Easy. Weight 5 and 5. Take the heavier and add 1 control ball from the other group. Weigh 3 and 3. Take the heavier group. Weigh any 2. If one is heavier you found it. Otherwise its the third ball.

Nvm didnt read the or lighter

>required some serious thought
maybe from a 8yo

Like really, I'm usually shit at riddles and puzzles but this doesn't take more than 5 seconds.

Take 2 packs of 3 balls, compare them. If they are the same the autistic one is in the other 4, in that case you take 2 of those 4 and compare them, after that you compare one of the 2 to the other 2 and deduce from the results.
If the first comparison shows the packs of 3 are different you take 2 packs of 2 each and compare. If they are the same you know the extra chromosome is hidden in the other 2 balls, compare one of them to one of the 4 and you have it. If they are not the same you are fucked because you can't figure out which of the 4 it is with just one measurement.

Weigh 3 and 3 (these 6 balls are group 1)

a) scale is balanced so odd ball must be in remaining 4 (group 2). weigh 2 from group 1 and 2 from group 2
aa) scale is balanced so odd ball must be in remaining 2 (group 3). weigh 1 from group 1 and 1 from group 3
aaa) scale is balanced so odd ball must be the unweighed ball
aab) scale is unbalanced so odd ball is obviously the ball not from group 1

I can continue with other cases (like if first weighing is unbalanced) but should be easy to figure out from here

are you sure you didn't just fuck up the part where you are supposed to read the instructions?
>heavier or lighter than the rest

Split the balls.

Weigh 5 and 5. One side will weigh more.
Take this remaining 5, and take four and weight them, 2 v 2. Either the heavy ball is in one of the two remaining sets, and the balance will show which two has it, and you measure the 2 against each other , or the two groups are equal and you are holding the heavy / light one.

one side will weigh more, yes. but what if the odd ball is lighter, now you've just discarded it on the assumption (despite clear instructions that the odd ball may be lighter) that it is heavier.
sorry user, we've decided not to proceed with your application, best of luck with your future career you're going to need it

this is where I got too. Is it an unsolvable problem then?

literally didn't pass the first hurdle of reading the instructions

>I can continue with other cases (like if first weighing is unbalanced) but should be easy to figure out from here
enlighten me

>Weigh 3 and 3
Same weight. What do you do now?

discard all those 6
of the remaining 4, pick 2, compare
>if same, swap one ball with either of remaining two
>>if same, the final untested ball is odd
>>if different, newly introduced ball is odd

>if different, odd ball is one of the 2 on the scales, swap either with either of the 2 untested as these must both be of uniform set
>>if same, discarded ball is odd
>>if still different, the ball remaining on the scales is odd

in the event of the 3v3 trial being different:
>remove two balls from each side
>>if different, proceed as above in > scenario 2
>>if same, odd ball is among 4 that were removed, balls currently on scale are of uniform set, puzzle becomes unsolvable with single remaining comparison

3v3 as a first trial is not correct, assuming a solution exists

>if same, swap one ball with either of remaining two
You already run out of compares.

>1: 3v3, same
>2: comparison of random 2 from remainder set
>3: final comparison according to outcome of trial 2

Attached: f1a0bca1fd091234ece7d83a041a71ce.jpg (500x375, 18K)

see
b) scale is unbalanced so odd ball must be in group 1. let the 3 balls on one side be group 4 and the 3 balls on the other side be group 5. *sorry didnt realize this side had more considerations. take 1 from group 4 and 5 and place on one side then do the same for the other side (so weighing 2 and 2).
bb) scale is balanced so odd ball must be one of the unweighed balls from group 4/5. at this point i've already done finding the odd ball when there are only 2 options and 1 weighing left so not going to write out bba or bbb

let P mean scale is unbalanced as in previous trials (both sides go down/up as they did in the previous weighing) and R mean the opposite
baP) scale is unbalanced but so have the sides that go up and down. this must mean we have moved the odd ball from group 4->5 or from 5->4. weigh those balls (1 ball and 1 ball, 1 weighing left, etc.)
bbR) scale is unbalanced but sides have not changed. this must mean we have not moved the odd ball. weigh the balls that did not change groups (1 ball and 1 ball, 1 weighing left, etc.)

on side note, i am going to orlando, florida for disneyworld and universal, does any1 have recommendations for things to see/do

kennedy space center is cool

The number of balls you can discern using 3 comparisons is 2^3=8 < 10.
It's impossible?

I feel I might be an idiot for suggesting this, but wouldn't the odd ball simply be a different size from the rest? They're all lead so if any of them need to weigh differently you'd just need to look at them to see a difference.

I know it's a logic puzzle but I'm compelled to ask this.

damn, i didn't think of remembering which way the scale tipped. you a smart motherfucker

maybe there's air pockets inside, you can't see that from the outside but it will change the weight

what if you pass an electric current through each ball

Attached: balls.png (1080x600, 17K)

yes

ITT

Attached: layton.jpg (480x360, 8K)

I'm certain I've figured out a solution, thought I'm not posting it yet to see if others can work it out. Anyone who independently works it out will still see that I have actual understanding of the solution, since I understand the nature of the 'Aha!' insight that you need to solve it.

It's not actually "easy to figure out from there" because he hasn't worked out the 'trick' that isn't immediately apparent that you need to confirm the nature of the 'odd' ball in group 1.

>3v3 as a first trial is not correct, assuming a solution exists

You're wrong, you have not actually ruled out the possibility of an initial 3v3 comparison working, because you haven't considered all the information that you possibly have from the tests on an abstract enough level. Specifically there is some information that you can only know from putting together two other 'bits' of information.

Babbys first "Divide and conquer" problem.

Just throw all of them in the water and see which sinks first/last. Parallel computing motherfuckers.

ITT: morons who will fail any interview they go to.

here's the solution retards:
split the ball into 3 groups of 3 leaving behind 1
Weigh the groups against each other. if all are equal, the loner is the faulty. (2 weighings)

if one of the group contains odd one out, it will definitely be heavier/lighter than the rest. we can also deduce wether the faulty ball in the group is lighter or heavier. Now you take 2 balls from the faulty group and weigh them against each other. if they are equal, the remaining is bad. otherwise if unequal, use the ligher/heavier fact from the above

Thanks for reminding me that I'm still waiting for the English version of Layton 2 on mobile

Make three groups of 3 balls with 1 ball remaining. Let's name them g1, g2, g3 and r.
Compare g1 and g2.

a) If g1 and g2 weight the same, discard g2 and compare g1 and g3.
aa) If g1 and g3 weight the same, the odd ball is r.
ab) If g3 is heavier (lighter) than g1, we know that the odd ball is in g3 and that it's heavier (lighter) than others.

b) If g1 and g2 are different, g1 being heavier (lighter), discard g2 and compare g1 and g3.
ba) If g1 and g3 are different, the odd ball in in g1 and that it's heavier (lighter) than others.
bb) If g1 and g3 weight same, the odd ball is in g2 and it's lighter (heaver) that others.

Then, compare two balls from the odd group.
aba) If they weight the same, odd ball is the remaining ball from the group.
abb) If they are different, the odd ball is either heaver or lighter one, depending on what we figured out it ended up being in the previous step.

Is this a riddle for brainlets?
Let me guess, you found that on reddit

I'm also gay if that matters

>calling other people retards when you're too fucking stupid to just split the balls in half each time and put in a ball you know is normal if the two sides don't have an equal ball count.

Attached: brainlet.png (645x729, 77K)

/thread

If you got this brain teaser shit asked on an interview, it's an awful company.

Did I do good?
Weight 1-3v4-6
If tipped:
Weight 1-3v7-9
If tipped as before:
Weight 1v2
If tipped as before:
Odd ball is 1
If tipped otherwise:
Odd ball is 2
Else:
Odd ball is 3
If not tipped:
Weight 5v4
If tipped as before:
Odd ball is 4
If tipped otherwise:
Odd ball is 5
Else:
Odd ball is 6
If not tipped:
Weight 1-3v7-9
If tipped:
Weight 8v7
If tipped as before:
Odd ball is 7
If tipped otherwise:
Odd ball is 8
If not tipped:
Odd ball is 9
If not tipped:
Odd ball is 10

Actually there is a solution:
if 3v3 is not equal ->
compare either of the three balls to three of those that were ruled out
if they are not equal the autistic ball is in those three, else it is in the other three. Also we know if the autistic ball is heavier or lighter
As last trial take two random balls from the incriminated grup, if equal the last one is autistic, if not the heavier / lighter is (depending on our previous deduction)

It's a perfectly good problem, as opposed to all of the 'think outside the box' bullshit questions.

or just take one ball off. if the two sides are equal the ball you've taken off is your ball. otherwise just split the heavier side. this way you can possibly save one weighting which is efficient and germans love efficiency

you need to look up binary search

You can use the scale only 3 times you retards
>weighs 3 groups
>(2 weighings)
Genius
>2 balls from the faulty group and weigh them against each other
If 3rd group is odd that will be 3 weightings + weighing the 2 of them will make 5 weightings, nice
You can't do binary search you retard, since the ball can be either heavier or lighter you have no way of discerning which side is the side you want
>Compare g1 and g2
2 weightings
>compare g1 and g3
3 weightings , one group was odd and you're out

>Can you find the oddball
no

Here it is you autists

I'm and I only used the scale three times you humongous fucking retard.

Whoops: en.m.wikipedia.org/wiki/Balance_puzzle

Right answer is walk out and be happy that shitty company revealed itself in the interview process

Divide in 3 groups of 3 balls each (A B and C) leaving out a "control ball" X.
Weigh A against B and then B against C, if they all weigh the same then X is the odd one out; otherwise take the odd group and weigh one ball against another one of the same group leaving one aside.

3v3 is already the second comparison after 5v5.

nvm op meant to say balance scale, my bad

Impossible in worst case scenario.
Proof:
Last move will come comparing one of 2 balls with normal balls
If 3 balls it will take 1 additional move in the worst case scenario to get to 2 balls
Same with 4 balls. Meaning it takes two moves (worst-case) to solve 3 or 4 balls.
It takes 2 moves in the worst case to reduce to 3/4 balls from 10. It is impossible to do in 1 move in the worst case.
This implies the worst case scenario requires 4 moves.

I pick them up one by one with my hands to figure it out because I don't need a scale to tell me stupid shit like that.

Actually possible for 13 coins in 3 moves if you don't care whether the coin is lighter or heavier or for 12 if you also need to determine whether it's lighter or heavier.

Also 5 and 6 reduce to 3 in one move in the worst case. Meaning it takes 3 moves to solve from there.
The only path to the final move (2 balls) is through 3 or 4 balls.

>Last move will come comparing one of 2 balls with normal balls
Wrong.

ITT: Everyone read the wikipedia entry from the last 500 times this was posted over the years but everyone skips the part where the coin could be lighter or heavier

ABSOLUTELY BASED

Yeah.. no. You're too much of a brainlet to be on Jow Forums, sorry.

i haven't

post link pls

This works. You save a move because you determined if the group has a lighter or heavier ball via the B / C comparison.

>can't solve a 70 years old problem
>calls me a retard

Wikipedia says the minimum amount of weighings to detect the odd coin is 4

That's wrong. You can do the OP problem in three moves. The groups of three method mentioned before works in three moves no matter the scenario.

I pick up each ball, comparing it to the last and the reference/balance.
I choose the candidate that feels most different.
I weigh the balance.
I weigh the 9 non-chosen balls
I weigh the candidate.

With lighter or heavier, yes

It literally doesn't.
>For example, in detecting a dissimilar coin in three weighings (n = 3), the maximum number of coins that can be analyzed is 13. Note that with 3 weighs and 13 coins, it is not always possible to determine the identity of the last coin (whether it is heavier or lighter than the rest), but merely that the coin is different.

Lmao your right i did log2 instead of log3

It's 3

...

What is the procedure for 13 and what is it for 10 then? Coin can be lighter or heavier.

For a brainlet that can't even read wiki, sure.

The wiki is wrong. Tell me the solution for 10 then if it is possible sweetie ;^)

It's right there you fucking retard.
Given a population of 13 coins in which it is known that 1 of the 13 is different (mass) from the rest, it is simple to determine which coin it is with a balance and 3 tests as follows:

1) Subdivide the coins in to 2 groups of 4 coins and a third group with the remaining 5 coins.
2) Test 1, Test the 2 groups of 4 coins against each other:
a. If the coins balance, the odd coin is in the population of 5 and proceed to test 2a.
b. The odd coin is among the population of 8 coins, proceed in the same way as in the 12 coins problem.
3) Test 2a, Test 3 of the coins from the group of 5 coins against any 3 coins from the population of 8 coins:
a. If the 3 coins balance, then the odd coin is among the remaining population of 2 coins. Test one of the 2 coins against any other coin; if they balance, the odd coin is the last untested coin, if they do not balance, the odd coin is the current test coin.
b. If the 3 coins do not balance, then the odd coin is from this population of 3 coins. Pay attention to the direction of the balance swing (up means the odd coin is light, down means it is heavy). Remove one of the 3 coins, move another to the other side of the balance (remove all other coins from balance). If the balance evens out, the odd coin is the coin that was removed. If the balance switches direction, the odd coin is the one that was moved to the other side, otherwise, the odd coin is the coin that remained in place.

Knock yourself out, brainlet

If I'm doing it right, you could:
>weigh 5 and 5, take the heavier one
>weigh 2 and 2. If they're balanced, it's the ball that isn't being weighed. If they're not balanced:
>weigh the 2 from the heavier one, take the heaviest
and be done quicker in certain cases.

If you don't know if the ball is heavier or lighter then how do you solve this without weighing each one?

It depends if it is a scale with 2 arms or a single scale

By reading the last 3 posts of this thread.

Isn't this Holt's riddle from Brooklyn 99?

It doesn't say "scale" anywhere, it says balance.

4 vs 4 if equal => 1 vs 1 => solution
4 vs 4 if !equal => 2vs2 => 1vs1 => solution
This is pathetic Jow Forums

>1vs1
You don't know whether it's lighter or heavier, try again.

It's a modified version of this OLD SHIT:
youtu.be/ZN48Ub3k8uE

god damn it. you people are really fucking stupid.

But you do not know whether the odd ball is lighter or heavier. So in your second scenario during the 2 vs 2 you still need an extra step to find out. Pathetic.

Yes and now solve it. You didnt even read op

test 3 vs 3

if same you have 4 Unknown (U) and 6 Known (K)

test UU vs KK. if same then you have two UU over there, else these UU are the ones.

test either U vs K. if same, it's the other U, else it's this U.

or, the first test 3 v 3 is not matched.

HERE'S THE KEY: ONE SET IS HEAVIER = HHH, other is lighter LLL

test HHH vs KKK. if heavier, then test 2 H: if one is heavier, it's the odd one, else it's the 3rd H

If HHH was same as KKK, then test two of the lighter ones. if one is lighter, it's the odd one, else it's the third light one.

I think the problem here is that when you are making the final weighing of the odd group out, you can only compare two of the three balls in the group.
So if they don't weigh the same, you don't know whether one is lighter or one is heavier.

No one can possibly solve this unless they read about it beforehand
It's literally impossible

I solved it by myself. Not during the job interview, though.

Hwo much time did it take
It's like 40 minutes that I'm thinking about it and I still can't solve it

>If I'm doing it right

You are not. Read OP again, more carefully this time.

spin them. The lighter/heavier one will not stay in motion for the same amount of time.

>spin them. The lighter/heavier one will not stay in motion for the same amount of time.
You could potentially weight a 5 & 5 group and reduce it to a 2 & 3 group. From there is should be pretty easy to find the odd one out.

That is weighing. By definition anything you do to the balls that will give you information about their weight, is weighing them.

I honestly can't remember. Some problems I solve extremely quickly, some can take days of on-and-off consideration. I remember me and a bunch of my friends from the university were trying to crack the 1 11 21 1211 111221 312211 13112221 sequence for more than two days, and I actually figured it out after hearing someone read it out loud (in fact, I thought he figured it out, and I congratulated him even, but he was just like what are you talking about).

Balance is scale, right? If so:
* Divide the balls in three groups of three A,B,C and leave one alone.
* Compare A with B, B with C and A with C, there we got our three weightings.
* If the scale shows that the three groups weigh the same, the ball we left alone is the odd one. (10% probability)
* If not, there are is one group A-B, A-C or B-C that weighs the same. The other group has the odd ball. In that case we did not find the odd ball but if we now take a ball at random the probability to grab the odd one rises to 33%.

>By definition anything you do to the balls that will give you information about their weight, is weighing them.
Op's puzzle does not in any way restrict you from spinning them. Only that you can ONLY weigh them 3 times.

Yes, so you can only spin them 3 times.

The same problem can be solved with 12 balls.