1. (2 pts each) Consider the following algorithm: procedure polynomial(c, a0,a1,…an: real numbers) power≔1 y≔a0for i=1 to n   power≔power*cy≔y+ai*power return y (Note: y=ancn +...

70.2K

Verified Solution

Question

Advance Math

1. (2 pts each) Consider the following algorithm:

procedurepolynomial(c,a0,a1,…an:real numbers)
power≔1
y≔a0
for i=1 to n
  
power≔power*c
y≔y+ai*power
return y
(Note: y=ancn + an-1cn-1 +. . . + a1C +a0 so the finalvalue of y is the value of the polynomial at x=c)

a. Use the algorithm to calculatef(3), wheref(x)=2x2+3x+1at x=3. Show the steps of working through the algorithm –don’t just plug 3 in for x in f(x).

b. How many multiplications andadditions are needed to evaluate a polynomial of degree nat x=c?

Answer & Explanation Solved by verified expert
3.7 Ratings (399 Votes)
aWe have to calculate fx 2x2 3x1 at x 3So here we get a0 1 a1 3 a2 2 c 3From the algorithmStep 1Initialization Here we initialize the values as follows Step    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students