[/B]hello guyz .. !!
i came across this interesting problem and have been trying to figure this out since... here it goes..

We are given 8 similar balls. 7 of them are identical in weight and 1 is defective. This one defective ball can be either heavy or light. We are given a weighing balance which we can use only two times to find out the defective ball. Find the defective ball.

I could only come up with a solution where I had to use the weighing balance 3 times. Can anyone solve it in 2 balances.
Any ideas ?

I think it is impossible, even for 5 balls.

You can solve it in two balances for as many as nine balls.

As long as you have more more than two.

Read the original post:
"This one defective ball can be either heavy or light."

It's this that makes it harder. Even 5 balls require 3 tries, but up to around 13 balls can be done with 3 tries.

> This one defective ball can be either heavy or light.
How much information are you really after?
- find the odd one (and not care about its mass)
- find the odd one AND know whether it is heavier or lighter than the rest

So far, the first answer is a special case in 2 steps (for 7+1).

Doesnt really matter...
becoz the unknown element i.e the ball being lighter or heavier , is what makes the problem so tricky...

U have two things to find out
->the defective ball here
-> the lighter/heavier ball
find any one and you shall get the other..

> This one defective ball can be either heavy or light.
How much information are you really after?
- find the odd one (and not care about its mass)
- find the odd one AND know whether it is heavier or lighter than the rest

So far, the first answer is a special case in 2 steps (for 7+1).

> find any one and you shall get the other..
How?

With luck (that is, not picking the odd one), I can establish that 7 balls all weigh the same amount in 2 weighings. I know the 8th is the odd one out, but I don't know whether it is heavier or lighter.

Well thats pretty much the problem buddy..:)
luck wont matter coz all cases gotta be considered...

> find any one and you shall get the other..
How?

With luck (that is, not picking the odd one), I can establish that 7 balls all weigh the same amount in 2 weighings. I know the 8th is the odd one out, but I don't know whether it is heavier or lighter.

Even in 3 weighings you can not know for certain which of the last 2 is the odd one out.
You'd need to test one of them against a known normal one to detemine which of the 2 it is, so need a minimum of 4 weighings.

If you knew in advance whether the odd one was heavy or light 3 would be enough.

Three weighings is enough, as the original poster pointed out. As I said, even the situation with 13 balls is possible with three weighings.

If it is known whether the odd one is heavy/light*, 2 tries is enough even with 9 balls. You just compare three balls with another three, then if they measure equal the odd one must be in the remaining three, while if they measure different, the odd one must be in the heavier/lighter* group. Now you are left with three balls, one of which is the odd one. The same thing can be done to figure it out.

It is really interesting problem. The people who's create such question are more intelligent then other people. I like this creation

commented: another dirty link spammer -2
commented: fuck off spammer -4

How can you do it with three tries? You don't know whether the defective ball is lighter or heavier.
If you are dividing the balls by two every time you wight, how can you know whether the defective ball is on the heavier or the lighter side?

commented: spammer -3

Hey buddy..here's how to do it in 3 weighings..

-> divide the whole set into 4 sets of 2 balls each.
-> now weigh any two sets... if these two sets are balanced it means the defective ball is in the other two sets else the defective ball is in the current sets being weighed

-> now we are left with 4 good balls for sure and 4 other balls of which 1 is defective
-> keep aside the 4 good balls
-> now out of the other 4, make 2 sets of 2 each
-> weigh one of these sets of 2 balls with a set of 2 good balls already kept aside
-> if weighing is balanced, that means defective ball is in the last set of 2 balls..else defective ball is in present set of 2 balls

-> now after 2 weighings, we are left with 2 balls out of which 1 is defective and the rest 6 are definitely good

-> now pick 1 of those 2 balls and weigh it with 1 of those 6 balls, if balanced it means it is defective , else the remaining ball is defective..

now the challenge for you is to work out a way to do it in 2 weighings, its been a real hard puzzle all along... all the best !!!


How can you do it with three tries? You don't know whether the defective ball is lighter or heavier.
If you are dividing the balls by two every time you wight, how can you know whether the defective ball is on the heavier or the lighter side?

I am unable to solve this interesting query. please share the solution if anyone have.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.