Evaluating Polynomials with Horner's Method]

Click For Summary
SUMMARY

The discussion focuses on Horner's method, an efficient algorithm for evaluating polynomials. The pseudocode provided demonstrates how to compute the polynomial value at a specific point, using the example of evaluating x² + 5x + 3 at x = 2. Participants clarify the polynomial's coefficients and the significance of the variable 'c', confirming that c = 2 in this context. The conversation highlights the method's utility in simplifying polynomial calculations and its relationship to synthetic division.

PREREQUISITES
  • Understanding of polynomial expressions and their coefficients
  • Familiarity with algorithmic pseudocode
  • Knowledge of synthetic division and its application
  • Basic arithmetic operations: addition and multiplication
NEXT STEPS
  • Study the implementation of Horner's method in programming languages like Python or Java
  • Explore synthetic division and its connection to polynomial evaluation
  • Learn about the computational complexity of polynomial evaluation algorithms
  • Investigate the application of Horner's method in Reverse Polish Notation (RPN) calculators
USEFUL FOR

Mathematicians, computer scientists, students learning polynomial evaluation, and software developers implementing polynomial algorithms.

hyderman
Messages
28
Reaction score
0
The Horner’s method is an algorithm that evaluates polynomials. The following pseudocode shows how to use this method to find the
value of anxn + an-1xn-1 + . . . + a1x + a0 at x = c.
procedure Horner(c, a0, a1, a2, . . . , an : real numbers)
y := an
for i := 1 to n
y := y × c + an-i
end {y = ancn + an-1cn-1 + . . . + a1c + a0}

(a) Evaluate x2 + 5x + 3 at x = 2 by working through each step of the algorithm.
(b) Exactly how many multiplications and additions are used by this algorithm to evaluate a polynomial of degree n at x = c? (Do not count additions used to increment the loop variable.)


please help in details thanks much


[
 
Physics news on Phys.org
n=2. a2=1, a1=5, a0=3. c=2. There - I did the hard part. Now just DO it. Step through the algorithm.
 
okey x^2 + 5x + 3 at x=2
i need to make sure about your answer.sooo

x^2(is a2) + 5x(is a1) + 3 (is a0) at x=2 (is n=2)
correct or not?

i will give anonther example make sure about it

lets assume evaluate 3x^2 + x + 1 at x=2

so according to you 3x^2(is a=2) + x(is a=1) + 1 (is a=0) at x=2(is n=2)
is it correct

please let me know
thanx
 
Boy are they going out of their way to make this obscure.

Horner's method is simply factoring the polynomial to eliminate all orders of x greater then 1. Then you start multiplying and adding your way through the nest.
For example expand a quadratic like this:
ax^2 + bx + c = x(ax+b) + c

To do the calculation start inside the parens and work your way out.

This method is very useful for RPN calculators.
 
Integral, Is Horner's method just an elaborate way to say that the value of a polynomial at x=a is simply the remainder when the polynomial is divided by x-a?

Nevermind... (I've never seen it written as Horner's method before; I just scratched it out on paper, and "that's all it is?") You're right! They did make that pretty obscure.

OP, if you're having trouble following it, have you been exposed to synthetic division before? Simply, synthetic division is used to divide a polynomial by a linear binomial in the form (x-a). The remainder after such a division is equal to f(a).
 
To answer the question, it doesn't matter if you don't know what Horner's method is, or what it's supposed to do.

You are given an algorithm, and asked to work through it step by step and count the number of operations. A computer just follows the instructions in the algorithm. To answer the question, you need to do the same as the computer would do.
 
hello
how did you calculate c=2

please explain in details

how about this
okey x^2 + 5x + 3 at x=2
what is c?
 
hyderman said:
hello
how did you calculate c=2

please explain in details

how about this
okey x^2 + 5x + 3 at x=2
what is c?

No one "calculated" c= 2! The definition of Horner's method said "use this method to find the value of a_nx^n + a_(n-1)x^(n-1) + . . . + a_1x + a_0 at x = c".
Your problem asks you to find the value of a given polynomia "at x= 2".

Just compare that "general form "anx^n + an-1x^(n-1) + . . . + a1x + a0 at x = c" with the specific problem you are given. In x^2+ 5x+ 3, the highest power of x is 2: n= 2. The coefficient of that highest power is 1, the next 5, the constant term is 3: a_2= 1, a_1= 5, a_0= 3. Because the problem says "at x= 2" compared with "at x= c", c= 2.

Here's a test: "evaluate 4x^3+ 3x^2- 2x+ 4 at x= 1". What are n, a_3, a_2, a_1, a_0, and c?

By the way, notice the use of "_2" for subscripts and "^2" for exponents? Makes it much easier to read.
 
Last edited by a moderator:
thank you HallsofIvy it is clear now...
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
6
Views
5K
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 27 ·
Replies
27
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
9
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K