# six coins

Arjun Shastry

Ranch Hand

Posts: 1898

1

Saurabh Pillai

Ranch Hand

Posts: 524

posted 5 years ago

I think question is open ended and allows to speculate.

There are six coins with 2 lighter coins. Considering 2gm as genuine and 1gm as counterfeit. 2,2,2,2,1,1

Divide them into two groups and weigh them. Two possibilities

1) They weigh unequal i.e. one group is heavier than other.

2) They weigh equal. A) 2,2,1 B) 2,2,1

First let's consider case 1 and groups were A1) 2,2,2 and B1) 2,1,1.

Now pick one coin from group A1 and mix with group B1 and again divide them in two groups.

Same possibility again,

1) They weigh unequal 2) They weigh equal

Consider they weigh unequal, A2) 2,2 B2) 1,1

The lighter group contains those two lighter coins.

Now, if you consider the second case i.e they weigh equal. A21) 1,2 B21) 1,2

Now, swipe two coins. There are two possibilities here You swipe 1)equally weighing 1 with 1 or 2 with 2 2) Unequally weighing 1 with 2 or 2 with 1

1) If you

2) If you swipe equally weighing coins then , you need to remember those two coins and separate them out and weigh with another two coins , and the lighter side is two lighter coins. This take 4 weighing.

I am leaving rest of the cases as homework.

(Did I take correct route?)

There are six coins with 2 lighter coins. Considering 2gm as genuine and 1gm as counterfeit. 2,2,2,2,1,1

Divide them into two groups and weigh them. Two possibilities

1) They weigh unequal i.e. one group is heavier than other.

2) They weigh equal. A) 2,2,1 B) 2,2,1

First let's consider case 1 and groups were A1) 2,2,2 and B1) 2,1,1.

Now pick one coin from group A1 and mix with group B1 and again divide them in two groups.

Same possibility again,

1) They weigh unequal 2) They weigh equal

Consider they weigh unequal, A2) 2,2 B2) 1,1

The lighter group contains those two lighter coins.

Now, if you consider the second case i.e they weigh equal. A21) 1,2 B21) 1,2

Now, swipe two coins. There are two possibilities here You swipe 1)equally weighing 1 with 1 or 2 with 2 2) Unequally weighing 1 with 2 or 2 with 1

1) If you

**swipe**unequally weighing coins and then weigh again you would find the lighter side as those two lighter coins. This is in 3 weighs only, but2) If you swipe equally weighing coins then , you need to remember those two coins and separate them out and weigh with another two coins , and the lighter side is two lighter coins. This take 4 weighing.

I am leaving rest of the cases as homework.

(Did I take correct route?)

posted 5 years ago

if you weigh 3 against three, and one side is lighter, you only need two weighings.

Both of the fake coins are in the lighter side.

take two from that side, and weigh them against each other. If they are equal, then those are the two counterfeit coins.

If they are unequal, the lighter one is counterfeit, as is the third, unweighed one.

[edit - corrected typo]

if you weigh 3 against three, and one side is lighter, you only need two weighings.

Both of the fake coins are in the lighter side.

take two from that side, and weigh them against each other. If they are equal, then those are the two counterfeit coins.

If they are unequal, the lighter one is counterfeit, as is the third, unweighed one.

[edit - corrected typo]

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors

Saurabh Pillai

Ranch Hand

Posts: 524

kri shan

Ranch Hand

Posts: 1460

posted 5 years ago

If one fake coin is one side and another fake coin is another side during my first weighing

like (2 original coins + 1 fake coin one side and 2 original coins + 1 fake coin another side).

Then can we start from begining ?

if you weigh 3 against three, and one side is lighter, you only need two weighings.

Both of the fake coins are in the lighter side.

If one fake coin is one side and another fake coin is another side during my first weighing

like (2 original coins + 1 fake coin one side and 2 original coins + 1 fake coin another side).

Then can we start from begining ?

Mike Simmons

Ranch Hand

Posts: 3028

10

posted 5 years ago

No need. Because the first weighing balances, you now know that there exactly one counterfeit on each side. There is a way to find both of these, using just two weighings.

kri shan wrote:If one fake coin is one side and another fake coin is another side during my first weighing

like (2 original coins + 1 fake coin one side and 2 original coins + 1 fake coin another side).

Then can we start from begining ?

No need. Because the first weighing balances, you now know that there exactly one counterfeit on each side. There is a way to find both of these, using just two weighings.

Arjun Shastry

Ranch Hand

Posts: 1898

1

posted 5 years ago

Thanks all.My approach was- coins A,B,C,D,E,F(Lighter coins need not be of same weight).

First compare A---B--If they weigh same, then C and D. If they too weigh same, then compare A and C.If A and C are same, then E and F are lighetr coins.

if A and B don't weigh same, then its simple.

First compare A---B--If they weigh same, then C and D. If they too weigh same, then compare A and C.If A and C are same, then E and F are lighetr coins.

if A and B don't weigh same, then its simple.

MH

Henrique Ordine

Ranch Hand

Posts: 129

Stefan Evans

Bartender

Posts: 1670

10

posted 5 years ago

Oh really?

1: A-B

2: C-D

If we have identified two coins as lighter, we are done (e.g. A<B and C<D).

If we have identified one coin as lighter

3: E-F to find the 'other" lighter coin.

Otherwise (all scales balanced to date):

3: A-C

If balanced, then the two 'lighter' coins are E,F

If A<C, then the coins are A,B

otherwise the coins are C,D

That is only 3 weighings

Henrique Ordine wrote:That's a lot more than 3 weighings.

Oh really?

1: A-B

2: C-D

If we have identified two coins as lighter, we are done (e.g. A<B and C<D).

If we have identified one coin as lighter

3: E-F to find the 'other" lighter coin.

Otherwise (all scales balanced to date):

3: A-C

If balanced, then the two 'lighter' coins are E,F

If A<C, then the coins are A,B

otherwise the coins are C,D

That is only 3 weighings

Henrique Ordine

Ranch Hand

Posts: 129

Mike Simmons

Ranch Hand

Posts: 3028

10

posted 5 years ago

Henrique: I think you're imagining a "weighing" differently than we are. That's probably because most of us have read similar problems to this, and we are assuming a detail which was not actually specified: the weighings are performed with a balance, in which you put as many things as you want on one side, and as many as you want on the other, and then you find out which side is heavier. (Or perhaps they balance, being equally heavy.) That's one weighing.

Henrique Ordine wrote:Nice try.

1:A

2:B

3:C

4

I stopped counting after that.

Henrique: I think you're imagining a "weighing" differently than we are. That's probably because most of us have read similar problems to this, and we are assuming a detail which was not actually specified: the weighings are performed with a balance, in which you put as many things as you want on one side, and as many as you want on the other, and then you find out which side is heavier. (Or perhaps they balance, being equally heavy.) That's one weighing.

Henrique Ordine

Ranch Hand

Posts: 129

Ryan McGuire

Ranch Hand

Posts: 1055

4

Henrique Ordine

Ranch Hand

Posts: 129

posted 5 years ago

I still have doubts about the last solution to the previous problem.

Are they assuming that if A<B then A is one of the lighter coins and B is not? If so, they said that the lighter coins don't necessarily need to have the same weight, so how do you know that they're not both the lighter coins. <br /> <br /> Also, are they assuming that if then they must be both original coins? If so, how do they know that they're not both lighter coins that coincidentally weigh the same weight?>

Are they assuming that if A<B then A is one of the lighter coins and B is not? If so, they said that the lighter coins don't necessarily need to have the same weight, so how do you know that they're not both the lighter coins. <br /> <br /> Also, are they assuming that if then they must be both original coins? If so, how do they know that they're not both lighter coins that coincidentally weigh the same weight?>

J2EE Architect/Developer

Ryan McGuire

Ranch Hand

Posts: 1055

4

posted 5 years ago

Yes, I do believe that even though it wasn't in the original problem statement we are assuming that both counterfeit coins are light by the same amount. Therefore, is A<B then A must be counterfeit and B must be real. <br /> <br /> >

Henrique Ordine wrote:I still have doubts about the last solution to the previous problem.

Are they assuming that if A<B then A is one of the lighter coins and B is not? If so, they said that the lighter coins don't necessarily need to have the same weight, so how do you know that they're not both the lighter coins. <br /> <br /> Also, are they assuming that if then they must be both original coins? If so, how do they know that they're not both lighter coins that coincidentally weigh the same weight?>

Yes, I do believe that even though it wasn't in the original problem statement we are assuming that both counterfeit coins are light by the same amount. Therefore, is A<B then A must be counterfeit and B must be real. <br /> <br /> >

Mike Simmons

Ranch Hand

Posts: 3028

10

posted 5 years ago

No, Arjun's solution does

If A < B, A is definitely counterfeit, and B is unknown.

From Stefan's description:

Meaning if both weighings are unbalanced, we have definitely identified two lighter coins, and those are the two counterfeits.

What was unstated here is that if E-F balance, that means that the second counterfeit must be in the first four. If only one of those two weighings was unbalanced, then the second counterfeit must be the

This part works as stated.

*not*require the assumption that both counterfeits have the same weight.If A < B, A is definitely counterfeit, and B is unknown.

From Stefan's description:

1: A-B

2: C-D

If we have identified two coins as lighter, we are done (e.g. A < B and C < D).

Meaning if both weighings are unbalanced, we have definitely identified two lighter coins, and those are the two counterfeits.

If we have identified one coin as lighter

3: E-F to find the 'other" lighter coin.

What was unstated here is that if E-F balance, that means that the second counterfeit must be in the first four. If only one of those two weighings was unbalanced, then the second counterfeit must be the

*heavier*coin there. It was the coin we weren't sure about at first - now we know it must be counterfeit.Otherwise (all scales balanced to date):

3: A-C

If balanced, then the two 'lighter' coins are E,F

If A<C, then the coins are A,B

otherwise the coins are C,D

This part works as stated.

anirudh jagithyala

Ranch Hand

Posts: 41

posted 5 years ago

I analysed all possible ways and came up withe following logic

For every time we weigh we have 3 possible outcomes either equals, greater than or less than

consider the four coins as a,b,c,d,e,f

make three groups of two each say ab,cd,ef

Now there are two possibilities both the defective are in same group or the defectives are in different groups.

i gave all symbols in small letters ,, sorry for that.......

as there are 2 fake coins in 6 coins these can have (6*5)/2=15 outcomes {Permutations and combinations}

I tried to get all the combination of 15 outcomes with the above analyses........

Hope this helps...

For every time we weigh we have 3 possible outcomes either equals, greater than or less than

consider the four coins as a,b,c,d,e,f

make three groups of two each say ab,cd,ef

Now there are two possibilities both the defective are in same group or the defectives are in different groups.

i gave all symbols in small letters ,, sorry for that.......

as there are 2 fake coins in 6 coins these can have (6*5)/2=15 outcomes {Permutations and combinations}

I tried to get all the combination of 15 outcomes with the above analyses........

Hope this helps...