Rev 539 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 539 | bpr | 1 | !goto $wims_read_parm |
| 2 | |||
| 3 | :def |
||
| 4 | title=Quadratic mean |
||
| 5 | input=data1d |
||
| 6 | !exit |
||
| 7 | |||
| 8 | :proc |
||
| 9 | |||
| 10 | cnt=!itemcnt $formula |
||
| 11 | !if $cnt>0 |
||
| 12 | result=!sum x^2 for x in $formula |
||
| 13 | result=$[sqrt(($result)/$cnt)] |
||
| 14 | !else |
||
| 15 | result=0 |
||
| 16 | !endif |
||
| 17 | |||
| 18 | !exit |
||
| 19 | |||
| 20 | :output |
||
| 21 | |||
| 6515 | bpr | 22 | <p class="wimscenter"> |
| 539 | bpr | 23 | Quadratic mean = |
| 24 | !htmlmath $result |
||
| 6515 | bpr | 25 | </p> |
| 539 | bpr | 26 | Data: $cnt numbers { $formula } |
| 27 | <p> |
||
| 6515 | bpr | 28 | The <em>quadratic mean</em> of |
| 29 | \(\{x_1, x_2, ..., x_n\}\) |
||
| 30 | is equal to |
||
| 539 | bpr | 31 | !set ins_align=middle |
| 6515 | bpr | 32 | !insmath \sqrt{{1\over n}\sum_{i=1}^n x_i^2} |
| 539 | bpr | 33 | . |
| 6515 | bpr | 34 | </p> |
| 539 | bpr | 35 | !exit |