Interview Questions with diamond

Source: Internet
Author: User

It is known that one has 10 floors and each layer has a diamond

1. You are in an elevator. The elevator goes up, stops every floor only once, and then goes to the upper floor.

2. You can only get one diamond at a time. (You cannot exchange diamond !), Of course, you can observe the diamond on each layer.

Question

How to maximize the probability of "getting the biggest diamond"

Assume that the largest diamond is D10, and the smallest diamond is D1.

1. Assume that only the floors behind the first floor are taken away if they are larger than the first floor.

2. Assume that you only observe the largest diamond in the first two layers, and take the diamond from the back of the floor as long as it is larger than the largest diamond in the first two layers,

What is the highest probability?

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.