Rank: Newbie
Groups: Registered
Joined: 01/09/2011(UTC) Posts: 5 Location: Puerto Rico
|
When calculing roots of x^3-x^2-x+1 using polyroots gives wrong answer.
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, Why do you consider the result obtained by polyroots() to be wrong? As we all know, cubic polynomial has three roots. You get them [-1,1,1] using polyroots(), although by ignoring the imaginary parts which are quite small and you could ignore them. The small imaginary parts might be due to the numerical procedure used to obtain the roots. If we are in doubt about real or complex roots then Descartes' rule of signs could help us out. Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Newbie
Groups: Registered
Joined: 01/09/2011(UTC) Posts: 5 Location: Puerto Rico
|
Thank you for your quick comment, but I think that when you see complex numbers in the roots of the polynomial it may mislead you in the correctness of the solution. Honestly when I counter check with ti-89 it gave me complex roots too, but in a friend Hp 50g gave me correct roots {1,1,-1}. You are correct the algorithm used appears to be companion matrix.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.