Gold coin problem. It’s tricky and confusing.?
Suppose You have 5 stacks with 20 supposedly gold coins in each stack. Each authentic gold coin weighs 10 grams, but two of the stacks are composed of only counterfeit coins weighing 11 grams each. You are given a scale the weighs grams. Figure out a way to determine the counterfeit stacks in one weighing using the scale.

label the stacks with 1, 2, 3, 4 and 5. take out 2^(n-1) coins from each stack with n = label number.
so we took out 1, 2, 4, 8 and 16 coins from 5 stacks. you should get weighing of 31*10 = 310 grams if there were no counterfeits. to know which 2 stacks have fakes, subtract your weighing by 310 and find the matching sum.
let’s say your weighing = 322 g.
the difference = 322 – 310 = 12 g.
12 = 4 + 8, meaning fakes are from stacks 3 and 4.
but you also could do it this way :
take none from S1, 1 from S2, 2 from S3, 4 from S4, and 8 from S5.
you’ll be weighing 15 coins, meaning if all of them are not fake, they should weight 150 grams. i’ll list the difference the actual weight made with 150 g and the matching fake stacks.
S1 + S2 = 1 g
S1 + S3 = 2 g
S1 + S4 = 4 g
S1 + S5 = 8 g
S2 + S3 = 3 g
S2 + S4 = 5 g
S2 + S5 = 9 g
S3 + S4 = 6 g
S3 + S5 = 10 g
S4 + S5 = 12 g
the counterfeit coins stack would weight 220 grams compared to a gold coin stack that weights 200 grams.
you couldn’t do it in one weighing
note
make your observations as you are putting the stacks on
put stack one on side A
put stack two on side B
If they are ballanced you know they have equal measurement
if it tilts one way then you know one is counterfeit
then put stack 3 on side A
stack 4 on side B and make further evaluations
ect
old problem with a new twist. take:
1 coin from stack 1
2 coins from stack 2
4 coins from stack 3
8 coins from stack 4
16 coins from stack 5
weigh the 31 coins.
If they are all good, weight would be 310g
if stack 1 only is bad, weight would be 311g
if stack 2 only is bad, weight would be 312g
if stack 3 only is bad, weight would be 314g
if stack 4 only is bad, weight would be 318g
if stack 5 only is bad, weight would be 326g
if stack 1 & 2 bad, weight would be 312g
if stack 1 & 3 bad, weight would be 315g
if stack 1 & 4 bad, weight would be 319g
if stack 1 & 5 bad, weight would be 327g
if stack 2 & 3 bad, weight would be 316g
if stack 2 & 4 bad, weight would be 320g
if stack 2 & 5 bad, weight would be 332g
if stack 3 & 4 bad, weight would be 322g
if stack 3 & 5 bad, weight would be 330g
if stack 4 & 5 bad, weight would be 334g