ISRO-2018
November 26, 2023Algorithms
November 26, 2023Question 9314 – GATE 2006
Consider the polynomial p(x) = a0 + a1x + a2x2 + a3x3, where ai ≠ 0, ∀i. The minimum number of multiplications needed to evaluate p on an input x is:
Correct Answer: A
Question 1 Explanation:
Given polynomial equation is
p(x) = a0 + a1x + a2x2 + a3x3 where ai≠0
This can be written as
p(x) = a0 +x( a1 + a2x + a3x2)=a0+(a1+(a2+a3x)x)x
Total no. of multiplications required is 3
i.e., a3x = K…..(i)
(a2+K)x = M….. (ii)
(a1+M)x=N…… (iii)
p(x) = a0 + a1x + a2x2 + a3x3 where ai≠0
This can be written as
p(x) = a0 +x( a1 + a2x + a3x2)=a0+(a1+(a2+a3x)x)x
Total no. of multiplications required is 3
i.e., a3x = K…..(i)
(a2+K)x = M….. (ii)
(a1+M)x=N…… (iii)
3
4
6
9
Subscribe
Login
0 Comments