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

Турниры > CEN - 372 Homework > задача:


2015-50. 50659 - Covariance Matrix

CEN - 372 Homework

Старт: 16.сен.2015 в 10:00:00
Финиш: 16.мая.2016 в 14:00:00
Турнир завершён!
• Турнирная таблица

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

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

• 2015-10. 50517 - Confusion Matrix
• 2015-20. 50518 - Histogram Equaliz...
• 2015-30. 50519 - Image Filtering
• 2015-40. 50498 - K-Means
• 2015-50. 50659 - Covariance M...
• 2015-60. 50505 - kht Puzzle
• 50. 50796 - KNN

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

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

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

Covariance Matrix

In probability theory and statistics, covariance is a measure of how much two random variables change together.

e.g. if you have the following 6 rows and 2 cols series, covariance matrix can be calculated as follows: First you calculate the average of every columns (4.5; 5)

Then, you calculate residuals by subtracting the average from every element of series:
Residual of every row is multiplied with its transpose (rotated 90o).
Then, the results are summed up and divided by (n-1) (5).

Question: Write a program that reads n rows m columns series. And then, it calculates and shows the covariance matrix.

Input specification
You will be given two numbers (n and m) in the beginning where 1 ≤ n ≤ 1000 and 1 ≤ m ≤ 50. Then Then in the following n lines you will be given m integers where the given numbers are integers between 0 and 1000.

Output specification
Show the covriance matrix with two digits precision.

Sample Input I
6 2
3 2
2 4
3 4
6 5
6 7
7 8
Sample Input II
6 3
11 9 8
5 11 9
9 7 8
1 0 4
5 10 7
10 11 2
Sample Output I
4.3 3.8
3.8 4.8
Sample Output II
14.57 9.80 0.87
9.80 17.60 3.00
0.87 3.00 7.47


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

www.contester.ru