12 ball Problems

Source: Internet
Author: User

Excerpted from: http://www.cnblogs.com/hlxs/archive/2011/08/17/2142820.html

There are 12 table tennis balls of the same shape and size. Only one of them has a different weight than the other eleven. Now, we need to use a weightless scale to name them three times and find out the ball with abnormal weight, and know that it is heavier or lighter than the other eleven balls.

 

I. The balance has 6 balls on both sides.

Because the weights on both sides are definitely not equal, you don't need to know that the balance is definitely not balanced, and it is a waste of time. Do you think that ox B can come to the conclusion after using it twice? Obviously, you don't think so, exclude.

 

2. Five Balls on both sides of the balance

If the balance is not balanced, a special ball may be on the left or on the right, or on the left or right. You don't have an answer, but you used three chances, game over.

 

3: three balls each on both sides of the balance

After one call, you know that the special ball is among the six. You need to find the special ball twice.

You should put two sides on the balance first. If you have a balance, are you thinking about whether the special ball is on the left or on the right? You have only one chance. Finally, you say, exclude three balls on both sides of the balance.

4: Our programmers generally don't consider putting two balls on the balance first. Stephen Chow may consider putting one ball on both sides first. Finally, he said: you guess which special ball is, is it light or heavy? You say angrily, drag this situation out and kill it.

 

5. Four balls are placed on both sides of the balance. The answer is shown here. Please take a look.

1: If the balance is reached, the remaining four special balls and the other eight are normal balls. Place three of the four and eight on the balance,

1.1: If you have a balance, the special ball is the one left of the four. You have another chance, and you already know which ball you are playing, if it is heavy, it is light.

1.2: unbalanced

1.2.1 if the special ball is light on the other side, the special ball is light. Among the three balls, you can find the light one at a time.

1.2.3 if the special ball is heavy on the other side, the special ball is heavy. Among the three balls, you can find the heavy one at a time.

2: If the balance is not balanced, the remaining four are normal balls, and the two sides of the Balance Exchange three balls.

2.1 if the light ball is still light, the special ball will be in the remaining two balls, and the light ball will be compared with the normal ball. If it is still light, the special ball is the light ball. If it is equal, the special ball is the one of the two.

2.2 If the light side gets heavier, then the Special ball will be in the three balls that have just been exchanged. It will make the light side heavy. The three balls are called to find the heavy one at a time.

In addition, you can continue to enjoy Chen taihan's blog on "Train coal transportation!

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.