Problem 2. The following algorithm which is used to evaluate a polynomial anx" + an-1x" -1 ++ a₁x + ªo at x = c is expressed in pseudocode as follows: procedure polynomial evaluation (c, ao,, an: real numbers) y := an for i:=1 to n y := y*c+an-i return y {y = anx² + an−1x¹−¹ + · + a₁x + ao}. where the final value of y is the value of the polynomial at x = c. (a) Evaluate 12x4 + 3x³ − 5x² + 7x - 8 at x = -1 by working through each step of the algorithm showing the values assigned at each assignment step CLEARLY. Answers with missing iterations, indices, etc. will not be taken into account. (b) How many additions and multiplications take place in the evaluation of a polynomial of degree n? Briefly explain. (Do not include the additions needed to increment the loop variable i.) (c) One can represent polynomials using nested multiplications, that is successively taking à as a common factor in the remaining polynomials of decreasing degrees, for example 3x³ + 2x² + 5x + 4 = x(x(3x + 2) + 5) +4. Represent the given polynomial given in (a) using nested multiplications and briefly explain the con- nection between the presented algorithm and this representation.
Problem 2. The following algorithm which is used to evaluate a polynomial anx" + an-1x" -1 ++ a₁x + ªo at x = c is expressed in pseudocode as follows: procedure polynomial evaluation (c, ao,, an: real numbers) y := an for i:=1 to n y := y*c+an-i return y {y = anx² + an−1x¹−¹ + · + a₁x + ao}. where the final value of y is the value of the polynomial at x = c. (a) Evaluate 12x4 + 3x³ − 5x² + 7x - 8 at x = -1 by working through each step of the algorithm showing the values assigned at each assignment step CLEARLY. Answers with missing iterations, indices, etc. will not be taken into account. (b) How many additions and multiplications take place in the evaluation of a polynomial of degree n? Briefly explain. (Do not include the additions needed to increment the loop variable i.) (c) One can represent polynomials using nested multiplications, that is successively taking à as a common factor in the remaining polynomials of decreasing degrees, for example 3x³ + 2x² + 5x + 4 = x(x(3x + 2) + 5) +4. Represent the given polynomial given in (a) using nested multiplications and briefly explain the con- nection between the presented algorithm and this representation.
Algebra and Trigonometry (6th Edition)
6th Edition
ISBN:9780134463216
Author:Robert F. Blitzer
Publisher:Robert F. Blitzer
ChapterP: Prerequisites: Fundamental Concepts Of Algebra
Section: Chapter Questions
Problem 1MCCP: In Exercises 1-25, simplify the given expression or perform the indicated operation (and simplify,...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 3 images
Recommended textbooks for you
Algebra and Trigonometry (6th Edition)
Algebra
ISBN:
9780134463216
Author:
Robert F. Blitzer
Publisher:
PEARSON
Contemporary Abstract Algebra
Algebra
ISBN:
9781305657960
Author:
Joseph Gallian
Publisher:
Cengage Learning
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Algebra and Trigonometry (6th Edition)
Algebra
ISBN:
9780134463216
Author:
Robert F. Blitzer
Publisher:
PEARSON
Contemporary Abstract Algebra
Algebra
ISBN:
9781305657960
Author:
Joseph Gallian
Publisher:
Cengage Learning
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Algebra And Trigonometry (11th Edition)
Algebra
ISBN:
9780135163078
Author:
Michael Sullivan
Publisher:
PEARSON
Introduction to Linear Algebra, Fifth Edition
Algebra
ISBN:
9780980232776
Author:
Gilbert Strang
Publisher:
Wellesley-Cambridge Press
College Algebra (Collegiate Math)
Algebra
ISBN:
9780077836344
Author:
Julie Miller, Donna Gerken
Publisher:
McGraw-Hill Education