My Math Forum  

Go Back   My Math Forum > High School Math Forum > Algebra

Algebra Pre-Algebra and Basic Algebra Math Forum


Reply
 
LinkBack Thread Tools Display Modes
March 11th, 2008, 06:30 PM   #1
Newbie
 
Joined: Mar 2008

Posts: 5
Thanks: 0

Programming TI-83 calculator to Solve Quadratic Equation?

Does anyone know how to program the TI-83 calculator to solve for quadratic equations? Thank you in advance for any input.
confused20 is offline  
 
March 11th, 2008, 09:54 PM   #2
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
If you just want numerical solutions that's easy. Just have it display the results with + and with -. If you want it in simplified symbolic form... well, I did this on my TI-83 ten years ago, but it's a lot of coding for such a simple language.
CRGreathouse is offline  
March 12th, 2008, 08:38 AM   #3
Member
 
Joined: Feb 2008

Posts: 89
Thanks: 0

[color=darkblue]Hi:

For ax^2 + bx + c = 0, program as,

:input a
:input b
:input c
:display 0.5[-b + sqrt(b^2-4ac)]
:display 0.5[-b - sqrt(b^2-4ac)]
:

Regards,

Rich B.
rmath4u2@aol.com[/color]
nikkor180 is offline  
March 13th, 2008, 01:20 AM   #4
Global Moderator
 
Joined: Dec 2006

Posts: 19,712
Thanks: 1806

You might get caught out (if you do it that way) by a sufficiently ill-conditioned equation.
skipjack is offline  
March 13th, 2008, 10:35 AM   #5
Member
 
Joined: Feb 2008

Posts: 89
Thanks: 0

[color=darkblue]explain please...

Rich B.[/color]
rmath4u2@aol.com
nikkor180 is offline  
March 13th, 2008, 11:43 AM   #6
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
nikkor, you forgot to divide by a.

Quote:
Originally Posted by skipjack
You might get caught out (if you do it that way) by a sufficiently ill-conditioned equation.
I can't imagine this would be a real problem. The only subtractive cancellation is b^2-4ac, which is a problem only when b^2 ~= 4ac so b^2-4ac is small compared to b^2. But then you're adding in b, so even if there was a loss of precision you're covered by the roundoff you'd be forced to do. Example, using 2-place decimal arithmetic (round-down instead of round-to-nearest) with significant digits in parentheses:

a = (16)
b = (33)
c = (16)

b^2 = (10)00, rounded from 1024
ac = (25)0, rounded from 256
4ac = (10)00
b^2 - 4ac = (0.0)
sqrt(b^2 - 4ac) = (0.0)
-b + sqrt(b^2 - 4ac) = -(33)
2a = (32)
(-b + sqrt(b^2 - 4ac))/(2a) = -(1.0)

which compares reasonably to -0.(78), the best result expressible in the system, considering that 5-10% precision can be lost per operation in a system with this few digits.


Practically, with as many digits as a TI-83 has, what's the worst case? I'm assuming this will be for algebra or calculus, not numerical analysis.
CRGreathouse is offline  
March 13th, 2008, 03:10 PM   #7
Member
 
Joined: Feb 2008

Posts: 89
Thanks: 0

[color=darkblue]You are indeed correct; I forgot the 'a'. Regarding rounding error, I suppose in the interest of accuracy, the program should report two separate terms for each root as,

:-b/2a
:display "+ square root":(b^2-4ac)/(4a^2)
:-b/2a
:display "- square root":(b^2-4ac)/(4a^2)
:

Assuming rational coefficients, accuracy should be covered and rounding left to the discretion of the program user. What do you think?

Regards,

Rich B.[/color]
rmath4u2@aol.com
nikkor180 is offline  
March 14th, 2008, 05:00 AM   #8
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Quote:
Originally Posted by nikkor180
Assuming rational coefficients, accuracy should be covered and rounding left to the discretion of the program user. What do you think?
I think you were fine without breaking those terms apart, but this works too. OF course if I were doing it this way I'd give it all in one line with "+/-".
CRGreathouse is offline  
March 15th, 2008, 05:28 AM   #9
Global Moderator
 
Joined: Dec 2006

Posts: 19,712
Thanks: 1806

Quote:
Originally Posted by CRGreathouse
I can't imagine this would be a real problem. The only subtractive cancellation is b^2-4ac, which is a problem only when b^2 ~= 4ac so b^2-4ac is small compared to b^2.
Incorrect. ?(b - 4ac) is subtracted from -b (for one root); these values may be too close for an accurate result, and then dividing by 2a may increase the error considerably.
skipjack is offline  
March 15th, 2008, 09:11 AM   #10
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Quote:
Originally Posted by skipjack
Incorrect. ?(b - 4ac) is subtracted from -b (for one root); these values may be too close for an accurate result, and then dividing by 2a may increase the error considerably.
Eh. You can't have both -- you can get catastrophic cancellation from b^2 - 4ac, or from -b + sqrt(b^2 - 4ac), or from neither. In the first case b^2 -4ac ~= 0 while in the second case b^2-4ac is close to b.

If a class requires so much precision that that much subtractive cancellation is a problem with the TI83's normal working precision, then the techniques for handling it should be covered in the class itself. I get the impression that this is more of a high school class than a graduate class.

My solution to that (non-)problem in high school was, as I wrote above, to evaluate the values symbolically. But this expands the program from 4-6 lines to 50-100 lines, or several hundred with good corner case handling and aligned displays.
CRGreathouse is offline  
Reply

  My Math Forum > High School Math Forum > Algebra

Tags
calculator, equation, programming, quadratic, solve, ti83



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linear programming using graphing calculator safaulk Algebra 0 November 16th, 2013 12:19 PM
solve quadratic equation rayman Complex Analysis 6 October 27th, 2013 01:32 PM
Solve quadratic equation knowing y alexmulo Algebra 8 August 23rd, 2012 06:45 AM
solve a quadratic equation hannah2329 Algebra 1 September 19th, 2011 12:54 PM
Solve Quadratic Equation for x pbwf Algebra 3 September 11th, 2008 10:15 PM





Copyright © 2018 My Math Forum. All rights reserved.