当前位置:网站首页>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.
边栏推荐
- Cloud function to achieve automatic website check-in configuration details [Web function/Nodejs/cookie]
- IDEA 自动导入的配置(Auto import)
- 无代码平台描述文字入门教程
- MindSpore:mirrorpad算子速度过慢的问题
- Post-94 Byte P7 posted the salary slip: It's really good to make up for this...
- 二叉树的基础练习
- LVS-DR集群部署
- MindSpore:model.train中的dataset_sink_mode该如何理解?
- HCIP 交换实验
- 参数优化文档介绍
猜你喜欢
MindSpore:【model_zoo】【resnet】尝试用THOR优化器运行时报cannot import name ‘THOR‘
【c】操作符详解(二)
Libtomcrypt AES 加密及解密
MindSpore:【mindinsight】【Profiler】用execution_time推导出来的训练耗时远小于真实的耗时
[Punctuality Atom STM32 Serial] Chapter 3 Development Environment Construction Excerpted from [Punctual Atom] MiniPro STM32H750 Development Guide_V1.1
广东对小鹏/广汽丰田开展网络安全检查
2022-08-03 第六小组 瞒春 学习笔记
张朝阳对话俞敏洪:谈宇宙、谈焦虑、谈创业、谈退休、谈人生
LVS-DR集群部署
iMeta | 德国国家肿瘤中心顾祖光发表复杂热图(ComplexHeatmap)可视化方法
随机推荐
物体颜色的来源
After four years of outsourcing, the autumn recruits finally landed
Multimedia and Internet of Things technology make the version "live" 129 vinyl records "Centennial Voice"
无代码平台附件上传入门教程
The difference between Mysql application log time and system time is eight hours
【C补充】指针相关知识点收集01
HTB-Sense
暴力破解-破解 Apache BASIC 认证
有了这篇 Kubernetes 的介绍,它的原理秒懂!
[Punctuality Atomic STM32 Serial] Chapter 1 Learning Method of the Book Excerpted from [Punctuality Atomic] MiniPro STM32H750 Development Guide_V1.1
关于技术学习的6个观点
超宽带UWB实时精准定位,短距离无缝交互应用,物联网厘米级精度方案
leetcode动态规划经典例题——53.最大子数组和
[论文阅读] Unpaired Image-to-Image Translation Using Adversarial Consistency Loss
[代码阅读] CycleGAN: Unpaired Image-To-Image Translation Using Cycle-Consistent Adversarial Networks
二叉树与堆
HTB-Nibbles
Qt:小的任务管理器(task)
JDBC知识点
Win11不识别蓝牙适配器的解决方法