Find a stone which is not the lightest one [closed]












10












$begingroup$


I've gotten this riddle and have been struggling with solving it:



Suppose you have 20 stones which have different weights [0 ... n] . You have no way of measuring the weight of any stone individually, instead you can only measure them by putting 10 on each side of a balance. After doing this you see which "group" of stones is heavier. You can do this only 10 times in total. You can also switch the stones from either side to the other as much as you want between the measurements.



Your task is to find a stone for which you can be certain is not the lightest of them all.



All the stones are marked, so you always know which is which. Their appearance or anything similar does not help you with to determine their weight, the only way you can do it is by putting it on the balance.










share|improve this question











$endgroup$



closed as off-topic by Rubio May 4 at 5:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This looks like a puzzle you found elsewhere. For content you did not create yourself, proper attribution is required. If you have permission to repost this, please edit to include (at minimum) where it came from, then vote to reopen. Posts which use someone else's content without attribution are generally deleted." – Rubio

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 5




    $begingroup$
    Please give credit to the author of the puzzle.
    $endgroup$
    – Gilles
    Apr 25 at 21:06










  • $begingroup$
    I have a new and improved solution!
    $endgroup$
    – Brandon_J
    Apr 26 at 0:35










  • $begingroup$
    One person noted attribution is required; 5 people upvoted that comment. NOBODY flagged or voted to close (we have a close reason specifically for this). Quick reminder: If you can tell (with reasonable certainty) that the OP is not posting their own content, we want to close that question until the attribution/no-plagiarism requirement is met, before people spend time answering something that may well end up closed and perhaps deleted.
    $endgroup$
    – Rubio
    May 4 at 5:24
















10












$begingroup$


I've gotten this riddle and have been struggling with solving it:



Suppose you have 20 stones which have different weights [0 ... n] . You have no way of measuring the weight of any stone individually, instead you can only measure them by putting 10 on each side of a balance. After doing this you see which "group" of stones is heavier. You can do this only 10 times in total. You can also switch the stones from either side to the other as much as you want between the measurements.



Your task is to find a stone for which you can be certain is not the lightest of them all.



All the stones are marked, so you always know which is which. Their appearance or anything similar does not help you with to determine their weight, the only way you can do it is by putting it on the balance.










share|improve this question











$endgroup$



closed as off-topic by Rubio May 4 at 5:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This looks like a puzzle you found elsewhere. For content you did not create yourself, proper attribution is required. If you have permission to repost this, please edit to include (at minimum) where it came from, then vote to reopen. Posts which use someone else's content without attribution are generally deleted." – Rubio

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 5




    $begingroup$
    Please give credit to the author of the puzzle.
    $endgroup$
    – Gilles
    Apr 25 at 21:06










  • $begingroup$
    I have a new and improved solution!
    $endgroup$
    – Brandon_J
    Apr 26 at 0:35










  • $begingroup$
    One person noted attribution is required; 5 people upvoted that comment. NOBODY flagged or voted to close (we have a close reason specifically for this). Quick reminder: If you can tell (with reasonable certainty) that the OP is not posting their own content, we want to close that question until the attribution/no-plagiarism requirement is met, before people spend time answering something that may well end up closed and perhaps deleted.
    $endgroup$
    – Rubio
    May 4 at 5:24














10












10








10





$begingroup$


I've gotten this riddle and have been struggling with solving it:



Suppose you have 20 stones which have different weights [0 ... n] . You have no way of measuring the weight of any stone individually, instead you can only measure them by putting 10 on each side of a balance. After doing this you see which "group" of stones is heavier. You can do this only 10 times in total. You can also switch the stones from either side to the other as much as you want between the measurements.



Your task is to find a stone for which you can be certain is not the lightest of them all.



All the stones are marked, so you always know which is which. Their appearance or anything similar does not help you with to determine their weight, the only way you can do it is by putting it on the balance.










share|improve this question











$endgroup$




I've gotten this riddle and have been struggling with solving it:



Suppose you have 20 stones which have different weights [0 ... n] . You have no way of measuring the weight of any stone individually, instead you can only measure them by putting 10 on each side of a balance. After doing this you see which "group" of stones is heavier. You can do this only 10 times in total. You can also switch the stones from either side to the other as much as you want between the measurements.



Your task is to find a stone for which you can be certain is not the lightest of them all.



All the stones are marked, so you always know which is which. Their appearance or anything similar does not help you with to determine their weight, the only way you can do it is by putting it on the balance.







weighing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 25 at 21:06









Gilles

3,44531937




3,44531937










asked Apr 25 at 12:46









podloga123podloga123

533




533




closed as off-topic by Rubio May 4 at 5:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This looks like a puzzle you found elsewhere. For content you did not create yourself, proper attribution is required. If you have permission to repost this, please edit to include (at minimum) where it came from, then vote to reopen. Posts which use someone else's content without attribution are generally deleted." – Rubio

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Rubio May 4 at 5:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This looks like a puzzle you found elsewhere. For content you did not create yourself, proper attribution is required. If you have permission to repost this, please edit to include (at minimum) where it came from, then vote to reopen. Posts which use someone else's content without attribution are generally deleted." – Rubio

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 5




    $begingroup$
    Please give credit to the author of the puzzle.
    $endgroup$
    – Gilles
    Apr 25 at 21:06










  • $begingroup$
    I have a new and improved solution!
    $endgroup$
    – Brandon_J
    Apr 26 at 0:35










  • $begingroup$
    One person noted attribution is required; 5 people upvoted that comment. NOBODY flagged or voted to close (we have a close reason specifically for this). Quick reminder: If you can tell (with reasonable certainty) that the OP is not posting their own content, we want to close that question until the attribution/no-plagiarism requirement is met, before people spend time answering something that may well end up closed and perhaps deleted.
    $endgroup$
    – Rubio
    May 4 at 5:24














  • 5




    $begingroup$
    Please give credit to the author of the puzzle.
    $endgroup$
    – Gilles
    Apr 25 at 21:06










  • $begingroup$
    I have a new and improved solution!
    $endgroup$
    – Brandon_J
    Apr 26 at 0:35










  • $begingroup$
    One person noted attribution is required; 5 people upvoted that comment. NOBODY flagged or voted to close (we have a close reason specifically for this). Quick reminder: If you can tell (with reasonable certainty) that the OP is not posting their own content, we want to close that question until the attribution/no-plagiarism requirement is met, before people spend time answering something that may well end up closed and perhaps deleted.
    $endgroup$
    – Rubio
    May 4 at 5:24








5




5




$begingroup$
Please give credit to the author of the puzzle.
$endgroup$
– Gilles
Apr 25 at 21:06




$begingroup$
Please give credit to the author of the puzzle.
$endgroup$
– Gilles
Apr 25 at 21:06












$begingroup$
I have a new and improved solution!
$endgroup$
– Brandon_J
Apr 26 at 0:35




$begingroup$
I have a new and improved solution!
$endgroup$
– Brandon_J
Apr 26 at 0:35












$begingroup$
One person noted attribution is required; 5 people upvoted that comment. NOBODY flagged or voted to close (we have a close reason specifically for this). Quick reminder: If you can tell (with reasonable certainty) that the OP is not posting their own content, we want to close that question until the attribution/no-plagiarism requirement is met, before people spend time answering something that may well end up closed and perhaps deleted.
$endgroup$
– Rubio
May 4 at 5:24




$begingroup$
One person noted attribution is required; 5 people upvoted that comment. NOBODY flagged or voted to close (we have a close reason specifically for this). Quick reminder: If you can tell (with reasonable certainty) that the OP is not posting their own content, we want to close that question until the attribution/no-plagiarism requirement is met, before people spend time answering something that may well end up closed and perhaps deleted.
$endgroup$
– Rubio
May 4 at 5:24










3 Answers
3






active

oldest

votes


















11












$begingroup$


Measure 10 and 10.

In each subsequent weighing you change one of the originals of one side for one of the originals of the other side.

At some point, the balance turns around.

The stone that you have put on the side that has come down is not the lightest, because the other is lighter than that.

If at the tenth weighing the sides have not been turned around, the only original stone left on the side that is below is not the lightest.







share|improve this answer









$endgroup$













  • $begingroup$
    You didn't explicitly mention this, but it is impossible for the two scales to ever be equal with the given set of stones. But this solution would still work even if the weights were such that the scales could be balanced, provided you know that there is at least one stone that has a unique weight.
    $endgroup$
    – Jaap Scherphuis
    Apr 25 at 13:51










  • $begingroup$
    Well, never mind my previous comment about being late; I found a better solution.
    $endgroup$
    – Brandon_J
    Apr 26 at 0:41



















8












$begingroup$

Here's a solution that needs at most




5




weighings.




For convenience, I arbitrarily number each stone on side "A" (which I declare to be the lighter side for convenience) of the balance in the first weighing to be stones 1, 3, 5...19 and each stone on the heaver side B 2, 4, 6...20. The original weighing of all of the stones is taken to count toward the weighing total, but will be named "step zero" for convenience, because it's the only possible thing to do at the beginning.




Note: if at any point the scale balances, a not-lightest stone can be found in one more weighing by switching any two stones and seeing which way the balance tips.



Step one:




Swap stones 1, 3, 5, and 7 with stones 2, 4, 6, and 8. If the balance tips, you would skip to step 3, but that wouldn't be worst-case scenario (as you will see), so we won't skip ahead. We assume the balance does not tip. Total weighings: 2




Step two:




Swap stones 9, 11, 13, and 15 with stones 10, 12, 14, and 16. If the balance tips doesn't tip, you would skip to step 4, but that's not the worst case, so we will assume that the balance does tip. Total weighings: 3




Step three:




Swap four of the 8 stones that you have just swapped. Assuming that we are still following the worst case, swap stones 9 and 11 with 10 and 12. If the scale does not tip back to side B, then you know that switching 13 and 15 with 14 and 16 will. Total weighings: 4




Step four:




Regardless of which route we took to get here, we currently have four stones which we know either have tipped the scale when swapped, or would tip the scale when swapped. Swap two of them across the balance. If the scale doesn't change state when these are swapped, then the unswapped stone on the side that the scale was expected to tip away from is definitely not the lightest stone. If the scale does change state, the swapped stone that ended up on the side that the scale just tipped toward is definitely _not the lightest stone. Total weighings: 5




And there's your answer!






share|improve this answer











$endgroup$













  • $begingroup$
    What if neither side is heavier?
    $endgroup$
    – noedne
    Apr 26 at 0:46










  • $begingroup$
    @noedne see JaapScherpius's comment above. Also, if neither side is heavier, a not-lightest stone could be identified in two weighings, one swap.
    $endgroup$
    – Brandon_J
    Apr 26 at 0:51












  • $begingroup$
    @noedne here's the better solution.
    $endgroup$
    – Brandon_J
    Apr 26 at 1:31





















0












$begingroup$

An optimization on Hermes's solution:




You have 2n stones numbered 0 to 2n-1.


Weigh stones 0..n-1 against stones n..2n-1.

If it balances, just swap 2 stones, the scale must tip to one side. The stone you added to the heavier side is not the lightest.

Else, let's say it tips left. Stones 0..(n-1) are left and the rest are right.


Consider what happens if you weigh stones k..(k+n-1) against the rest.
For k=0 the scale tips left, for k=n it tips right. At some point there is a value 'a' such that the scale tips left for k=a, but balances or tips right for k=a+1.


To find 'a' do a binary search: set a=0, b=n. Then choose k=(a+b)/2 rounded down. If the scale tips left, set a=k and restart, else set b=k and restart. When a+1=b then you are done.


From k=a to k=a+1, stone (a) is moved right and stone (a+n) is moved left. If it tips the scale, stone (a) is heavier than stone (a+n). You can pick stone (a) as guaranteed not the lightest.


This method requires at most 5 weighings for 20 stones.







share|improve this answer









$endgroup$




















    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    11












    $begingroup$


    Measure 10 and 10.

    In each subsequent weighing you change one of the originals of one side for one of the originals of the other side.

    At some point, the balance turns around.

    The stone that you have put on the side that has come down is not the lightest, because the other is lighter than that.

    If at the tenth weighing the sides have not been turned around, the only original stone left on the side that is below is not the lightest.







    share|improve this answer









    $endgroup$













    • $begingroup$
      You didn't explicitly mention this, but it is impossible for the two scales to ever be equal with the given set of stones. But this solution would still work even if the weights were such that the scales could be balanced, provided you know that there is at least one stone that has a unique weight.
      $endgroup$
      – Jaap Scherphuis
      Apr 25 at 13:51










    • $begingroup$
      Well, never mind my previous comment about being late; I found a better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:41
















    11












    $begingroup$


    Measure 10 and 10.

    In each subsequent weighing you change one of the originals of one side for one of the originals of the other side.

    At some point, the balance turns around.

    The stone that you have put on the side that has come down is not the lightest, because the other is lighter than that.

    If at the tenth weighing the sides have not been turned around, the only original stone left on the side that is below is not the lightest.







    share|improve this answer









    $endgroup$













    • $begingroup$
      You didn't explicitly mention this, but it is impossible for the two scales to ever be equal with the given set of stones. But this solution would still work even if the weights were such that the scales could be balanced, provided you know that there is at least one stone that has a unique weight.
      $endgroup$
      – Jaap Scherphuis
      Apr 25 at 13:51










    • $begingroup$
      Well, never mind my previous comment about being late; I found a better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:41














    11












    11








    11





    $begingroup$


    Measure 10 and 10.

    In each subsequent weighing you change one of the originals of one side for one of the originals of the other side.

    At some point, the balance turns around.

    The stone that you have put on the side that has come down is not the lightest, because the other is lighter than that.

    If at the tenth weighing the sides have not been turned around, the only original stone left on the side that is below is not the lightest.







    share|improve this answer









    $endgroup$




    Measure 10 and 10.

    In each subsequent weighing you change one of the originals of one side for one of the originals of the other side.

    At some point, the balance turns around.

    The stone that you have put on the side that has come down is not the lightest, because the other is lighter than that.

    If at the tenth weighing the sides have not been turned around, the only original stone left on the side that is below is not the lightest.








    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 25 at 13:20









    HermesHermes

    655111




    655111












    • $begingroup$
      You didn't explicitly mention this, but it is impossible for the two scales to ever be equal with the given set of stones. But this solution would still work even if the weights were such that the scales could be balanced, provided you know that there is at least one stone that has a unique weight.
      $endgroup$
      – Jaap Scherphuis
      Apr 25 at 13:51










    • $begingroup$
      Well, never mind my previous comment about being late; I found a better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:41


















    • $begingroup$
      You didn't explicitly mention this, but it is impossible for the two scales to ever be equal with the given set of stones. But this solution would still work even if the weights were such that the scales could be balanced, provided you know that there is at least one stone that has a unique weight.
      $endgroup$
      – Jaap Scherphuis
      Apr 25 at 13:51










    • $begingroup$
      Well, never mind my previous comment about being late; I found a better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:41
















    $begingroup$
    You didn't explicitly mention this, but it is impossible for the two scales to ever be equal with the given set of stones. But this solution would still work even if the weights were such that the scales could be balanced, provided you know that there is at least one stone that has a unique weight.
    $endgroup$
    – Jaap Scherphuis
    Apr 25 at 13:51




    $begingroup$
    You didn't explicitly mention this, but it is impossible for the two scales to ever be equal with the given set of stones. But this solution would still work even if the weights were such that the scales could be balanced, provided you know that there is at least one stone that has a unique weight.
    $endgroup$
    – Jaap Scherphuis
    Apr 25 at 13:51












    $begingroup$
    Well, never mind my previous comment about being late; I found a better solution.
    $endgroup$
    – Brandon_J
    Apr 26 at 0:41




    $begingroup$
    Well, never mind my previous comment about being late; I found a better solution.
    $endgroup$
    – Brandon_J
    Apr 26 at 0:41











    8












    $begingroup$

    Here's a solution that needs at most




    5




    weighings.




    For convenience, I arbitrarily number each stone on side "A" (which I declare to be the lighter side for convenience) of the balance in the first weighing to be stones 1, 3, 5...19 and each stone on the heaver side B 2, 4, 6...20. The original weighing of all of the stones is taken to count toward the weighing total, but will be named "step zero" for convenience, because it's the only possible thing to do at the beginning.




    Note: if at any point the scale balances, a not-lightest stone can be found in one more weighing by switching any two stones and seeing which way the balance tips.



    Step one:




    Swap stones 1, 3, 5, and 7 with stones 2, 4, 6, and 8. If the balance tips, you would skip to step 3, but that wouldn't be worst-case scenario (as you will see), so we won't skip ahead. We assume the balance does not tip. Total weighings: 2




    Step two:




    Swap stones 9, 11, 13, and 15 with stones 10, 12, 14, and 16. If the balance tips doesn't tip, you would skip to step 4, but that's not the worst case, so we will assume that the balance does tip. Total weighings: 3




    Step three:




    Swap four of the 8 stones that you have just swapped. Assuming that we are still following the worst case, swap stones 9 and 11 with 10 and 12. If the scale does not tip back to side B, then you know that switching 13 and 15 with 14 and 16 will. Total weighings: 4




    Step four:




    Regardless of which route we took to get here, we currently have four stones which we know either have tipped the scale when swapped, or would tip the scale when swapped. Swap two of them across the balance. If the scale doesn't change state when these are swapped, then the unswapped stone on the side that the scale was expected to tip away from is definitely not the lightest stone. If the scale does change state, the swapped stone that ended up on the side that the scale just tipped toward is definitely _not the lightest stone. Total weighings: 5




    And there's your answer!






    share|improve this answer











    $endgroup$













    • $begingroup$
      What if neither side is heavier?
      $endgroup$
      – noedne
      Apr 26 at 0:46










    • $begingroup$
      @noedne see JaapScherpius's comment above. Also, if neither side is heavier, a not-lightest stone could be identified in two weighings, one swap.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:51












    • $begingroup$
      @noedne here's the better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 1:31


















    8












    $begingroup$

    Here's a solution that needs at most




    5




    weighings.




    For convenience, I arbitrarily number each stone on side "A" (which I declare to be the lighter side for convenience) of the balance in the first weighing to be stones 1, 3, 5...19 and each stone on the heaver side B 2, 4, 6...20. The original weighing of all of the stones is taken to count toward the weighing total, but will be named "step zero" for convenience, because it's the only possible thing to do at the beginning.




    Note: if at any point the scale balances, a not-lightest stone can be found in one more weighing by switching any two stones and seeing which way the balance tips.



    Step one:




    Swap stones 1, 3, 5, and 7 with stones 2, 4, 6, and 8. If the balance tips, you would skip to step 3, but that wouldn't be worst-case scenario (as you will see), so we won't skip ahead. We assume the balance does not tip. Total weighings: 2




    Step two:




    Swap stones 9, 11, 13, and 15 with stones 10, 12, 14, and 16. If the balance tips doesn't tip, you would skip to step 4, but that's not the worst case, so we will assume that the balance does tip. Total weighings: 3




    Step three:




    Swap four of the 8 stones that you have just swapped. Assuming that we are still following the worst case, swap stones 9 and 11 with 10 and 12. If the scale does not tip back to side B, then you know that switching 13 and 15 with 14 and 16 will. Total weighings: 4




    Step four:




    Regardless of which route we took to get here, we currently have four stones which we know either have tipped the scale when swapped, or would tip the scale when swapped. Swap two of them across the balance. If the scale doesn't change state when these are swapped, then the unswapped stone on the side that the scale was expected to tip away from is definitely not the lightest stone. If the scale does change state, the swapped stone that ended up on the side that the scale just tipped toward is definitely _not the lightest stone. Total weighings: 5




    And there's your answer!






    share|improve this answer











    $endgroup$













    • $begingroup$
      What if neither side is heavier?
      $endgroup$
      – noedne
      Apr 26 at 0:46










    • $begingroup$
      @noedne see JaapScherpius's comment above. Also, if neither side is heavier, a not-lightest stone could be identified in two weighings, one swap.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:51












    • $begingroup$
      @noedne here's the better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 1:31
















    8












    8








    8





    $begingroup$

    Here's a solution that needs at most




    5




    weighings.




    For convenience, I arbitrarily number each stone on side "A" (which I declare to be the lighter side for convenience) of the balance in the first weighing to be stones 1, 3, 5...19 and each stone on the heaver side B 2, 4, 6...20. The original weighing of all of the stones is taken to count toward the weighing total, but will be named "step zero" for convenience, because it's the only possible thing to do at the beginning.




    Note: if at any point the scale balances, a not-lightest stone can be found in one more weighing by switching any two stones and seeing which way the balance tips.



    Step one:




    Swap stones 1, 3, 5, and 7 with stones 2, 4, 6, and 8. If the balance tips, you would skip to step 3, but that wouldn't be worst-case scenario (as you will see), so we won't skip ahead. We assume the balance does not tip. Total weighings: 2




    Step two:




    Swap stones 9, 11, 13, and 15 with stones 10, 12, 14, and 16. If the balance tips doesn't tip, you would skip to step 4, but that's not the worst case, so we will assume that the balance does tip. Total weighings: 3




    Step three:




    Swap four of the 8 stones that you have just swapped. Assuming that we are still following the worst case, swap stones 9 and 11 with 10 and 12. If the scale does not tip back to side B, then you know that switching 13 and 15 with 14 and 16 will. Total weighings: 4




    Step four:




    Regardless of which route we took to get here, we currently have four stones which we know either have tipped the scale when swapped, or would tip the scale when swapped. Swap two of them across the balance. If the scale doesn't change state when these are swapped, then the unswapped stone on the side that the scale was expected to tip away from is definitely not the lightest stone. If the scale does change state, the swapped stone that ended up on the side that the scale just tipped toward is definitely _not the lightest stone. Total weighings: 5




    And there's your answer!






    share|improve this answer











    $endgroup$



    Here's a solution that needs at most




    5




    weighings.




    For convenience, I arbitrarily number each stone on side "A" (which I declare to be the lighter side for convenience) of the balance in the first weighing to be stones 1, 3, 5...19 and each stone on the heaver side B 2, 4, 6...20. The original weighing of all of the stones is taken to count toward the weighing total, but will be named "step zero" for convenience, because it's the only possible thing to do at the beginning.




    Note: if at any point the scale balances, a not-lightest stone can be found in one more weighing by switching any two stones and seeing which way the balance tips.



    Step one:




    Swap stones 1, 3, 5, and 7 with stones 2, 4, 6, and 8. If the balance tips, you would skip to step 3, but that wouldn't be worst-case scenario (as you will see), so we won't skip ahead. We assume the balance does not tip. Total weighings: 2




    Step two:




    Swap stones 9, 11, 13, and 15 with stones 10, 12, 14, and 16. If the balance tips doesn't tip, you would skip to step 4, but that's not the worst case, so we will assume that the balance does tip. Total weighings: 3




    Step three:




    Swap four of the 8 stones that you have just swapped. Assuming that we are still following the worst case, swap stones 9 and 11 with 10 and 12. If the scale does not tip back to side B, then you know that switching 13 and 15 with 14 and 16 will. Total weighings: 4




    Step four:




    Regardless of which route we took to get here, we currently have four stones which we know either have tipped the scale when swapped, or would tip the scale when swapped. Swap two of them across the balance. If the scale doesn't change state when these are swapped, then the unswapped stone on the side that the scale was expected to tip away from is definitely not the lightest stone. If the scale does change state, the swapped stone that ended up on the side that the scale just tipped toward is definitely _not the lightest stone. Total weighings: 5




    And there's your answer!







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 28 at 1:20

























    answered Apr 25 at 13:23









    Brandon_JBrandon_J

    4,420550




    4,420550












    • $begingroup$
      What if neither side is heavier?
      $endgroup$
      – noedne
      Apr 26 at 0:46










    • $begingroup$
      @noedne see JaapScherpius's comment above. Also, if neither side is heavier, a not-lightest stone could be identified in two weighings, one swap.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:51












    • $begingroup$
      @noedne here's the better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 1:31




















    • $begingroup$
      What if neither side is heavier?
      $endgroup$
      – noedne
      Apr 26 at 0:46










    • $begingroup$
      @noedne see JaapScherpius's comment above. Also, if neither side is heavier, a not-lightest stone could be identified in two weighings, one swap.
      $endgroup$
      – Brandon_J
      Apr 26 at 0:51












    • $begingroup$
      @noedne here's the better solution.
      $endgroup$
      – Brandon_J
      Apr 26 at 1:31


















    $begingroup$
    What if neither side is heavier?
    $endgroup$
    – noedne
    Apr 26 at 0:46




    $begingroup$
    What if neither side is heavier?
    $endgroup$
    – noedne
    Apr 26 at 0:46












    $begingroup$
    @noedne see JaapScherpius's comment above. Also, if neither side is heavier, a not-lightest stone could be identified in two weighings, one swap.
    $endgroup$
    – Brandon_J
    Apr 26 at 0:51






    $begingroup$
    @noedne see JaapScherpius's comment above. Also, if neither side is heavier, a not-lightest stone could be identified in two weighings, one swap.
    $endgroup$
    – Brandon_J
    Apr 26 at 0:51














    $begingroup$
    @noedne here's the better solution.
    $endgroup$
    – Brandon_J
    Apr 26 at 1:31






    $begingroup$
    @noedne here's the better solution.
    $endgroup$
    – Brandon_J
    Apr 26 at 1:31













    0












    $begingroup$

    An optimization on Hermes's solution:




    You have 2n stones numbered 0 to 2n-1.


    Weigh stones 0..n-1 against stones n..2n-1.

    If it balances, just swap 2 stones, the scale must tip to one side. The stone you added to the heavier side is not the lightest.

    Else, let's say it tips left. Stones 0..(n-1) are left and the rest are right.


    Consider what happens if you weigh stones k..(k+n-1) against the rest.
    For k=0 the scale tips left, for k=n it tips right. At some point there is a value 'a' such that the scale tips left for k=a, but balances or tips right for k=a+1.


    To find 'a' do a binary search: set a=0, b=n. Then choose k=(a+b)/2 rounded down. If the scale tips left, set a=k and restart, else set b=k and restart. When a+1=b then you are done.


    From k=a to k=a+1, stone (a) is moved right and stone (a+n) is moved left. If it tips the scale, stone (a) is heavier than stone (a+n). You can pick stone (a) as guaranteed not the lightest.


    This method requires at most 5 weighings for 20 stones.







    share|improve this answer









    $endgroup$


















      0












      $begingroup$

      An optimization on Hermes's solution:




      You have 2n stones numbered 0 to 2n-1.


      Weigh stones 0..n-1 against stones n..2n-1.

      If it balances, just swap 2 stones, the scale must tip to one side. The stone you added to the heavier side is not the lightest.

      Else, let's say it tips left. Stones 0..(n-1) are left and the rest are right.


      Consider what happens if you weigh stones k..(k+n-1) against the rest.
      For k=0 the scale tips left, for k=n it tips right. At some point there is a value 'a' such that the scale tips left for k=a, but balances or tips right for k=a+1.


      To find 'a' do a binary search: set a=0, b=n. Then choose k=(a+b)/2 rounded down. If the scale tips left, set a=k and restart, else set b=k and restart. When a+1=b then you are done.


      From k=a to k=a+1, stone (a) is moved right and stone (a+n) is moved left. If it tips the scale, stone (a) is heavier than stone (a+n). You can pick stone (a) as guaranteed not the lightest.


      This method requires at most 5 weighings for 20 stones.







      share|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        An optimization on Hermes's solution:




        You have 2n stones numbered 0 to 2n-1.


        Weigh stones 0..n-1 against stones n..2n-1.

        If it balances, just swap 2 stones, the scale must tip to one side. The stone you added to the heavier side is not the lightest.

        Else, let's say it tips left. Stones 0..(n-1) are left and the rest are right.


        Consider what happens if you weigh stones k..(k+n-1) against the rest.
        For k=0 the scale tips left, for k=n it tips right. At some point there is a value 'a' such that the scale tips left for k=a, but balances or tips right for k=a+1.


        To find 'a' do a binary search: set a=0, b=n. Then choose k=(a+b)/2 rounded down. If the scale tips left, set a=k and restart, else set b=k and restart. When a+1=b then you are done.


        From k=a to k=a+1, stone (a) is moved right and stone (a+n) is moved left. If it tips the scale, stone (a) is heavier than stone (a+n). You can pick stone (a) as guaranteed not the lightest.


        This method requires at most 5 weighings for 20 stones.







        share|improve this answer









        $endgroup$



        An optimization on Hermes's solution:




        You have 2n stones numbered 0 to 2n-1.


        Weigh stones 0..n-1 against stones n..2n-1.

        If it balances, just swap 2 stones, the scale must tip to one side. The stone you added to the heavier side is not the lightest.

        Else, let's say it tips left. Stones 0..(n-1) are left and the rest are right.


        Consider what happens if you weigh stones k..(k+n-1) against the rest.
        For k=0 the scale tips left, for k=n it tips right. At some point there is a value 'a' such that the scale tips left for k=a, but balances or tips right for k=a+1.


        To find 'a' do a binary search: set a=0, b=n. Then choose k=(a+b)/2 rounded down. If the scale tips left, set a=k and restart, else set b=k and restart. When a+1=b then you are done.


        From k=a to k=a+1, stone (a) is moved right and stone (a+n) is moved left. If it tips the scale, stone (a) is heavier than stone (a+n). You can pick stone (a) as guaranteed not the lightest.


        This method requires at most 5 weighings for 20 stones.








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 28 at 10:47









        Florian FFlorian F

        9,91412462




        9,91412462















            Popular posts from this blog

            Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum

            He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

            Slayer Innehåll Historia | Stil, komposition och lyrik | Bandets betydelse och framgångar | Sidoprojekt och samarbeten | Kontroverser | Medlemmar | Utmärkelser och nomineringar | Turnéer och festivaler | Diskografi | Referenser | Externa länkar | Navigeringsmenywww.slayer.net”Metal Massacre vol. 1””Metal Massacre vol. 3””Metal Massacre Volume III””Show No Mercy””Haunting the Chapel””Live Undead””Hell Awaits””Reign in Blood””Reign in Blood””Gold & Platinum – Reign in Blood””Golden Gods Awards Winners”originalet”Kerrang! Hall Of Fame””Slayer Looks Back On 37-Year Career In New Video Series: Part Two””South of Heaven””Gold & Platinum – South of Heaven””Seasons in the Abyss””Gold & Platinum - Seasons in the Abyss””Divine Intervention””Divine Intervention - Release group by Slayer””Gold & Platinum - Divine Intervention””Live Intrusion””Undisputed Attitude””Abolish Government/Superficial Love””Release “Slatanic Slaughter: A Tribute to Slayer” by Various Artists””Diabolus in Musica””Soundtrack to the Apocalypse””God Hates Us All””Systematic - Relationships””War at the Warfield””Gold & Platinum - War at the Warfield””Soundtrack to the Apocalypse””Gold & Platinum - Still Reigning””Metallica, Slayer, Iron Mauden Among Winners At Metal Hammer Awards””Eternal Pyre””Eternal Pyre - Slayer release group””Eternal Pyre””Metal Storm Awards 2006””Kerrang! Hall Of Fame””Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Bullet-For My Valentine booed at Metal Hammer Golden Gods Awards””Unholy Aliance””The End Of Slayer?””Slayer: We Could Thrash Out Two More Albums If We're Fast Enough...””'The Unholy Alliance: Chapter III' UK Dates Added”originalet”Megadeth And Slayer To Co-Headline 'Canadian Carnage' Trek”originalet”World Painted Blood””Release “World Painted Blood” by Slayer””Metallica Heading To Cinemas””Slayer, Megadeth To Join Forces For 'European Carnage' Tour - Dec. 18, 2010”originalet”Slayer's Hanneman Contracts Acute Infection; Band To Bring In Guest Guitarist””Cannibal Corpse's Pat O'Brien Will Step In As Slayer's Guest Guitarist”originalet”Slayer’s Jeff Hanneman Dead at 49””Dave Lombardo Says He Made Only $67,000 In 2011 While Touring With Slayer””Slayer: We Do Not Agree With Dave Lombardo's Substance Or Timeline Of Events””Slayer Welcomes Drummer Paul Bostaph Back To The Fold””Slayer Hope to Unveil Never-Before-Heard Jeff Hanneman Material on Next Album””Slayer Debut New Song 'Implode' During Surprise Golden Gods Appearance””Release group Repentless by Slayer””Repentless - Slayer - Credits””Slayer””Metal Storm Awards 2015””Slayer - to release comic book "Repentless #1"””Slayer To Release 'Repentless' 6.66" Vinyl Box Set””BREAKING NEWS: Slayer Announce Farewell Tour””Slayer Recruit Lamb of God, Anthrax, Behemoth + Testament for Final Tour””Slayer lägger ner efter 37 år””Slayer Announces Second North American Leg Of 'Final' Tour””Final World Tour””Slayer Announces Final European Tour With Lamb of God, Anthrax And Obituary””Slayer To Tour Europe With Lamb of God, Anthrax And Obituary””Slayer To Play 'Last French Show Ever' At Next Year's Hellfst””Slayer's Final World Tour Will Extend Into 2019””Death Angel's Rob Cavestany On Slayer's 'Farewell' Tour: 'Some Of Us Could See This Coming'””Testament Has No Plans To Retire Anytime Soon, Says Chuck Billy””Anthrax's Scott Ian On Slayer's 'Farewell' Tour Plans: 'I Was Surprised And I Wasn't Surprised'””Slayer””Slayer's Morbid Schlock””Review/Rock; For Slayer, the Mania Is the Message””Slayer - Biography””Slayer - Reign In Blood”originalet”Dave Lombardo””An exclusive oral history of Slayer”originalet”Exclusive! Interview With Slayer Guitarist Jeff Hanneman”originalet”Thinking Out Loud: Slayer's Kerry King on hair metal, Satan and being polite””Slayer Lyrics””Slayer - Biography””Most influential artists for extreme metal music””Slayer - Reign in Blood””Slayer guitarist Jeff Hanneman dies aged 49””Slatanic Slaughter: A Tribute to Slayer””Gateway to Hell: A Tribute to Slayer””Covered In Blood””Slayer: The Origins of Thrash in San Francisco, CA.””Why They Rule - #6 Slayer”originalet”Guitar World's 100 Greatest Heavy Metal Guitarists Of All Time”originalet”The fans have spoken: Slayer comes out on top in readers' polls”originalet”Tribute to Jeff Hanneman (1964-2013)””Lamb Of God Frontman: We Sound Like A Slayer Rip-Off””BEHEMOTH Frontman Pays Tribute To SLAYER's JEFF HANNEMAN””Slayer, Hatebreed Doing Double Duty On This Year's Ozzfest””System of a Down””Lacuna Coil’s Andrea Ferro Talks Influences, Skateboarding, Band Origins + More””Slayer - Reign in Blood””Into The Lungs of Hell””Slayer rules - en utställning om fans””Slayer and Their Fans Slashed Through a No-Holds-Barred Night at Gas Monkey””Home””Slayer””Gold & Platinum - The Big 4 Live from Sofia, Bulgaria””Exclusive! Interview With Slayer Guitarist Kerry King””2008-02-23: Wiltern, Los Angeles, CA, USA””Slayer's Kerry King To Perform With Megadeth Tonight! - Oct. 21, 2010”originalet”Dave Lombardo - Biography”Slayer Case DismissedArkiveradUltimate Classic Rock: Slayer guitarist Jeff Hanneman dead at 49.”Slayer: "We could never do any thing like Some Kind Of Monster..."””Cannibal Corpse'S Pat O'Brien Will Step In As Slayer'S Guest Guitarist | The Official Slayer Site”originalet”Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Kerrang! Awards 2006 Blog: Kerrang! Hall Of Fame””Kerrang! Awards 2013: Kerrang! Legend”originalet”Metallica, Slayer, Iron Maien Among Winners At Metal Hammer Awards””Metal Hammer Golden Gods Awards””Bullet For My Valentine Booed At Metal Hammer Golden Gods Awards””Metal Storm Awards 2006””Metal Storm Awards 2015””Slayer's Concert History””Slayer - Relationships””Slayer - Releases”Slayers officiella webbplatsSlayer på MusicBrainzOfficiell webbplatsSlayerSlayerr1373445760000 0001 1540 47353068615-5086262726cb13906545x(data)6033143kn20030215029