Funny Balance scale coin problem

Source: Internet
Author: User

Problem Description:

There are 12 coins, one of which is counterfeit, but I don't know if it is heavy or light. Given a Libra without weights, ask at least how many times to weigh to find this coin? How to prove that the given scheme is the least number of times?

Thinking Analysis:

Our first thought might be to divide 12 coins into two piles, each weighing 6 pieces on the Libra, and the result must be that the Libra is tilted. Without any other information, a weighing opportunity is wasted. So the first weighing must be part of the selection to weigh, using the principle of sharing, Libra left a part of the coin, the right part of the coin, there are some coins left. From the average case, the probability of the three parts containing counterfeit currency is equal. Therefore, in the first weighing, we can divide 12 coins into 3 pieces, each 4 coins, as a, B, C .

Take A, B put on the Libra weighing, there will be 3 kinds of situations:

    • Balance: No counterfeit money is included in a B, then the counterfeit currency must be in C, and the 4 coins in the note C are a, B, C and D. ( 4 coins still cannot be divided into 2 parts!) No sense!! take A and b to weigh on the Libra, then there will be three different situations:
      • AB Balance: AB can not be counterfeit money, must be in C, D.
        • Take C and a amount, if balanced, indicating D is counterfeit money, if unbalanced, it means that C is counterfeit money.
      • A heavy/b weight: A is false or B is false. Take any one of the pieces (real coins) and a weighing. XXIV Note B is counterfeit, and the counterfeit money is light, if still a heavy, indicating a is counterfeit money and counterfeit currency heavy;
    • Left: Indicates that counterfeit money is in a or B. Each of the four coins in the EFGH is ABCD, the four coins in B are the same, and the four coins in C are ijkl (all real coins). For Abe and CDI weighing, there will be
      • If Abe balances with CDI, it means they are real coins. FGH is counterfeit and the counterfeit is light. To take FG weighing:
        • If the balance, indicating H is counterfeit money;
        • Otherwise FG who light who is counterfeit money.
      • If left-leaning (i.e. Abe Heavy, CDI light). The first time it was called, Abcd>efgh. So the counterfeit money in AB, and the counterfeit currency heavy;
        • A and I weigh once, xxiv B is counterfeit money, if a heavy, then a is counterfeit money.
      • If the right (ie, Abe Light, CDI Heavy). The first time it was called, Abcd>efgh. So the counterfeit money is in CD, and the counterfeit currency is heavy;
        • C and I weigh once again, XXIV D is counterfeit money, if C heavy, then C is counterfeit money.
    • Right: (completely symmetrical with left-leaning condition)

According to the above analysis, no matter what the situation, 3 weighing can be obtained which is counterfeit money.

Theoretical analysis:

    • One Libra weighing can get left, right, balance 3 cases, if the weighing once as a code, then it is 3 binary encoding to be able to express;
    • We want to use 3 binary code to indicate: 12 coins, and the severity of the counterfeit currency is unknown.
      • Each coin may be counterfeit money, a total of 12 cases, counterfeit money may be lighter than the real currency, may also be heavy, a total of 12*2=24;
      • 3n>=24 N is at least 3.
    • So from the information theory point of view, 3 times the weighing is the minimum value.

Funny Balance scale coin problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.