How to Use dice to select 7 cases with even Probability

Source: Internet
Author: User

2012-02-12 wcdj

Problem description:

A dice has 6 sides with even probability. I have 7 things to choose randomly and evenly. How can I continue to throw at least?
Problem Extension: If I have four things, five things, eight things, nine things, ten things ...... How can I use n cases?Minimum throwing timesTo achieveUniform Distribution?

From:
The problem comes from

Ideas:

Note the keywords in the problem: (1) least throwing times (2) requires even Probability Distribution

Let's describe the problem in an easy-to-understand way: we decided to have a dinner on the weekend. At this time, there were 6 alternative hotels for us to choose, in order to be fair, you can randomly select a restaurant by throwing a dice.

However, if there are seven alternative hotels at this time, we also need to be fair. How can we choose which hotel to go with six dice?

Method:

If you throw a dice twice, you can get a number in the range [7, 42] (in hexadecimal notation). Assume that the number of throws is expressed as m, and if M = 7, it is discarded, otherwise, the number obtained by M mod 7 is the final result.

When PS: M = 7, it will increase the probability of 0, so we should discard it.

In another way, you can throw the dice twice to obtain a number in the range [7, 42]. In this case, 36 random numbers are obtained, corresponding to the range [1, 36]. Therefore, assume that the number of throws is m, and if M = 36, discard. Otherwise, the number obtained by M mod 7 is the final result. Similarly, when M = 36, it will increase the probability of 1, so we should discard it.

Conclusion:

(1) The concept of flexible use of N-base, although the life of more than 10-base. This question uses a 6-in-6 idea, that is, result = y * 6 + X. In this example, X indicates the number of points thrown for the first time, and y indicates the number of points thrown for the second time.

(2) The sum method does not satisfy the even probability distribution. The result of the sum is a normal distribution. The probability of the intermediate value is the highest, and the probability of the maximum and minimum values is the lowest.

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.