Question

2. (10%) Suppose that among n identical-looking coins, one is fake. With a balance scale, we can compare any two sets of coin

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:
As stated in the question the counterfeit coin is lighter than the original coin. Desired algorithm to find counterfeit coin is given below:-

STEP 1: if n== even, divide the coins into 2 equal groups of n/2 and n/2.
STEP 2: check which group is lighter, lighter group would be the one which contains the counterfeit coin.
We will have to repeat all the steps mentioned here for the subgroup as well.
STEP 3: if n==odd, randomly remove one coin from the group and then divide remaining (n-1) into 2 groups of
(n-1)/2 each, there could be two possibility both group are equal in this case one coin which was removed
is counterfeit coin. else follow same step as above for lighter weigh group of (n-1)/2
STEP 4: one number of element ==2 check and find the lighter coin among the two as the counterfeit coin.

From the above algorithm its clear that on every weighing steps we are able to decrease the number of elements to half, so on worst case scenario it can become
< k/2+k/4+k/6..... 2 (number of terms in above algorithm, let it be m)
2n+1 < 3^m
n < (3^m-1)/2
log(2n+1) < m*log(3) //taking log both sides
log(2n+1)/log(3) < m

So worst case number weighing for n coins would be m = log(2n+1)/log(3)


(plz give me a thums up...if my answer helped you and if any suggestion plz comment, Yr thums up boost me)
  

Add a comment
Know the answer?
Add Answer to:
2. (10%) Suppose that among n identical-looking coins, one is fake. With a balance scale, we...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT