Thursday, July 31, 2014

Sharp EL-501X (today) vs TI-35 Plus (1989)

TI-35 Plus Notes vs Sharp EL-501X (and almost all of its clones)

Ever wanted a TI-35 Plus? First you could go to eBay or other online stores and try to hunt one down or invest up to $10 for one of the many close-version that are still manufactured and sold today. There is even a version sold at the Dollar Store! (The keyboard of that $1 Store I bought is crappy.) Today I will be comparing the Sharp EL-501X against the 1989 TI-35 Plus (and its solar sister, TI-36 Solar (no X)).

Since I never actually owned a TI-35 Plus, all the information will be from its manual. I did buy a TI-36 Solar guidebook, 20 years ago or so, from a clearance bin at Toys R Us of all places. The Sharp EL-501X I bought this week primarily for this blog entry, and to replace a blue cased EL-501X I gave to my cousin's daughter.

Source of the TI-35 Plus information:

TI-35 Plus Page:

Side plug: Datamath is an excellent web page for all things Texas Instruments calculators, past and preset.


Internal Digits: 12

Complex Mode
Base Display Modes: Binary, Decimal, Octal, Hexadecimal
One Variable Statistics

Complex Mode is limited to arithmetic. The real part is stored and recalled using the [ a ] key and the [ b ] key is for the imaginary part. ( a + bi )

Base Display Modes (except for Decimal) is limited to arithmetic. To convert numbers, just call their respective mode.

Number of memory registers: 1

Factorial Function: n!. Only takes positive integers or zero unless an error occurs.

Polar/Rectangular Conversions:
[ a ] is used for x and r
[ b ] is used for y and θ

Basic Scientific Function set: hyperbolic functions, trigonometric functions and inverses, exponential functions and inverses, reciprocal, square root, cube root, power, arithmetic, π, 3-decimal random number (usually labeled RND)


TI-35 Plus: 10 digits plus 2 digit exponent
EL-501X:10 digits or 8 digit plus 2 digit exponent

Exchange Key:
TI-35 Plus has two: EXC to change the number in the display with the number in the memory register. x<>y exchanges operands in power, root, division, and subtraction calculations.
EL-501X: Only the latter is present, often symbolized by a vertical line with up and down arrows. ( [2ndF] [ ( ] )

Decimal Display Settings:
TI-35 Plus: Four permanent modes: floating, fixed, scientific, engineering
EL-501X: Two permanent modes: floating and fixed. Numbers can be toggled between floating/fixed and scientific notation by pressing [ F ←→ E ]

Things the TI-35 Plus had that the EL-501X and most of the clones do not:

Permutations and Combinations. The TI-35 Plus facilitated the use of the [ a ] and [ b ] keys.

Normal Cumulative Distribution Functions (mean = 0, variance = 1, given z):
R(z): area between 0 and z
Q(z): area from z to positive infinity (upper tail)
P(z): area from negative infinity to z (lower tail)

In more advanced calculators and mathematical software, the normalcdf function calculates P(z) (lower tail).

One variate of the EL-501X, the Canon F-604 has permutations, combinations, memory exchange, and fractions. Unfortunately the one I bought not to long ago, the zero key reseted the calculator, so I had to return it. Hopefully it is not the case with all F-604s.

Yes - entry level scientific calculators still exist in the market.

Take care everyone, thanks for comments and questions. Much appreciated. Eddie

This blog is property of Edward Shore. 2014

Roots of the Cubic Equation - Pythonista 2.7

Roots of the Cubic Equation - Pythonista 2.7


# Cubic Equations: 2014-07-30 EWS
# need the root
import math
# is a root 1?
if test==0:
if test!=0:
# first root by Newton's Method
while math.fabs(xn-x1)>1e-13:
# second and third roots
if disc<0:


x^3 - 4*x^2 - 17*x + 60 = 0
a = 1, b = -4, c = -17, d = 60
Roots: 3, 4, 5

2*x^3 + x^2 - 2*x + 1 = 0
a = 2, b = 1, c = -2, d = 1
Roots (approximately): -1.43756, 0.46878 ± 0.35784i

This blog is property of Edward Shore. 2014

Saturday, July 26, 2014

HP Prime: Drawing the Pareto Curve

This program draws the Pareto Curve given a list of frequencies.

Program Name:  PARETO(list of frequencies)

This is best called from the Home Screen and not the program catalog.  The curve drawn is not tracable, but is able to used without having to switch apps.  

// 2014-07-25 EWS
// frequency list
LOCAL lx,ly,I,J,n;
// Setup
// Draw the Curve
Xmin:=0; Xmax:=n+1; Xtick:=1;
Ymin:=0; Ymax:=1.1; Ytick:=0.1;





Example:  A list of frequencies:  {4, 8, 9, 5}.  Note that the biggest frequency is plotted first, as the program first arranges the frequencies from largest to smallest.  Each point will show the cumulative percentage of the total population.  A list of the cumulative percentages will be returned to the home screen.

Pareto Curve Plot
List of Cumulative Percentages


This blog is property of Edward Shore.  2014

Friday, July 25, 2014

Pythonista 2.7: Triangle: Lengths of the side and angle given three points

Pythonista Program:
Version 2.7

Draws a triangle given three points: S, A, and B with coordinates (sx, sy), (ax, ay), and (bx, by), respectively. Lines formed are SA, SB, and AB. This program finds the lengths of SA, SB, and AB, calculates the angle between SA and SB, and draws the triangle.

Note, the modules math and canvas are used. I think the math module is universal but the canvas module seems to exclusive to Pythonista. Not 100% sure. So if you don't have the canvas module, you can omit the second part of the script out. You will just have text.

Example (see screen shot 2):
S = (10,6)
A = (24,25)
B = (12, -2)

SA = 23.600847442411894
SB = 8.246211251235321
AB = 29.546573405388315
Angle = 129.57940471623766°


import math
# find distances and angle
# vertex
print('Vertex Point s')
sx=float(input('sx= '))
sy=float(input('sy= '))
# outer points
print('Point A')
ax=float(input('ax= '))
ay=float(input('ay= '))
print('Point B')
bx=float(input('bx= '))
by=float(input('by= '))
# calculate side lengths sa, sb, and ab
# using the hypot function
print('|SA|', sa)
print('|SB|', sb)
print('|AB|', ab)
# calcuate the angle between sa and sb
print('Angle beteeen SA & SB:', ang)

# drawing lines - Pythonista
import canvas
# set canvas of 100 x 100 to allow room
# use pixel (50,50) as the origin
# set stroke line
# draw lines
# lines sa and sb are blue
# line ab is dark green
# draw axis - gray

Kind of a little intro to Pythonista, at least for me.


This blog is property of Edward Shore. 2014

Tuesday, July 22, 2014

My experience with Python so far (Pythonista iOS App 2.7)

Overall, my experience with Python has not been a great one, especially trying it with using iOS apps. (Update: but it's getting better - see below)

The iOS Python 3.2 app by Jonathan Hosmer crashes a lot on my iPad (3rd generation). Not worth the $2.99 in my opinion.

I also tried the pythoni3.3 iOS app by XiaoWen Huang, which is free to download but has in app purchases. Sadly, this app fails in even in giving simple instructions as the help file will tell you everything of the history and how to use it on other machines, but forget it if you want to find how to invoke the interpreter on the app itself. And it crashes if I try to erase the word "in".

Then there is Pythonista 2.7 which has a great interface. However, I am not sure if the mathematics used by this app is not solid or I lack some obvious command. For instance:

Solving 2 by 2 Systems

Solve for x and y:
Ax + By = E
Cx + Dy = F

x = (D*E-B*F)/(A*D-B*C)
y = (A*F-C*E)/(A*D-B*C)

Below is the code for it:
# solving 2 x 2 systems
print('Ax+By=E, Cx+Dy=F')

A = 2
B = 3.5
C = -1
D = 0.4
E = 0.6
F = -2

The results I get are these:
x = 1.68372093023, y = -7.90697674429

Which is fine. I get comparable results when using other calculators and the MathStudio app to verify my answer.

However, the volume of a sphere tells another story.

Volume of the Sphere

Formula = 4/3 * π * r^3

Here is the program and results for r = 3. First the screenshots:


import math
print('volume = ',vol)

r = 2.45; result Pythonista gives: 46.200654262773026

Verifying the answer with an fx-5800p and HP Prime I get: 61.60087235 (correct answer)

r = 3; result Pythonista gives: 84.82300164692441

However, my calculators return 113.0973355.

Again, am I missing something obvious? Or is Pythonista (maybe the language itself) not reliable?

(Updated) Thank you so much Bhuvanesh Bhatt!

Here is the corrected code:

import math
print('volume = ',vol)

In version 2.7, which Pythonista runs, the slash operator (/) is treated as integer divsion. So a decimal point after the denominator is required in order to use floating divsion. In version 3, the extra decimal point is not required.

Under the updated code, I get the correct answers. Thanks once again Bhuvanesh!

Let me know your experiences in the comments below. Thanks as always, Eddie.

This blog is property of Edward Shore. 2014

Monday, July 21, 2014

My Mathematical Notes for Python (so far)

Official website:

Latest version: 3.4 (at the time of this blog entry)

My mathematical notes on Python so far:

This is from the 3.4 instructions but should hold in the 2.7 version as well. I am trying to find a good iOS app to do this.

* A good suggestion is to watch a few tutorial YouTube videos on Python. Onestopprogramming has a good set of tutorials. Python is capable of doing many things, including working with computer files, my focus will be on some of the mathematical capabilities of Python.

* The uses of the equals symbol ( = ) in Python:

(1) A single equal sign means assignment.
x = 4 stores "4" in the variable x.
str = "Eddie" or str = 'Eddie' stores "Eddie" in the variable str.

(2) Two equals signs mean comparison, does x equal y? ( x = y ?)
12==12 returns True

(3) An exclamation mark in front of an equals sign means the comparison, does x not equal y? ( x ≠ y ?)
12!=12 returns False

* Variables that are assigned are defaulted to strings. In order to use variables to represent numbers, we must first declare them as such. The declarations are:

int: integer
long: long integer
float: floating numbers
complex: complex numbers

Example: float(x) declares x as a floating variable.

* Working with floating numbers can bring "weird results" due to Python internally representing every number as a binary representation (0s and 1s). For example,

2.2 * 2 returns 4.40000000000000004

Although the PC version returns 4.4. So this may just be he iOS or a not so good app I was using a the time (Python 3.3 iOS app).

In order to get this answer in more acceptable form. This requires the format declaration. It's syntax is generally this:

"{:.xf}".format(answer, expression, variable, etc..)

Where x is the number of decimal places desired.

Back to our example, let's express 2.2 * 2 using four decimal places:

"{:.4f}".format(2.2*2) returns '4.4000'

* To access mathematical functions beyond arithmetic, we must first import the math library. This is done usually at the beginning of each script (program).

Syntax: import math

Common math functions are what you would expect:

math.ceil(x): ceiling
math.fabs(x): absolute value
math.factorial(x): factorial of x, integers only
math.gamma(x): the gamma function, Γ(x)
math.erf(x): error function
math.fsum(list): sum of a lists elements (in single square brackets)
math.exp(x): e^x
math.log(x, base): logarithm. Leave base out for natural logarithms ( ln x ).
math.pow(x, y): x^y. More expansive than using the double asterisk. ( x ** y )
math.sqrt(x): √x

math.sin(x), math.cos(x), math,tan(x): sine, cosine, and tangent, respectively. The angle is always in radians.
math.asin(x), math.acos(x), math.atan(x): arcsine, arccosine, and arctangent, respectively. The angle returned is in radians.
There are hyperbolic versions of these functions.

math.degrees(x): convert from radians to degrees
math.radians(x): convert from degrees to radians
math.pi: π
math.e: e

A complete list can be found in the python documentary.

* Quick math symbols that don't need the math library to be imported:

Arithmetic functions: +, -, *, and /. (For those new to programming, * represents × and / represents ÷)

Power: ** (two asterisks)

Modoluo: %

Representing exponential powers of 10: e+N or e-N

That is my quick notes for now. I want to post some programs using the Python language in the upcoming weeks.


Saturday, July 12, 2014

When is the Glass Half Full?

We have heard the famous two expressions “the glass is half-full” and the “glass is half-empty”; the former is from the view of an optimist while the latter is from the view of a pessimist.  In life, I have been both the optimist and the pessimist. 

Let’s consider when a glass is actually half empty, oh sorry, half full.  This is achieved when the volume is half full when the volume of the liquid equals half of the volume of the glass.  Simple enough.

Let q be the flow rate of the liquid being poured in the glass, and assume it is a constant to keep it simple.  (Yes we can a variable flow rate q(t) – this would be appropriate when pouring viscous liquids or considering problems when we are drinking water or our favorite spirit or pop).

With V being the volume of the liquid:

dV/dt = q

dV = q dt

Taking the integral of both sides yield:

V = q*t + V0

Where V0 is the initial volume of the liquid.  Let’s assume that we start with an empty glass.  Then the liquid of the liquid inside of the glass is:

V = q*t

Let C be the volume (or the capacity) of the glass.  The glass is half full when V = C/2 or

t = C/(2 * q)

We can use this equation for various shapes of drinking glasses.  Case in point:

For a cylindrical glass:  volume = π * r^2 * h

For a cylindrical glass:  C = π * r^2 * h

For a parabolic glass:  volume = π * r^2 * h/2

For a parabolic glass:  C = π * r^2 * h/2

For a cup:  volume = π * h/3 * (a^2 + a*b + b^2)

For a cup:  C = π * h/3 * (a^2 + a*b + b^2)

(r, a, and b are radii – half of the distance of the diameter.)

Take the example that we have a cup with dimensions a = 1.375 in, b = 1.75 in, and h = 3.5 in.  We are going to pour iced tea in it at a flow rate of q = 8.3 in^3/sec.   

C = π * 3.5/3 * (1.375^2 + 1.375 * 1.75 + 1.75^2) ≈ 26.93752 in^3

and t ≈ 26.97352/(2 * 8.3) ≈ 1.62491 sec

P.S. The flow rate I gave came from a short experiment of actually pouring Arnold Palmer Ice Tea into the glass and timing how long it takes to pour the ice tea, which it took about 3.25 seconds to fill it.  Doing the same experiment with pouring water from a bottle, which took me 7 seconds (a flow rate of approximately 3.9 in^3/sec) – but I think held the bottle closer to the cup.

Pessimists and optimists (and everyone in between) – go out and have an awesome weekend.  Cheers!


This blog is property of Edward Shore.  2014.


Swiss Micros DM41X and Casio fx-CG 50: Minor Head Loss

Swiss Micros   DM41X and Casio fx-CG 50: Minor Head Loss Introduction When a fluid, such as water, is flowing in a pipe system, ene...