100 floors and two glass balls

Source: Internet
Author: User

There is a 100-storey building that gives you two identical glass balls. It is assumed that the glass ball will be broken after being dropped from a layer. So how can we use the two balls in our hands and use the best strategy to know what layer the critical layer is ???

The number of throws is unevenly distributed. It is estimated by the worst case that this method has been done several times.In order to minimize the number of throws in the worst case, we hope that the total number of throws will remain unchanged no matter where the critical segment is located, that is to say, even distribution of throws..
The next solution is easy to come up with: Since the number of throws in the first step (determining the critical segment) increases, let's take the second step (determining the critical Layer) the number of throws decreases with the increase in the first step. The number of throws in the first step increases at a time, which reduces the number of throws in the second step at a time. Assume that the number of layers to be dropped for the first time is F, which is converted into a mathematical model. F + (F-1) +... + 2 + 1> = 99, that is, F (F + 1)/2> = 99 (it is meaningless to select layer 100 for the first test point, and it will be broken, so there is no test value, so the first test point K is a number in 1-99), and the solution result is equal to 14. The floors where the first egg is left are 14, 27,
39, 50, 60, 69, 77, 84, 90, 95, 99.

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.