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

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

https://www.spoj.com/problems/ADASEA/ Anyone who can give me an explanation. I am not able to comprehend

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

»
11 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
This is an expected value problem. 
Expected value = value * probability_of_getting_this_value
Looking at cases 3 and 5 from the sample:
6/20 chance of landing on an island of size 2, 4/20 chance of landing on an island of size 4.
6 * 2 + 4 * 4 / 20 = 28 / 20 = 7 / 5
TC5:
6/16 chance of landing on an island of size 6, so the expected value is 6 * 6 / 16 = 9 / 4