Sunday, August 29, 2021

Back to School Reference Sheet

 Back to School Reference Sheet


It's near the end of summer, hence for a lot of students the school year is either about to start or just has started.  


Attached is a link to a quick reference that can be helpful in terms of algebra, pre-algebra, geometry, and trigonometry.  Topics include:


* Solving Equations

* Quadratic Equations

* Completing the Square

* Basic Laws of Logarithms

* Basic Trigonometry Identities

* Some Conversions of Length

* Basic Circle and Right Triangle Properties



I hope you find this useful.   

Good luck, good health, and good fortune to all the students in school this year and may you succeed in all of your studies.

Eddie

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

TI-95 ProCalc: Industrial Calculations

 TI-95 ProCalc: Industrial Calculations


Flag Sequence for Degree Mode

RF 33 RF 34

A Sample of Utility Calculations

F1:  >DB:  Decibel Function, DB = 20 * log x
F2:  IDB:  Inverse Decibel Function, x = 10^(DB ÷ 20)
F3:  PAR:  Resistance of two parallel circuits.  R = 1 ÷ ( 1÷a + 1÷b)
F4:  ANG:  Convert from Frequency to Angular Velocity. ω = 2 * π * f
F5:  FRQ:  Convert from Angular Velocity to Frequency.  f = ω ÷ ( 2 * π )

The first two functions (F1 and F2) were inspired by a unique key on the 1977 Casio fx-110 scientific calculator.  

Source:
"Casio fx-110"  Voidware.  http://www.voidware.com/calcs/fx110.htm Accessed May 30, 2021


TI-95 ProCalc File UTL

CLR 'READY' 

DFN F1: >DB @ 01

DFN F2: IDB @ 02

DFN F3: PAR @ 03

DFN F4: ANG @ 04

DFN F5: FRQ @ 05

HLT 

LBL 01 CLR 'X?' BRK LOG * 20 = 'DB=' GTL 06

LBL 02 CLR ( 'DB?' BRK / 20 ) INV LOG = 'X=' GTL 06

LBL 03 CLR ( 'A?' BRK 1/x + 'B?' BRK 1/x ) 1/x  = 'Z=' GTL 06

LBL 04 CLR 'FRQ?' BRK * 2 * PI = 'ANG=' GTL 06

LBL 05 CLR 'ANG?' BRK / ( 2 * PI ) = 'FRQ='

LBL 06 COL 16 MRG = HLT

Stairs

Inputs:

RISE:  The floor-to-floor rise of the staircase. 

MAX RISER HGHT:  The maximum allowable rise height.

TREAD WIDTH:  The desired tread width of each stair.

Outputs:

N:  Number of Stairs

TRH:  True riser height of the stair

#TRD:  Number of treads

RUN:  Total theoretical run from the first stair to the top.

INC:  Incline of the stair in degrees

STR:  Length of the stringer

All amounts are assumed to be in inches and all amounts are precise (no rounding to the nearest 1/8th inch or 1/16 inch, etc).

Formulas Used:

N = int( rise ÷ DRH ) + 1

TRH = rise ÷ N

#TRD = N - 1

RUN = #TRD * TREADWIDTH

INC = atan( TRH ÷ TREADWIDTH)

STR = T * TREADWIDTH ÷ cos INC

TI-95 ProCalc File STR
Size:  184 bytes

RF 33 RF 34 CLR 'STAIRS' PAU

CLR 'RISE (IN)?' BRK STO R

CLR 'MAX RISER HGHT?' BRK STO H

CLR 'TREADWIDTH?' BRK STO W

( RCL R / RCL H ) INT + 1 = STO N 

CLR 'N=' COL 16 MRG N BRK

RCL R / RCL N = STO T 

CLR 'TRH=' COL 16 MRG T BRK

RCL N - 1 = STO E 

CLR '#TRD=' COL 16 MRG E BRK

RCL E * RCL W = STO U 

CLR 'RUN=' COL 16 MRG U BRK

( RCL T / RCL W ) INV TAN STO A 

CLR 'INC=' COL 15 MRG A CHR 223 BRK

RCL E * RCL W / RCL A COS = STO S 

CLR 'STR=' COL 16 MRG S HLT

Example

Input:  
RISE:  120 in
MAX RISER HGHT:  7.5 in
TREADWIDTH:  10 in

Results:
N = 17
TRH = 7.058823529 in
#TRD = 16
RUN = 160 in
INC = 35.21759297°
STR = 195.8461369 in

Travel and Run of a Rolling Pipe

Inputs:

A: Bend angle in degrees

Y: Roll distance 

Z:  Vertical Offset

Outputs:

L:  length of the pipe

R:  set back of the pipe 

All amounts are assumed to be in inches and all amounts are precise (no rounding to the nearest 1/8th inch or 1/16 inch, etc).

Formulas Used:

Let W = √( Y^2 + Z^2 )

Then:

L = W ÷ (90° - cos A)

R = √(L^2 - W^2)

Source:

Heckman, Kurt  "Rolling Offset (run)"  vCalc Last Modified March 10, 2021  https://www.vcalc.com/wiki/KurtHeckman/Rolling+Offsets+%28run%29  Accessed June 5, 2021


TI-94 ProCalc File PIP
Size:  120 bytes

RF 33 RF 34 

CLR 'PIPE ROLL OFFSET' PAU

CLR 'BEND ANGLE?' BRK STO A

CLR 'ROLL DIST?' BRK STO Y

CLR 'OFFSET?' BRK STO Z

( RCL Y x^2 + RCL Z x^2 ) SQR = STO W

/ ( 90 - RCL A ) COS = STO L

'LEN=' COL 16 MRG L BRK

( RCL L x^2 - RCL W x^2 ) SQR = STO X

'SET=' COL 16 MRG X HLT

Example:

Inputs:
Bend Angle: 40°
Roll Distance: 6"
Vertical Offset: 6"

Results:
Travel = 13.20075441"
Setback = 10.11236456"

Coming Up:   Let's get Sharp

Retro Month - Sharp EL-5500 III (also known as the PC-1403) Pocket Computer - every Saturday in September 2021 


Eddie

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

Nuwmorks: Three Doors Game

Nuwmorks: Three Doors Game


Happy Monday!


Introduction


In the popular game show Let's Make a Deal, there is a final round called the Big Deal.  In the Big Deal, one or two contestants picked from one of three doors.   One door had the "Big Deal" containing the biggest prize.  


This game simulates a modified round of the Big Deal.  You are tasked of choosing one of three doors, and the doors contain:


*  $5,000 (not a real contest, this is for gaming purposes)

*  A car

*  A goat 


Numworks Python Script: thedoorgame.py


https://my.numworks.com/python/ews31415/thedoorgame


Required modules:  math, random, kandinsky, ion


# 2021-08-05 EWS

# Three Door Game

# based on Lets Make A Deal

from math import *

from random import *

from kandinsky import *

from ion import *


# set up the key function

def key():

  while True:

    if keydown(KEY_ONE):

      return 1

    if keydown(KEY_TWO):

      return 2

    if keydown(KEY_THREE):

      return 3


# initial doors: indigo, fir green, orange

fill_rect(40,15,100,75,color(43,43,95))

fill_rect(140,15,200,75,color(34,139,34))

fill_rect(240,15,300,75,color(255,127,0))

# text, wheat

draw_string("1",70,45,color(245,222,179),color(43,43,95))

draw_string("2",170,45,color(245,222,179),color(34,139,34))

draw_string("3",270,45,color(245,222,179),color(255,127,0))

# prize setup

p=["\u0024 5,000","CAR","GOAT"]

l=[0,1,2]

w=[]

for i in range(3):

  a=choice(l)

  w.append(a)

  l.remove(a)

# ask for a door

draw_string("Which door do you want?",40,120,color(0,0,0))

k=key()

if k==1:

  ps=p[w[0]]

if k==2:

  ps=p[w[1]]

if k==3:

  ps=p[w[2]]

# the reveal

fill_rect(40,15,100,75,color(0,0,0))

fill_rect(140,15,200,75,color(0,0,0))

fill_rect(240,15,300,75,color(0,0,0))

# text, wheat

draw_string(p[w[0]],45,45,color(245,222,179),color(0,0,0))

draw_string(p[w[1]],145,45,color(245,222,179),color(0,0,0))

draw_string(p[w[2]],245,45,color(245,222,179),color(0,0,0))

draw_string("You win: "+ps,40,160,color(0,0,0))


Download the Python file here:  https://drive.google.com/file/d/1yR8bBqmFwOeKZqBSgCVnoQkUcqDZzvu6/view?usp=sharing


Good luck!


Eddie


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

Numworks: Statistics and Regression Tutorial

Numworks:  Statistics and Regression Tutorial


Introduction


Numworks has two modes for statistical calculations and plotting:  Statistics and Regression.   Each of the two modes can hold up to three sets of data, each having their own separate graph color (red for the 1st, blue for the 2nd, green for the 3rd).  


Each mode has its own separate data, stored independently.   As far as I know so far, none of the data points or results can be accessed in any other mode.


Navigation of the modes are controlled by the keypad.  To change screens, keep press the up key until the header is selected.  


Statistics


The Statistics mode deals with univariate data (one-variable).   Two plots are offered:


*  Histogram Plots.  The bin width and starting point can be changed by pressing [ OK ] to bring up the options dialogue box.  


*  Box Plots.  Data for each lists calculated are:  minimum, 1st quarter, median, 3rd quarter, maximum



Regression


The Regression mode deals with bivariate data (two-variable).  The data and it's scatterplot are automatically displayed on the Graph screen.  The Data screen shows the mean, variance, and sums, along with regression model.


To change the regression, go to the Graph screen, scroll down to the regression model:


Linear:  ax + b

Proportional:  ax

Quadratic:  ax^2+bx+c

Cubic:  ax^3+bx^2+cx+d

Quartic:  ax^4+bx^3+cx^2+dx+e

Logarithmic: a*ln x+b

Exponential:  a*e^(bx)

Power: a*x^b

Trigonometric:  a*sin(bx+c)+d

Logistic:  c/(1+a*e^(-bx))


This menu will also to predict x and y values.



I hope you find this helpful, and highlight some of the other features of Numworks (other than Python).


Eddie 



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

TI-95 ProCalc: Approximate Derivative and Bisection Method

TI-95 ProCalc: Approximate Derivative and Bisection Method


Introduction:  The Label FX and Flags to set Radians Mode

The two programs presented today will use a subroutine with the label FX.  FX is going to be where you store your function.  I have designated the variables such that X can be used as storing and recall in the subroutine.   To edit FX:

In run mode (out of LEARN):  [ 2nd ] [ 2 ] (GTL) FX, [ LEARN ] [ F2 ] (PC)

The subroutine FX must end with = RTN.  

Radians mode can be set during programming with the following flag commands: RF 34 SF 33.

FYI, Degrees Mode:  RF 34 RF 33

And Gradians Mode:  RF 33 SF 34

Approximate Derivative

This program calculates f'(x), rounds, and displays the answer to five decimal places.  

f'(x) ≈ ( f(x + h) - f(x - h) ) / ( 2 * h ),  h is set to 10^-5

FIX 9 resets the TI-95 ProCalc to floating (all/standard) mode.

TI-95 ProCalc File DRV
Size:  varies

RF 34 SF 33 1 EE 5 +/- STO H

CLR 'X?' BRK STO A 

+ RCL H = SBL FX STO D

RCL A - RCL H = SBL FX ST- D

RCL D / ( 2 * RCL H ) = 

FIX 5 RND FIX 9 STO D HLT

LBL FX   [insert f(x) here, do not store values to A or H] = RTN

Examples

f(x) = x * sin x 
FX:  STO X * SIN = RTN
f'( π/5 ) returns 1.09611 
f'( 1.6*π ) returns 0.60223

f(x) = 3 * e^x
FX:  INV LN * 3 = RTN
f'( 1 ) returns 8.15485
f'( -1.215 ) returns 0.89013

Bisection Method

The bisection method finds a root for the equation f(x) = 0.  An advantage to the bisection method is that there is no requirement to calculate the derivative.  However, two initial guesses a and b are required such that f(a) * f(b) < 0, and the calculation process can be lengthy.

I set the tolerance to 10^-10.   

Note:  I will need a variable to store the 0 value.  IF tests on the TI-95 ProCalc can not compare to numeric values directly.   I use the variable Z to store 0.

TI-95 ProCalc File BIS
Size:  varies

'BISECTION F(X)=0' PAU

CLR 'A?' BRK STO A

CLR 'B?' BRK STO B

10 +/- INV LOG STO T

0 STO Z

LBL A0 ( RCL A + RCL B ) / 2 = STO C

SBL FX STO F ABS IF <T GTL BO

RCL B SBL FX * RCL F = IF >Z GTL A1

RCL C STO A GTL A0

LBL A1 RCL C STO B GTL A0

LBL B0 CLR 'SOL=' COL 16 MRG C HLT

LBL FX  [insert f(x) here, do not store values to A, B, C, T, or Z] = RTN

Examples

3*x - e^x = 0
FX:  STO X * 3 - RCL X INV LN = RTN
Interval:  [1, 2] (A = 1, B = 2)
Result: 1.512134552

x - 2^(-x) = 0
FX:  STO X - 2 y^x RCL X +/- = RTN
Interval:  [0, 1]  (A = 0, B = 1)
Result:  0.6411857446

Source:
Byju's Classes  "Bisection Method - Definition, Procedure, and Example"  https://byjus.com/maths/bisection-method/  Retrieved June 5, 2021

Commas added to the results for readability.  

Eddie

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

Construction Master 5: Right Triangle Trigonometry

Construction Master 5:   Right Triangle Trigonometry





Solving Right Triangles


The Construction Master 5 has four keys that allow the user to solve right triangles.  The four keys involved are:


[ Rise ] : The rise of the triangle, opposite side (Y).  The value entered can have units.


[ Run ] : The run of the triangle, adjacent side (X).  The value entered can have units.  


[ Diag ] : The diagonal of the triangle, hypotenuse (R).  The value entered can have units.  


[ Pitch ]: Can have one of four values: pitch  (rise in inches over a run of 12 inches), angle (in degrees), slope (rise/run), and grade (percent representation of the slope).


There are four types of entry with the [ Pitch ] key, as stated by the Construction Master 5's Pocket Reference Guide:


1.  n [ Inch ] [ Pitch ] enters the angle as a pitch:  n inch rise over 12 inch run, used in construction and industry mathematics 


2.  Θ (no units attached) [ Pitch ] enters the angle as angle degrees


3.  r [ Conv ] [ Pitch ] enters the value as a slope of rise/run


4.  g [ % ] [ Pitch ] enters the value as a grade percentage, useful in construction and civil engineering


When solving for angle/pitch/slope/grade: repeated presses cycled through the four values: pitch (PTCH), angle (still labeled as PTCH), grade (labeled as %GRD), slope (labeled as SLP).


Examples

(1/16 fraction mode set)


Example 1:

Rise:  36 ft

Run:  45 ft


Results:

Diag: 57 ft 7 9/16 in 


[ Pitch ] key:

Pitch: 9 5/8 in

Angle: 38.66°

Grade: 80%

Slope: 0.8


Example 2:

Rise: 50 ft

Diagonal:  72.5 ft


Results:

Run: 52.5 ft


[ Pitch ] key:

Pitch: 11.42857 in

Angle: 43.60°

Grade: 95.2381%

Slope: 0.952381


Example 3:

Rise: 60 ft

Angle:  30°  (enter as 30 [ Pitch ] )


Results:

Run:  103 ft 11 1/16 in

Diag:  120 ft


[ Pitch ] key:

Pitch: 6 15/16 in

Angle: 30.00°

Grade: 57.73503%

Slope: 0.57735


Example 4:

Rise: 60 ft

Pitch: 4 in (enter as 4 [ Inch ] [ Pitch ])


Results:

Run:  180 ft

Diag:  189 ft 8 13/16 in


[ Pitch ] key:

Pitch: 4 in

Angle: 18.43°

Grade: 33.33333%

Slope: 0.333333



I hope you found this tip helpful,


Eddie


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

Construction Pro 5: Geometry Algorithms

Construction Pro 5:  Geometry Algorithms


Before We Begin


Before we begin, some things to note:


1.  The [ Circ ] [ Circ ] sequence gives the area of a circle given by the denominator.  Area = (π * diameter^2) / 4 


2.  The [ Conv ] [ Rcl ] will clear the Construction Master 5's memory register.  So will [ Rcl ] [ Rcl ], the only difference is that the former sequence will not recall the memory's contents.


3.  The [ Rcl ] [ M+ ] sequence will recall the memory register's contents.


4.  The Construction Master 5 operates in Chain mode, like standard four-function calculators.  


5.  The algorithms presented today is one way to approach these calculation, most of them demonstrate the [ Circ ] [ Circ ] and memory features.   


Area:  Donut Driveway




Area = ((2D + I)^2 - I^2) * π/4


Key Sequence:


[ Conv ] [ Rcl ]

2 [ x ] D [ + ] I [ = ] [ Circ ] [ Circ ] [ M+ ]

I [ Circ ] [ Circ ] [ Conv ] ( M- )

[ Rcl ] [ M+ ]


Example:

D = 50 feet, I = 10 feet


[ Conv ] [ Rcl ]

2 [ x ] 50 [ Feet ] [ + ] 10 [ Feet ] [ = ] [ Circ ] [ Circ ] [ M+ ]

10 [ Feet ] [ Circ ] [ Circ ] [ Conv ] ( M- )

[ Rcl ] [ M+ ]


Result:  9,424.778 ft^2


Volume:  One-Hole Concrete Block




Note:  The border length (d) is equal around the entire block.


V = ( ( W + L ) * 2 * d - 4 * d^2 ) * t


Key Sequence:


[ Conv ] [ Rcl ]

W [ + ] L [ x ] 2 [ x ] d [ M+ ]

d [ Conv ] ( x^2 ) [ x ] 4 [ M- ]

[ Rcl ] [ M+ ] [ x ] t [ = ]


Example:

L = 12 in, W = 8 in, d = 1 in, t  10 in


[ Conv ] [ Rcl ]

8 [ Inch ] [ + ] 12 [ Inch ] [ x ] 2 [ x ] 1 [ Inch ] [ M+ ]

1 [ Inch ] [ Conv ] ( x^2 ) [ x ] 4 [ M- ]

[ Rcl ] [ M+ ] [ x ] 10 [ Inch ] [ = ]


Result:  360 in^3


Volume: Right Triangular Prism




V = D * H * B / 2 


Key Sequence:


D [ x ] H [ x ] B [ ÷ ] 2 [ = ]


Example:

D = 325 ft, H = 77 ft, B = 148 ft


325 [ Feet ] [ x ] 77 [ Feet ] [ x ] 148 [ Feet ] [ ÷ ] 2 [ = ]


Result:  1,851,850 ft^3 ≈ 68,587.04 yd^3


Volume:  Sphere Using the Circ Function





V = 4/3 * π * r^3 = π * d^3 / 6 = area_circle * d / 1.5

where area_circle = π * d^2 / 4


Key Sequence:


[ Conv ] [ Rcl ]

D [ M+ ] [ = ] [ Circ ] [ Circ ] [ x ] [ Rcl ] [ M+ ] [ ÷ ] 1.5 [ = ]


Note:  The first equals key "locks" in the value of D on to the register and allows it to be picked up with the Circ function without having to re-type it.  


Example:

D = 5 ft


[ Conv ] [ Rcl ]

5 [ Feet ] [ = ] [ M+ ] [ Circ ] [ Circ ] [ x ] [ Rcl ] [ M+ ] [ ÷ ] 1.5 [ = ]


Result: 65.44985 ft^3


Volume:  Column Using the Circ Function



V = π * D^2 * H / 4 = area_circle * H

where area_circle = π * d^2 / 4


Key Sequence:


D [ Circ ] [ Circ ] [ x ] H [ = ]


Example:

D = 2 ft 2 in, H = 1 ft 8 in


2 [ Feet ] 2 [ Inch ] [ Circ ] [ Circ ] [ x ] 1 [ Feet ] 8 [ Inch ] [ = ]


Result:  6.145013 ft^3


Commas added for readability.  


Eddie


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

TI-95 ProCalc: Solving Equations With 2 Known Values, Solve for the Third Variable


 

TI-95 ProCalc: Solving Equations With 2 Known Values, Solve for the Third Variable 


Introduction

The two programs presented on today's blog will show an approach to program a solver where:

*  Values for two variables are known
*  The third variable is solved for automatically

We will make use of TI-95 ProCalc's user flags 01, 02, and 03 to determine which variable has entries and which variable is to be solved for.   I stored 2 into a variable (in this case, C) to count down the number of values are entered.  These programs assume that the user will always enter values for two different variables without the need to review or edit values entered.

Keys:
F1:  first variable - controlled by user flag 01
F2:  second variable - controlled by user flag 02
F3:  third variable - controlled by user flag 03

TI-95 ProCalc's flag operations:
RF:  reset flag, clear flag
SF:  set flag
TF:  tests whether a flag is set
INV TF: tests whether a flag is reset

All the variables and their values, entered or solved for, are shown at the end.

Ohm's Law

R = V / I
R = resistance in Ohms (Ω)
V = voltage in Volts (V)
I = current in Amps (A)

The program reminds the user of what units are expected in the beginning.

CHAR 244 adds Ω to the alpha string.

The alpha string '   TO ENTER' has three spaces at the beginning of the string to allow room for C.   C is merged at space 2.  

Housekeeping Items: 

RF 01 RF 02 RF 03:  Resets the flags 01, 02, and 03 at the end of the program. 

DFN CLR:  Clears the defined keys F1 - F5. 

TI-95 ProCalc File OHM
Size:  224 bytes

0 STO I STO R STO V 2 STO C

RF 01 RF 02 RF 03 CLR

'OHM'S LAW' PAU CLR

'UNITS: ' CHR 244 ',A,V' PAU

LBL A0   

CLR '   TO ENTER'  COL 02 MRG C

DEF F1: R @A1  

DEF F2: I @A2

DEF F3: V @A3

HLT 

LBL A1 STO R SF 01 DSZ C GTL A0 GTL B0

LBL A2 STO I ST 02 DSZ C GTL A0 GTL B0

LBL A3 STO V SF 03 DSZ C GTL A0 GTL B0

LBL B0 

INV TF 01 SBL B1

INV TV 02 SBL B2

INV TF 03 SBL B3

CLR 'R=' COL 16 MRG R BRK

CLR 'I=' COL 16 MRG I BRK

CLR 'V=' COL 16 MRG V  RF 01 RF 02 RF 03 DFN CLR HLT

LBL B1 RCL V / RCL I = STO R RTN

LBL B2 RCL V / RCL R = STO I RTN

LBL B3 RCL I * RCL R = STO V RTN


Examples

I = 10 A, R = 1500 Ω;  Result:  V = 15,000 V

R = 200 Ω, V = 240 V; Result:  I = 1.2 A

I = 15 A, V = 110 V; Result: = 7.333333333 Ω


Right Triangle

This programs solves any of the following variables, from knowing the other two vales: 

X:  run
Y:  rise
R:  hypotenuse

In addition, the angle (Θ) is calculated where Y is considered the opposite side and X the adjacent side.

CHECK ANG MODE:  a prompt to check angle mode, just in case you are not in the desired angle mode.   The program runs in any angle mode.

CHR 242: adds Θ to the alpha string

TI-95 ProCalc File TRI
Size:  248 bytes

0 STO X STO Y STO R STO A 2 STO C

RF 01 RF 02 RF 03 CLR

'CHECK ANG MODE' BRK 

LBL A0   

CLR '   TO ENTER'  COL 02 MRG C

DEF F1:ADJ@A1  

DEF F2:ADJ@A2

DEF F3:HYP@A3

HLT 

LBL A1 STO X SF 01 DSZ C GTL A0 GTL B0

LBL A2 STO Y ST 02 DSZ C GTL A0 GTL B0

LBL A3 STO R SF 03 DSZ C GTL A0 GTL B0

LBL B0 

INV TF 01 SBL B1

INV TV 02 SBL B2

INV TF 03 SBL B3

( RCL Y / RCL X ) INV TAN = STO A

CLR 'X=' COL 16 MRG X BRK

CLR 'Y=' COL 16 MRG Y BRK

CLR 'R=' COL 16 MRG R BRK

CLR CHR 242 '=' COL 16 MRG 

A RF 01 RF 02 RF 03 DFN CLR HLT

LBL B1 ( RCL R x^2 - RCL Y x^2 ) SQR = STO X RTN

LBL B2 ( RCL R x^2 - RCL X x^2 ) SQR  = STO Y RTN

LBL B3 ( RCL X x^2 + RCL Y x^2 ) SQR = STO R RTN

Examples

All examples are in degrees mode.

X = 3, Y = 4
Results:  R = 5, Θ = 53.13010235°

X = 11.8, R = 19.9
Results:  Y = 16.02404443, Θ = 53.63231539°

Y = 27, R = 54.4
Results:  X = 47.22668737, Θ = 29.75706329°

Commas added to the results for readability.  

Eddie

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

Numworks: Finding a Numeric Target Game

Numworks:  Finding a Numeric Target Game


Happy Monday!


Introduction


The Python script target.py is a game where the player is tasked to guess a mystery number.   The game has four levels:


Level 0:  Easy.  Range of 50, number between 100 and 999.

Level 1:  Medium.  Range of 100, number is between 1,000 and 9,999.

Level 2:  Difficult.  Range of 250, number is between 10,000 and 99,999. 

Level 3:  Challenge.  Range of 500, numbers if between 100,000 and 999,999.


After each guess you will be told whether the target is higher or lower than your guess.   At the beginning you are given a range where your target number is.


Trick:  I fit a quartic curve to the points (0,50), (1,100), (2,250), and (3,500) and Numworks came up with y = 50*x^2 + 50.   


The script page on my Numwork's account is here:  https://my.numworks.com/python/ews31415/target


Numworks Python Script: target.py


from math import *

from random import *

# 2021-08-03 EWS

# target finding game


# set up

print("**** TARGET ****")

print(" EWS 2021")

print(" ")

print("SELECT MODE")

print("0. EASY")

print("1. MEDIUM")

print("2. DIFFICULT")

print("3. CHALLENGE")

c=int(input())


# variables

# range

r=50*c**2+50

# lower limit

x=10**(c+2)

# upper limit

y=10**(c+3)-1

# score

s=0

# target, limits

t=randint(x+r,y-r)

lx=t-r

ly=t+r


# the game

g=-1

print("The target is between")

print(str(lx)+" and "+str(ly)+".")


while g!=t:

  s+=1

  g=int(input("Guess "+str(s)+"? "))

  if g>t:

    print("LOWER")

  else:

    print("HIGHER")

  

print(str(g)+" is the target!")

print("Your score is: "+str(s))


Good luck!  


Testing News


According to their website, numworks.com the Numworks calculator is now permitted for SAT, AP, PSAT, and ACT.  Click here for more information:  https://www.numworks.com/calculator/exams/

Note: Some Python Scripts can be Transferred to Different Calculators as is - Check the modules!  

You can download the Python file here.   I was able to transfer the file to a TI-84 Plus CE Python and it runs fine.  Because of the modules used, it should be able to run on any calculator with Python.  Please be aware that the calculator must have the modules installed before attempting to transfer Python scripts between different kinds of calculators.  

Link:  https://drive.google.com/file/d/1g2JjxkeKbk14Pm-qZR_LdW-0B4_BcZik/view?usp=sharing

Eddie


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