User Guide: Miscellaneous Programs v1.00


Contents:


Introduction:

As a math student, I'm always trying to find ways to simplify the amount of work that I have to do on tests, quizzes, and homework. And as a programmer, the graphing calculator is the perfect way to do this. Almost all of the programs in this package were created as I was learning about them, or suddenly found a needed for them.

When I first started turning formulas into programs, I ran into a problem. I had tons of programs that just preformed one function. Searching through my calculator for a particular formula was a mess and I decided to group them all into a single program. That program later became Formulas 1. But as I got into higher math, I realized that a formula that you can plug numbers into just simply isn't enough. What I needed was algorithms, which for the non-programmer means a set of recursive instructions.

As I developed these, I ran into the same problem I ran into above and of course, came to the same conclusion. That's how Misc. Programs got started. The same thing happened with my calculus formulas (now part of misc programs). I have now rearranged the programs into logical categories to reduce search time.

Don't forget, these programs were only developed because I had a need for them to be developed. But every level of math is different and you may need additional programs for the area of math you are currently in. The only reason I would not have that program is because I myself have not learned it or found it useful.

I am completely open to suggestions for new programs to help you solve your problems (and probably my problems at some point). Feel free to e-mail me your suggestions, but please also explain to me how your method works and maybe even give an example. If well explained, I can usually write a program in just a few days. If I find it useful as well, I will add it to later versions of this program.

I would also like to hear about bugs in the programs so I can quickly fix them for later versions. If you find any bugs please tell me.


Standard Polynomial Format:

How to Read:
All standardized polynomials are displayed as lists of numbers. If the list goes off the screen, hold down left or right to pan through the complete list. The lists of numbers are the coefficients to the polynomials. The numbers farthest to the right are the lowest powers of X, and the ones to the left are the highest powers of X. Here are some examples:

Output Polynomial
{1,2,3,4} x3 + 2x2 + 3x + 4
{1,-1,2,-1,1} x4 - x3 + 2x2 - x + 1
{1,0,-2} x2 - 2
{3,0,0,0,0,0} 3x5

Hopefully you'll get the hang of reading SPFs. They're fairly intuitive.

How to Write:
When asked to input a polynomial, you must list the coefficients from highest power to lowest power separated by commas. DO NOT put that fancy bracket thing at the front or end of the list. That is only seen when displaying the answer because I can't figure out how to get rid of them. Also, don't forget to put zeros whenever you skip a power. Here are some examples:

Polynomial Input
2x3 + x2 - 3x + 1 2,1,-3,1
x4 - x3 + 2x2 1,-1,2,0,0
x2 + x - 6 1,1,-6
x6 + 1 1,0,0,0,0,0,1

See? It's not too difficult. You'll get used to it.

Simplify Root

Purpose: To simplify a root to it's reduced form.

Examples:

Input Output
√80 4√5
3√648 6 3√3

Input: The calculator will prompt you for an X and an N. X is the number inside the radical and N is the Nth root. For instance, in the first example, X=80 and N=2. In the second example, X=648 and N=3.

Output: The calculator will output the answer in the form a√b. The first line is the 'a' and the second line is the 'b'. In the first example, the first line would read 4 and the second line would read 5.

Notes: The algorithm used in this program could take a long time for large numbers in the radical; especially for square roots. I therefore added a progress bar to indicate how long the calculation will take.


Solver XY

Purpose:To solve any two variable systems of equations.

Examples:

Input Output
0 = exy - x - 3
0 = x2 + 3y - 2
x = -1.191922397
y = -.496898275
a2 + b2 = 61
a + b = 11
a = 5
b = 6

Input: You must enter the two equations exactly as they are written, but in terms of X and Y and in zero equals form. The equal sign is already in the input so there is no need to add another one. In Example 2, you have to solve it into zero equals form. You would input "X2+Y2-61" for the first equation and "X+Y-11" for the second equation. Once you enter the equations, you will be prompted for a guess. Pick numbers you think are close to the correct answer. If you have no idea, just try x=1 and y=2.

Output: The calculator will iterate answers until it finds a correct one. If the calculator goes on continuously with seemingly random numbers for more than a minute, press any key to quit because there's probably no real solution. If there are multiple solutions to a given equation, the calculator will usually find the one closest to your initial guess. If you receive an error or want to find another solution, try a different guess. If that doesn't work, there might not be any real solution.

Notes: This algorithm only works with real numbers and can not find complex solutions. Also, it seems to get confused when the set of equations has an infinite number of solutions. Hopefully, I will have both of these problems fixed in a later version.


Solver XYZ

Purpose:To solve any three variable system of equations.

Examples:

Input Output
0 = 2x + y2
0 = y + z -2x
0 = xyz - 8
x = -1.24555065
y = 1.578322306
z = -4.069423606

Input: Refer to Solver XY. Everything is the same, except you enter 3 equations and 3 unknowns.

Output: Same as "Solver XY"

Notes: Same as "Solver XY". Algorithm could take slightly longer.


Solve over 2π

Purpose: To solve any trigonometric function.

Examples:

Input Output
sin(θ) + cos(θ) = 1 θ = 0 , π/2
cos(2X) = sin(2X) X = π/8 , 5π/8, 9π/8, 13π/8

Input: Input the equation EXACTLY as written, but in terms of θ. This INCLUDES the equal sign. For those of you who do not know where to find the equal sign, press "2nd" and then "Math". It's the first one so just press "Enter". In Example 2, do not use X's; you must enter it in terms of θ.

Output: The calculator will display a list of all the solutions to the equation between 0 and 2π. You must add a π to the numerator of the fractions for the correct answer.

Notes: Solutions are limited to 1/48th of a pi apart, but don't worry though, because teachers will never give problems even close to that.


Complex Roots

Purpose: To find all the roots of a complex number.

Examples:

Input Output
Find all roots of 4√(-7 - 24i) { 2-i },{ 1+2i },{ -2+i },{ -1-2i }
x3 = 1 Solve for x x = { 1 },{ -.5+.866025i },{ -.5-.866025i }

Input: Input the complex number by parts. First enter the real part, press enter, then the imaginary part. Then, you are prompted for the root. Simply enter what root you are taking.

Output: The calculator will display all the individual solutions separately. After you copy down the first solution, press enter for the next one. Keep pressing enter until you have gotten all the solutions.

Notes: You can scroll though the solutions too big to fit on the screen by holding down left or right.


Expand Binomial

Purpose:To expand a binomial into a polynomial.

Examples:

Input Output
(x+2)5 x5 + 10x4 + 40x3 + 80x2 + 80x + 32
Probability density of getting 6's
after rolling 3 six sided dice.
1/216, 5/72, 25/72, 125/216

Input: First, you enter the two coefficients. Example 1 used "1" and "2". If you're using this for statistics, you should already know how binomial distributions work. Example 2 used P(6)="1/6" and P(not 6)="5/6". Then you enter the power or number of simulations.

Output: The calculator will output the answer in SPF.

Notes: none


Make List

Purpose:To make a list of incrementing numbers.

Examples:

{1,2,3,4,5,6,7,8,9}
{10,12,14,16,18,20}

Input: First, you enter the value you want the list to start at. Example 1 would be "1" and Example 2 would be "10". Next enter where you want the list to end. Example 1 is "9" and Example 2 is "20". Lastly, enter the step (how much is in-between each number in the list). Example 1 is "1" and Example 2 is "2"

Output: The calculator will store the list in L1

Notes: I found this most useful in statistics when I had 50 data elements and I was tired of typing 123456… through 50 for the independent variable. However, there are lots of other applications for this.


Draw Marbles

Purpose: Computes the probability of drawing a particular combination of colored marbles from a bag.

Examples:

A bag consists of 4 red marbles, 6 green marbles, and 3 blue marbles. If Joey draws 4 marbles from the bag, what is the probability that he picked 2 red marbles and 2 green ones?

Answer: 18/143

Input: When inputting the total marbles, input the total number of each marble separated with commas. In this example, you would have typed "4,6,3". Next, enter the picked marbles respectively (make sure they line up). In this problem you would have entered "2,2,0". Notice how the total was red, blue, green. The picked must also be red, blue, green.

Output: The probability (displayed as a fraction if possible)

Notes: I only put one example, but obviously this works with any type of non-replacement drawings such as cards or straws. Also, notice how the example question wanted Joey to draw 4 marbles yet '4' was not inputted into the calculator? The calculator will automatically add up your picked list for you. (2 + 2 + 0 = 4) So don't worry about that.


Draw Digit Table

Purpose: To draw a static table of random digits.

Examples: none

Input: none

Output: A table of random numbers. The Row number is labeled on the left. Press the "Enter" key to scroll down the table. Press any other key to quit the program.

Notes: If you take statistics, you know that this is used a lot. Also, there is a very important fact; the digit table is the same regardless of when you run the program. So row #5 on your calculator would be the same as row #5 on everybody else's calculator. You can use this to compare answers and methods with other students/teachers.


Poly Multiply

Purpose: To multiply two polynomials together.

Examples:

Input Output
(x2 - x + 3)(x2 + 4x + 2) x4 + 3x3 + x2 + 10x + 6
(x3 - 2x + 1)(x2 - 2) x5 - 4x3 + x2 + 4x - 2

Input: Input the two polynomials you want to multiply in SPF.

Output: The resulting polynomial in SPF.

Notes: If you want to multiply 3 or more polynomials together, use this program to multiply the first two, and then multiply the answer by the third. Then use that and multiply it by the forth, etc.


Poly Divide

Purpose: To divide two polynomials together.

Examples:

Input Output
(x3 + x2 - 3)/(x2 + 4x + 2) x - 3 + (10x + 3)/(x2 + 4x + 2)
(x2 - 2x + 1)/(x - 2) x + 1/(x - 2)

Input: Input the two polynomials you want to divide in SPF. First enter the numerator, then the denominator.

Output: The resulting polynomial as well as the remainder in SPF.

Notes: This algorithm takes a while with large polynomials as do many of the other poly functions. When possible (for instance Example B), use the synthetic division program to get an answer much quicker. In this case it makes no difference, but when you start getting to 9th degree polynomials and such, it could save a lot of time.


Poly Power

Purpose: To raise a polynomial to a power.

Examples:

Input Output
(x2 + 3x - 2)3 x6 + 9x5 + 21x4 - 9x3 - 42x2 + 36x - 8
(3x - 2)4 81x4 - 216x3 + 216x2 - 96x + 16

Input: Input the polynomial in SPF. Then enter the power you want to raise it to.

Output: The resulting polynomial in SPF.

Notes: This algorithm also takes a while with large polynomials so when possible (for instance Example 2), use the binomial expansion program to get an answer much quicker for high powers.


Poly F(G)

Purpose: To find F(G(x)) where F and G are polynomials

Examples:

Input Output
f(x) = x2 - 4x - 1
g(x) = x3 + 2x + 3

Find f(g(x))
x6 + 4x4 + 2x3 + 4x2 + 4x - 4

Input: Input the two polynomials in SPF. Enter f(x) first, and g(x) second.

Output: The resulting polynomial in SPF.

Notes: This poly algorithm takes the longest amount of time.


Synthetic Division

Purpose: To synthetically divide a polynomial.

Examples:

Input Output
(x2 + 3x - 5)/(x+3) x - 5/(x+3)
(x3 + 2x2 - 4x - 2)/(x-1) x2 + 3x - 1 - 3/(x-1)

Input: First input the term you are dividing. Example 1 would be "3" and Example 2 would be "-1". Next enter the polynomial you want to divide by using SPF.

Output: The calculator will output the answer as an SPF with an exception. The polynomial will be actually one degree lower, making the last term the remainder. For instance, Example 2 returns "{1,3,-1,-3}" which does NOT mean x3 + 3x2 - x - 3. It is one power of x lower.

Notes: Don't be afraid to divide by a negative number even though it says "X+_". That's just to make sure you don't get the divisor mixed up with the zero of the polynomial (which would make it "X-_").


Unfactor

Purpose: To turn a factored polynomial into an un-factored one.

Examples:

Input Output
(x+3)(x-2) x2 + x - 6
(x+1)(x+1)(x-4)(x+4) x4 + 2x3 - 15x2 - 32x - 16

Input: The calculator will prompt you for factors. Not literally the 'factors', but the numbers next to the x are entered in list form separated by commas. In Example 1, simply enter "3,-2". In Example 2, you would enter "1,1,-4,4"

Output: The calculator will output the answer as an SPF

Notes: Example 2 could have been written like this on a test: (x+1)2(x-4)(x+4)
Don't forget, if you have a factor to a power, you must enter the factor multiple times.


Rectangle Estimate

Purpose: To evaluate the area underneath a curve using rectangles

Examples:

Input Output
Estimate the area beneath the function y=x2+1
Between x=0 and x=2 using 4 upperbound rectangles.
5.75

Input: First enter the function in terms of x (In this example, do "x2+1") then enter the lower and upper bounds (0 and 2 respectively) and finally the number of rectangles to sum (4 in this case).

Output: Displays the actual area, upperbound, lowerbound, midpoint, and trapezoid estimates.

Notes: I can only fit so much data on one screen. Press enter after the first results are displayed to see the rest.


Slope Field

Purpose: To draw a slope field graph.

Examples: none

Input: Enter the equation in terms of x and y.

Output: Calculator will graph the slope field.

Notes: Before or after graphing, you can go to "Y=" and write an equation in Y2 to see if it matches.


Euler's Method

Purpose: To approximate an implicit integral using Euler's Method.

Examples:

Input Output
dy/dx = x2/(x+y)
Use Euler's method with step size .1 to estimate
the value of y when x = 5. Assume y(1)=0
6.361220679

Input: First input the differential equation in terms of x and y. Then enter the starting point, which is x=1 and y=0 in the example. Next, enter the delta x (.1 for this problem). Finally, enter the point to stop at (x=5).

Output: The calculator will iterate until it reaches the end point. The value of the point is then displayed.

Notes: You can use negative step sizes if you want to move backwards.


Taylor Series

Purpose: To create a Taylor series for any function.

Examples:

Input Output
Find the first 5 terms of y=ex centered at x=0 1 + x + .993x2/2 + x3/6 + 1.008x4/24
Find the first 5 temrs of y=1/x centered at x=1 1 - (x-1) + 1.0025(x-1)2 - .9977(x-1)3 + .9757(x-1)4

Input: First, input the function in terms of x. Then enter the x value that you want it centered at.

Output: Displays a reverse SPF (lowest power first because this is how Taylor Series are normally read). The actual Taylor Series is displayed first, then the coefficients of the derivatives. These polynomials are always taken to 9 terms.

Notes: Obviously there are some serious precision issues, but usually its pretty close and you can use some common sense and pattern recognition to round the numbers. I usually wouldn't trust any term after the 5th term. Sometimes, like in example 2, it is easier to find a pattern in the Taylor Series itself. Other times, like in example 1, it is easier to find a pattern in the derivative coefficients and then add the factorials later.


Double Integral

Purpose: To evaluate double integrals.

Examples:

Input Output
∫∫(x + y2)dydx
Evaluate dy in [-x,x] and dx in [-1,1] use 100 rectangles.
1.188

Input: First, enter the equation in terms of x and y. Then, enter the integration bounds for the dy integral. This can be an expression like in the example. Next, enter the dx bounds. Grid size is the number of rectangles in the width and height. In the example, you would enter "10" because 10x10=100 rectangles.

Output: The volume.

Notes: The more rectangles you use, the more accurate the result, but it will take more time to compute the volume.


Fit Curve

Purpose: To find a polynomial that goes through given points.

Examples:

Input Output
Find a 4th degree polynomial that passes through points:
(1,2) (2,6) (4,1) (0,-2) (-1,-1)
(7/120)x4 - (19/20)x3 + (293/120)x2 + (49/20)x - 2

Input: First type in the number of points in the polynomial (5 in the example). Next, type in all of the points. You type the X, then a comma, then the Y. Your first point in the example would be "1,2". Press enter and you'll be asked for the next point "2,6". Repeat until all points are entered.

Output: The calculator will output the answer as an SPF.

Notes: The calculator will display the polynomial coefficients as fractions whenever possible. Also, you can't have repeats in the domain, or else it will return an error.


Polygon Area

Purpose: To compute the area of a non-regular polygon from known vertices.

Examples:

Input Output
A pentagon is has vertices:
(0,0) (6,-1) (3,3) (5,6) (-2,2)
What is its area?
23

Input: First type in the number of vertices in the polygon (5 in the example). Next you have to type all of the vertices in order Counter-Clockwise. You type the X, then a comma, then the Y. So for your first point in the example you would type "0,0". Press enter and you'll be asked for the next point "6,-1". Repeat until all points are entered.

Output: The enclosed area.

Notes: This algorithm works very nicely and is not restricted to the points entered. It works for concave, convex, and even when lines cross over each other. Also, don't worry if you accidentally entered in the points clockwise, you'll just get the negative area. Just take off the negative sign.


Factorial

Purpose: To compute factorials that the calculator can not.

Examples:

Input Output
10! 3628800
250! 3.232856261x10492
3.2! 7.75669

Input: The number you want to factorial

Output: For numbers the built in function can do, it will just display the number (as in Example 1). If the number is too large for the built in function, the calculator will use the logarithm definition to compute the factorial in scientific notation (Example 2). Finally, if the number is not an integer, the calculator will use the integral definition to compute the factorial (Example 3).

Notes: For fractional factorials, unfortunately the algorithm takes a while to compute and is only accurate to about 5 decimal places, sorry.


LU Decomposition

Purpose: To decompose a matrix into unique upper and lower triangular matrices.

Examples:

Input Output
[ 2 -3 6 ]
[ 4 -5 17 ]
[ 2 0 23 ]
[ 1 0 0 ] [ 2 -3 6 ]
[ 2 1 0 ] [ 0 1 5 ]
[ 1 3 1 ] [ 0 0 2 ]

Input: You must already have the matrix you want to decompose stored in matrix [A] before running the program.

Output: Answer is displayed. [L] is stored in [A] and [U] is stored in [B] if you need them for later reference.

Notes: Multiplying [L] and [U] together will get you back to the original matrix. Don't forget, this works with any sized square matrix


Pseudo-Inverse

Purpose: To find the Pseudo-Inverse of a matrix.

Examples: none

Input: [A] must already be entered into the calculator (that's the matrix you need to invert). [B] must also already be entered in the calculator (this matrix gets multiplied by [A]-1)

Output: The calculator will store the calculation in [C]

Notes: Honestly, I forgot what this does (which is why there's no examples) but I remember finding it very useful when I took Math Analysis. Invariant form is also called Moore-Penrose form, by the way.


User Guide for Miscellaneous Programs
Copyright (c) 2008 Kevin Horowitz
Email: compfreakkev(at)yahoo.com