Блог пользователя Tanmoy1228

Автор Tanmoy1228, история, 9 лет назад, По-английски

Problem: 453A - Little Pony and Expected Maximum

can not understand the solution in editorial

can anyone give me any idea of solution in deails???

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
9 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Expected values are calculated as follows E[X] = sum(x*p(x)) where X is a random variable and 'x' are all possible outcomes

Lets define a random variable X to be the maximum of n tosses of m-sided dice. 'x' are all possible maximums that can happen (1,2,3,..,m) and p(x) is the probability that x is the maximum.

Tricky thing here is to calculate p(x) for each x. You have to use the formula for combinations with repetition: If you toss the m-sided dice n times, there are m^n possible outcomes.

For a maximum 'x' you can use formula p(x) = (x^n — (x-1)^n) / m^n

Let me elaborate this. We count all the outcomes where you never toss a dice higher than x (there are x^n of them). That means that for these outcomes the maximum will be <=x. From that we have to subtract the outcomes where you toss only numbers less than x (there are (x-1)^n of them). Now you have the number of outcomes where maximum is x. You divide that by m^n (number of total outcomes that can happen) and you have yourself the probability that after n tosses, you will get maximum x.