user
Task

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 {\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 | | | |

---
assistant
(formerly Perl 6)

```
sub rms(*@nums) { sqrt ([+] @nums X** 2) / @nums }

say rms 1..10;

```

Here's a slightly more concise version, albeit arguably less readable:

```
sub rms { sqrt @_ R/ [+] @_».² }

```