Sunday, March 29, 2020

TI 84 Plus CE: Rotating y(x) (Updated)

TI 84 Plus CE:  Rotating y(x) (Updated) 

See the original post, way back on August 13, 2012, here:  http://edspi31415.blogspot.com/2012/08/applications-and-programming-rotation.html

This is an updated version of ROTATEY1.  This version will ask you for a function (enter y(X) in quotes, very important), degree rotation, and a speed factor.  For the most detailed rotated graph, enter 1.  Higher numbers will speed up the plot but will decrease the detail of the rotated graph.

The rotated graph is plotted by two lists, L1 for the x coordinates, and L2 for the y coordinates.

TI-84 Plus CE Program ROTATEY1

"2020-02-24 EWS 84+CE"
Func
FnOff
PlotsOff
Disp "USE QUOTES"
Input "Y1=", Y1
FnOn 1
PlotsOn 1
Radian
Disp "TYPE ° FOR DEGREES","COUNTERCLOCKWISE"
Input "θ?", θ
Input "SPEED FACTOR?", F
Xmin → X
{0} → L1
{0} → L2
1 → C
For(K, Xmin, Xmax - ∆X, ∆X F)
K + ∆X F → X
augment(L1, {X cos(θ) - Y1 sin(θ)}) → L1
augment(L2, {X sin(θ) + Y1 cos(θ)}) → L2
C + 1 → C
ClrHome
Output(1,1"PROGRESS")
Output(2,1,round(100C/(319/F),2))
End
L1(2) → L1(1)
L2(2) → L2(1)
Plot1(xyLine, L1, L2, .)
ZoomStat

Download the TI-84 Plus CE version: 
https://drive.google.com/open?id=1Mop7Vfn_5EwZ2dzFrlwMzUXsTPAz7baV

Examples

Example 1: 
Y1 = "X*SIN(X)"
θ = 35°
SPEED FACTOR = 2




Example 2:
Y1 = "(X-1)^3"
θ = -60°
SPEED FACTOR = 2




Eddie

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

TI 84 Plus CE: Building Piecewise Functions by Points

TI 84 Plus CE:  Building Piecewise Functions by Points

Introduction

The program PWISEBLD generates a parametric piecewise function in the form:

x(t) = t
y(t) = p(t)  (piecewise function)

The program allows the user to draw lines from 2 to 5 points.

Point 1:  (A, B)
Point 2:  (C, D)
Point 3:  (E, F)
Point 4:  (G, H)
Point 5:  (I, J)

p(t) =
(Kt + B - KA)(A ≤ t ≤ C) +
(LT + D - LC)(C < t ≤ E) +
(Mt + F - ME)(E < t ≤ G) +
(Nt + H - NG)(G < t ≤ I)

where the comparisons evaluate to either 0 (false) or 1 (true)

The program was typed on the TI-84 Plus CE but it should work with any of the TI-80 (?), TI-81 (?), TI-82, TI-83, and TI-84 families. 

TI-84 Plus Program PWISEBLD

"2020-02-24 EWS"
Param
FnOff
ClrHome
Disp "PIECEWISE BY POINTS", "PARAMETRIC MODE"
Lbl 0
Input "POINTS (2,3,4,5)?", O
iPart(O) → O
If O<2 o="" or="">5
Then
Disp "2,3,4 OR 5 ONLY"
Goto 0
End
"DATA"
"T" → X1T
Disp "(A,B)?"
Prompt A,B
A → Tmin
Disp "(C,D)?"
Prompt C,D
C → Tmax
(D - B) / (C - A) → K
"(KT + B - KA)(A ≤ T and T ≤ C)" → Str0
If O ≥ 3
Then
Disp "(E,F)?"
Prompt E,F
E → Tmax
(F - D) / (E - C) → L
Str0 + "+(LT+D-LC)(C
End
If O ≥ 4
Then
Disp "(G,H)?"
Prompt G,H
G → Tmax
(H - F) / (G - E) → M
Stro + "+(MT+F-ME)(E
End
If O = 5
Then
Disp "(I,J)?"
Prompt I,J
I → Tmax
(J - H) / (I - G) → N 
Str0 + "+(NT+H-NG)(G
End
Str0 → Y1T
"SET GRAPH" 
ZoomFit

Download the TI-84 Plus CE version: 
https://drive.google.com/open?id=1195hC6LBkR6uHCmCTjWAybSb07YwEPIa

You can use the parametric function Y1T(t) for analysis. 

Examples

Example 1: 
Three Points:  (3, 4), (5, 6), (8, 1)



Example 2:
Four Points:  (0, 0), (3, 4), (5, 6), (8, 1)



Example 3:
Five Points: (0, 0), (1, 1), (3, 6), (6, 10), (9, 12)




Eddie

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

Friday, March 27, 2020

Review: Victor 930-2 Scientific Calculator

Review:  Victor 930-2 Scientific Calculator



Quick Facts:

Model:  Victor 930-2
Company:  Victor
Type:  Scientific
Years:  2008 to present
Display:  10 digits
Batteries:  Solar with battery backup (LR43/LR1130)
Retail Price:  $17.99
Logic:  Algebraic, AOS
Number of Functions:  154

Product website from Victor:  https://www.victortech.com/product/930-2

Powerful One Line Calculator - The 21st Century Version of the TI-34



The Victor 930-2 calculator has the following features:

*  Trigonometric functions and their inverses
*  Rectangular/Polar Conversions
*  Degrees/Degree-Minute-Second Conversions
*  Logarithms, Power, Exponential
*  Single Variable Statistics
*  Base Conversions with Boolean Functions (AND, OR, XOR, XNOR, NOT)
*  Constant Calculations
*  Fractions

The keys have the same mapping as the original Texas Instruments (one line) TI-34 from the 1980s and 1990s.   There are some keys and functions that are labeled differently:

Victor 930-2:  [ X→M ],   TI-34:  [ STO ]
Victor 930-2:  [ M+ ], TI-34:  [ SUM ]
Victor 930-2:  [ X←→M ], TI-34:  [ EXC ]
Victor 930-2:  [ INV ],  TI-34:  [ 2nd ]
Victor 930-2:  [ DATA ], TI-34:  [ ∑+ ]
Victor 930-2:  [ DEL ], TI-34: [ ∑- ]

The Victor 930-2 has a bigger and clearer numeric display and an on-off switch. 

Constant calculations is something that might be an overlooked feature on some of these calculators, so let's take a look at how it works.  This applies to both the Victor 930-2 and the TI-34. 

Constant Calculations

For selected two argument functions, you can repeat the calculations on the second argument by entering different values and pressing the equals button [=]. 

A  (op)  B [ = ]
C [ = ]    ( C op B )
D [ = ]    ( D op B )
...

op:  +, -, ×, ÷, y^x, x√y, AND, OR

Example 1:
f(x) = x × π,  x = 4, 3, 3.8

4 [ × ] [ INV ] [ EXP ] (π) [ = ]
Result:  12.56637061

3 [ = ]   ×π is stored in memory
Result:  9.424777961

3.8 [ = ]
Result:  11.93805208

Example 2:
f(x) = x^2.5, x = π, 10.2, e

[ INV ] [ EXP ] (π) [ y^x ] 2.5 [ = ]
Result:  17.49341833

10.2 [ = ]     ^2.5 is stored in memory
Result:  332.2771137

1 [ INV ] [ LN ] (e^x) [ = ]
Result:  12.18249396

Example 3: 
B can be a multi-step in constant calculations.

f(x) = x ÷ (4^2 + 3), x = 10, 20, 50

10 [ ÷ ] [ ( ] 4 [ x^2 ] [ + ] 3 [ = ]
Result:  0.526315789

20 [ = ]    ÷(4^2 + 3) or ÷19 is stored in memory
Result:  1.052631579

50 [ = ]
Result:  2.631578947

Fractions

You can enter fractions and calculate with fractions.  However, you can only convert between fractions and decimals if you start with fractions in your calculations.  The calculator has a limit of 10 digits between the whole part, numerator, and denominator. 

Keyboard

The keyboard is OK.  I like the contrast between the black background and the font better on the Victor 930-2. 

I am irked by the protective case, as it is difficult to take the hard shell case off once the calculator is locked in place.  I prefer the slide case of the TI-34.  I may not cover the 930-2 and use a case or the box to protect the calculator. 

Verdict

If you are looking for a TI-34, consider the Victor 930-2 as it is an updated version.  It does the job.  Again, I wish the hard shell case was easier to work with. 

Eddie

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

Tuesday, March 24, 2020

Puzzle and Games: Guess The Digit

Puzzle and Games:  Guess The Digit 

Here's a game that you can play with students or to sharpen your wits.   I will let you figure out the solution and how you tackle these puzzles is up to you.

Each of the blanks, ____, needs a digit, from 0 to 9.  One of the digits fills in all the blanks in the puzzle.

Have fun!

Easy Level: One Blank

Example:  ___2 + 15 = 47

The missing digit is 3, since 32 + 15 = 47

3___ + 50 = 82 9___ + 27 = 120

___8 + 36 = 94 40 + 5___ = 97

__0 + 82 = 112 ___9 + 33 = 52

5___ + 48 = 104 42 + 3___ = 78

28 + 7___ = 103 52__ + 33 = 559

1__4 + 37 = 221 380 + __7 = 437

Medium Level: Two Blanks

Example:  8___ + ___6 = 119

Answer:  3, since 83 + 36 = 119


5__  + ___8 = 80 ___6 + ___4 = 150

8__ + ___1 = 136 7___ + 3___ = 116

5___ + ___3 = 64 ___8 + ___7 = 55

4___ + ___3 = 98 8___ + 3___ = 124

___8 + 3__ = 137 1__5 + __3 = 248

__4__ + 88 = 330 __43 + __6 = 819

7__3 + 1__6 = 969 45___ + 5__6 = 956

3__8 + __62 = 480 45___ + __45 = 798

51__ + 36___ = 878 4__8 + 38__ = 810


Harder Level: Three Blanks

4__ + 5__ + __2 = 128 5__ + __6 + 3__ = 98

3__ + __4 + __7 = 146 8__ + __5 + __3 = 172

5__ + __3 + __ 5 = 226 4__ + 5___ + 6__ = 159

__4 + __7 + ___0 = 281 __50 + 3__ + 4__ = 732

__4__ + 50___ = 846 __3___ + __6 = 147

__8__ + 5__ = 742 51__ + __6__ = 876


Eddie

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

OT: Race to the Finish Line Board Game

OT:   Race to the Finish Line Board Game 




What Is Needed

Your printer - preferably a color printer

Scissors

Markers:  the file contains four markers you can cut out (gray box), but any sort of small marker will do

A single die (use one of the dice from a pair of dice).  Alternates: playing cards of Ace through Six (Ace counts as one), six index cards labeled one through six (shuffle each time), or a calculator that can generate random integers 1-6

Rules

The object is simple:  get your marker to the finish line.  This game for at least 2 players.  You can determine the order which turns are taken. 

There are several spaces:

Green:  Lucky Space, Roll Again!  The player who lands on this space takes another turn. 

Red:  Stop!, Lose a Turn:  The player that lands here has his/her next turn skipped.

Blue:  Chance?  Draw one of the blue chance cards (see the bottom on the file).  You can add or transfer the chance cards to index cards, customize it any way you want. For young children, play without the chance cards if you want. 

I hope this game provides some entertainment in these tough times (and beyond).  Feel free to comment some creative ideas. 

You can download the jpeg and pdf files here (zip drive): 

https://drive.google.com/open?id=1LPJc5rh-2b17wtu9A6UtyaY5fkJ8Oxvl


(P.S. There is no cost)

Take care, stay sane, stay healthy, and love,


Eddie

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

Using Pitch in Right Triangle Calculations

Using Pitch in Right Triangle Calculations

Using Pitch to Solve Right Triangle Lengths

In construction problems, we sometimes are working with roots and other structures that are shaped as right triangles.  In roofing applications, we are often working with the pitch of the roof.  The pitch is similar to the standard angle of right triangle.

The pitch is defined in 1 unit of rise over 12 units of run.  In the United States, the units are typically either feet or yards. 

pitch = 1 unit of rise / 12 units of run

With the right triangle, we can use similar triangles to determine that:

pitch /12 = rise / run

Knowing either one of the variables, we can use ratio calculations to determine the other.



Example 1:

Pitch: 3/12, Run:  48

Rise: 
12/48 = 3/x
x = 3 * 48 / 12
x = 12

Hypotenuse:
√(48^2 + 12^2) ≈ 49.4773

Example 2:

Pitch: 5/12, Rise: 30

Run:
5/12 = 30/x
x = 30 * 12 / 5
x = 72

Hypotenuse:
√(30^2 + 72^2) = 78

Approximating Angle with Pitch

To find the angle using pitch:

θ = atan(pitch / 12)



If you do not have a scientific calculator, you can approximate the angle by using any of the approximations (these are not the only approximation equations).   They were found using the curve fitting features of a Casio fx-9860gii.

θ ≈ 3.72674504 * p  + 2.78886014     (r^2 = 0.99084258)
θ ≈ 4.93070418 * p^0.91971679    (r^2 = 0.997149)
θ ≈ -0.1158911 * p^2 + 5.17538414 * p - 0.3498579   (r^2 = 0.9999772)

Data used:  θ to four decimal places are used. 

Eddie

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

Modern Casio Graphing Calculators: Function Memory

Modern Casio Graphing Calculators: Function Memory

This blog covers all the series:
*  Casio fx-7400gii (I don't believe earlier versions of the 7400 have this)
*  Casio fx-9750g, fx-9750gii
*  Casio fx-9860g, fx-9860gii, fx-9860 Slim
*  Casio Prizm fx-CG10/20
*  Casio fx-CG 50

Screenshots are from the fx-CG 50.

Note:  Casio calculators with math print (9860, CG 10, CG 20, CG 50), the menu FMEM/FUNCMEM will only appear when the calculator is set to Line Mode.   In any case, the commands will be always available throughout the Catalog and in Program editing mode. 

Menu names:  FMEM or FUNCMEM

Introduction

The calculator has 20 slots for function memory.  They can be for any variable, any amount of variables.   To access the FMEM (FUNCMEM for the fx-CG 10, fx-CG 20, and fx-CG 50) menu:  press [OPTN].  Please refer to the note above because this menu only appears in Line mode.  (although you still can access fn in the catalog).



You can store expressions to function memory one of two ways:

1.  Use a string and use the store arrow (→).

2.  From the FMEM/FUNCMEM menu, select STORE.  You will be prompted to enter a slot from 1 to 20.  Then you will be taken the list of all the functions stored in memory.  Press [EXIT].



You can clear an expression stored in fn, by storing nothing to it.  It is easiest to do this from the RUN.MAT mode.



You can paste the expression stored in fn by pressing RECALL, and entering the fn number at the prompt.  I think you can only do this in RUN.MAT mode.



Anything stored in fn can be used in evaluating expressions and mathematical commands.   See the screen shots below.  To evaluate fn, store the values in the variables first before recalling fn. 



The next screen shots show how fn can be stored in a graphing database (assuming it has the proper variables and type).



Hopefully you can find this helpful and it makes the use of Casio graphing calculators more efficient. 

Eddie

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

Friday, March 20, 2020

Casio fx-9860g and fx-CG 50: Binomial Series

Casio fx-9860g and fx-CG 50: Binomial Series

Generating The Binomial Series

The binomial series (1 + b*x)^a can be generated by the series:

(1 + b*x)^a = 1 + a*b*x +  a*(a-1) / 2! * (b*x)^2 + a*(a-1)*(a-2) / 3! * (b*x)^3 + ....

= ∑ ( a NCR k) * (b * x)^k for k = 0 from ∞

where:

(a NCR k) = (a * (a - 1) * (a - 2) * ... * (a - k + 1) ) / k!

The values a and b can be complex and do not have to be integers.

If a is not a positive integer, the series continues on indefinitely. 

Output:  List 5 has the coefficients.  The program BINOMSRS calculates the coefficients and any approximation of that series (f(x)).

Casio fx-9860GII and fx-CG 50 Program BINOMSRS

Lbl 2
"2020-02-24 EWS"
"BINOMIAL SERIES"
"EXPAND (1+BX)^A"
"B"? → B
"A"? → A
Lbl 0
"TERMS (≥3)"? → T
Int T → T
T < 3 ⇒ Goto 0
T → Dim List 5
1 → List 5[1]
1 → N
For 2 → K To T
N (A - (K - 2)) → N
N ÷ (K - 1)! * B^(K - 1) → List 5[K]
Next
Lbl 1
Menu "MENU","LIST COEFS",C,"APPROX F(X)",E,"NEW SERIES",2,"EXIT",X
Lbl C
"COEFS IN List 5"
List 5 ◢
Goto 1
Lbl E
"X"? → X
Sum( List 5 * X^Seq(I, I, 0, T-1, 1) ) → Y
"F(X) IS ABOUT:"
Y ◢
Goto 1
Lbl X 
"DONE"

The program allows the user to evaluate the series for given values and create new series for different problems. 

Download the fx-9860gII and fx-9750gII version: 
https://drive.google.com/open?id=1fgxjwf4UkyxhY7XIWqx7HRQHJf-PKnbi

Download the fx-CG 50 and fx-CG 10/20 version:
https://drive.google.com/open?id=1H0Sq2-h6NcWFIw7_pM25PAHHQ2QKtKEy

Example

Expand (1 - x)^(1/2) to six terms.   Approximate f(0.35).

Hint:  Use the fraction key  ( [ a b/c ] or [ []/[] ] ) to get results in fractions (whenever possible). 

b = -1
a = 1/2
t = 6

Coefficients (List 5):
{1, -1/2, -1/8, -1/16, -5/128, -7/256}

(1 - x)^(1/2) ≈ 1 - 1/2 * x - 1/8 * x^2 - 1/16 * x^3 - 5/128 * x^4 - 7/256 * x^5

Approx F(X):  X = 0.35
Result:  0.8062780164


Eddie

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

Thursday, March 19, 2020

Puzzle and Games: Guess the Operation

Puzzle:  Guess The Operation

Everyone, please stay safe, sane, and most importantly, healthy.  We are in unprecedented times.  My blessings to all of you, always.

Blog entries will continue to be published every Saturday and Sunday, and most Fridays, through the end of April.  I will be working on content for May soon.

Here's a game that you can play with students or to sharpen your wits.   I will let you figure out the solution and how you tackle these puzzles is up to you.

Each of the blanks, ____, needs an arithmetic operation:

+   add
-    subtract
×   multiply
÷   divide

Have fun!

Easy Level

Example:  82 ____ 24 = 1968

Fill in the box by either +, -, ×, or ÷. 

Answer:  82 × 24 = 1968

Try these puzzles:

12 ____ 38 = 50 1334 ____ 58 = 23

425 ____ 25 = 17 27 ____ 15 = 405

68 ____ 46 = 22 631 ____ 399 = 1030

108 ____ 34 = 142 1200 ____ 750 = 450

Medium Level

Example:  49 ____ 58 ____ 20 = 87

Answer:  49 + 58 - 20 = 87

Hint:
The answer for the first box is either:  +, -, ×, ÷
The answer for the second box is either: +, -

Try these puzzles:

45 ____ 52 ____ 36 = 133 51 ____ 16 ____ 36 = 852

208 ____ 34 ____ 102 = 72 18 ____ 24 ____ 58 = 100

5 ____ 8 ____ 6 = 46 500 ____ 100 ____ 300 = 305

11 ____ 3 ____ 9 = 24 764 ____ 195 ____ 420 = 989

52 ____ 49 ____ 68 = 71 44 ____ 28 ____ 250 = 982

399 ____ 3 ____ 15 = 148 582 ____ 6 ____ 50 = 47

Harder Level

Good luck and happy solving.

Hint:  In this level, the choice of operations are +, -, ×

61 ____ 49 ____ 36 ____ 50 = 24

58 ____ 76 ____ 34 ____ 53 = 4495

99 ____ 39 ____ 49 ____ 59 = 50

88 ____ 76 ____ 46 ____ 50 = 6684

63 ____ 26 ____ 100 ____ 305 = 1433

402 ____ 118 ____ 386 ____ 453 = 217

153 ____ 38 ____ 500 ____ 205 = 5109


Eddie

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

HP Prime and Casio fx-CG50 Condition Number of a Function

HP Prime and Casio fx-CG50 Condition Number of a Function

Introduction

Condition number for a function f(x) is:

Cond = abs( x *  d/dx f(x) / f(x) )

If the condition number is low, then function is not sensitive to small changes.  This is similar to the condition number for matrices, where a low number gives for a well-conditioned problem while a higher number gives for an ill-conditioned problem.

HP Prime Program CONDFX

Arguments:  f(X) as a string, use the capital X as a variable;  a: value

Syntax:  CONDFX(f, a)

EXPORT CONDFX(f,a)
BEGIN
// f(X) as a string, x0
// 2020-02-06 EWS
X:=a;
fx:=EXPR(f);
X:=a+.0001;
dx:=(EXPR(f)-fx)/.0001;
c:=ABS(a*dx/fx); 
RETURN c;
END;

Note:  The derivative is calculated manually.

Example:  (in Radians mode)

CONDFX("2*X*COS(X)",1.5) returns 20.15361502

CONDFX("e^-(.25*X)",1.5) returns 0.374995308312

Casio fx-CG 50 Program FCOND

"2020-02-05 EWS"
"NO QUOTES NEEDED"
Rad
"F(X): "?→Y1
"X0: "?→A
Abs( A * d/dx(Y1,A) ÷ Y1(A))→C

Note: Y1 is from the VARS, Graphic menu.

Example: 

F(X):  2*X*COS(X), X0:  1.5;   Result:  20.15212992

F(X):  e^(-.25*X), X0:  1.5;  Result:  0.375


Source: 
Condition Number.  Wikipedia.  https://en.wikipedia.org/wiki/Condition_number  Retrieved February 1, 2020


Eddie

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

TI-36X Pro: Using f(x) in Calculus

TI-36X Pro: Using f(x) in Calculus

The TI-36X Pro Calculator has a table function where you can store a function in the form f(x) and use it for build a short table.  But did you know the function can be used in outside calculations like calculating the derivative and the integral?

It's fairly easy to do. 

1.  Press the [ table ] key and select 2: Edit Function
2.  Enter f(x).  Use the variables key [ x ytzabcd ] to enter x. 
3.  Press [ enter ], [ 2nd ] [ mode ] (quit)

To recall f(x):

1.  Press the [ table ] key and select 1: 1(. 
2.  The function call f( is inserted.   You can use this to make calculations on the home screen.

Below are screen shots of an example, with f(x) set as 3x^2 + 3.






Eddie

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

Friday, March 13, 2020

Casio fx-9860g and fx-CG 50: Psuedorandom Numbers

Casio fx-9860g and fx-CG 50:  Psuedorandom Numbers

Introduction:  Generating Random Integers

The program PSUEDORN generates random integers by using the recurring relationship:

R_n+1 = (R_n * A + C) mod M

where R_0 = S, the seed
A = multiplier
M = modulus
C = increment

Outputs:

List 5:  list of integers generated.  If the list cycles, then the numbers return and we don't have a good random sample.

List 6:  percentile list of 10 elements, which each element represents a 10 percentile.  The best parameters will have elements of List 6 of around 0.1 uniformly.

List 6 =
{ 0% - 10% tile, 10% - 20% tile, 20% - 30% tile, 30% - 40% tile, 40% - 50% tile,
50% - 60% tile, 60% - 70% tile, 70% - 80% tile, 80% - 90% tile, 90% - 100% tile}
(percentage of the population)

List 6 is a demonstration of the bucket test.

Casio fx-9860GII and fx-CG 50 Program PSUEDORN

"2020-02-24 EWS"
"PSUEDORANDOM INTEGERS"
"MOD(R*A+C,M)→R"
"SEED"?→S
"MULTIPLIER"?→A
"MODULUS"?→M
"INCREMENT"?→C
"SAMPLE SIZE"?→T
1 → Dim List 5
10 → Dim List 6
MOD(SA+C,M) → R
Intg(10R ÷ M)+1 → B
List 6[B] + 1 → List 6[B]
For 2 → I To T
MOD(RA+C,M) → R
Augment(List 5, {R}) → List 5
Intg(10R ÷ M) + 1 → B
List 6[B] + 1 → List 6[B]
Next
"ANALYSIS:"
"MEAN:"
Mean(List 5) ◢
List 6 ÷ Dim List 6 → List 6
"BUCKET TEST:" ◢
List 6 ◢
"RANDOM NUMBERS (List 5)" ◢
List 5

Download the fx-9860gII and fx-9750gII version: 
https://drive.google.com/open?id=1PBTzvYtwZ5wLdIJqZ-oT6obgm3HnUcCp

Download the fx-CG 50 and fx-CG 10/20 version:
https://drive.google.com/open?id=1CqHPxYMdUeJjRxV4i3lKcOtWR-X0kAGu

Example

Generate a list of psuedorandom integers from 0 to 8192 with seed 111 of sample size 25. 

r_n+1 = (3 * r_n + 4) mod (2^13 + 1)
Seed: 111

Multiplier: 3
Modulus:  2^13 + 1
Increment:  4
Sample Size:  25

Bucket Test (List 6):  { 0.2, 0.4, 0.2, 0.4, 0.4, 0, 0.2, 0.3, 0.1, 0.3 }

List (List 5):
{ 0, 1015, 3049, 958, 2878, 445, 1339, 4021, 3874, 3433, 2110, 6334, 2620, 7864, 7210, 5248, 7555, 6283, 2467, 7405, 5833, 1117, 3355, 1876, 5632 }

Eddie

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

HP Prime: Advanced Boolean Functions

Advanced Boolean Functions





This is a collection of advanced Boolean functions and how you can do this on a scientific calculator that has base conversions and Boolean functions (and, or, not).   One thing to keep in mind is that Boolean functions on a scientific calculator assume that you are working with a set bit size.

Order of Operations:  Parenthesis, NOT, AND, OR

For the examples below, I am going to work with only 8 bit size binary integers, and display the last 8 bits (rightmost 8 digits in Binary numbers).   For all examples, let (in base 2):

A = 1100 1010
B = 1110 0011

Like the Boolean functions and, or, and not, these functions work on each bit (0s and 1s) of the binary form of the number.

Integer Types on the HP Prime

On the HP Prime, the integer type is used for Boolean function calculations.  Symbolize integer types by preceding it by a hashtag # and designated a letter at the end of the integer:  b for binary, o for octal, d for decimal, and h for hexadecimal.

Example:  #11010b  represents the binary number 11010.

You can specify the bit size, from 1 to 64, by attaching a colon and bit size in between the integer and it's indicator.

Example:  #11010:8b represents the 11010 in an 8-bit format.  You can specify the default size in the Home Settings.

NAND (Not And)

The function NAND is also known as the Shaffer function.

nand(A, B) = not(A and B)

nand(1100 1010, 1110 0011) = not(1100 1010 and 1110 0011) = 0011 1101

Truth Table - NAND
0 nand 0 = 1
0 nand 1 = 1
1 nand 0 = 1
1 nand 1 = 0

HP Prime Program:  NAND

EXPORT NAND(a,b)
BEGIN
// not and Boolean Function
RETURN  NOT (a AND b);
END;

Syntax:  NAND(a,b)

NOR (Not Or)

The function NOR is also known as the Peirce function.

nor(A, B) = not(A or B)

nor(1100 1010, 1110 0011) = not(1100 1010 or 1110 0011) = 0001 0100

Truth Table - NOR
0 nor 0 = 1
0 nor 1 = 0
1 nor 0 = 0
1 nor 1 = 0

HP Prime Program:  NOR

EXPORT NOR(a,b)
BEGIN
// not or Boolean Function
RETURN  NOT (a  OR  b);
END;

Syntax:  NOR(a,b)

XOR (Exclusive Or)

Note:  some calculators will have the XOR function

xor(A, B) = (A or B) and (not A or not B)

xor(1100 1010, 1110 0011)
= (1100 1010 or 1110 0011) and (not 1100 1010 or not 1110 0011)
= 0010 1001

Truth Table - XOR
0 xor 0 = 0
0 xor 1 = 1
1 xor 0 = 1
1 xor 1 = 0

Equivalence (←→), XNOR

A ←→ B = (not A and not B) or (A and B)

1100 1010 ←→ 1110 0011
= 1100 1010 xnor 1110 0011
= (not 1100 1010 and not 1110 0011) or (1100 1010 and 1110 0011)
= 1101 0110

Truth Table - ←→, xnor 
0 xnor 0 = 1
0 xnor 1 = 0
1 xnor 0 = 0
1 xnor 1 = 1

HP Prime Program XNOR

EXPORT XNOR(a,b)
BEGIN
// equivalence, XNOR
RETURN (NOT a AND NOT b) or (a AND b);
END;

Syntax:  XNOR(a, b)

Implication (→)

A → B = (not A) or B

1100 1010 → 1110 0011
= (not 1100 1010) or 1110 0011
= 1111 0111

Truth Table -  Implication, →
0 → 0 = 1
0 → 1 = 1
1 → 0 = 0
1 → 1 = 1

HP Prime Program:  IMPL

EXPORT IMPL(a,b)
BEGIN
// implication
RETURN (NOT a) or b;
END;

Source:

John W. Harris and Horst Stocker.  Handbook of Mathematics and Computation Science  Springer:  New York, NY.  2006.  ISBN 978-0-387-94746-4

Eddie

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

Approximations for Common Logarithm Function

Approximations for Common Logarithm Function

A Personal Note:

Hi, everyone!  I had heart surgery two weeks ago, and I am still in recovery.  However, things are going well and I am breathing a lot easier.  Glad to be back. 
- Eddie

Transformations

I am trying to find an approximation polynomial for the common logarithmic function, log(x).   My goal is to find an approximation polynomial which is accurate to at least 2 decimal points.

The first fit was to fit x against log(x).  However, if I apply a transformation, then compare data, I was able to get better results.

I used a TI-84 Plus CE to fit a quadratic and cubic polynomial to data generated by the following sets:

x,  log(x)
x,  log(x^(1/2))
x,  log(x^(1/3))
x,  log(x^(1/4))



Comparison of Approximations

The table compares two approximations against the logarithmic function.

POLY 1:
log x ≈ -.63965*t^2 + 3.06651*t - 2.44635

POLY 2:
log x ≈ .39510*t^3 - 2.10974*t^2 + 4.805*t - 3.091

In both polynomials, t = x^(1/4)




Eddie

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