Saturday, February 14, 2026

RPN: Absolute Value Equations with the HP 11C and DM41X

RPN: Absolute Value Equations with the HP 11C and DM41X



Introduction: Solving |z * w + y| = x


Today’s blog focuses on solving the absolute value equation:


|z * w + y| = x


for the variable w, and the values of z, y, and x are given and are on the Classic RPN stack.


For example, in the problem |5 * w + 7| = 2, the stack would be set up as:


t: (anything, it doesn’t matter)

z: 5

y: 7

x: 2


(This is why I set the variable as w instead of the usual x.)


One approach is to use memory registers and other uses only stack operations. Today’s algorithm focuses on the latter.


Caution: In the above equation, x will always be non-negative. The equation will never be valid if x is negative.



The Algebra


Solve for w:

|z * w + y| = x


This leads us to solve the two equations:


(I)

z * w + y = -x

z * w = -x – y

w = -x/z – y/z


Let w- = -x/z – y/z = (-x/z) + (-y/z)


(II)

z * w + y = x

z * w = x – y

w = x/z - y/z


Let w+ = x/z – y/z = (x/z) + (-y/z)


Then:


w- = -x/z – y/z

w- = (-x/z) + (-y/z)

w- = (-x/z) + (-y/z) + (-x/z) + (x/z)

w- = 2 * (-x/z) + (x/z) + (-y/z)

w- = 2 * (-x/z) + w+


RPN Code: HP 11C (adoptable for other RPN calculators)


LBL A

001

42, 21, 11

Program start

R↓

002

33


R↓

003

33


X<>Y

004

34


R↓

005

33


1/x

006

15


×

007

20


LST x

008

43, 36


X<>Y

009

34


R↓

010

33


×

011

20


LST x

012

43, 36


R↑

013

43, 33


X<>Y

014

34


R↓

015

33


X<>Y

016

34


CHS

017

16


X<>Y

018

34


+

019

40


ENTER

020

36


ENTER

021

36


LST x

022

43, 36


-

023

30


LST x

024

43, 36


-

025

30


RTN

026

43, 32

Program end


RPN Code: DM41X (HP 41C series, no module is required)


LBL “ASBEQ”

RDN

RDN

X<>Y

RDN


1/x

×

LAST X

X<>Y

RDN

×

LAST X

R↑

X<>Y


RDN


X<>Y

CHS

X<>Y


+

ENTER

ENTER

LAST X

-

LAST X

-


RTN



Notes:

* RDN is shown as R↓

* To enter R↑, press XEQ, ALPHA, R, SHIFT, ENTER, ALPHA



Subroutines Used


We used several techniques to manipulate the stack. They are presented below:


Rotate stack from X, Y, Z, T to Z, X, Y, T

R↓

R↓

X<>Y

R↓


Source:

Ball, John A. Algorithms for RPN Calculators John Wiley & Sons: New York. 1978. ISBN 0-471-03070-8. pg. 78



Multiply Y and Z by 1/X. Stack: X, Y, Z, T → X, Y/X, Z/X, T


1/x

×

LAST X

X<>Y

R↓

×

LAST X

R↑

X<>Y


Change X, Y to Y+ X, Y – X


+

ENTER

ENTER

LAST X

-

LAST X

-


The resulting stack is:


z

z

y + x

y – x


Doing LAST X, -, twice is effectively subtracting whatever is in L register twice.



Examples


|4 * w – 6| = 5


Stack:

z: 4

y: -6

x: 5


Results:

y: 2.75

x: 0.25


|2 * w + 5| = 3


Stack:

z: 2

y: 5

x: 3


Results:

y: -1

x: -4




Eddie


All original content copyright, © 2011-2026. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Saturday, February 7, 2026

Numworks (Python): Control Charts

 Numworks (Python): Control Charts



The following Python script develops the x-bar and R control charts.


Formulas used:


mean_average = Σ(mean of each sample)

range_average = Σ(range of each sample)



x-Bar Chart:

low = mean_average - a2 * range_average

high = mean_average + a2 * range_average


R chart:

low = d3 * range_average

high = d4 * range_average



Python script (done with Numworks): ctrlchart.py


from math import *

# control chart function

# run as a defined function

# HP 65 Stat Pac 2, 1975



def ctrlchart():

  #elements

  a2=[0,0,1.88,1.02,.73,.58,.48,.42,.37,.34,.31,.29,.27,.25,.24,.22,.21,.20,.19,.19,.18]

  d3=[0,0,0,0,0,0,0,.08,.14,.18,.22,.26,.28,.31,.33,.35,.36,.38,.39,.4,.41]

  d4=[0,0,3.27,2.57,2.28,2.11,2,1.92,1.86,1.82,1.78,1.74,1.72,1.69,1.67,1.65,1.64,1.62,1.61,1.6,1.59]

  # calculation

  meansum=0

  rangesum=0

  n=int(input("number of samples? "))

  m=int(input("sample size (2-20)? "))

  for i in range(n):

    x=[]

    for j in range(m):

      # adjust to show proper numbering

      s="x("+str(i+1)+","+str(j+1)+")? "

      p=eval(input(s))

      x.append(p)

    rangesum+=max(x)-min(x)

    meansum+=sum(x)/m

  rangeavg=rangesum/n

  meanavg=meansum/n

  lowmean=meanavg-rangeavg*a2[m]

  highmean=meanavg+rangeavg*a2[m]

  lowrange=d3[m]*rangeavg

  highrange=d4[m]*rangeavg

  print("x-bar chart")

  print("L: "+str(lowmean))

  print("H: "+str(highmean))

  print("range chart")

  print("L: "+str(lowrange))

  print("H: "+str(highrange))


Example 1:

5 samples (n = 5)
Sample size: 4  (m = 4)

Sample 1:  4.3, 4.2, 4.3, 5.0
Sample 2:  4.1, 4.1, 4.6, 3.6
Sample 3:  4.0, 4.5, 4.3, 3.7
Sample 4:  3.9, 4.7, 4.4, 5.1
Sample 5:  4.2, 5.2, 4.9, 5.3

x-Bar chart:
Low:  3.7046
High:  5.1354

R chart:
Low:  0
High:  about 2.2345

Example 2:

2 samples (n = 2)
Sample Size: 7 (m = 7)

Sample 1:  48, 58, 53, 56, 57, 59, 55
Sample 2:  56, 46, 48, 49, 63, 52, 51

x-Bar chart:  
Low:  47.33428571428571
High:  59.09428571428571

R chart:
Low:  1.12
High: 26.88

Source


“x-bar and R Control Charts”. HP 65 Stat Pac 2. Hewlett Packard. 1975. pp. 98 – 101



Eddie


All original content copyright, © 2011-2026. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


Monday, February 2, 2026

Dozenal RPN Calculator App for Android for Android Smartphones and Numworks Beta Firmware Version 25

 Dozenal Calculator App for Android Smartphones and Numworks Beta Firmware Version 25


Dozenal Calculator App for Android Smartphones


The Dozenal RPN Calculator app is by Unum Designum for the Android smartphones. It is a classical, four-level stack RPN (Reverse Polish Notation) app that operates in both dozenal (i.e. duodecimal, Base 12) and decimal (Base 10). The calculator app features a standard set of scientific functions:


* arithmetic, square, square root

* sin, cos, tan, and inverses

* e^x, 10^x, ln, log

* DMS/Decimal conversions and HMS/Hours conversions (not sure how there are two sets, since they seem to do the same thing)

* Pol/Rect conversions

* percent function (%)

* Stack functions: roll down, roll up, swap, last x


Originally Released: July 1, 2020

Last Updated: December 17, 2025 (as of January 22, 2026)

Version I am reviewing 1.0.11


The polar/rectangular conversions follow the conventional RPN calculator format:



Rectangular

Polar

Y Stack:

Y

Θ

X Stack:

X

R



The percent function follows the conventional RPN calculator format:



Before

After

Y Stack:

Y

Y

X Stack:

X

Y * X ÷ 100



However, the decimal/DMS (decimal-minute-seconds) and hours/HMS (hours-minute-seconds) follow up this format:



Decimal/Hours

DMS/HMS

Z Stack:

0 after conversion

seconds

Y Stack:

0 after conversion

minutes

X Stack:

decimal/hours as a decimal

decimal/hours



Conversion between bases is just a matter of pressing [ f ] [ DOZ/DEC ].





Symbols:


* Upside down 2 (↊) represents 10 (Unicode 218A); commonly symbolized by X

* Backwards 3 (↋) represents 11 (Unicode 218B); commonly symbolized by E

(Unicode is from Wikipedia: https://en.wikipedia.org/wiki/Duodecimal)




Two constants provided by the Dozenal RPN app:


Base 10 (e: 10^n)

Base 12 (e: 12^n)

Ï€

3.141592653589793

3;184809493↋9186459↊↊

Planck

6.6206070149999999e-34

1;↊79611175↊0925342846e-27


App information: https://play.google.com/store/apps/details?id=dozecal.unumdesignum.com&hl=en_NZ#/





Numworks: Beta Firmware 25



Version 25 Information: https://www.numworks.com/calculator/update/version-25/



Nuwmorks has released a firmware update 25.1. It is a beta version software where new features are tested. To try it, Numworks is inviting Numworks users to download and become a beta test or us the beta emulator on the Numworks website.



Verison 25 Beta Emulator: https://www.numworks.com/calculator/update/version-25/

Please keep in mind that this emulator is probably only available for the testing period and may become unavaiable once the official release is made.



Major updates include:

* Data in the Statistics app can either be qualitative (data points, the way the statistics mode was always used) or categorial (data points always belong to specific categories, up to 10)

* The Grapher app can shade area of intersection for a given set of inequalities.

* The Grapher app also finds intersection points of conic sections and vertical lines.

* In the Calculations app, results with five or more decimal place will have at least a fractional approximation in the Additional Results quick tab.

* The degree and radian symbol/indicators are added to the Toolbox.

* Sequences have new notations.

* Installing this version will limit roll back deinstalls to versions 24.11 or later.



No word on any additions or changes to the Python app.



I have installed version 25 on my older Numworks calculator (N0110) so I can try them out.



RPN: Absolute Value Equations with the HP 11C and DM41X

RPN: Absolute Value Equations with the HP 11C and DM41X Introduction: Solving |z * w + y| = x Today’s blog focuses on solvi...