   Chapter 11.3, Problem 43ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# Exercises 40—43 refer to another algorithm, known as Horner’s rule, for finding the value of a polynomial. Algorithm 11.3.4 Homer’s Rule [This algorithn computes the value of a polynomial a [ n ] x n + a [ n − 1 ] x n − 1 + ⋯ + a [ 2 ] x 2 + a [ 1 ] x + a [ 0 ] by nesting successive additions and multiplications as indicated in the following parenthesization:   ( ( ⋯ ( ( a [ n ] x + a [ n − 1 ] ) x + a [ n − 2 ] ) x + ⋯ + a [ 2 ] ) x + a [ 1 ] ) x + a [ 0 ] .At each stage, starting with a [ n ] , the current value of polyval is multiplied by x and the next lower coefficient of the polynomial is added to it.] Input: n[a nonnegative integer], a [ 0 ] ,   a [ 1 ] ,   a [ 2 ] ,   … , a [ n ] [an array of real numbers], x [a real number] Algorithm Body: p o l y v a l : = a [ n ] for i : = 1 to n p o l y v a l : = p o l y v a l ⋅ x + a [ n − i ] next i [ A t   t h i s   p o i n t   p o l y v a l = a [ n ] x n + a [ n − 1 ] x n − 1 + ⋯ + a [ 2 ] x 2 + a [ 1 ] x + a [ 0 ] . ] Output: polyval [a real number] 43. Use the theorem on polynomial orders to find an order for Algorithm 11.3.4. How does this order compare with that of Algorithm 11.3.3?

To determine

To find:

The order of the algorithm for Horner’s Rule and the comparison orders of algorithm for Term-by-term polynomial evaluation and the algorithm for Horner’s Rule.

Explanation

Given information:

The number of elementary operations (tn) of algorithm for Horner’ Rule is 2n.

The algorithm for Term-by-term polynomial evaluation is order of θ(n2).

The considered algorithm for Horner’s Rule is as follows.

Input:

n [a nonnegative integer], a,a,a....,a[n] [an array of real numbers], x [a real number] Algorithm Body:

polyval:=a[n]

for i:=1 tn

polyval:=polyval·x+a[n1]

next i

[at this point

polyval=a[n]xn+a[n1]xn1 +...+ax2+ax+a

Output:

polyval [a real number]

The algorithm for Term-by-term polynomial evaluation is,

Input:

n [a nonnegative integer], a,a,a...

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 