ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > IMPC - 2013-2014 > задача:


2013-04-90. 50332 - Variance of a series

IMPC - 2013-2014

Старт: 16.мар.2013 в 12:00:00
Финиш: 16.мар.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (2)

Задачи турнира

• 2013-03-40. 50685 - Perdorimi i dh...
• 2013-04-10. 50335 - Five Math Ope...
• 2013-04-100. 50323 - Filtering Cont...
• 2013-04-30. 50337 - Exam Averages
• 2013-04-40. 50338 - Convert Into ...
• 2013-04-50. 50774 - Hot Potato
• 2013-04-70. 50296 - Total Discount...
• 2013-04-80. 50343 - The number of...
• 2013-04-90. 50332 - Variance o...
• 2013-05-10. 50552 - Kepuce te perd...
• 2013-05-30. 50580 - Sa dite kane ka...
• 2013-05-40. 50553 - I pjestueshem...
• 2013-05-50. 50593 - Transportimi
• 2013-12-10. 50352 - Selling Cows
• 2013-12-40. 50342 - 100 Factorial
• 2013-12-50. 50674 - Collecting Eggs
• 2013-Nov-01. 50328 - How far away

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan.

Variance of a series

In Statistics, Variance is a measure of how values vary from the mean. The Variance of a series of numbers can be calculated with the following formula

where
  • σ2 is the variance of a series
  • n is the number of elements in the series
  • xi represents each number in the series
  • µ is the mean of series

The variance of the series {1, 2, 3, 4, 5, 6} then can be calculated, like this:
  µ = (1 + 2 + 3 + 4 + 5 + 6) / 6 = 3.5
S = (1 - 3.5)2 + (2 - 3.5)2 + (3 - 3.5)2 + (4 - 3.5)2 + (5 - 3.5)2 + (6 - 3.5)2
    = (-2.5)2 + (-1.5)2 + (-0.5)2 + (0.5)2 + (1.5)2 + (2.5)2
    = 17.5
 σ2 = (1 / n) * S = (1 / 6) * 17.5
 σ2 = 2.9167

Input specification
You will first be given a number (n) which shows the number of numbers in the following line. The following line contains n integer numbers (xi) where each of the numbers is 1 ≤ xi ≤ 3000 and 1 ≤ n ≤ 5000.

Output specification
Show one float number that represent the variance of the given series.

 Sample Input I   Sample Input II 
  6
  1 2 3 4 5 6
  10
  4 4 7 2 1 2 5 5 1 1   
 Sample Output 1   Sample Output 2 
  2.916   3.96

Для отправки решений необходимо выполнить вход.

www.contester.ru