Showing posts with label function. Show all posts
Showing posts with label function. Show all posts

Saturday, May 2, 2026

TI-84 Plus CE, HP 15C, and HP 12C: Decoding the Gradematic 100

TI-84 Plus CE, HP 15C, and HP 12C: Decoding the Gradematic 100





GPA as a function of grade



Last December, we have gave a spotlight on the Calculated Industries 100 from 1983. The Gradematic 100 was a specialty calculator that determines the GPA average for a student or a bunch of students in a class. We can either use numerical grades, where the maximum total score and the minimum passing grade (better than E (or F)) are set, or letter grades, where the letters are given an approximated. To see the review, click the link below:



https://edspi31415.blogspot.com/2025/12/spotlight-calculated-industries.html



Using the standard grade scale for a single assignment, with a perfect score being 100 and the minimum passing grade is 60, the following scores are given the GPA:



GRADE (0 – 100)

GPA

Letter Grade Given by Gradematic 100

0

0.00

E (can stand for F)

10

0.08

E (can stand for F)

20

0.16

E (can stand for F)

30

0.25

E (can stand for F)

40

0.33

E (can stand for F)

50

0.41

E (can stand for F)

55

0.45

E (can stand for F)

60

0.50

D-

65

1.00

D

70

1.50

C-

75

2.00

C

80

2.50

B-

85

3.00

B

90

3.50

A-

95

4.00

A

100

4.50

A+



Plot of values (using a TI-84 Plus CE):







As we can see, the plot consists of two line segments: one where grades value from 0 to 60, and one where grades value from 60 and higher. It is apparent that that the two parts makes a piece-wise function consisting of two lines.






Note: the graphs and statistics were done with the TI-84 Plus CE Python (will work with any TI-84 CE family). The piecewise function is from the math-math menu.



The Gradematic 100 distributes the GPA as:

E: 0.00 (or F)

D+: 1.33

C+: 2.33

B+: 3.33

A+: 4.33

D-: 0.66

C-: 1.66

B-: 2.66

A-: 3.66


D: 1.00

C: 2.00

B: 3.00

A: 4.00




Note: The distributed GPA scales will vary among the school districts and systems. However, we will assume the system that matches the default 60/100 system.



HP 15C and HP 12C: Find the GPA given numeric grade



HP 15C Code:

LBL C

001

42, 21, 13

6

002

6

0

003

0

x≤y

004

43, 10

GTO 1

005

22, 1

2

006

2

×

007

20

÷

008

10

RTN

009

43, 32

LBL 1

010

42, 21, 1

CL x

011

43, 35

1

012

1

0

013

0

÷

014

10

5

015

5

.

016

48

5

017

5

-

018

30

RTN

019

43, 32



HP 12C Code:



6

01

6

0

02

0

x≤y

03

43, 34

GTO 09

04

43, 33, 09

2

05

2

×

06

20

÷

07

10

GTO 00

08

43, 33, 00

CL x

09

35

1

10

1

0

11

0

÷

12

10

5

13

5

.

14

48

5

15

5

-

16

30

GTO 00

17

43, 33, 00



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, March 8, 2025

RPN with HP 15C & DM32: Expanding Linear Regression

RPN with HP 15C & DM32: Expanding Linear Regression



Linearize” the Equation


The linear regression mode of the HP 15C and Swiss Micros DM32 can be expanded to fit different curves for bi-variate data.


Curves can be set up for linear regression if we can get the equation into the form:


y = b + m * x ⇒ f(y) = b + m * g(x)


where b is the y-intercept and x is the slope. The correlation is r and r^2 can be used to determine the relationship between x (independent) and y (dependent) variables. If r^2 is close to 1, the better the curve fits to the data.


Note: f(y) and g(x) are functions that contain only one term (sin y, cos y, e^y, 1/y, y^2 …. sin x, cos x, e^x, 1/x, x^2, ….)


The DM32 labels the slope as m, y-intercept as b. Each of the parameters can be recalled separately.


The HP 12C labels the slope as a, y-intercept as b. Both a and b are calculated by the key sequence [ f ] [ Σ+ ] (L.R.): slope is on the y-stack and the y-intercept is on the x-stack. To get the correlation, enter any (valid) number and press [ f ] [ . ] (y-hat, r) [ x<>y ].


Let’s illustrate this for with a couple of examples.


y = 1 / (b + m * e^(-x))

1/y = b + m * e^(-x)


We have the equation in the required form with the following adjustments: x’ = e^(-x), y’ = 1/x.


y = b * m^x

ln y = ln (b * m^x)

ln y = ln b + ln (m^x)

ln y = ln b + x * ln m


We have the equation in the required form with the following adjustments: x’ = x, y’ = ln y.

Now note that we have ln b and ln m. This will require an adjustment when the linear regression is calculated. To get the “true” slope and y-intercept in this case, we must calculate e^b and e^m.


To employ different curve fittings, I use (at least) two programs:


Entering data (DM32, HP15C):

LBL #

g(x)

x<>y

f(y)

x<>y

Σ+

R/S

GTO #


Entering data:

CLEAR Σ (CLΣ)

y1 ENTER x1 XEQ/GSB #

yn ENTER xn R/S


You can enter as many data points as you like.


Calculating the Parameters:

DM32:

LBL @

b

(adjustments if needed)

R/S

m

(adjustments if needed)

R/S

r

x^2

RTN


HP 15C:

LBL @

L.R.

(adjustment if needed)

R/S

x<>y

(adjustment if needed)

R/S

1

y-hat, r

x<>y

x^2

RTN



Example 1: y = 1 / (b + m * e^(-x))

Linearized: 1 / y = b + m * e^(-x)


Adjustments: x’ = e^(-x), y’ = 1 / y, no adjustment to b or m


Enter Data:

HP 15C Code

HP 15C Key

DM32

42, 21, 11

LBL A

LBL D

16

CHS

+/-

12

e^x

e^x

34

x<>y

x<>y

15

1/x

1/x

34

x<>y

x<>y

49

Σ+

Σ+

31

R/S

R/S

22, 11

GTO A

GTO D


Calculating the Parameters:

HP 15C Code

HP 15C Key

DM32

42, 21, 1

LBL 1

LBL R

42, 49

L.R.

b

31

R/S

R/S

34

x<>y

m

31

R/S

R/S

1

1

r

42, 48

y-hat, r

x^2

34

x<>y

RTN

43, 11

x^2


43, 32

RTN



Example:

x

y

0.0

0.125

0.1

0.13

0.2

0.134

0.3

0.138

0.4

0.143

0.5

0.147


Results (FIX 5):


HP 15C

DM32

Intercept (b)

4.98312

4.98312

Slope (m/a)

3.01575

3.01575

r^2

0.99841

0.99841



Example 2: y = ln(b + m * e^(-x))

Linearized: e^y = b + m * e^(-x)


Adjustments: x’ = e^(-x), y’ = e^(y), no adjustment to b or m


Enter Data:

HP 15C Code

HP 15C Key

DM32

42, 21, 12

LBL B

LBL E

16

CHS

+/-

12

e^x

e^x

34

x<>y

x<>y

12

e^x

e^x

34

x<>y

x<>y

49

Σ+

Σ+

31

R/S

R/S

22, 12

GTO B

GTO E


Calculating the Parameters:

HP 15C Code

HP 15C Key

DM32

42, 21, 1

LBL 1

LBL R

42, 49

L.R.

b

31

R/S

R/S

34

x<>y

m

31

R/S

R/S

1

1

r

42, 48

y-hat, r

x^2

34

x<>y

RTN

43, 11

x^2


43, 32

RTN



Example:

x

y

0.98

1.946

0.99

1.942

1.00

1.938

1.01

1.934

1.02

1.929

1.03

1.925


Results (FIX 5):


HP 15C

DM32

Intercept (b)

3.99987

3.99985

Slope (m/a)

8.00051

8.00056

r^2

0.99844

0.99844

*differences may be due to rounding error in the internal algorithms


Example 3: y = √(b + m * x^2)

Linearized: y^2 = b + m * x^2


Adjustments: x’ = x^2, y’ = y^2, no adjustment to b or m


Enter Data:

HP 15C Code

HP 15C Key

DM32

42, 21, 13

LBL C

LBL F

43, 11

x^2

x^2

34

x<>y

x<>y

43, 11

x^2

x^2

34

x<>y

x<>y

49

Σ+

Σ+

31

R/S

R/S

22, 13

GTO C

GTO F


Calculating the Parameters:

HP 15C Code

HP 15C Key

DM32

42, 21, 1

LBL 1

LBL R

42, 49

L.R.

b

31

R/S

R/S

34

x<>y

m

31

R/S

R/S

1

1

r

42, 48

y-hat, r

x^2

34

x<>y

RTN

43, 11

x^2


43, 32

RTN



Example:

x

y

1.05

2.066

1.25

2.337

1.45

2.620

1.65

2.912

1.85

3.209

2.05

3.511


Results (FIX 5):


HP 15C

DM32

Intercept (b)

1.40009

1.40009

Slope (m/a)

2.59996

2.59996

r^2

1.00000

1.00000



Example 4: y = b * m^x

Linearized: ln y = ln b + x * ln m


Adjustments: x’ = x, y’ = ln y, result adjustments: e^b, e^m


Enter Data:

HP 15C Code

HP 15C Key

DM32

42, 21, 14

LBL D

LBL G

34

x<>y

x<>y

43, 12

LN

LN

34

x<>y

x<>y

49

Σ+

Σ+

31

R/S

R/S

22, 14

GTO D

GTO G


Calculating the Parameters:

HP 15C Code

HP 15C Key

DM32

42, 21, 2

LBL 2

LBL S

42, 49

L.R.

b

12

e^x

e^x

31

R/S

R/S

34

x<>y

m

12

e^x

e^x

31

R/S

R/S

1

1

r

42, 48

y-bar, r

x^2

34

x<>y

RTN

43, 11

x^2


43, 32

RTN



Example:

x

y

0.84

2.358

0.87

2.363

0.90

2.369

0.93

2.374

0.96

2.379

0.99

2.385


Results (FIX 5):


HP 15C

DM32

Intercept (b)

2.21302

2.21302

Slope (m/a)

1.07843

1.07843

r^2

0.99916

0.99919

*differences may be due to rounding error in the internal algorithms


Expanding Linear Regression Table


Regression

X

Y

B = ITC

M = SLP

Logarithmic: y = b + m * ln x

ln x

y

b

m

Exponential: y = b * e^(m*x)

x

ln y

e^b

m

Inverse: y = b + m/x

1/x

y

b

m

Power: y = b * x^m

ln x

ln y

e^b

m

General Exponential: y = b * m^x

x

ln y

e^b

e^m

Simple Logistic: y = 1/(b + m * e^(-x))

e^(-x)

1/y

b

m

Square Root Linear: y = √(b + m * x)

x

y^2

b

m

Cosine: y = b + m*cos(ω(x – Ï•))

With

Ï• = the point (x) nearest to zero where the trough or peak begins

ω = (2*π)/period (radians) or

ω = 360°/period (degrees)

cos(ω(x – Ï•))

y

b

m

Logarithmic-Linear-Exponential:

y = ln(b + m * e^(-x))

e^(-x)

e^y

b

m

Square Root Quadratic:

y = √(b + m * x^2)

x^2

y^2

b

m



Eddie


All original content copyright, © 2011-2025. 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.

My International Casio Collection (So Far)

 Pictured: Pic 1:  Casio fx-991CN X (China)  Pic 2:  Casio fx-570SPX II Iberia (Spain) Pic 3:  Casio fx-92 Collège (France) All original co...