Task[edit]
Compute the   Root mean square   of the numbers 1..10.



The   root mean square   is also known by its initials RMS (or rms), and as the quadratic mean.

The RMS is calculated as the mean of the squares of the numbers, square-rooted:



 




x


r
m
s



=







x

1




2


+



x

2




2


+
⋯
+



x

n




2



n



.


{\displaystyle x_{\mathrm {rms} }={\sqrt {{{x_{1}}^{2}+{x_{2}}^{2}+\cdots +{x_{n}}^{2}} \over n}}.}




See also
Tasks for calculating statistical measures



in one go
moving (sliding window)
moving (cumulative)

Mean
Arithmetic

Statistics/Basic
Averages/Arithmetic mean
Averages/Pythagorean means


Averages/Simple moving average




Geometric

Averages/Pythagorean means




Harmonic

Averages/Pythagorean means




Quadratic

Averages/Root mean square




Circular

Averages/Mean angle
Averages/Mean time of day




Median

Averages/Median




Mode

Averages/Mode




Standard deviation

Statistics/Basic



Cumulative standard deviation






NewList MyList()  ; To hold a unknown amount of numbers to calculate
 
If OpenConsole()
  Define.d result
  Define i, sum_of_squares
 
  ;Populate a random amounts of numbers to calculate
  For i=0 To (Random(45)+5) ; max elements is unknown to the program
    AddElement(MyList())
    MyList()=Random(15)  ; Put in a random number
  Next
 
  Print("Averages/Root mean square"+#CRLF$+"of : ")  
 
  ; Calculate square of each element, print each & add them together
  ForEach MyList()  
    Print(Str(MyList())+" ")             ; Present to our user
    sum_of_squares+MyList()*MyList()     ; Sum the squares, e.g
  Next
 
  ;Present the result
  result=Sqr(sum_of_squares/ListSize(MyList()))
  PrintN(#CRLF$+"= "+StrD(result))
 
  PrintN("Press ENTER to exit"): Input()
  CloseConsole()
EndIf