Saturday, June 15, 2024

Calculated Industries Qualifier Plus IIIFx: Logarithm, Exponential, Square Root

Calculated Industries Qualifier Plus IIIFx: Logarithm, Exponential, Square Root



Introduction


Say we have a financial calculator such as Calculated Industries Qualifier Plus IIIFx (or the Pocket Real Estate Master or another pocket basic financial calculator). Note that this calculator does not have the following functions: natural logarithm (ln x), exponential function (e^x), and square root (√). No problem. We can use the time value of money keys.


The relationship between present value (PV), future value (FV), periodic interest rate (I%), and number of periods (N) is determined as:


FV = PV * (1 + I% / 100) ^ N


For the natural logarithm and exponential, start by dividing both sides by PV:


FV / PV = (1 + I% / 100) ^ N


Let PV = 1 and equate 1 + I% / 100 = e (e ≈ 2.71828182846…)


Then:

1 + I% / 100 = 2.71828182846

I% / 100 = 1.71828182846

I% = 171.828182846


Since financial calculators are usually set to 2 decimal places, for most instances, we can use the approximation with reasonable accuracy:


I% ≈ 171.82818



Then we have:


FV / 1 = (1 + 171.82818 / 100) ^ N →


FV ≈ e^N and ln FV ≈ N


Now for square root:


Let’s start with the same basic relationship:


FV / PV = (1 + I% / 100) ^ N


Let PV = 1, and N be 0.5 since √x is x^0.5 for x≥0.


Let x = 1 + I% / 100. Solving for I%:


x = 1 + I% / 100

x – 1 = I% / 100

100 * (x – 1) = I%


FV ≈ √x

FV / 1 = ((100 * (x – 1)) ^ 0.5


We can use this to build similar relationships with powers and roots.






Procedures and Examples


Procedure for ln(x):

Set the following variables:

P/Y = 1

Loan Amt = 1*

Int = 171.82818

FV = x

Solve for Term


Estimate ln 55.5.


P/Y = 1

Loan Amt = 1*

Int = 171.82818

FV = 55.5

Solve for Term


Result (Term): 4.02


Procedure for e^x:

P/Y = 1

Loan Amt = 1*

Int = 171.82818

Term = x

Solve for FV.


Estimate e^2.


P/Y = 1

Loan Amt = 1

Int = 171.82818

Term = 2

Solve for FV


Result (FV): 7.39



Procedure for √x:

P/Y = 1

Loan Amt = 1*

Term = 0.5

Int = 100 * (x – 1)

Solve for FV


Example: Estimate √84.


P/Y = 1

Loan Amt = 1

Term = 0.5

Int = 100 * (84 – 1) = 8300

Solve for FV


Result (FV): 9.17


*Note: Loan Amt (PV) is entered as -1 on graphing calculator TVM solvers.



Note: Please do not try this on the HP 12C or the BA Plus II, because on those calculators, the variable N is rounded up to the near highest integer.


Enjoy this hack and until next time,


Eddie


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

Casio fx-4000P - The Programs I took on Vacation

 Casio fx-4000P - The Programs I took on Vacation


I was on vacation in Atascadero last May 2024 at a car conference with my partner. I may not have classic cars, but I do have classic calculators. Here the programs I took with me in Casio fx-4000P.
I also took my HP 45 with me as well.


Total: 448 bytes out of 550 bytes ( ^ => x^y)


Prog 0: Quadratic Equation: Po Shen way: x^2 + B * x + C = 0, built for real roots (39 steps)


“ B “ : ? → B : “C” : ? → C : B² ÷ 4 – C → W ◢ -B ÷ 2 - √W ◢ Ans + 2 × √W


Prog 1: Law of Cosines - Side Z (45 steps)


Deg : “X” : ? → X : “Y” : ? → Y : “C” : ? → C : X² + Y² – 2 × X × Y × cos C : √Ans → Z


Prog 2: Law of Cosines - Angle C (49 steps)


Deg : “X” : ? → X : “Y” : ? → Y : “Z” : ? → Z : ( X² + Y² – Z² ) ÷ ( 2 × X × Y ) : cos^-1 Ans → C


Prog 3: Area of Triangle – Heron’s Formula (55 steps)


X” : ?→X : “Y” : ?→Y : “Z” : ?→Z : (X + Y + Z) ÷ 2→S : √( S×(S – X)×(S – Y)×(S – Z))


Prog 4: Speed of Sound in Dry Air (53 steps)

All constants, γ, R, M are taken care of in the formula, T = temp in °F

Conversions: 1 m/s = 2.236936 mph, 20.04503702 * 2.236936 = 44.83946493


T “ : ?→T : 5÷9 × (T – 32) + 273.15 : 20.04503702 * √Ans : 2.236936 * Ans → S


Prog 5: Horizontal Curve Analysis Given Central Angle and Radius (52 steps)

I = central angle, R = radius, L = arc length, C = chord length


Deg : “I” : ?→I : “R” : ?→R : “L=” ◢ π×R×I ÷ 180 → L ◢ “C=” ◢ 2×R× sin(I ÷ 2) → C


Prog 6: D = Displacement of a Cylinder (in) (36 steps)

B = bore (in), S = stroke (in), N = number of cylinders


“B” : ? → B : “S” : ? → S : “N” : ? → N : π × B² × S × N ÷ 4 → D


Prog 7: Tire Size (in) (36 steps)

S = section width (mm), A = aspect ratio, R = rim diameter (S, A, R → )


“S” : ? → S : “A” : ? → A : “R” : ? → R : S × A ÷ 1270 + R → T


Prog 8: Air Pressure for height up to 36,089 ft above sea level (inHg) (45 steps)

This is with constants already completed (g, M, R, etc.)


H” : ?→H : 29.92126 × (1 - 6.875 × 10^-6 × H) x^y 5.255876329 → P


Prog 9: Breaking Distance in Feet Given the Car’s Velocity in Miles Per Hour (35 steps)


V” : ? → V : V × 22 ÷ 15 : Ans × 1.5 + Ans² ÷ 45.04367 → D


Source:

“Breaking Distance” Wikipedia. Last Edited March 30, 2024. Accessed April 29, 2024.

https://en.wikipedia.org/wiki/Braking_distance


Hagberg Media AB. “Stopping distance = reca2tion distance + breaking distance” 2024.

Accessed April 29, 2024. https://korkortonline.se/en/theory/reaction-braking-stopping/


Just for fun,

Eddie


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

Order of Operations: The Pesky Math Problem from the Internet [ 6 ÷ 2(1 + 2) ]

Order of Operations: The Pesky Math Problem from the Internet



Perhaps the World’s Most Problematic Math Problem


You’ve seen this, we all seen this, it’s the math problems that’s put all calculators in jeopardy, it’s the dreaded:


6 ÷ 2(1 + 2)


Is it 1 or is it 9? No matter what we answer, the debate still rages on and on. Why? Because not everyone agrees with the order of operations. And the problem lies with implied multiplication.


Seeing that this issues comes up multiple times of the HP Museum of Calculators (latest can be seen at [Source 5]), it’s time to input my two dollars into the subject. (It was two cents but the price went up due to inflation.)



What is Implied Multiplication?


Implied multiplication occurs when two or more quantities, often with or without a numeric coefficient, are combined with one or more variables without explicit multiplication symbols (*, ⋅, or ×). It is implied that when this notation is used, the quantities are to be added.


Examples:


xy is implied to mean x * y


2x is implied to mean 2 * x


3rs is implied to mean 3 * r * s


If there are two or more quantities and at least one of them is surrounded by parenthesis, this is also implied multiplication.


Examples:


The following are implied to mean 2 * 6:

2(6)

(2)6

(2)(6)


4(x)y is implied to mean 4 * x * y.


Implied multiplication is also known as juxtaposition. [Source 2]


Infix multiplication is multiplication with symbols (*, ⋅, or ×).


Where is implied multiplication in the order of operations?


PEMDAS vs PEJMDAS


PEMDAS and PEJMDAS are the two major order of operations.


In PEMDAS, also known as BODMAS in some parts of the world, put implied multiplication (juxtaposition) on the same level as infix multiplication and division. The video by The How and Why of Mathematics serves an excellent video to explain the difference and the potential problems that can be encountered. [Source 1]



PEMDAS


PEMDAS stands for:

P: parenthesis

E: exponents (and roots) (one-argument functions such as sin, int, abs and log are included)

MD: all multiplication and division, left to right

AS: all addition and subtraction, left to right


Similarly, BODMAS stands for:

B: brackets (serves as the same function as parenthesis)

O: operations (exponents, roots, one-argument functions such as sin, int, abs, and log)

DM: all division and multiplication, left to right

AS: all addition and subtraction, left to right


For this blog post, I will refer to this sequence as PEMDAS.


PEJMDAS


PEJMDAS moves implied multiplication to a higher priority:

P: parenthesis

E: exponents (and roots) (one-argument functions such as sin, int, abs and log are included)

J: multiplication by juxtaposition (implied multiplication), left to right

MD: infix multiplication and division, left to right

AS: all addition and subtraction, left to right


Examples


Problem 1: 48 / 2 * 3


PEMDAS:

48 / 2 * 3

24 * 3

72


PEJMDAS:

48 / 2 * 3

24 * 3

72


Here there is no difference because the multiplication is infix.


Problem 2: 48 / 2 (3)


PEMDAS:

48 / 2 (3)

24 (3)

72


PEJMDAS:

48 / 2 (3)

48 / 6

8


Notice in PEJMDAS the implicit multiplication, as marked by two numbers juxtaposed next to each other separated by parenthesis, takes priority.


Problem 3: 100 – 5 (2 + 3)


PEMDAS:

100 – 5 (2 + 3)

100 – 5 (5)

100 – 25

75


PEJMDAS:

100 – 5 (2 + 3)

100 – 5 (5)

100 – 25

75


Here we arrive at the same problem because subtraction has the lower priority than implication in both cases.


Problem 4: 100 / 5 (2 + 3)


PEMDAS:

100 / 5 (2 + 3)

100 / 5 (5)

20 (5)

100


PEJMDAS:

100 / 5 (2 + 3)

100 / 5 (5)

100 / 25

4


In PEJDMAS, implied multiplication has priority over division.



Conclusion – Which Method Reigns Supreme? Should we Even use Implied Multiplication?


I’m not usually a fan of the phrase “pick a lane”, but for the sake of consistency, I’ll make an exception. I would prefer the world to pick either PEMDAS or PEJMDAS and stick to it as a universal rule. It seems like PEJMDAS might get the favor since more mathematicians, scientists, and professionals prefer it. I view the PEMDAS vs PEMJDAS as similar to the way the world views which are the standard scientific units:


PEMDAS: ft, sec lbs (United States, especially in the education field)

PEJMDAS: m, sec, kg


Having grown up in the United States, it will take me a bit to adjust to PEJMDAS from PEDMAS.


I’m also in favor of just using additional multiplication, parenthesis, and perhaps using a fraction bar to make problems much clearer. To borrow a suggestion from Tony Barlow, a mathematician who tested the ill-fated never-released TI-88:


“Kill Implied Multiplication. Kill Implied Multiplication. Kill Implied Multiplication.” [2]


Disallowing implied multiplication allows us to avoid two potential problems:


1. In calculators with CAS capabilities and in Python, we are allowed variable names with more than one character (rate, chg, pts). If implied multiplication is allowed with variable names with more than one character, and “ratepts” is typed, do I mean “rate * pts”, the entire variable “ratepts”, or something else like “r * a * t * e * p * t * s”?


2. This makes it clear when we mean function calls, which thankfully is usually understood. But to someone who is unfamiliar with functions, something like “sin(x)” may mean “sin * x” or “ s * I * n * x” to them. “f(x)” may be misinterpreted as “f * x”.


Calculators with the classic AOS (algebraic operating system, postfix system), RPN (Reverse Polish Notation), or Chain operation do not deal with implied multiplication:


AOS: In all cases, the multiplication and parenthesis keys must be explicitly pressed. (Examples: TI-30 series, Casio fx-260 series)


RPN: RPN is a parenthesis-less operating system. (Examples: Almost all HP calculators, all Swiss Micros calculators)


Chain: Everything entered in the Chain operating system is done how you enter the keys. Therefore, these calculators don’t even deal with the order of operations, accuracy is completely up to you. (Examples: all basic four-function calculators)


I hope you find this blog entry helpful, and hopefully one day, we have a universal solution.



This is not the only issue with the order of operations, another issue is where to place the unary operator of negation, but that’s for another day.


Eddie


Sources


[1]

The How and Why of Mathematics. “The Problem with PEMDAS: Why Calculators Disagree” August 5, 2019. Accessed April 15, 2024. Video. https://www.youtube.com/watch?v=4x-BcYCiKCk


[2]

Wright, Gene. “HHC 2022: TI-88 Part 1: History and Go / No Go Decision” September 14, 2022. Accessed April 15, 2024. https://www.youtube.com/watch?v=wl16wzmn3wA Video. (Refer to time stamp 13:24).


[3]

“Multiplication” Wikipedia. Edited April 17, 2024. Accessed April 21, 2024. https://en.wikipedia.org/wiki/Multiplication


[4]

“Order of Operations” Wikipedia. Edited April 19, 2024. Accessed April 19, 2024. https://en.wikipedia.org/wiki/Order_of_operations


[5]

“What is the correct result?” Museum of HP Calculators. Thread started on March 18, 2024. https://www.hpmuseum.org/forum/thread-21474.html



Next Post: June 8, 2024



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

Sunday, May 26, 2024

TI 30Xa Algorithms: Greatest Common Divisor

TI 30Xa Algorithms: Greatest Common Divisor


To find the greatest common divisor between two positive integers U and V:


Let U ≥ V. Let U = A * V + R where A is the quotient of U / V and R is the remainder. If R≠0, then V becomes the new U and R become the new V. The process repeats until R=0. At that point the value of V prior to the last calculation is the greatest common divisor (GCD) of U and V.


Example:

gcd(166, 78)

U = 166, V = 78


Algorithm Loop:

  1. A = int(U / V)

  2. R = U – V * int(U / V)



A

R

U

V

Start

n/a

n/a

166

78

A = int(166 / 78) = 2

R = 166 – 2 * 78 = 10

2

10

78

10

A = int(78 / 10) = 7,

R = 78 – 7 * 10 = 8

7

8

10

8

A = int(10 / 8) = 1

R = 10 – 1 * 8 = 2

1

2

8

2

A = int(8 / 2) = 4

R = 8 – 4 * 2 = 0

4

0 *STOP*





Procedure


  1. Store the greater of the two numbers in memory register 1: [ STO ] [ 1 ].

  2. Store the lesser of the two numbers in memory register 2: [ STO ] [ 2 ].

  3. Divide memory register 1 by memory register 2. Store the integer part (no fractional part) in memory register 3: [ RCL ] [ 1 ] [ ÷ ] [ RCL ] [ 2 ] [ = ], (integer part) [ STO ] [ 3 ]

  4. Figure the remainder and store the result in memory 3: [ RCL ] [ 1 ] [ - ] [ RCL ] [ 2 ] [ × ] [ RCL ] [ 3 ] [ = ] [ STO ] [ 3 ]

  5. If the remainder is 0, stop. The GCD is stored in memory 2.

  6. If the remainder is non-zero, then store memory 2 into memory 1 then memory 3 into memory 2. You need to do it in this order. [ RCL ] [ 2 ] [ STO ] [ 1 ], [ RCL ] [ 3 ] [ STO ] [ 2 ]. Go back to Step 3 and repeat.


Examples


Example 1: GCD(26, 14)

M1 = 26, M2 = 14



M1

M2

M3

26 [ STO ] [ 1 ], 14 [ STO ] [ 2 ]

26

14


[ RCL ] [ 1 ] [ ÷ ] [ RCL ] [ 2 ] [ = ]

Result: 1.857142857

1 [ STO ] [ 3 ]

26

14

1

[ RCL ] [ 1 ] [ - ] [ RCL ] [ 2 ] [ × ] [ RCL ] [ 3 ] [ = ]

Result: 12

[ STO ] [ 3 ]

R is not zero, so we continue.

26

14

12

[ RCL ] [ 2 ] [ STO ] [ 1 ], [ RCL ] [ 3 ] [ STO ] [ 2 ]

14

12

12

[ RCL ] [ 1 ] [ ÷ ] [ RCL ] [ 2 ] [ = ]

Result: 1.166666667

1 [ STO ] [ 3 ]

14

12

1

[ RCL ] [ 1 ] [ - ] [ RCL ] [ 2 ] [ × ] [ RCL ] [ 3 ] [ = ]

Result: 2

[ STO ] [ 3 ]

R is not zero, so we continue.

14

12

2

[ RCL ] [ 2 ] [ STO ] [ 1 ], [ RCL ] [ 3 ] [ STO ] [ 2 ]

12

2

2

[ RCL ] [ 1 ] [ ÷ ] [ RCL ] [ 2 ] [ = ]

Result: 6

6 [ STO ] [ 3 ]

12

2

6

[ RCL ] [ 1 ] [ - ] [ RCL ] [ 2 ] [ × ] [ RCL ] [ 3 ] [ = ]

Result: 0

[ STO ] [ 3 ]

R is zero, so we stop.

GCD: [ RCL ] [ 2 ]: GCD(26, 14) = 2

12

2

0



Example 2: GCD(27, 15)

M1 = 27, M2 = 15




M1

M2

M3

27 [ STO ] [ 1 ], 15 [ STO ] [ 2 ]

27

15


[ RCL ] [ 1 ] [ ÷ ] [ RCL ] [ 2 ] [ = ]

Result: 1.8

1 [ STO ] [ 3 ]

27

15

1

[ RCL ] [ 1 ] [ - ] [ RCL ] [ 2 ] [ × ] [ RCL ] [ 3 ] [ = ]

Result: 12

[ STO ] [ 3 ]

R is not zero, so we continue.

27

15

12

[ RCL ] [ 2 ] [ STO ] [ 1 ], [ RCL ] [ 3 ] [ STO ] [ 2 ]

15

12

12

[ RCL ] [ 1 ] [ ÷ ] [ RCL ] [ 2 ] [ = ]

Result: 1.25

1 [ STO ] [ 3 ]

15

12

1

[ RCL ] [ 1 ] [ - ] [ RCL ] [ 2 ] [ × ] [ RCL ] [ 3 ] [ = ]

Result: 3

[ STO ] [ 3 ]

R is not zero, so we continue.

15

12

3

[ RCL ] [ 2 ] [ STO ] [ 1 ], [ RCL ] [ 3 ] [ STO ] [ 2 ]

12

3

3

[ RCL ] [ 1 ] [ ÷ ] [ RCL ] [ 2 ] [ = ]

Result: 4

4 [ STO ] [ 3 ]

12

3

4

[ RCL ] [ 1 ] [ - ] [ RCL ] [ 2 ] [ × ] [ RCL ] [ 3 ] [ = ]

Result: 0

[ STO ] [ 3 ]

R is zero, so we stop.

GCD: [ RCL ] [ 2 ]: GCD(27, 15) = 3

12

3

0



I hope you find this useful. What I hope to do with the monthly series is to demonstrate various calculations with the TI-30Xa.


Note: For June and July 2024, I will be posting on Saturdays only. I plan to resume the Saturday-Sunday schedule in August.



Eddie


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

Calculated Industries Qualifier Plus IIIFx: Logarithm, Exponential, Square Root

Calculated Industries Qualifier Plus IIIFx: Logarithm, Exponential, Square Root Introduction Say we have a financial calculator ...