Monday, August 31, 2015

I Love You Dad

Mike Shore, my dad on the right (1943-2015)

My father passed away this morning.  My mom and I took him to the Emergency room Saturday morning.  He was having a high fever and was shaking.  Between last night and this morning, has was moved to the ICU and had three cardiac arrests.  He was not feeling well for a long time.  

Thank you for being there for us, you brought joy and laughter to everyone, dad.

Eddie




Note:  I'm not sure when or even if I'm going to post again.  I hope to much sooner than later.  Thanks everyone.


Monday, August 24, 2015

Review: Sharp EL-738F Financial Calculator

Sharp EL-738F Financial Calculator Review


Price:  I paid $39.99 plus tax (Fry’s Electronics). 

Note:  This is an update of the EL-738C model, I am not sure if the EL-738C has the exact same set of functions of the newer, black keyboard EL-738F model, but looking at the EL-738C’s Amazon page, it appears that the EL-738F is a looks update. 

Sharp EL-738F

What’s In the Package:  calculator and a good size, detailed manual.  And it is refreshing to see the manual as a complete book, and not a fold-out sheet. 

Number of Variables:  Besides the financial variables, the EL-738F has ten independent memories, A through H, M, X, Y, and Z.   The memory M has the memory arithmetic M+ and M-.

Power:  1 CR2032 battery. 

Protection:  Plum colored hard case 

Does the EL-738F have scientific functions?  Yes!  And kind of unusual for financial calculators, the common logarithm and its inverse (log and 10^, respectively) are present, random numbers (including dice, coins, random integers between 0 and 99), and π are present on the keyboard.   The only other financial calculator that has π on the keyboard is the HP 10bII+.   Furthermore, there is no inverse key for the trigonometric functions, hence arcsine, arccosine, and arctangent can be acessed directly from the keyboard.



Two Line Display:  The EL-738F has a two line displays like most non-graphing scientific calculators.    This is nice because you can see the expression on the top line and the result on the bottom line.  The top line will also display the appropriate financial variable (i.e. PMT, M-D-Y 1=[*day of the week*], COUPON(PMT), etc.) which is really helpful and impressive.

Financial Calculations Available:

*  Time Value of Money: Compound Interest. 
*  Amortization
*  Cash Flows:  IRR and NPV only
*  Bonds:  Calculates Yield or Price of a Bond. 
*  Depreciation:  Straight Line, Sum of the Year’s Digits, Declining Balance. 
*  APR/EFF Conversion Functions
*  Days between Dates (four digit years) – one of my favorite functions
*  Percent Change
*  Profit Worksheet (Cost/Sell/Margin and Markup) – accessed by the [COST] key
*  Breakeven Worskheet
To exit a worksheet, press the [ON/C] key.  You’ll be pressing this key a lot.  The calculator is in a worksheet if there is a message ending with an equals key on the top line.

Keyboard:  The keys are plastic, so don’t expect a small “pop” or “click” for feedback, but the keys are responsive. 

Statistics Regressions Available:  Linear, Quadratic, Exponential, Logarithmic, Power, and Inverse. 


Time Value of Money:   Clear the variables by pressing [2ndF] [MODE] (CA).  This will not affect your alpha variables (A-H,M,X,Y,Z).   Enter the amounts for the variables and press the appropriate key.  To calculate, press [COMP] first before the variable to solve for.

For each calculation, I suggest setting the payments per year (P/Y) (and maybe the compounding interest periods per year, C/Y) first, by pressing [2ndF], [I/Y] (P/Y).  Enter the payments per year and press [ENT].  When the variables are cleared, P/Y and C/Y are automatically set to 1.     If you use the xP/Y function, make sure to press the [ N ] key twice to make sure the value is stored in N.

And the interest variable (I/Y), the interest rate is annual. 

Also, cash flow convention applies:  negative values for outflows, positive values for inflows.

The [(x,y)] and [ENT] (DATA) Keys

Depending on which mode the EL-738F is in, data will be stored as either a cash flow or a statistical point.

Normal Mode (0):

[ENT] (DATA) (outside a financial worksheet):  enters a cash flow
Cash flows with frequency:   cash flow [(x,y)] frequence [DATA]

Statistics Mode (1):

[DATA] enters the data point.
SD Mode (1-Variable):  [(x,y)] separates the data point and its frequency
Regressions: [(x,y)] separates the x and y point.  You can add frequency by adding a third number, hence:  x point, y point, frequency

The EL-738F has a total of 100 registers that are shared between cash flows and statistical data points.  Without frequencies, up to 50 statistical pairs can be entered.

Connection between the TMV Variables and the Worksheets:

The worksheets often assign its variables to the TVM variables.  For example:

Cash Flow Calculations ([2ndF] [CFi] (CASH)):
RATE corresponds with I/Y

Bond Calculations ( [BOND] ):
Coupon works with PMT
Redemption Value is stored in FV
CPN/Y is stored in N
Yield is stored in I/Y
Price is stored in PV

Depreciation ([BRKV]): 
Type is set through the [SET UP] key, press 2 for DEPR submenu.
Life in stored in N
Cost is stored in PV
Salvage is stored in FV

This means we can store values in the TVM variables, press the worksheet, and have them automatically recalled.  The flip side is that using the worksheet will affect the TVM variables.  Hence, it is good practice to clear the TVM variables via [2ndF] [MODE] (CA) for each new problem.  This is an extra step the user has to get used to.


Bottom Line:  If you want an alternative to HP or TI, or you like Sharp and need a financial calculator, the EL-738F is one to check out.  The keyboard is good, and the amount of functions are towards the mid-range financial calculators. 


Eddie

This blog is property of Edward Shore.  2015



Friday, August 21, 2015

Fun with Desmos

Some graphs with the Desmos free online graphing calculator, which can be found at https://www.desmos.com/.  Desmos is also available as an iOS app and Android app.


Cosine Graphs in a Bottle
y= cos(2^x), -cos(2^x), cos(2^-x), -cos(2^-x)

y= cos(2^x), -cos(2^x), cos(2^-x), -cos(2^-x)
y= cos(2^x), -cos(2^x), cos(2^-x), -cos(2^-x)

red curve: x^3+y^4 = 6 sin(12*x^-2)
blue curve: -x^3+y^4 = 6 sin(12*x^-2)

red: x^3+y^4 = 6 sin(12*x^-2), blue: -x^3+y^4 = 6 sin(12*x^-2)
red: x^3+y^4 = 6 sin(12*x^-2), blue: -x^3+y^4 = 6 sin(12*x^-2)

A Spirograph 
polar curve: r = 6 sin (2 sin (θ - 2 (cos (θ^1.02)))

polar curve: r = 6 sin (2 sin (θ - 2 (cos (θ^1.02)))
polar curve: r = 6 sin (2 sin (θ - 2 (cos (θ^1.02)))

y^2 = (8.65 * exp(x))/(-3*x^0.2 -3*x^2 + x^4)

y^2 = (8.65 * exp(x))/(-3*x^0.2 -3*x^2 + x^4)
y^2 = (8.65 * exp(x))/(-3*x^0.2 -3*x^2 + x^4)

Double Teardrop Squeezed on One Side
right: x = 4.5(-cos t + 1), y = 4 * sin t * sin (0.5*t^2)
left:  x = 3 * (cos t - 1), y = sin t * (0.5*t)^4 
-4 π ≤ t ≤ 4 π

double teardrop, squeezed on the left
right: x = 4.5(-cos t + 1), y = 4 * sin t * sin (0.5*t^2)
left:  x = 3 * (cos t - 1), y = sin t * (0.5*t)^4 
Vibration
1.025*x*y^2 = 1.5*π*sin(x^3)

1.025*x*y^2 = 1.5*π*sin(x^3)
1.025*x*y^2 = 1.5*π*sin(x^3)
x = 0.65*t + 1.5 sin(t^2)
y = 5 * (sin t)^3
-4 π ≤ t ≤ 4 π

x = 0.65*t + 1.5 sin(t^2) y = 5 * (sin t)^3
x = 0.65*t + 1.5 sin(t^2)
y = 5 * (sin t)^3



Get Desmos and have some fun!

Eddie



This blog is property of Edward Shore.  2015

Monday, August 17, 2015

TI-84 Plus: Picking List Elements Using a Logical List and Matrix By-Element Multiplication

Picking List Elements Using a Logical List 

The program BOOLLIST picks out elements from a source list based on a logical list (a list that consists of 0s and 1s).  0 represents  FALSE (do not pick) and 1 represents TRUE (pick).  

For more information and examples, see my last blog entry:  http://edspi31415.blogspot.com/2015/08/hp-prime-picking-out-elements-using.html

Note, that weird looking L is not the L character, but is represents the small "L" character.  This is accessed from [2nd], [stat] (list), OPS sub-menu, select B for "L" (the last option in this sub-menu).  On this listing, I will bold the "L".  


TI-84 Plus:  BOOLLIST

Input "SOURCE LIST=",A
Input "LOGICAL LIST=",B
sum(B)→S
S→dim(C)
1→I
1→J
dim(A)→A
dim(B)→B
For(K,1,A)
If B(J)=1
Then
A(K)→C(I)
1+I→I
End
1+J→J
If J>B
1→J
End
Pause C

Matrix by Element Multiplication

In R, the multiplication operator (*) multiplies matrices element-by-element.  To get the proper linear-algebra multiplication of matrices, use the %*% operator.  The program MATMLEM implements the former method.  

Example:
[A] = [[ 1, 2 ] [ 3, 4 ]]
[B] = [[ 4, 3 ] [ 2, 1 ]]
Running MATMELM returns the matrix [[ 4, 6 ][ 6, 4 ]].

Variables [H], [I], and [J] are used for calculations.  Also, like BOOLLIST above,  the weird looking L is not the L character, but is represents the small "L" character.  This is accessed from [2nd], [stat] (list), OPS sub-menu, select B for "L" (the last option in this sub-menu).  On this listing, I will bold the "L". 

TI-84 Plus:  MATMELM

Disp "MATRIX MULTIPLY"
Disp "BY ELEMENT"
Input "[H]=",[H]
Input "[I]=",[I]
dim([H])→H
dim([I])→I
If H(1)≠I(1) or H(2)≠I(2)
Then
Disp "INVALID"
Stop
End
[H]→[J]
For(H,1,H(1))
For(I,1,H(2))
[H](H,I)*[I](H,I)→[J](H,I)
End
End
DelVar H
DelVar I
Disp "[J]="
Pause [J]


If the program is hard to read, please let me know in the comments.  


I am about half way through the R introduction programming course.  Time flies by when you are having fun. 

Eddie

This blog is property of Edward Shore.  2015.

Tuesday, August 11, 2015

HP Prime: Picking Out Elements Using a Logical List (Updated 10/18/2015)

HP Prime:  Picking Out Elements Using a Logical List

I am taking an online class in R Programming language (www.edx.org), having a great time. The program BOOLLIST is based on the ability in R to pick out elements using logical elements (TRUE, FALSE).


Example (in R):

vector <- [2, 3, 4, 5]
vector[ c(TRUE, TRUE, FALSE, TRUE) ]   returns [2, 3, 5]

The logical vector doesn’t have to be same length as the source vector.  If the logical vector has elements than the source vector.    

vector <- [1, 2, 3, 4, 5, 6]
vector[ c(TRUE, FALSE, TRUE, FALSE, TRUE, FALSE) ] returns [1, 3, 5]
vector[ c(TRUE, FALSE) ] returns [1, 3, 5]  (TRUE, FALSE pattern recycles)

Program BOOLLIST:

Input:  BOOLLIST(source list, logical list)

Notes:  Use list brackets { }.  For the logical list, use 1 for TRUE and 0 for FALSE.

EXPORT BOOLLIST(LA, LB)
BEGIN

LOCAL LC, n, s, k, j;

//  Initialization
LC≔{ };
j≔1;
s≔SIZE(LA);
n≔SIZE(LB);

// Process
FOR k FROM 1 TO s DO

IF LB(j)==1 THEN
LC≔CONCAT(LC,LA(k));
END;

j≔j+1;

IF j>n THEN
j≔1;
END;

END;

RETURN LC;

END;


Examples:

In addition to the examples above that can be tried with BOOLLIST:

BOOLLIST( {4,2,3,6}, {1,0,0,1} ) returns {4, 6}

BOOLLIST( {3,9,6,-1,6}, {1,0} ) returns {3, 6, 6}

See you next time, Eddie

Update:  There was an error in the program listing.  Previously I had b:=SIZE(LB); where it should be n:=SIZE(LB).  Eddie




This blog is property of Edward Shore – 2015.

Thursday, August 6, 2015

HP 41C vs HP 50g Guide (for Starters)

HP 41C vs HP 50g Guide (for Starters)

Generally, HP 41C and HP 50g programming languages are somewhat similar, as long as you operate the HP 50g in RPN mode.  Here are some key differences to keep in mind:

* There are no LBL (label) or GTO (go to) commands with the HP 50g. 

* Subroutines are typically in the beginning of the main program, stored, and are called when necessary.

* Variables start with a letter, can be almost any length, and can contain various types of objects.  Variable names are surrounded by single quotes ( ‘ ‘ ).  Store and recall the contents of the variables like normal.  For the HP 50g, undefined variables are used as CAS (computer algebraic system) algebraic objects.   Erase the variable by typing in the variable as such
variable’,  and execute the PURGE function.

* There is no ASTO/ARCL command.  Strings are designated with double quotes. 

* DSE and ISG are replaced with FOR loops.  In general, a FOR loop for the HP 50g is:

starting_number  ending_number  FOR variable
commands
NEXT

* There are no line numbers in the HP 50g programming language.  For comparisons, and IF-THEN-ELSE-END structure is used.  The ELSE portion is optional.

IF  y  x   (==, ≠, <, > , ≤, ≥)
THEN (do these commands if the test is true)
ELSE (do these commands if the test is false)
END

* Programs begin and end with double arrow symbols.   and .   So do subroutines.

For further information on programming the HP 50g, which was posted in October 2013, please check out the tutorial series, which starts here:



List of Commands that work exactly the same on the HP 41C and HP 50g:

+
CHS
FS?
%
-
CLΣ
FS?C
%CH
*
DEG
GRAD
SCI
/
ENG
HMS+
SF
ABS
FC?
HMS-
SIGN
ACOS
FC?C
MOD
SIN
ASIN
FIX
LOG
TAN

Basic Statistics Functions

The commands MEAN, SDEV, Σ+, Σ-, and CLΣ related to the date matrix ΣDAT.  

Base Conversions

The HP 50g has four base conversion (integer) modes:  OCT (Octal), DEC (Decimal), HEX (Hexadecimal), and BIN (Binary). The 41C only has two:  OCT and DEC.   Base integers are designated with a hashtag and lower case indicator at the end of the integer.  For example:  #827o,   #52d, #A36h, and #1101b.   The indicators are:  o for Octal, d for Decimal, h for Hexadecimal, and b for Binary.

Before converting base types, the number needs to be converted to a real number format using the command B→R.   The change modes.  Convert back to base by using R→B. 

List of commands that have the same functions, but different names:

HP 41C
HP 50g
HP 41C
HP 50g
1/X
INV
FACT
!
10↑X
ALOG
CLD
CLLCD
BEEP/TONE
Frequency (in HZ),
Time (in seconds), BEEP
INT
IP
D-R
D→R
HMS
→HMS
R-D
R→D
HR
HMS→
E↑X
EXP
PI
π
E↑X-1
EXPM
SQRT
LN1+X
LNP1
X↑2
SQ
SIZE*
MEM
Y↑X
^
X<>Y
SWAP
X=Y?
== 
LASTX*
LASTARG
X≠Y?
ST+
STO+
X>Y?
<   (y<x)
ST-
STO-
X<Y?
>  (y>x)
ST*
STO*
X>=Y?
≤   (y≤x)
ST/
STO/
X<=Y?
≥  (y≥x)


* SIZE has a different function for the HP 50g: returning the dimension of a list, matrix, or string.

* LASTARG returns all the arguments last used by a command, not just the last used x-argument. (Level 1).

Note: This should cover most of the basic differences between the HP 41C and HP 50g.   If I am missing something or something needs correction, please let me know in the comments.  Thank you!


Sources:   Hewlett Packard. “Owner’s Handbook and Programming Guide” 1979.  Printed March 1980.

Eddie



This blog is property of Edward Shore – 2015.

Tuesday, August 4, 2015

Repeated Presses of the Square Root Button

Repeated Presses of the Square Root Button



How many of you have ever done this?  You take an ordinary calculator (or even an older-style AOS calculator or an RPN calculator), enter a number, particularly greater than 1, and just kept pressing the square root button?  Eventually, the number would approach 1, and due to the number decimal points the calculator can hold, the display would be 1.

We can theorize on how many times we would have press the square root button before the displayed value falls below a limit level L. 

Taking repeated square roots of x, n times, will lead to:

√ … √ √ √ x
= √ … √ √ (x^(1/2)
= √ … √ (x^(1/4))
= √ … (x^(1/8))
= x^(1/(2^n))

The number of times the square root button needs to be pressed until it falls below a limit L (for the first time), the inequality is set up as:

x^(1/(2^n)) < L

Solving for n (x and L are given):

Take the logarithm of both sides:

ln (x^(1/(2^n))) < ln L
1/(2^n) ln x < ln L
1/(2^n) < (ln L)/(ln x)

Taking the reciprocal of both sides:

2^n > (ln x)/(ln L)

Again, take the logarithm of both sides:

ln (2^n) > ln (ln x/ln L)
n ln 2 > ln (ln x/ln L)

Solving for n:

n > ln (ln x/ln L)/ln 2

Implementing a short algorithm on an HP 42S:

01 LBL “BL08”
02 LN
03 X<>Y
04 LN
05 ÷
06 LN
07 2
08 LN
09 ÷
10 RTN
11 .END.

Input:  L followed by x.   (x>2)

I calculated a theoretical n for various limits (L = 2, L = 1.5, and L = 1.01) and various values of x.


Table of Repeated Square Root Button Presses:  Theoretical n vs. Actual n
(Excel, HP 42S)


From the table, it seems that a suitable formula for n (L ≥ 1, x ≥ 2):

n = int(ln (ln x/ln L)/ln 2) + 1  

Where int represents the integer part function.    

Try this out – and maybe revisit a small part of your childhood in the process.  Have a great day,

Eddie




This blog is property of Edward Shore – 2015.

Casio fx-991CW: Input Output Formats

Casio fx-991CW: Input Output Formats The Four Formats There are four input/output formats that the Casio fx-991CW has. With eac...