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=Geometric mean |
||
5 | input=data1d |
||
6 | !exit |
||
7 | |||
8 | :proc |
||
9 | |||
10 | cnt=!itemcnt $formula |
||
11 | !if $cnt>0 |
||
12 | result=!product x for x in $formula |
||
13 | result=$[($result)^(1/$cnt)] |
||
14 | !else |
||
15 | result=1 |
||
16 | !endif |
||
17 | |||
18 | !exit |
||
19 | |||
20 | :output |
||
21 | |||
6515 | bpr | 22 | <div class="wimscenter"> |
539 | bpr | 23 | Geometric mean = |
24 | !htmlmath $result |
||
6515 | bpr | 25 | </div> |
539 | bpr | 26 | Data: $cnt numbers { $formula } |
27 | <p> |
||
6515 | bpr | 28 | The <em>geometric 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 \left(\prod_{i=1}^n x_i\right)^{1/n} |
539 | bpr | 33 | . |
6515 | bpr | 34 | </p> |
539 | bpr | 35 | !exit |