   Chapter 11.3, Problem 38ES ### 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] 38. Let s n = the number of additions and multiplications that are performed when Algorithm 11.3.3 is executed for a polynomial of degree n. Express s n as a function of n.

To determine

To find out the term Sn by using the polynomial algorithm executed for degree n.

Explanation

Let us assume that input having some integer n (using polinomial algorithm)

Multiplications

Each iteration of the inner for −loop excute term:=term*x ,total 1 miltiplication per iteration of the inner for-loop and j can goes to 1 to i which are i1+1=i  and i goes up to n possible values.

No of iteration =i=0ni=1here,i=n(n+1)/2=(1/2n2+1/2n)So

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