Sunday, November 25, 2012

Two more calculators added to the collection.

I love swap meets and pawn shops. Eddie

f(x) = x * random ^ random

Earlier this month, I received a request from Jason Foose. These are six graphs of y = x * rand^rand: two with the TI-84+, two with the Casio Prizm (fx-CG 10, and two with the HP 39gii.

On the Prizm, I had to use the catalog to find the random number function (labeled Ran#).

Re-editing the function will cause the function to be redrawn.

Enjoy!

Eddie

Matrix Functions on the fx-991ES (fx-115ES in the US) vs TI-36X Pro

Matrix Function Comparison (fx-991ES/fx-115ES vs TI 36X Pro)

Today's blog entry comes from a question by An Artist:


An Artist has left a new comment on your post "TI-36X Pro Review":

Hi Eddie,

In India, the TI 36x pro is available at the same price as the Casio 991ES.
I have ordered the TI.

Is this a good decision?
I've heard of a memory overload bug of the TI which gives wrong answers. Can you please tell me how to get around the bug?

My main focus is matrix and someone told me that this one has more matrix functions for matrices. Can you please confirm that?

Your blogs have been very helpful about calcs. So, keep up the good work.


First of all thank you for the compliment An Artist, very much appreciated.

Regarding the overload bug on the TI-36X Pro, honestly this is the first time I read of it. According to one of the reviewers on the flipkart.com page, the reviewer reports an overload bug occurs when too many equations are used or too much memory is used. I have not found any additional information about this. Personally I have not encounter this problem.

Now the matrix commands. I am going to list the available matrix functions for each calculator. First up, Casio, then Texas Instruments.

Keep in mind both calculators allow only for real-numbered elements.


Casio fx-991ES (aka fx-115ES in the United States)

You will need to enter a specific mode for Matrices (MODE 6)

3 matrices can be stored, up to size 3 x 3 matrices. A separate "Ans" matrix is also available.

Matrix Functions:
Arithmetic
Ability to resize matrices
Determinant (dim)
Transpose (Trn)
Inverse (with the x⁻¹ button)
Square of a square matrix (with the x² button)
Cube of a square matrix (with the x³ function)
Absolute Value of each element (Abs)

Matrices are automatically cleared when modes are switched.

Note: The updated fx-115ES PLUS adds the ref and rref functions.


Texas Instruments TI-36X Pro

There is no specific mode required, you can work with matrices directly from the Home screen.

3 matrices can be stored, up to size 3 x 3 matrices. A separate "Ans" matrix is also available. The TI-36X offers identity matrices [I2] and [I3] of size 2 x 2 and 3 x 3, respectively.

Matrix Functions:
Arithmetic
Ability to resize matrices (through the edit screen)
Determinant (dim)
Transpose (Trn)
Inverse
Square of a square matrix (with the x² button)
Powers of a square matrix ([A]^n where n is a positive integer, 0, or -1)
Absolute Value of each element (abs)
Integer Part of each element (iPart)
Fractional Part of each element (fPart))
Rounding of each element (round)
Reduced Echelon Form (ref)
Row Reduced Echelon Form (rref)

Matrices are retained in memory on the TI-36X Pro.


An Artist, to answer your question between the fx-991ES and the TI-36X Pro, I can confirm that the TI-36X Pro has more functions for matrices. Hope this helps,

Eddie



Thursday, November 22, 2012

Happy Thanksgiving

Wishing everyone a happy and safe Thanksgiving. I am very thankful to all who follow my blog and all who read and make comments. You are truly the best!

May Thanksgiving be a blessed event, memorable, and stress be minimized!


Eddie

Sunday, November 18, 2012

Graphing Calculator Programming Languages Comparison: TI 84 Plus vs Casio Prizm

This is a short comparison between the programming languages of the Texas Instruments TI-84+ and the Casio Prizm. For each category, I will list the different syntaxes required.

If you find a program that you like that is programmed on a calculator you don't have, no fear! This guide can be served as a translation guide. For more details, consult the manual or search for detailed tutorials.

Hope this helps,

Eddie

Notes:

The commands for the TI-84+ also covers the TI-84+ Silver Edition, TI-83+ Silver Edition, TI-83+, and most likely the TI-82 and the upcoming TI-84+ Plus C Silver Edition (84+ with a color screen). The TI-84+ family carries a program memory of about 24,000 bytes, 28,000 for the TI-82.

The commands for the Casio Prizm (Model fx-CG 10/20) also apply to the fx-9860g (all versions), fx-9750g, and (most likely) fx-9850g. The Casio family carriers about 60,000-62,000 bytes of program memory, except the 9850g (32,000 bytes).

Keystrokes may vary.

Arguments in each command are in italics.


Here we go:

Numerical Derivative

TI-84+: MATH, 8
nDeriv(f(variable),var,value)

Casio Prizm: OPTN, F4, F2
d/dx(f(X),value)
The variable is always X.

Definite Integral

TI-84+: MATH, 9
fnInt(f(var), var, lower limit, upper limit)

Casio Prizm: OPTN, F4, F4
∫(f(X),lower limit,upper limit)
The variable is always X.

Solve

TI-84+: Catalog or MATH, B in programming mode
solve(expression,variable to be solved for,guess, range*)
expression is set to be equal to 0
range is a two element list {low, high}, and is an optional argument.

Casio Prizm:

There are two commands.

Solve f(X)=0 for X: OPTN, F4, F1
Solve(f(X),guess,low,high)

Solve an equation in any variable: OPTN, F4, F5
SolveN(equation,variable to be solved for,low,high)

Sums

TI-84+: MATH, 0
Σ(f(var),var,start value,end value)

Casio Prizm: OPTN, F4, F6, F3
Σ(f(var),var,start value,end value)

Asking for Input

TI-84+:
Input "prompt string", var

Casio Prizm:
"prompt string"? → var

Displaying Results

TI-84+:
Disp var or string
You can add other lines, using commas to separate them.

Pause var
Pause allows the user to scroll the variable's value.

Casio Prizm:
var or string
The ◢ is the right triangle symbol, which acts like a pause command.

If Then Else

TI-84+:
If test expression
Then
do this if test is true
Else
do this if test is false
End

Casio Prizm:
If test expression
Then
do this if test is true
Else
do this if test is false
EndIf

Shortcut: Jump Command
test condition1 command if test is true : skip to here if the test is false

For Loop

TI-84+:
For(counter var,start value,end value,step size*)
commands
End

step size can be positive or negative, and is optional

Casio Prizm:
For start valuevar To end value Step step size*
commands
End

step size can be positive or negative, and is optional

While Loop

TI-84+:
While this test condition is true
do these commands
End

Casio Prizm:
While this test condition is true
do these commands
WhileEnd

Do Until Loop

TI-84+:
Repeat until this condition becomes true
these commands
End

Casio Prizm:
Do
these commands
LpWhile this condition remains false

List and Matrix Element Calls

TI-84+:
Lists:
L#(element number)
#: 1 through 6 or custom name

Matrix:
[[#]](row,column)
#: A through J

Casio Prizm:
Lists:
List #[element number]
#: 1 through 26 or custom name

Matrix:
Mat #[row,column]
#: 1 through 26

Giving the user a menu of options

TI-84+:
Menu("title string", "choice 1",label name...)
Up to 7 menu items

Casio Prizm:
Menu "title string", "choice 1", label name...
Up to 9 menu items

Decrementing and Incrementing Variables by 1

TI-84+:
IS>(var,target value)
do if var + 1 ≤ target value
skip to here if var + 1 > target value

DS<(var,target value)
do if var - 1 ≥ target value
skip to here if var - 1 < target value

Casio Prizm:
ISZ var
do if var + 1 ≠ 0
skip to here if var + 1 = 0

DSZ var
do if var - 1 ≠ 0
skip to here if var - 1 = 0



This blog is property of Edward Shore, 2012.

Sunday, November 11, 2012

Jacobi Elliptical Functions

This blog entry is possible thanks to @mathematicsprof on Twitter. He posted an article "Jacobi Elliptic Functions from a Dynamic Systems Point of View", written by Ken Meyer Ph.D of the University of Cincinnati, which not only gave me something to read during lunch last Friday but also lead me on how to calculate Jacobi Elliptic Functions. I am so grateful!

By the way, I am on Twitter: @edward_shore.

Jacobi Elliptic Functions - An Introduction

Let k and t be parameters where 0 < k < 1 as the following system of differential equations is to be solved:

dx/dt = y(t) * z(t)
dy/dt = -z(t) * x(t)
dz/dt = -k^2 * x(t) * y(t)

which satisfy the initial conditions x(0) = 0, y(0) = 1, and z(0) = 1.

The Jacobi Elliptical Functions are defined to be the solutions to the above system.

The sine amplitude function is defined as sn(t, k) = x(t).

The cosine amplitude function is defined as cn(t, k) = y(t).

The delta amplitude function is defined as dn(t,k) = z(t).

A very interesting point, which has also managed to trip me up for years, is that there is no explicit closed formula for sn(t,k), cn(t,k), and dn(t,k). Yet mathematicians can find the derivatives and integrals of these functions.

Derivatives of the Jacobi Elliptical Functions

These derivatives, by looking at the system above, are:

d/dt sn(t,k) = cn(t,k) * dn(t,k)
d/dt cn(t,k) = -dn(t,k) * sn(t,k)
d/dt dn(t,k) = -k^2 * sn(t,k) * cn(t,k)

When k=0

By setting k=0 and finding solutions to the system equations becomes:

dz/dt = 0
z(t) = c
Since z(0)=1, conclude z(t)=1.

Then
dx/dt = y(t)
dy/dt = -x(t)
with initial conditions x(0)=0 and y(0)=1.

Since sin(0)=0, cos(0)=1, d/dt sin t = cos t, and d/dt cos t = -sin t, we can conclude that x(t) = sin t and y(t) = cos t. Meyer states that as k approaches 0, sn(t,k) approaches sin(t), cn(t,k) approaches cos(t), and dn(t,k) approaches 1.

A Very Familiar Identity

Similar to the famous identity:

sin²(θ) + cos²(θ) = 1

An identity of Jacobi Elliptical functions is:

sn²(t,k) + cn²(t,k) = 1

Why is this true? Take the derivative with respect to t and we find that:

2 sn(t,k) cn(t,k) dn(t,k) - 2 cn(t,k) dn(t,k) sn(t,k) = 0

How to Calculate

We can use the integral definition to assist us in calculating values for sn, cn, and dn. In this section, let the parameters be u and k, respectively. The integral definition stems from the incomplete elliptical integral:

where u and k are known and p is the value we are solving for.

The value p is known as the Jacobi Amplitude, am(u,k) for short. Then:

am(u,k) = p

sn(u,k) = sin(am(u,k)) = p

cn(u,k) = cos(am(u,k)) = p

dn(u,k) = √(1 - k² sin² (am(u,k)) = √(1 - k² sin²(p))

Advanced mathematics software or an online calculator, such as this one from Ke!san, are often used to calculate values of Jacobi Elliptical Functions. Fortunately, this task can be done with high-end graphing calculators, using their solve application.

I have been able to obtain accurate answers using the Hewlett Packard HP-50g, Texas Instruments TI-84+, and Casio Prizm fx-CG 10. The later two are relatively fast in finding values. Below I will show the setup for each of the three calculators. I am pretty sure the TI nSpire can handle this too. The following screens show how to obtain am(u,k), the Jacobi Elliptical functions easily follow.

In the solver screen, you can leave X blank (HP-50G only), or just assign any arbitrary value to X, such as 1, since X is the dummy variable in the integration and has no effect on calculations.


Here is a small table of values:

Resources

Meyer, Kenneth R. "Jacobi Elliptic Functions from a Dynamic Systems Point of View" The Mathematical Association of America. Monthly 108. October 2001 - retrieved 11/9/2012

Weinstein, Eric "Jacobi Elliptic Functions" - From MathWorld - A Wolfram Web Source, http://mathworld.wolfram.com/JacobiEllipticFunctions.html, retrieved 11/11/2012

Fun as always! Thank you as always. Until next time, Eddie




This blog is property of Edward Shore, 2012.

The United States Fiscal Cliff: What does it all mean?

Hi everybody. Today I want to talk about tax policy and how the potential tax changes come January 1, 2013 affects taxpayers in the United States.

When the United States Congress goes back into session, one of the hot topics will be the "fiscal cliff". The "fiscal cliff" is a set of income tax credits and tax rates that are set to expire on January 1, 2013; effectively raising the income tax liability for each taxpayer. This blog entry will show how much of a tax increase to expect if no action is taken.


CAUTION AND DISCLAIMER:

1. The information presented today is for general purposes only and is not to be used as income tax advice. If you need advice, please work with a licensed income tax professional.

2. I am only working with federal income tax - be aware that other taxes can increase and decrease.

3. There is no guarantee of the final tax rates for 2013.

4. For today's blog, I will work with single and married filers (married filing jointly). Taxpayers that are head of households, married but filing separately, and other statuses may have different tax rates.



Current United States Tax Law for 2012

These are the current tax laws. When Americans file their income tax early next year, they will calculate tax liability using these rates.



2012 Tax Rates

(income range, tax rate)

Single
$0-$8,700; 10% of income
$8,700-$35,350; $870 plus 15% of income excess of $8,700
$35,350-$85,650; $4,867.50 plus 25% of income excess of $35,350
$85,650-$178,650; $17,442.50 plus 28% of income excess of $85,560
$178,650-$388,350; $43,482.50 plus 33% of income excess of $178,650
$388,350 and above; $112,683.50 plus 35% of income excess of $388,350

Standard Deduction: $5,950 (phased out as income passes a certain point)

Married Filing Jointly (filing as a couple)
$0-$17,400; 10% of income
$17,400-$70,700; $1,740 plus 15% of income excess of $17,400
$70,700-$142,700; $9,735 plus 25% of income excess of $70,700
$142,700-$217,450; $27,735 plus 28% of income excess of $142,700
$217,450-$388,350; $48,665 plus 33% of income excess of $217,450
$388,350 and above; $105,062 plus 35% of income excess of $388,350

Standard Deduction: $11,900 (phased out as income passes a certain point)

Personal Exemption: $3,800 (almost every person gets one)


Let's take an example for a single person in the United States who earned $50,000. Every taxpayer gets a personal exemption, and assume that this person takes a standard deduction in lieu of itemized deductions. Assuming no other credits apply:

Income: 50,000 - 3,800 - 5,950 = 40,250
Tax Liability for 2012: 4,867.50 + (40,250 - 35,350) * 25% = $6,092.50

Tax Rates for 2013 if No Action is Taken

If no action is taken, the income tax rates for each bracket will rise, except for the 15% bracket. The 10% bracket disappears entirely. The amounts shown in the table are 2012 amounts to determine the tax brackets - which will most likely be adjusted for inflation. These are estimated tables only, not final.


Tax Increase in 2013?

(income range, tax rage)

Single

$0-$35,350; 15% of income
$35,350-$85,650; $5,302.50 plus 28% of income excess of $35,350
$85,650-$178,650; $19,386.50 plus 31% of income excess of $85,650
$178,650-$388,350; $48,216.50 plus 36% of income excess of $178,650
$388,350 and above; $123,708.50 plus 39.6% of income excess of $388,350

Standard Deduction: $5,950 but will probably increase - final number not released

Married Filing Jointly

$0-$70,700; 15% of income
$70,700-$142,700; $10,605 plus 28% of income excess of $70,700
$142,700-$217,450; $30,765 plus 31% of income excess of $142,700
$217,450-$388,350; $53,937.50 plus 36% of income excess of $217,450
$388,350 and above; $115,461.50 plus 39.6% of income excess of $388,350

Standard Deduction: $9,900 - due to the "marriage penalty"

Personal Exemption: $3,800 but will most likely increase due to inflation



Let's take the same person, who is Single and makes $50,000. Assume income level stays level for 2013 and the person takes the standard deduction. Then for 2013:

Income: $50,000 - $5,950 - $3,800 = $40,250
Estimated Tax Liability for 2013: $5,302.50 + ($40,250 - $35,350) * 28% = $6,674.50

This represents a potential increase of $582 in income taxes.

You can use these estimate these tax brackets to estimate the increase in federal income taxes in 2013 - should nothing happen and the Bush Tax Brackets, which were set back in 2001 and 2003, expire.

In addition, the potential tax laws can change in 2013:

* An increase in long term capital gain tax, from 15% to 20%. This tax is for profit made on selling stocks and other long term capital assets held for more than 1 year.
* Social security tax on wages increase from 4.2% to 6.2%. Personally, I see this happening regardless of what happens in Congress over the next two months.
* The exclusion of employer-provided education assistance of $5,250 can disappear in 2013.
* The American Opportunity Tax Credit revers to the Hope Credit. The credit would be reduced from $2,500 to $1,800 and will only be available to students in the first two years of undergraduate education instead of four.
* The Child Credit and Earned Income Tax Credit is set to take a hit for 2013.

Hopefully this will alleviate some fear, or at the very least prepare taxpayers for what could be coming.

What is Congress Discussing

There is talk about extending the Bush tax brackets for at least another year for most taxpayers. Those with the highest income tax brackets (33% and 35%) could see their income tax increase and that what is in debate. Hopefully soon, Americans will know the final income tax structure for 2013

Source:
Discussion by Godfrey Kahn S.C., 5/23/2012 - Retrieved 11/11/2012

Good day everyone. This blog is information purposes only and not to start political debate.


Eddie


Saturday, November 10, 2012

Bernoulli Numbers and Polynomials

Today is a good day. I went to the library of alma mater, Cal Poly Pomona for library day. Once a month I try to visit a university library and peruse through with Mathematics Section.

I finally got the concept of generating functions. In the many years I studied math, generating functions proved to be an elusive topic for me. Not any more.

What are generating functions?

Generating Functions

Generating functions is a power series. The series is usually does not terminate. The coefficients of the power series can reveal a sequence used in various fields in science.

The Ordinary Generating Function:

G(a_n; x^n) = ∑ a_n * x^n

Sometimes we have an Exponential Generating Function:

E(a_n; x^n) = ∑ a_n * (x^n/n!)

There are other types of generating functions, but I will focus on the basic types described above.


n! represents the factorial of n. In this case, n is a positive integer, and:

n! = n * (n-1) * (n-2) * ... * 3 * 2 * 1

By definition, 0! = 1


To expand the generating function G(a_n; x^n), calculate a Maclaurin Series of G(x). A Maclaurin Series of a function is a Taylor Series about the point x = 0. Hence the Maclaurin Series:

G(x) = G(0) + G'(0) * x/1! + G''(0) * x^2/2! + G'''(0) * x^3/3! + .... + O(x)

where O(x) is the error term G^(n+1)(z) * x^(n+1)/(n+1)! In practice and calculation, O(x) is sometimes "ignored".

You can find more information about generating functions here.

An Example: A Basic Generating Function

Expand the generating function, let's go five terms:

G(a_n; x^n) = 1/(1 - x)

G(x) = 1/(1 - x)
Then:
G(0) = 1/(1 - 0) = 1

dG/dx = 1/(x-1)^2; dG/dx(0) = 1

d^2G/dx^2 = -2/(x-1)^3; d^2G/dx^2(0) = 2

d^3G/dx^3 = 6/(x-1)^4; d^3G/dx^3(0) = 6

d^4G/dx^4 = -24/(x-1)^5; d^4G/dx^4(0) = 24

To five terms...

1/(1-x) = 1 + 1 * x/1! + 2 * x^2/2! + 6 *x^3/3! + 24 * x^4/4! + O(x)
= 1 + x + x^2 + x^3 + x^4 + O(x)

The sequence of coefficients are: {1, 1, 1, 1, 1}.

The Bernoulli Numbers

The Bernoulli Numbers can be found by using the Exponential Generating Function:

E(a_n; x) = ∑ x/(e^x - 1)

The Bernoulli Numbers, B_n, are the "coefficients" of the expansion of ∑ x/(e^x - 1). Recall in the Exponential Generating Function, the "coefficients" are of the term x^n/n!.

With E(x) = x/(e^x - 1), the first two derivatives are:

dE/dx = - ((x-1)*e^x + 1)/(e^(2x) - 2*e^x + 1)

d^2E/dx^2 =
((x - 2)*e^(2x) + (x + 2)*e^x) / (e^(3x) - 3*e^(2x) + 3*e^(2x) - 1)

Note that calculating E(0) gives us 0/0. Same for dE/dx(0) and d^2E/dx^2(0). However, if I use a calculate with CAS capabilities such as the Hewlett Packard HP 50g, or mathematical software such as MathStudio (an app for smartphones and iPads), I get something like this (first eight terms):

Why is that?

Observe that:

lim x/(e^x - 1) as x → 0 = 0/0

Using the L'Hospital's rule, we can take the derivatives of both numerator and denominator,

lim 1/(e^x) as x → 1 = 1

which implies that:

lim x/(e^x - 1) as x → 0 = 1

You can generate terms by taking the limit as x → 0 for each term.

This how we end up with the series. Now to extract the "coefficients", observe that:

12 = 6 * 2!
(no term contains x^3/3!)
720 = 30 * 4!
(no term contains x^5/5!)
30240 = 42 * 6!
(no term contains x^7/7!)
1,209,600 = 30 * 8!

Our sequence for this generating function (for nine terms) is:

{1, -1/2, 1/6, 0, -1/30, 0, 1/42, 0, -1/30}

These numbers are the Bernoulli numbers. In fact, definition by generating function is:

x/(e^x - 1) = ∑ B_n * (x^n/n!)


Bernoulli Numbers

B_0 = 1
B_1 = -1
B_2 = 1/6
B_3 = 0
B_4 = -1/30
B_6 = 1/42
B_8 = -1/30
B_10 = 5/66
B_12 = -691/2730
B_14 = 7/6

B_n = 0 where n is odd and n > 2


Bernoulli Polynomials

Bernoulli Polynomials can be generated by the following formula:

β_n(x) = ∑((B_k * n!/(k!*(n-k)!) * x^k, from k = 0 to n)

where B_k is the kth Bernoulli number.

Source:
Krylov, Vladimir Ivanoch, translated by H. Stroud Approximate Calculations of Integrals McMillian Company: New York, 1962

Until next time, be safe everyone! Eddie



This blog is property of Edward Shore, 2012.

Friday, November 9, 2012

The Sine Wave - A Portrait

Good Friday!

One of my favorite mathematical functions is the sine function. Not only the sine wave helps describe a lot of physical phenomena, but I also see it like how life goes, with its ups and downs.

So here are few graphs (portraits) of the sine wave.

Settings:
Calculator: TI-84+
Window: X range: -π/2 to 5π/2, Y range: -2.05 to 2.05
(Except the last one, X range: 0 to 5π/2)


Eddie

This blog is property of Edward Shore, 2012.

Sunday, October 28, 2012

Review of FreeCalcFxc

Review: FreeCalcFxC

Platforms: iPhone and iPod Touch, will run on an iPad

Versions Available:
Free Version
$0.99 Scientific Version
$0.99 Financial Version

The only difference between the Free Version and the Scientific Version is that the Free Version is ad-supported.


Keyboard

The keyboard is a simple layout of 34 keys. The keys are labeled with one function. To access the shift function, press the gold shift key. The names of the shifted function replace the primary functions. Kudos for simplicity, however, my personal preference is to see both the primary and shift functions at the same time.

RPN and Algebraic Mode

The default mode is RPN (Reverse Polish Notation), but you can always enter an algebraic formula by pressing the "=f" key. The "=f" becomes the "=" to terminate entry of the formula.

Many, many, many calculators are available

Accessing the Focused Calculator list gives many calculators such as Math and Trig (the main calculator), Time Value of Money, Bonds, Statistics, Probability and Conversion calculators. For me the Conversion calculators leave a little to be desired, since there are no direct conversion keys attached to the default keyboard (luckily, that can be remedied!).

In addition to the Focused Calculators, CalcFxC gives formula template calculates. Among these formula calculators you have Percent Change, Distribution Functions, and the Quadratic and Cubic Equations.

The keyboard gives a good response when the "keys" are pressed. The screen is a two line (adjustable) screen which displays the y-stack and x-stack. The stack is four levels.

Help can be accessed by pressing and holding a key.

Real Numbers and Limits

The calculator operates on real numbers only. So, entering √-1 will return an error. As a consequence, the polynomial solvers return only real roots. The numbers range in the order of -10^-308 to 10^308.

There are no fractions or exact values of trig functions.

Math and Trig Keyboard

This keyboard contains functions usually not found a standard scientific calculator:

sqrtpi: takes the square root of the number then multiplies it by π
exmp1: e^x - 1, known on Hewlett Packard Calculators as the EXM1 function
log1p: ln(x + 1), known on Hewlett Packard Calculators as the LNP1 function
jn: Bessel Function of the First Kind, with x on the y-stack and the order n on the x-stack. jn also returns the Bessel Function of the Second Kind.
quad: Takes three arguments from the stack (a, b, c of ax^2+bx+c) and returns the real roots.

If you want to access the hyperbolic functions, you will need to call the Math and Hyperbolic calculator.


Memory

The calculator has 27 memories: memories a through z, and a special register ra. Storage and recall arithmetic can be performed on register ra - no idea why (except for maybe programming limitations) CalcFxC decided to restrict this feature to one register.

Programmability in the Form of Customizable Calculators

CalcFxC does not offer "traditional" macro or program capability. Instead, CalcFxC offers the ability to edit and create custom keyboards. You can redefine the key's name and help screen, along with it's formula. You have access to all of the functions. To use the stack arguments, use rgx(), rgy(), rgz(), and rgt() for the x, y, z, and t stacks respectively. This is a fun feature for those who has ever wanted to design their own calculators, and I am one of them!

To emulate the stack operations properly, you will need to define the formulas for each stack.

For example, if I designate the comb function as the Combination function, I would use the following formulas:
x Formula: combin(rgy(),rgx())
y Formula: rgz()
z Formula: rgt()
t Formula: rgt()
Last x Formula: rgx()

Functions can be copied and pasted. You will need some experience with RPN calculators to take advantage of this feature.

Final Word

This app is enjoyable to use. I am probably going to spend an afternoon or evening making a custom calculator. RPN fans, this is a good calculator app to get.

Since I am not a fan of ads, I will pay the $0.99 to get the non-ad version.

4.5 of 5 stars.

Eddie


This blog is property of Edward Shore. 2012.


Wednesday, October 24, 2012

Permutations: When Objects Repeat

Monday's blog entry (10/22/2012), Factorials and Arrangements of Unique Objects dealt with permutations of arranging a group of objects where all the objects are unique. Today's blog entry looks at three situations where objects can be repeated.

All the Choices are Available all the Time

This is where you make permutations in which all the objects are available for each slot. For example, let's take a five digit zip code. There are five slots and for each slot the 10 digits are available: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

For the first slot there are 10 choices. For each of the 10 choices, the second slot presents another 10 choices. For each of those 10 choices, the third slot presents another 10 choices. And so on.

The number of arrangements is: 10 × 10 × 10 × 10 × 10 = 100,000. There are 100,000 five-digit zip codes possible, 00000 to 99999.

Remember when calculating permutations, order matters. For our example, 11110, 11101, 11011, 10111, and 01111 are five different arrangements. The general rule is presented below.


Permutations where all the choices are available all the time = n^k

where
n = number of objects
k = number of slots


Objects Can Repeat, but with Some Restrictions

This is similar to the first situation in the way of calculating the number of permutations (arrangements).

Let's say we are on a very famous game show. One of it's mini games is played for a car valued anywhere from $20,000 to $59,999. We want to know how many possible prices for this game are possible.

Looking at the range from $20,000 to $59,999: we can see the choices for each of the five digits. The first digit must be a 2, 3, 4, or 5. The other four digits can be anything 0 through 9 (10 choices each).

The number of prices possible are 4 × 10 × 10 × 10 × 10 = 40,000.

So using a random guess, the contestant has a 1 in 40,000 choice in getting the price exactly right.

Another mini-game offers cars from $11,111 to $36,666 where the first digit is given to the contestant (1, 2, or 3) and the contestant tries to roll the other four digits using a single die. The die contains the numbers 1, 2, 3, 4, 5, and 6. Our task to find out how many prices are possible.

There are 3 choices for the first digit, and 6 choices for the other four digits.

The number of prices possible are 3 × 6 × 6 × 6 × 6 = 3,888.

This mini-game can be played up to 3,888 times before a price repeats.


Permutations where:
1) Different slots can have restrictions
2) Each choice is independent

P = (number of choices for slot 1) × (number of choices for slot 2) × ... × (number of choices for slot k)


Rearranging a Group of Objects where some of the Objects Repeat

In this situation we are finding the number of permutations of a group of objects, except some of the objects repeat.

Let's try to find the number of ways to arrange the letters in the word PHYSICS, removing any restriction that the arrangement has to make a sensible word (HYSSICP would count as arrangement).

In the word PHYSICS, there is 1 "P", 1 "H", 1 "Y", 2 "S"s, 1 "I", and 1 "C", for a total of 7 letters. PHYSICS counts as one permutation, regardless which "S" is used in each slot. We still have 7 letters, which can be arranged 7! = 5,040 ways, but have to account for the 2 "S"s.

The true number of ways to arrange the letters in the word PHYSICS is 2,520 ways.

7! / 2! = 5,040/2 = 2,520

Coincidentally, the calculation is really 7! / (1! × 1! × 1! × 2! × 1! × 1!). However, 1! = 1. Hence, 1! × 1! × 1! × 2! × 1! × 1! = 2!.

Let's take another example. Find the number of ways to arrange the letters in the "word" AAABB. In this example, there are 3 "A"s and 2 "B"s for a total of 5 letters.

If all the letters were unique, the number of ways is 5!. But we have to account for the repeats. Divide by 3! for the "A"s and 2! for the "B"s. The result is:

5! / (3! × 2!) = 120 / (6 × 2) = 10

There are only 10 ways to arrange the letters of the "word" AAABB. The ten are:

AAABB
AABAB
AABBA
ABABA
ABBAA

BABAA
BBAAA
ABBAA
AABBA
BAAAB


Finding the Number of Arrangements of Objects Where Some Objects Repeat

n! / ( (k_1)! × (k_2)! × ... × (k_m)! )

where:
n = the total number of objects, including repeated objects
m = the number of unique objects
k_1 = number of "k_1" objects
k_2 = number of "k_2" objects
and so on until...
k_m = number of "k_m" objects

The expression above is known as a multinomial coefficient.


I hope this day is well for each of you. Thank you for your comments and suggestions. Take care,

Eddie


Source:
Marcus, Daniel A. "Combinatorics: A Problem Orientated Approach" Mathematical Association of America, Washington DC. 1998.


This blog is property of Edward Shore, 2012.

Tuesday, October 23, 2012

Factorials and Arrangements of Unique Objects

Last weekend my dad asked me about my blog, and the last entry was about factorials of large numbers. Clicking on this link will take you there. On our way to classic car auto shop in Orange, CA; my dad and I talked about the factorials as I tried to come up with a way of finding applications using factorials. Last weekend became the inspiration for my blog entry. Love you, Dad.

Note: This blog entry will cover factorials of non-zero integers, that is n = 0, 1, 2, 3...


Factorials

The factorial of a non-negative integer, written with an exclamation mark after the number, is defined as:

n! = n × (n - 1) × (n - 2) × (n - 3) × ... × 3 × 2 × 1

Start by multiplying n by n less 1, then multiplying the product by n less 2, and repeat until you get to 1.

Examples
5! = 5 × 4 × 3 × 2 × 1 = 120
8! = 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320


What about 0! ?

By definition, 0! = 1. Dr. James Tanton, Ph. D (www.jamestaton.com) gives an explanation why mathematicians choose to in video: Link to Video

Simply put, 0! = 1 is just defined this way.


Arrangements

In this section, we consider three common arrangement problems. The task is to find the number of possible permutations a group of objects can be arranged. A permutation is an arrangement where the order of which the objects are placed is important.

In this section, we are going to arrange all the objects.

Arrangement of Unique Objects

Consider a bookshelf that has room for five books. For simplicity, let's call the books A, B, C, D, and E (and not "Combinatorics", "The Irrationals", "Euclid's Number", "Programming", and "Making Soup for Dummies" like I originally planned.)

The for the first slot there are five choices. The second slot provides four choices. Whatever is available for the second slot depends on what book was put in the first slot. For example, if I choose to put book A in the first slot, the books B, C, D, and E are available for the second slot. Instead, if I choose to put book C in the first slot, then A, B, D, and E are available.

For each choice I make on the first slot, I get four choices for the second. Considering the first two slots alone, this gives me a total of 5 × 4 = 20 arrangements.

Continuing in this way, there are three choices for the third slot, two choices for the fourth slot, and whatever is left over gets the fifth slot.

So, the total number of arrangements of five books is:

5 × 4 × 3 × 2 × 1 = 5! = 120

Yes, 120 different arrangements. Since order is important, the arrangement is considered a permutation.

In general, working with n objects and n slots:
There are n objects for the first slot,
there are n - 1 objects for the second slot,
there are n - 2 objects for the third slot,
and so on,
until we reach 1 slot left for the last object.

Hence, the number of arrangements are:

n × (n - 1) × (n - 2) × ... × 1 = n!


Number of Permutations of n Unique Objects = n!


Arrangement of Unique Slots, Limited Spaces Available

Let's go back to our problem of arranging five books (A, B, C, D, and E) but this time, we only have three slots available.

For the first slot, I have 5 books available to choose from. Depending on what I choose, I will have 4 books for the second slot. Each of those 4 books present a choice of the 3 books for the last slot. Whatever is left either goes somewhere else in the house or gets donated.

The number of arrangements that are available to me has decreased due to the fact I only have three slots available. Hence, 5 × 4 × 3 = 60.

Observe if we multiply 5 × 4 × 3 by (2 × 1)/(2 × 1) we get:

5 × 4 × 3
= (5 × 4 × 3 × 2 × 1) / (2 × 1)
= 5! / (2 × 1)
= 5! / (5 - 3)!

Basically we are taking all of the ways 5 books can be arranged, and then dividing that number by all the ways the 2 books that are not going to be used can be arranged.

Doing the above in the general case is how we arrive at the formula for permutations:

nPk = n! / (n - k)!

where we have n objects and k slots to fill.


Permutations: nPk = n! / (n - k)! where n ≥ k. Order is important.


Until next time, have a great day!

Eddie



This blog is property of Edward Shore, 2012.

Saturday, October 20, 2012

Factorial of Large Numbers


Hi everyone! I am blogging from Coffee Klatch in San Dimas, CA! I was overdue for a latte. Their pumpkin brownies are to die for.

Factorial of Large Numbers

Calculators have an upper limit when working with numbers. Typically, the scientific calculators allow numbers up to 9.999999999 × 10^99. Anything over 10^100 is considered an overflow. Some of the higher graphing and CAS calculators allow for higher limits.

This means if you need to calculate anything over 69!, most calculators will give an "Overflow" error message.


Factorial:

The factorial of an integer n is the product:

n! = n × (n - 1) × (n - 2) × ... × 3 × 2 × 1



We can remedy this by using the laws of logarithms to calculate factorials of higher integers. Common logarithms (base 10) are used.

n! = n × (n - 1) × (n - 2) × ... × 2 × 1
log (n!) = log [ n × (n - 1) × (n - 2) × ... × 2 × 1 ]
log (n!) = log (n) + log (n - 1) + log (n - 2) + ... + log (2) + log (1)

log (n!) = ∑( log(k) from k = 2 to n)

Let T be this sum.

T = ∑(log (k) from k = 2 to n)


Note the following laws are used:

log (a × b) = log a + log b
log (1) = 0



If we take the anti-common logarithm of both sides, we get:

n! = 10^(∑( log(k) from k = 2 to n)
n! = 10^(T)
n! = 10^(frac(T) + int(T))
n! = 10^(frac(T)) × 10^(int(T))

Where:

(1) int(T) is the integer part of T. To find it, take the integer and ignore everything after the decimal point.

(2) frac(T) is the fractional part of T. To find this, take everything after the decimal point and ignore the integer part.

(3) int(T) + frac(T) = T

Example:
int(14.125) = 14
frac(14.125) = 0.125

A lot of programming and graphing scientific calculators have the int and frac functions. On most Hewlett Packard programming and scientific calculators, they are named IP and FP, respectively.

Example 1: 8!

Calculate 8! using the logarithm method.

T = ∑( log(k) for k = 2 to 8) = log 2 + log 3 + log 4 + log 5 + log 6 + log 7 + log 8 ≈ 4.605520523

In this case, int(T) = 4 and frac(T) = 0.605520523.

Then 8! ≈ 10^(0.65520523) × 10^4 ≈ 4.031999996 × 10^4

Because the accuracy of calculators and computer programs, I recommend that you round 10^(frac(T)) to a set amount of decimal places. I find that 5 decimal places works well. Then:

8! ≈ 4.03200 × 10^4

In fact, 8! = 40,320

Example 2: 111!

1. Calculate the sum ∑( log(k) from k=2 to 111). We find the answer to be 180.2462406.

2. Split the integer and fractional portions. Take the anti-common logarithm of the fractional portion. Hence, 10^0.2462406 ≈ 1.762952551. I round this answer to five decimal places to get 1.76295.

3. Answer: 111! ≈ 1.76295 × 10^180

In fact, using an HP 50g, 111! =
1,762,952,255,109,024,466,387,216,104,710,707,578,876,140,953,602,656,551,604,157,406,334,734,695,508,724,831,643,655,557,459,846,231,577,319,604,766,283,797,891,314,584,749,719,987,162,332,009,625,414,533,120,000,000,000,000,000,000,000,000

And yes, typing out this long number is not as easy it sounds.

Programming

Now we come to the programming portion of calculating n! using the logarithmic method.

This program was done on a HP 39gii, but can easily adapted on most graphing/programming calculators.

Program LFACT

EXPORT LFACT(N)
BEGIN
LOCAL T,M;
Σ(LOG(K),K,2,N)→T;
ROUND(10^FRAC(T),5)→M;
MSGBOX(M + "10^" + INT(T));
RETURN {M, INT(T)};
END;


Here is a program in BASIC language. I used the App techBASIC from ByteWorks.
Everything after explanation points signify comments.

! Approximate Factorial (5 decimal mantissa plus exponent)
! Eddie Shore
! 10/20/2012

! To improve accuracy, set all variables as DOUBLE
01 DIM N as DOUBLE
02 DIM T as DOUBLE
03 DIM F as DOUBLE
04 DIM M as DOUBLE
05 DIM K as DOUBLE


10 PRINT "Factorial Program"
11 INPUT "N = "; N
12 T = 0

! Sum Loop
14 FOR K = 2 TO N
16 T = T + LOG10(K)
18 NEXT K

! Separation of T into its fractional and integer parts, we know T>0
20 M = INT(T)
22 F = T - M

! Round Fraction to five places - we have no ROUND function to work with
! 10^x when x<1 10="" a="" br="" has="" less="" than="" value="">! Use string functions to round the answer to 5 decimal places (7 characters: the integer, decimal point, and five decimal places)
30 F = 10^F
32 F = VAL(LEFT(STR(F),7))

! Final results
40 PRINT "N! = "; F ; " x 10^"; M


Test Data:
8! = 4.0320 × 10^4
66! = 5.4434 × 10^92
122! = 9.87504 × 10^202
425! = 1.59775 × 10^934

Thank you as always, I appreciate the comments and compliments. Hope you enjoy the weekend.

Until next time,

Eddie


This blog is property of Edward Shore, 2012.



Solving Simple Arcsine and Arccosine Equations

  Solving Simple Arcsine and Arccosine Equations Angle Measure This document will focus on angle measurement in degrees. For radia...