"Non-original" Lightoj 1248-dice (III) "Geometric distribution + expectation"

Source: Internet
Author: User

Study Blog: Poke here

Test instructions: There is an n-sided dice, ask at least see all the faces at once the desired number of times to roll the dice;

The first face of the first occurrence of the probability is P1 n/n;

The probability of the first occurrence of the second face is P2 (n-1)/n;

The probability of the first occurrence of the third face is P3 (n-2)/n;

...

The first occurrence probability is pi (n-i+1)/n;

First look at what the geometric distribution is:

Geometric distribution: In the nth-time Bernoulli test, the probability of the first success was obtained by the test K . In detail: The first k-1 times all failed, the probability of K -times success is p.

Expectation of the geometrical distribution E (X) = 1/p;

So the expectation is ∑1/PI = n * (1+1/2+1/3+1/4+1/5+...+1/n);

"Non-original" Lightoj 1248-dice (III) "Geometric distribution + expectation"

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.