Friday, November 30, 2018

Casio fx-CG50: Using Goto and Label to Simulate Subroutines

Casio fx-CG50: Using Goto and Label to Simulate Subroutines

If you have a subroutine, you can program the main algorithm and any subroutines in one program file.  In this method, a single subroutine can be executed up to 36 times.  The programming language for Casio allows up to 37 labels: 0 through 9, A through Z, and θ.  

The Technique

1.  Know how many times the subroutine is to be executed.  This is the key.  

2.  We will need to set aside a variable to keep count.

3.  Use a label for the subroutine portion of the program.  The subroutine will be kept at the bottom of the program file.

4.  Each time the subroutine is executed, increase the counter by 1 and execute a jump test by using ⇒.  

5.  Finish the main portion of the program with the Stop command. 

Sample:

[main program starts here]
0 → C  [designate a counter variable]
Goto 0   [go to the subroutine]
Lbl 1 [resume]
...
Goto 0 [run the subroutine the 2nd time]
Lbl 2 [resume]
...
Goto 0 [run the subroutine the 3rd time]
Lbl 3 [resume]
...
(and so on)
...
Stop  [end of main program]

Lbl 0 [start of subroutine]
...
If C = 1 ⇒ Goto 1
If C = 2 ⇒ Goto 2
If C = 3 ⇒ Goto 3
... (and so on)

You can make this a simple or complex as you want.  Below are two sample programs, LOOP1 and LOOP2 that illustrate this technique. 

Note:  

The programs listed here are text files generated from the Casio fx-CG50.  You can generate text files by selecting a program from the Program List ([MENU] [ log ] (B)), then pressing [ F6 ] ( > ), [ F3 ] (SAVE.AS).  

Y^<2> represents Y^2

(-)1 represents -1

Example Programs

LOOP1:  Calculates the following:

f(x)^2 + 2 * f(x) - 1

In this example f(x) = x^2 - 3*x + 1

'ProgramMode:RUN
"F(X): X"?->X
0->C
Goto 0
Lbl 1
Y^<2>->F
Goto 0
Lbl 2
2*Y+F-1->F
F
Stop
Lbl 0
X^<2>-3*X+1->Y
C+1->C
C=1=>Goto 1
C=2=>Goto 2


Now for a more detailed example.  

LOOP2:   This program splits two positive integers of equal length (example: 4326 and 1821, both have four digits each).  Carry over is included and the result is returned in a list of digits.  

Example:  4326  + 1481 = 5807  (displayed as {5, 8, 0, 7})

'ProgramMode:RUN
"SPLIT R+T"
"R"?->R
"T"?->T
0->C
R->X
Goto 0
Lbl 1
List 1->List 2
T->X
Goto 0
Lbl 2
List 1+List 2->List 2
For N->I To 2 Step (-)1
If List 2[I]>=10
Then 
List 2[I]-10->List 2[I]
List 2[I-1]+1->List 2[I-1]
IfEnd
Next
If List 2[1]>=10
Then 
List 2[1]-10->List 2[1]
Augment({1},List 2)->List 2
IfEnd
List 2
Stop


Lbl 0
Int (log X)+1->N
X/(10)(N-1)->S
Int S->I
Frac S->F
{I}->List 1
F*(10)(N-1)->X
For N-2->K To 0 Step (-)1
X/(10)K->S
Int S->I
Frac S->F
Augment(List 1,{I})->List 1
F*(10)K->X
Next
C+1->C
C=1=>Goto 1
C=2=>Goto 2

Have fun and happy upcoming December!

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Monday, November 26, 2018

TI-84 Plus and HP 12C Platinum: Banker's Rounding Method

TI-84 Plus and HP 12C Platinum:  Banker's Rounding Method

Introduction 

The banker's  rounding method involves rounding numeric amounts to the nearest integer.  When the number ends in 0.5  (1.5, 3.5, 8.5, etc), special rules apply:

The decimal gets rounded to the nearest even integer.  For example:  0.5,  2.5, and 4.5 round down to 0, 2, and 4 respectively.  However, 1.5, 3.5, and 5.5 are rounded up to 2, 4, and 6 respectively.

TI-84 Plus Program:  BANKRND

"2018-11-22 EWS"
Disp "BANKER'S ROUNDING"
Prompt X
iPart(X) → I
fPart(X) → F

If F=0.5
Then

If fPart(I/2)=0
Then
I → N
Else
I+1 → N
End

Else
round(X,0) → N
End
Disp N

HP 12C Platinum Program: Banker's Rounding

Note: Use two-digit addresses for the regular HP 12C.

Memory addresses needed: registers 0 through 4.  

Step  Key

001  STO 0
002  INTG
003  STO 1
004  LSTx  
005  FRAC
006  STO 2
007   .
008  5
009   -
010   x=0
011   GTO 018
012   RCL 0
013   FIX 0
014   RND
015   STO 4
016   FIX 2
017   GTO 000
018   RCL 1 
019   2
020   ÷
021   FRAC
022   x=0
023   GTO 029
024   RCL 1
025   1
026   +
027   STO 4
028   GTO 000
029   RCL 1
030   STO 4
031   GTO 000

Source:

"Bankers Rounding"  http://wiki.c2.com/?BankersRounding  Retrieved November 22, 2018


Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Thursday, November 22, 2018

A Word of Thanks

I am grateful to all of you readers, for all the comments, compliments, questions, and for reading my blog and getting enjoyment out of it.  This blog is one of my joys in life and I am grateful that I can share this with you (for over seven years, wow!)!

Happy Thanksgiving!  Much love and blessings,

Eddie

TI-84 Plus and HP Prime: Chinese Remainder Theorem

TI-84 Plus and HP Prime:  Chinese Remainder Theorem

Introduction

The Chinese Remainder Theorem deals with solving the following congruences:

x ≡ r₀ mod m₀
x ≡ r₁ mod m₁
x ≡ r₂ mod m₂
...

where m₀, m₁, m₂, etc are all relatively prime.  Two integers are relatively prime when both integers have a GCD (greatest common divisor) is 1. 

We are going to focus on the two congruent system:

(I)
x ≡ r mod s
x ≡ t mod u

where the solution is x mod s*u.

HP Prime Function CAS.inchinrem

To solve the Chinese Remainder Theorem, use the function inchinrem. 

Syntax (reference (I) above):

Home/Programming Mode Syntax:  CAS.inchinrem([r, s], [t, u]). 
CAS Mode Syntax:  inchinrem([r, s], [t, u])

The answer returned is x mod s*u in vector form [x, s*u]. 

Where to find inchinrem:  [Toolbox], (CAS), 5.  Integer, 7. Division, 3.  Chinese Remainder


TI-84 Plus Program CTR2

"2018-11-18 EWS"
Disp "CHINESE REMAINDER","X=R MOD S","X=T MOD U"
Prompt R,S,T,U
If gcd(S,U)≠1
Then 
Disp "NO SOLUTION"
Stop
T-R→W
U*fPart(abs(W)/U)→W
If T-R<0 font="">
U-W→W
0→Y
0→N
Repeat W=N
1+Y→Y
U*fPart(S*Y/U)→N
End
S*Y+R→X
S*U→M
Disp "SOLUTION:",X,"MOD",M


Examples

Example 1:

x ≡ 3 mod 19
x ≡ 8 mod 11

Solution:  [41, 209],  41 mod 209

Example 2:

x ≡ 4 mod 14
x ≡ 7 mod 17

Solution:  [228, 238],  228 mod 238

Source:

Silverman, Joseph H.  A Friendly Introduction to Number Theory Prentice Hall, Inc: Upper Saddle River, New Jersey  2001.  ISBN 0-13-030954-0


Happy Thanksgiving!

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

TI 84 Plus: Expressing an Integer as a Sum of Powers of Two

TI 84 Plus:  Expressing an Integer as a Sum of Powers of Two

Happy Thanksgiving!

The program POW2SUM expresses a positive integer as a sum of powers of 2.  The program generates a list of terms.

The powers of 2 are:

2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16
2^5 = 32
2^6 = 64
 and so on.

Examples:

117 = 1 + 4 + 16 + 32 + 64 (+ 0) 
(117 = 2^0 + 2^2 + 2^4 + 2^6)

386 = 2 + 128 + 256
(386 = 2^1 + 2^7 + 2^8)

Note:  The list includes a 0 (due to programming limitations on the TI-84 Plus). 

TI 84 Plus Program POW2SUM

"EWS 2018-11-18"
Disp "N = 2^P1+2^P2+..."
Prompt N
{0} → L₁
Repeat N≤0
ln(N)/ln(2) → P
iPart(P) → P
N-2^P → N
augment({2^P},L₁) → L₁
End
Pause L₁

(I like Unicode)

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Saturday, November 17, 2018

TI-84+ and Casio (fx-CG 50) Micropython: Simplifying Nested Radicals

TI-84+ and Casio (fx-CG 50) Micropython: Simplifying Nested Radicals

Introduction 

The following program will simplifying the following expression:

√(x + y) = √a + √b

The input is x and y, with output a and b.  The following conditions are implied:  x > y and x > 0.

To see the derivation of simplification and examples, please check out this blog entry:

https://edspi31415.blogspot.com/2018/11/simplifying-nested-radicals.html

TI 84 Plus Program:  DENEST

"EWS 2018-11-12"
Disp "√(X+Y)=√(A)+√(B)","X>Y","X>0"
Prompt X,Y
X/2+1/2*√(X^2-Y^2)→A
X/2-1/2*√(X^2-Y^2) →B
√(A)→Z
round(Z,9)→Z
Disp " "

If Y<0 font="">

Then
If fPart(Z)=0
Then 
Disp √(A),"- √(",B,")"
Else 
Disp "√(",A,")- √(",B,")"
End

Else
If fPart(Z)=0
Then 
Disp √(A),"+ √(",B,")"
Else 
Disp "√(",A,")+ √(",B,")"
End

End

Casio Micropython (fx-CG 50) Script denest.py

Input is the form of:

√(x1 * √x2 + y1 * √y2) = √a + √b

import math
print("sqrt(x+y)=")
print("sqrt(a)+sqrt(b)")
print("x>y","x>0")

print(" ")
print("x1*sqrt(x2)")
x1=float(input("x1:"))
x2=float(input("x2:"))
x=x1*math.sqrt(x2)

print(" ")
print("y1*sqrt(y2)")
y1=float(input("y1:"))
y2=float(input("y2:"))
y=y1*math.sqrt(y2)

a=x/2+math.sqrt(x**2-y**2)
b=x/2-math.sqrt(x**2-y**2)
z=math.sqrt(a)
z=round(z,10)
a=round(a,10)
b=round(b,10)

if y<0: font="">
  if z-int(z)==0:
    print(z,"-sqrt(")
    print(b,"?")
  else:
    print("sqrt(",a)
    print("-sqrt(")
    print(b,")")
else:
  if z-int(z)==0:
    print(z,"+sqrt(")
    print(b,")")
  else:
    print("sqrt(",a)
    print("+sqrt(")
    print(b,")")


Source:

Michael J. Wester, Editor.  Computer Algebra Systems: A Practical Guide John Wiley & Sons: Chichester 1999.  ISBN 978-0-471-983538

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Thursday, November 15, 2018

TI-84+ and Casio (fx-CG 50) Micropython: Simplifying A sin x + B cos x To r sin (x + θ)

TI-84+ and Casio (fx-CG 50) Micropython:  Simplifying  A sin x + B cos x To r sin (x + θ)

Introduction

Simplify the expression:

(I)   a * sin x + b * cos x

to an expression that involves only one trigonometric function. 

The first task is to multiply the expression by √(a^2 + b^2)/√(a^2 + b^2). (refer to Source)  This results as:

(II) a* √(a^2 + b^2)/√(a^2 + b^2) * sin x + b * √(a^2 + b^2)/√(a^2 + b^2) * cos x

Refer to the triangle diagram below and it will should become clear why it is desirable to multiply by √(a^2 + b^2)/√(a^2 + b^2). 



With:

(III)
 √(a^2 + b^2) * a/√(a^2 + b^2) * sin x +  √(a^2 + b^2) * b/√(a^2 + b^2) * cos x
=  √(a^2 + b^2) * cos θ * sin x +  √(a^2 + b^2) * sin θ * cos x
=  √(a^2 + b^2) * (cos θ * sin x +  sin θ * cos x)

With the use of the trigonometric identity:
sin(x + y) = sin x * cos y + cos x * sin y

This becomes:
(IV)
 =  √(a^2 + b^2) * sin(x + θ)

Let's make some observations.

1.  The angle θ dependents on what quadrant the point (a,b) is. 

2.  Taking into consideration of where the point (a,b) is and the expression √(a^2 + b^2), the task of finding the coefficients of reduced formula for a * sin x + b* cos x can be achieved by calculating a rectangular to polar conversion of the point (a,b). 

Hence: (IV) becomes:

(V)
 a * sin x + b * cos x =  r * sin(x + θ)

where
r = √(a^2 + b^2)  = abs(a + bi)
θ = atan(b/a) = atan2(b,a) = arg(a + bi)


TI 84 Plus Program:  SCTOSIN

"EWS 2018-11-12"
a+bi
Disp "A*sin(X)+B*cos(X)", "=R*sin(X+θ)"
Prompt A,B
abs(A+B*i)→R
angle(A+B*i)→θ
Disp R,"sin(X+", θ, ")"

Casio Micropython (fx-CG 50) Script scotosin.py

import math
print("a*sin(x)+b*cos(x)")
print("=r*sin(x+t)")
a=float(input("a:"))
b=float(input("b:"))
r=math.sqrt(a**2+b**2)
t=math.atan2(b,a)
print(" ")
print(r)
print("*sin(x+")
print(t,")")

Examples
(Radians mode assumed)

Example 1:
4 * sin x + 2 * cos x = 4.472135955 * sin(x + 0.463647609)

Input:
a = 4
b = 2

Output:
r = 4.472135955
θ = 0.463647609



Example 2:
3 * sin x - 5 * cos x = 5.803951895 * sin(x - 1.030376827)

Input:
a = 3
b = -5

Output:
r = 5.803951895
θ = -1.030376827


Source:
Dugopolski, Mark  Trigonometry Addison Wesley: Boston 2003 pp 211-212  ISBN 0-201-70338-6

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Tuesday, November 13, 2018

TI-84+ and Casio Micropython (fx-CG50): Solving Equations Involving Factorials (Inverse Factorial)

TI-84+ and Casio Micropython (fx-CG50):  Inverse Factorial of Integer

Introduction

The goal is to solve the equation for n:

x = n!

One way to do this is to use a variation of the gamma function which invovles an improper integral:

x = ʃ (t^ n * e^(-n) dt, 0, ∞)

(note that n! = gamma(n+1) )

Or use an approximation formula.

Another approach is to use an iterative method, which does not use calculus.  Hence, if x and n are integers then x can be written as:

x = n! + r

Where r is a remainder.  This method involves successive division.

Loop:

1.  Set n = 2  (since 1! = 1) and set t = x.  The  variable t will be working copy of x.
2.  Divide t by n and store in t, t = t / n
3.  Increase n by 1, n = n + 1
4.  If t is less than or greater than n, repeat steps 2 and 3.
5.  If t = n, then x = n!.  Done.
6.  If t ≠ 1, then do the following.  Set n = n - 1 and r = x - n!.  The answer is x = n! + r.

Example 1:    120 = n!

n = 2, t = 120/2 = 60,  60 > 3
n = 3,  t = 60/3 = 20,  20 > 4
n = 4,  t = 20/4 = 5, 5 = 5

Since 5 = 5, 120 = 5!

Example 2:   177 = n!

n = 2, t = 177/2,  88.5 > 3
n = 3, t = 88.5/3, 29.5 > 4
n = 4,  t = 29.5./4, 7.375 > 5
n = 5, t = 7.375/5, 1.475 < 6.  Stop

r = 177 - 5!  = 57

Hence:  177 = 5! + 57

TI-84 Plus Program INVFACT

"EWS 2018-11-11"
Disp "X = N! + R"
Input "X: ", X
X→T
2→N
Repeat T≤N
T/N→T 
N+1→N
End 
If X-N!=0
Then
Disp N, "!"
Else
N-1→N
X-N!→R
Disp N, "! +", R
End

Casio Micropython (fx-CG 50) Script invfact.py

import math
print("x = n! + r")
x=float(input("x: "))
t=x
n=2
while t>n:
  t=t/n
  n=n+1
f=1
for i in range (1, n+1):
  f=f*i
if x-f==0:
  print(n,"!")
else:
  n=n-1
  f=f/i
  r=int(x-f)
  print(n, "! +",r)

Examples:

24 = 4!

26 = 4! + 2

53 = 4! + 29

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.


Saturday, November 10, 2018

HP Prime: The Period of a Pseudo Random Number Generator

HP Prime:  The Period of a Pseudo Random Number Generator

Introduction

Most scientific calculators, mathematical programs, and spreadsheet programs will have random number generators that will generate numbers at random.  The most common generator is a one that produces numbers between 0 and 1.  Additional random functions will also allow the user to generate random integers and random numbers that fit the normal distribution.

It wasn't always this way.

In the 1970s and into the 1980s, scientific calculators and some computers did not have random number functions.  This facilitated a need for pseudo random number generators, hereafter noted as PRNG, which date back to the 1940s.  PRNGs used recursive functions to generate random numbers between 0 and 1.  Several examples include:

x_n+1 = frac(997 * x_n)

x_n+1 = frac(147 * x_n)

x_n+1 = frac( (π + x_n)^5 )

You select a seed, which the RPNG starts generating random numbers.  For example, using the PRNG of x_n+1 = frac(147 * x_n) with a seed of π/3 generates the random numbers:

0.938040026
0.891883822
0.106921834
0.717509598
0.473910906
0.664903182
and so on..



HP Prime Program RNGTEST

The program RNGTEST tests the period of a pseudo random number generator, given a seed. The period of a pseudo random number generator at a given seed is how many iterations it takes for the generator to return to it's initial (first) random number.  For example, if a generator's first random number is 0.1 and it takes 20 iterations for the generator to reach 0.1 again, then the period is 20.

The program sets an arbitrary maximum limit, set in the code of 50,000.  If the count reaches this limit, then the period of the generator is at least this maximum, possibly infinity.  You may change this limit as wished.  Thankfully the HP Prime's processor is fast, so the calculator can handle many interactions quickly.  Older calculators will require more time. 

The program:

rngf(x);  // random number generator

EXPORT RNGTEST(s)
BEGIN
// s = seed
// 2018-11-04 EWS
LOCAL i,k,x:=s;
// initial point
i:=rngf(x);
k:=0;
PRINT();
// loop
REPEAT 
x:=rngf(x);
PRINT(k+" , "+x);
k:=k+1;
UNTIL (x==i AND k>1) OR k>50000;
RETURN k-1;
END;

rngf(x)
BEGIN
RETURN FP(997*x);
END;

Note:  In the rngf(x) subroutine, you can insert any pseudo random number generator you want.

Testing a Simple PRNG

I had set up the program to test a simple PRNG x_n+1 = frac(997 * x_n). 

If the seed is picked with one decimal point (0.1 through 0.9), the period is only 4.  That means, the generator cycles only 4 numbers before repeating again, with the exception is 0.5, which period is only 1.  Specifically:

The seed 0.1 generates 0.1, 0.7, 0.9, 0.3, and then repeats.

The seed 0.2 generates 0.2, 0.4, 0.8, 0.6, and then repeats.

The seed 0.3 generates 0.3, 0.1, 0.7, 0.9, and then repeats.

The seed 0.4 generates 0.4, 0.8, 0.6, 0.2 and then repeats.

The seed 0.5 generates 0.5 and only 0.5.

You can see the repeating periods below. (click on the picture below)



For two decimal point seeds 0.01 to 0.99 (leaving out 0.10, 0.20, etc), from an random sample, you either get a period of 20, or if the seed ends in 5, a period of 4.

For three decimal points seeds 0.001 to 0.999 (leaving out 0.100, 0.110, etc), from a random sample, you either get a period of 100, or if the seed ends in 5, a period of 20.

For simple PRNGs, you are going to a seed with many decimal places to be able to generate different random numbers.

Source:

Shammas, Namir  "New Pseudo Random Number Generators:  Part 1" 2015.  http://www.namirshammas.com/NEW/prng1.pdf  Retrieved October 28, 2018.

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Monday, November 5, 2018

Simplifying Nested Radicals

Simplifying Nested Radicals

Introduction

A nested radical is a radical of the form:

√(x_0 + √(x_1 + √(x_2 + .... + √(x_k) ... )))

A expression of radicals (not necessarily square roots) that contains radicals or surds (unresolved n th roots).  Example of a nested radicals include:

√(8 +  √3)

√(8 +  2 * √3)

√(√8 +  √3)

√(√8 -  √3)

This blog entry will deal with the denesting the following:

√(x + y) and √(x - y) where x and/or y is a radical.  Let's assume that x > y and only principal roots are calculated. We're looking into a neat process that is used in computer algebra systems.

Derivation

We want to obtain the following and determine a and b. 

(I) √(x + y) = √a + √b

and

(II) √(x - y) = √a - √b


Start by squaring both sides of (I):

(√(x + y))^2 = (√a + √b)^2

(III) x + y = a + 2 * √(a*b) + b

(IV)  Set:
x = a + b
y = 2 * √(a*b)

(V)  Determine  x - y:

x - y = a + -1*2 * √(a*b) + b  (see IV)
x - y = a - 2 * √(a*b) + b
√(x - y) = √a - √b

(VI)

√(x + y) * √(x - y) = (√a + √b) * (√a - √b)
√((x + y) * (x - y)) = (√a)^2 - (√b)^2
√(x^2 - y^2) = a - b


We have the following simultaneous equations set up:

(VII)
a + b = x     (from (IV))
a - b = √(x^2 - y^2)   (from (VI))

Solving the system in (VII) for both a and b yield:

(VIII)
a = x/2 + 1/2 * √(x^2 - y^2)
b = x/2 - 1/2 * √(x^2 - y^2)

Substituting a and b back in (I) and (II):

(IX)

√(x + y) = √(x/2 + 1/2 * √(x^2 - y^2)) + √(x/2 - 1/2 * √(x^2 - y^2))

√(x - y) = √(x/2 + 1/2 * √(x^2 - y^2)) - √(x/2 - 1/2 * √(x^2 - y^2))

Examples

Example 1:  Simplify  √(8 + 2 * √15)

x = 8
y = 2 * √15

x^2 - y^2
= 8^2 - (2 * √15)^2
= 64 -  4 * 15
= 4

Then: 

√(x/2 + 1/2 * √(x^2 - y^2))
= √(4 + 1/2 * √4)
= √(4 + 1/2 * 2)
= √5    // √a

And:

√(x/2 - 1/2 * √(x^2 - y^2))
= √(4 - 1/2 * √4)
= √(4 - 1/2 * 2)
= √3     // √b

Hence:

√(8 + 2 * √15) = √5 + √3

Example 2:  Simplify  √(88 + 2 * √567)

x = 88
y = 2 * √567

x^2 - y^2
= 88^2 - (2 * √567)^2
= 7744 - 2268
= 5476

Note √5476 = 74

Then: 

√(x/2 + 1/2 * √(x^2 - y^2))
= √(44 + 1/2 * 74)
= √81
= 9        // √a

And:

√(x/2 + 1/2 * √(x^2 - y^2))
= √(44  - 1/2 * 74)
= √7      // √b

√(88 + 2 * √567) = 9 + √7


Example 3:  Simplify √(19 - 4 * √22))  (note the subtraction)

x = 19
y = 4 * √22

x^2 - y^2
= 19^2 - (4 * √22)^2
= 9

√(x/2 + 1/2 * √(x^2 - y^2))  = √11
√(x/2 + 1/2 * √(x^2 - y^2))  = √8 = 2 * √2

Hence:

√(19 - 4 * √22))  = √11 - 2 * √2


Neat algebra.

Source:

Michael J. Wester, Editor.  Computer Algebra Systems: A Practical Guide John Wiley & Sons: Chichester 1999.  ISBN 978-0-471-983538


Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Sunday, November 4, 2018

HP Prime Firmware Update: Firmware 14181

HP Prime Firmware Update



The newest firmware update (version 14181) is now released.  Changes include:

* New function UVAL and UPART.  UVAL extracts the value from a unit object (example:  10 from 10_m) while UPART extracts the unit part (example 1_m from 10_m).

* The DMS key [Shift] (° ' '' )  now will work everywhere.  

* The fraction part (FP) and integer part (IP) functions will work with unit objects.

* Large matrices, strings, and other objects will now be displayed with an ellipsis (...).  To see the full object, scroll up, select the big expression and press on the soft key (Show). 


Link to the updated firmware:  ftp://ftp.hp.com/pub/calculators/Prime/



Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Thursday, November 1, 2018

(OT) JDRF Walk - November 4, 2018

Hi everyone, I am Edward Shore, author of Eddie's Math and Calculator Blog, and I am joining Derek Theler on the JDRF walk at the Rose Bowl. 

The walk is to raise funds for research to find a cure for type 1 diabetes.  The walk will be on November 4, check in at 8:00 AM starting at 10. 

The walk is 5 kilometers which is approximately 3.11 miles. 

Hope to see you on Sunday and thank you for your support.

http://www2.jdrf.org/goto/ews

Eddie

TI 84 Plus CE: Consolidated Debts

TI 84 Plus CE: Consolidated Debts   Disclaimer: This blog is for informational and academic purposes only. Financial decisions are your ...