calculate values of Z-table with DM42

Discussion around the Swiss Micros DM42 calculator.
fridlmue
Posts: 23
Joined: Mon Dec 09, 2019 9:57 am
Location: Germany - Saxony

calculate values of Z-table with DM42

Hi there,

as I'm not a native speaker probably there is already the solution for my question in the forums but I'm not able to find it because I search for the wrong terms.
I'm a happy new owner of a DM42 and now I'm searching for a solution to calculate the "values of the Z-table" with the calculator. (Like in https://www.dummies.com/education/math/ ... e-z-table/.)
I know what to search for in German ("(einseitige) Abgrenzung der Standardnormalverteilung" but I don't know what to search for in English
E.g. I want to calculate the probability for z=2,26 in the standard normal distibution.
Is there any program, either "pre-installed" in the program lib or some you know from, that can solve that task?
Or is it even possible to build a program calculating that?

Thanks and best regards
Friedrich
HP-41cx, HP-35s, DM42
PierreMengisen
Posts: 139
Joined: Wed Nov 29, 2017 1:38 pm
Location: Neuchâtel CH

Re: calculate values of Z-table with DM42

It is a normal distribution centered and reduced. You must evaluate it by a numerical integration of the function "(exp (-0.5 * x ** 2)) / sqrt (2π)" from -∞ to x. For this you have the HP42S digital integration program.
Pierre
[TI59 with PC100C; TI-84 Plus CE-T; HP41CV with HP IL loop & 2*82161A DCD & 82162 TP; HP15C; HP28S; DM41; DM41L; DM42; DM41X]
fridlmue
Posts: 23
Joined: Mon Dec 09, 2019 9:57 am
Location: Germany - Saxony

Re: calculate values of Z-table with DM42

Ok, I'll try that! Thanks!
HP-41cx, HP-35s, DM42
fridlmue
Posts: 23
Joined: Mon Dec 09, 2019 9:57 am
Location: Germany - Saxony

Re: calculate values of Z-table with DM42

So I wrote the following program representing the formula:

Code: Select all

01 LBL "SND"
02 MVAR "z"
03 RCL "z"
04 x^2
05 +/-
06 0.5
07 x
08 e^x
09 2
10 ENTER
11 PI
12 x
13 SQRT
14 /

Now I try to integrate this for the variable z from LLIM = -1 to ULIM = 1 with different accuracy. Shouldn't that return ~0.682 (68,2%)? But I get something around 0.2724
It looks like I'm doing wrong somehow. Any idea what?

My second question is: What do I insert, if I want to integrate from -∞. Do i just use a very, very big negative number instead of -∞?

EDIT: I inserted the SQRT on line 13 as I got pointed to that a few posts later...
Last edited by fridlmue on Thu Dec 12, 2019 3:04 pm, edited 1 time in total.
HP-41cx, HP-35s, DM42
rprosperi
Posts: 1105
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: calculate values of Z-table with DM42

fridlmue wrote:
Thu Dec 12, 2019 2:26 pm
My second question is: What do I insert, if I want to integrate from -∞. Do i just use a very, very big negative number instead of -∞?
Basically, yes. The 42S "Programming Examples and Techniques" manual discusses this exact topic on p.127; I'd suggest reading that as there is some explanation and examples to illustrate how to do this.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Coyotte
Posts: 8
Joined: Sat Sep 28, 2019 3:59 pm
Location: Liège (BE)

Re: calculate values of Z-table with DM42

Hello,

I'm far from being a specialist of the subject but just with a developper point of view, I do not see the Square Root appear in your program.
(But maybe is it normal...)

Regards,

Coyotte
fridlmue
Posts: 23
Joined: Mon Dec 09, 2019 9:57 am
Location: Germany - Saxony

Re: calculate values of Z-table with DM42

Coyotte wrote:
Thu Dec 12, 2019 2:50 pm
Hello,

I'm far from being a specialist of the subject but just with a developper point of view, I do not see the Square Root appear in your program.
(But maybe is it normal...)

Regards,

Coyotte
Oh, men, you are so right! That was the Issue
Thanks!
HP-41cx, HP-35s, DM42
fridlmue
Posts: 23
Joined: Mon Dec 09, 2019 9:57 am
Location: Germany - Saxony

Re: calculate values of Z-table with DM42

rprosperi wrote:
Thu Dec 12, 2019 2:49 pm
fridlmue wrote:
Thu Dec 12, 2019 2:26 pm
My second question is: What do I insert, if I want to integrate from -∞. Do i just use a very, very big negative number instead of -∞?
Basically, yes. The 42S "Programming Examples and Techniques" manual discusses this exact topic on p.127; I'd suggest reading that as there is some explanation and examples to illustrate how to do this.
Cool! Thanks for the hint! This works pretty well for me with arguments LLIM -1000 and ACC 0.00001. I'm going to Iterate the best Value. Perhaps after that I'll pack all of it into a nice program... Makes fun so far to figure out the possibility
HP-41cx, HP-35s, DM42
PierreMengisen
Posts: 139
Joined: Wed Nov 29, 2017 1:38 pm
Location: Neuchâtel CH

Re: calculate values of Z-table with DM42

With a centered and reduced distribution, it is not wise to use infinity as lower limit. For x <0 the probability is (0.5 - integral from x to 0). For x> 0 the probability is (0.5 + integral from 0 to x).
Pierre
Pierre
[TI59 with PC100C; TI-84 Plus CE-T; HP41CV with HP IL loop & 2*82161A DCD & 82162 TP; HP15C; HP28S; DM41; DM41L; DM42; DM41X]
fridlmue
Posts: 23
Joined: Mon Dec 09, 2019 9:57 am
Location: Germany - Saxony

Re: calculate values of Z-table with DM42

PierreMengisen wrote:
Thu Dec 12, 2019 4:53 pm
With a centered and reduced distribution, it is not wise to use infinity as lower limit. For x <0 the probability is (0.5 - integral from x to 0). For x> 0 the probability is (0.5 + integral from 0 to x).
Pierre
If i think about it, this makes fully sense. Thank you for this second very valuable hint!
HP-41cx, HP-35s, DM42