TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

How to extract from polinom ... ?

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> Math
Author Message
gramili



Joined: 05 Feb 2010
Posts: 1

PostPosted: February 5, 2010 10:18 AM    Post subject: How to extract from polinom ... ? Reply with quote

If I have a polinom

11*x^5-99*x^3+65*x^2+5

How to get numbers which multiple x^ from polinom?

In this example I want to get list of numbers like
{11, 0, -99, 65, 0, 5}

Is there any function or method?

that represents numbers in my polinom
11*x^5+0*x^4-99*x^3+65*x^2+0*x+5

Thank you in advance
Back to top
View user's profile Send private message
BlainUSM



Joined: 24 Oct 2009
Posts: 30
Location: New England

PostPosted: February 6, 2010 3:58 AM    Post subject: Reply with quote

If the degree of the polynomial is taken as a given, then the following input may be used to define a function that will return the coefficients:

Define co(p, n) = seq(d(p,x,i)/i!, i, n, 0, -1) | x = 0

The parameter p is the polynomial and n is the polynomial’s degree. Note that “d” is accessed by pushing “2nd” and then “8”.
For your problem:

Input: co(11*x^5-99*x^3+65*x^2+5, 5)
Output: {11, 0, -99, 65, 0, 5}

There are many other ways of obtaining the coefficients; they may be extracted with careful use of the “part” command, identified with the “solve” command, returned as a matrix from the “rref” command, obtained with other algebraic methods, or parsed with plain vanilla string operations.

The function co(p,n) may be modified so that the parameter n no longer needs to be given...
Back to top
View user's profile Send private message Send e-mail
BlainUSM



Joined: 24 Oct 2009
Posts: 30
Location: New England

PostPosted: February 8, 2010 2:30 PM    Post subject: Reply with quote

Below is code for a function that will return the coefficients of an arbitrary polynomial (given only the polynomial):

co(p)
Func

Local i,z

{}->z
1->i
p->z[1]

While string(d(p,x))!="0" and string(d(p,x))!="0."

d(p,x)->p
p/i!->z[i+1]
i+1->i

EndWhile

Local t
For i,1,floor(dim(z)/2)

z[i]->t
z[dim(z)-i+1]->z[i]
t->z[dim(z)-i+1]

EndFor

Return z|x=0

EndFunc


To test the program type "co(x^2 + 4x - 3)" your output should be "{1, 4,-3}".

Note: The symbol != is short for not equal to, which may be accessed via the catalog. Also, the symbol for differentiation, d, may be accessed by pushing "2nd" and then "8".
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:    View previous topic : View next topic  
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> Math All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Contact Us | Privacy Policy | Disclaimer | Trademarks

Copyright ©2006 All rights reserved.


Free Greeting Cards | Girly Myspace Layouts | Myspace Unblocker |