How can I break 2 eggs in a 100-story tall building?

Source: Internet
Author: User

A building has a total of 100 floors. Some Types of eggs will be broken when they fall down from a certain floor or above, and the eggs will be broken down from the lower floor (that is, the critical Floor, the eggs are not damaged. Now I want to give you two identical eggs of this type. Q: How can I find this critical floor through these two eggs?

Solution:

Key: each layer may be a critical layer with the same possibility.

Assume that the first egg broke from the X layer, at most need to try X-1, a total of X;

The first egg not broken, and then from x + X-1 layer fell, if broken, at most still need X-2 attempts, a total of X;

The first egg not broken, and then from x + X-1 + X-2 layer fell, if broken, at most also need X-3 attempts, a total of X;

......

In this way, no matter the first floor is a critical building, it can be obtained only X times at most.

X + X-1 + ...... + 1 = (x + 1) * X/2> = 100, x = 14.

How can I break 2 eggs in a 100-story tall building?

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.