HP Forums
HP 35S Programme to Produce 2 Normal Deviates - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: HP 35S Programme to Produce 2 Normal Deviates (/thread-1599.html)



HP 35S Programme to Produce 2 Normal Deviates - Gerald H - 06-11-2014 04:07 PM

For no input the programme returns two normal deviates for average 0 and standard deviation 1:

1 LBL T
2 XEQ T021
3 x<>y
4 XEQ T021
5 R↑
6 +
7 1
8 x<=y?
9 GTO T002
10 R↓
11 ENTER
12 LN
13 x<>y
14 ÷
15 -2
16 *
17 SQRTx
18 REGZ*REGX
19 REGZ*REGY
20 RTN
21 RANDOM
22 2
23 *
24 1
25 -
26 ENTER
27 x^2
28 RTN

Edit: Sorry, this should be in General Software.


RE: HP 35S Programme to Produce 2 Normal Deviates - Marcus von Cube - 06-14-2014 02:34 PM

(06-11-2014 04:07 PM)Gerald H Wrote:  For no input the programme returns two normal deviates for average 0 and standard deviation 1
Can you explain in a few words what this is and the formula you're using. I tried to follow the Wikipedia Article but I'm a bit lost.


RE: HP 35S Programme to Produce 2 Normal Deviates - Thomas Klemm - 06-14-2014 05:21 PM

(06-14-2014 02:34 PM)Marcus von Cube Wrote:  Can you explain in a few words what this is and the formula you're using.

cf. Box–Muller transform (polar form)

Cheers
Thomas


RE: HP 35S Programme to Produce 2 Normal Deviates - Paul Dale - 06-14-2014 10:43 PM

This is quite an amazing result -- take two independent uniform samples, apply a transform to the pair and get two independent normal samples. The fact that independence is maintained is the real surprise.


- Pauli