   Chapter 11.3, Problem 39ES ### 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 36—39 refer to the following algorithm to compute the value of a real polynomial. Algorithm 11.3.3 Term-by-Term Polynomial Evaluation[This algorithm 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 computing each term separately, starting with a [ 0 ] , and adding it to an accumulating sum.]Input: n [a nonnegative inreger], 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 [ 0 ] for i : = 1 to n t e r m   : = a [ i ] for j : = 1 to i t e r m : = t e r m ⋅ x next j p o l y v a l : = p o l y v a l + t e r m 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] 39. Use the theorem on polynomial orders to find an order for Algorithm 11.3.3.

To determine

The order of the given algorithm 11.3.3 (Term-by-Term Polynomial Evaluation).

Explanation

Formula used:

The order of a polynomial is given by,

If m is any integer with m0 and a1,a2,...,am are real numbers with am>0, then amnm+am1nm1+...+a1n+a0 is θ(nm)

Proof:

To find the order of the algorithm, first we should find the total number of iterations of the loops.

Here we got a nested for-next loop and we can create a trace table to find the number of iterations.

i1234j1121231234... n 1|2|3|4|5...| n1|n1 2 3 4

### 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 