当前位置:网站首页>There are 12 balls, including 11 weight, only one, don't know is light or heavy. Three times in balance scales, find out the ball.
There are 12 balls, including 11 weight, only one, don't know is light or heavy. Three times in balance scales, find out the ball.
2022-08-04 10:03:00 【Kangkang's Road to Code Farmers】
Solution 1:
Weigh the ping pong ball with an unsecured balance. How many results will there be for each weighing? There are three different results, that is, the weight on the left is heavier, lighter or equal to the weight on the right.To find this unqualified table tennis ball, the balls must be divided into three groups (each of four balls).Now, for the convenience of understanding the problem, we number these three groups of table tennis balls as group A, group B, and group C respectively.
First, choose any two groups of balls and place them on the balance.For example, we weigh the two groups A and B on the balance.There will be two situations:
In the first situation, the balance is balanced on both sides.Then, the unqualified bad ball must be in the c group.
Secondly, randomly take out two balls (eg C1, C2) from group c and place them on the left and right discs respectively, called the second time.At this time, there may be two situations:
1. Balance on both sides of the balance.In this way, the bad ball must be in C3 and C4.This is because, out of 12 ping pong balls, only one is an unqualified bad ball.Only when one of C1 and C2 is a bad ball, the two sides of the scale are not balanced.Since both sides of the scale are balanced, it can be seen that C1 and C2 are both qualified strikes.
When weighing for the third time, you can take out a ball (eg C3) from C3 and C4, and place it on both sides of the balance with another qualified ball (eg C1), then the result can be deduced.At this time, there may be two results: if the balance is balanced on both sides, then the bad ball must be C4; if the balance is not balanced on both sides, then the bad ball must be C3.
2. The two sides of the balance are not balanced.In this way, the bad ball must be in C1 and C2.This is because, only when one of C1 and C2 is a bad ball, the two sides of the scale cannot be balanced.This is called the second time.
When weighing for the third time, you can take out a ball (such as C1) from C1 and C2, and place it on both sides of the balance with another qualified ball (such as C3), and the result can be deduced.The reason is the same as above.
The above is the analysis of the first situation after the first weighing.
In the second case, the balance is not balanced after the first weighing.This shows that Group C must be qualified strikes, and the unqualified bad balls must be in Group A or Group B.
We assume: Group A (with four balls A1, A2, A3, A4) is heavy, and Group B (with four balls B1, B2, B3, B4) is light.At this time, you need to take out A1 in the heavy disk and put it aside, take out A2 and A3 in the light disk, and keep A4 in the heavy disk.At the same time, take out B1 and B4 in the light plate and put them aside, take out B2 and put them in the heavy plate, B3 remains in the light plate, and take another standard ball C1 and put it in the heavy plate.After such an exchange, there are three balls in each set: A4, B2, C1 in the original heavy set, and A2, A3, B3 in the original light set.
At this time, it can be called the second time.There are three possible situations after this weighing:
1. Balance on both sides of the balance.This shows that A4B2C1=A2A3B3, which means that these six are only good balls, so the bad ball must be in A1 or B1 or B4 outside the plate.It is known that drive A is heavier than drive B.Therefore, A1 is either a strike or heavier than a strike; while B1 and B4 are a strike or a lighter than strike.
At this time, you can put B1 and B4 on one end of the balance and weigh the third time.At this time, three situations may also occur: (1) If the balance is balanced on both sides, it can be inferred that A1 is an unqualified bad ball. This is because there is only one bad ball out of 12 balls. Since B1 and B4 have the same weight, it can be seen that these twoThe ball is a strike, and A1 is a strike; (2) B1 is lighter than B4, then B1 is a strike; (3) B4 is lighter than B1, then B4 is a strike, because B1 and B4 are strikes,Or lighter than strikes, so the third call is actually a lighter ball than which of the two lighter balls, and the lighter ball must be the bad ball.
2. The plate with A4, B2, C1 (original group A) is heavier than the plate with A2, A3, B3 (original group B).In this case, the bad ball must be in the unexchanged A4 or B3.This is because the exchanged balls B2, A2 and A3 do not affect the weight, so it can be seen that these three balls are good balls.
The above shows that one of A4 or B3 is a bad ball.At this time, it is only necessary to compare A4 or B3 with the standard ball C1.For example, take A4 and put it on one end of the balance, and take C1 and put it on the other end of the balance.This is the third time.If the scales are balanced, then B3 is the bad ball; if the scales are not, then A4 is the bad ball (in this case A4 is heavier than C1).
3. The plate on which A4, B2 and C1 are placed (group A was originally placed) is lighter than the plate placed on A2, A3 and B3 (group B was originally placed).In this case, the bad ball must be among the balls A2, A3, and B23 just exchanged.This is because if A2, A3, and B2 are all good balls, then the bad ball must be in A4 or B3. If A4 or B3 is a bad ball, then the plate on which A4, B2, and C1 are placed must be heavier than that on A2 and A3., B3 plate, the current situation is just the opposite, so it is not that A2, A3, B2 are all good shots.
The above description shows that one of A2, A3 and B2 is a bad ball.At this time, it is only necessary to compare A2 with A3 and call it the third time, that is, which one is the bad ball.Put A2 and A3 on one end of the balance and weigh it for the third time. There are three possible situations: (1) the two sides of the balance are balanced, which can infer that B2 is a bad ball; (2) A2 is heavier than A3, and it can be inferred that A2 is bad(3) A3 is heavier than A2, so it can be inferred that A3 is a bad ball.
Solution 2
*** Divide the balls into three groups of ABC, each group of four, weigh A and B once if they are the same, then there is a bad ball in C, and three balls (C1C2C3) and three normal balls are taken out of CIn the second weighing, if it is balanced, the bad ball is C4, if it is not balanced, the bad ball is in (C1C2C3), then it can be concluded that the bad ball is heavy or light, then take two of the three balls in C at will.If you look at the balance, you can get a bad ball.
If it is tilted for the first time, combine A1B2B3B4 into a group, B1 and other three normal balls are combined, and weigh again, 1. If the situation remains unchanged, there is a bad ball between A1 and B1, and the thirdJust compare any one of A1B1 with a normal ball.2. If the situation is opposite to the first weighing, there are bad balls in B2B3B4, which can be obtained by following the above method.3. In balance, there are bad balls in A2A3A4, and the above method can be used.
边栏推荐
- JDBC知识点
- Detailed Explanation of Addresses Delivered by DHCP on Routing/Layer 3 Switches [Huawei eNSP]
- 无代码平台数字入门教程
- TCP协议 - 三次握手 - 四次挥手-内核参数调优
- 移动端 开源低代码工具 beeware 和 kivy
- 2022 Cloud Native Computing代表厂商 | 灵雀云第三次入选Gartner中国ICT技术成熟度曲线报告
- leetcode经典例题——56.合并区间
- 数据使用要谨慎——不良数据带来严重后果
- 请问下Flink SQL如何写hologres分区表?我想要每天一个分区
- How to restore the Youxuan database with only data files
猜你喜欢
随机推荐
Win7C盘不能扩大怎么办?Win7C盘扩展卷不能点怎么解决
超宽带UWB实时精准定位,短距离无缝交互应用,物联网厘米级精度方案
被Win11安全中心误删除的文件怎么恢复?
多媒体和物联网技术让版本“活”起来 129张黑胶唱片“百年留声”
MindSpore:Ascend运行出现问题
数据万象内容审核 — 共建安全互联网,专项开展“清朗”直播整治行动
GBsae 8 c database using an error, how to do?
双向带头循环链表实现
【cookie 临时存储数据,WebStorage ,sessionStorage】
LVGL's multi-language conversion tool -- a good assistant for font settings
LeetCode中等题之旋转图像
LVS-DR集群部署
VSCode学习资料
EastWave应用:自动计算光子晶体透反率
Detailed explanation of MSTP protocol configuration on Layer 3 switches [Huawei eNSP experiment]
有12个球,其中11个重量相等,只有1个不一样,不知是轻还是重.用天平秤三次,找出这个球.
Anton Paar Anton Paar Density Meter Hydrometer Repair DMA35 Performance Parameters
JS工厂模式_工厂模式进行封装
无代码平台描述文字入门教程
KubeDNS 和 CoreDNS









