Click to like/follow us on:
Write an Algorithm that will request for an integer number n afterwards it will request for n pairs of scores Xi and Yi. The algorithm will calculate and display the statistics:

Covariance
Solution:
1. Request n
2. Determine Covariance
   2.1 sumX
   2.2 sumY
   2.3 count = 1
   2.4 covariance = 0
   2.5 sumProduct = 0
   2.6 count = count + 1
   2.7 Request Pair X, Y
   2.8 sumProduct = sumProduct + (X * Y)
   2.9 sumX = sumX + X
   2.10 sumY = sumY + Y
   2.11 Repeat  2.6 - 2.10 until count <= n
   2.12 covariance = sumProduct - ((sumX + sumY) / (n)) / (n - 1)
3. Display covariance

And that is it.

SHARE THIS POST WITH YOUR FRIENDS...::

0 comments:

Leave a Reply

All Posts

Access all posts here!

Categories

Unordered List

Sample Text

Lists of Jobs in the United States

List of Courses & Outlines For UNN Students

Popular Posts

Like us on Facebook

Recent Posts

    Text Widget