Tuesday, August 18, 2015

OTHER AVERAGE CALCULATION ALGORITHM

AVERAGE CALCULATION ALGORITHM


normally we calculate average as :

             x1+x2+.........+xn
avg =  ---------------------
                      n











MY ALGORITHM:


                      (xn-x1)+(xn-x2)+......(xn-x(n-1))                                           
avg = x1  +   -----------------------------------                                         
                                            n                                                                     

here, xn is the largest no.


THIS WORKS GOOD FOR 2nos
ie

102.75 and 103.6


traditional avg=(102.75+103.6)/2

BY THIS METHOD

avg=102.75 + (0.85/2) = 103.175

No comments:

Post a Comment