GATE CS 2006 · Systems of Linear Equations & Consistency

MCQ · 1 mark · Problem EM-LSYS-0040

Consider the polynomial \(p(x)=a_{0}+a_{1}x+a_{2}x^{2} + a_{3}x^{3}\), where \(a_{i}\neq 0,\forall i\). The minimum number of multiplications needed to evaluate p on an input x is:
  1. A
    3
  2. B
    5
  3. C
    6
  4. D
    9

Solve it on GATE DA practice →More Systems of Linear Equations problems

Show the worked solution\[\boxed{\text{Horner: } p(x)=a_0+x\big(a_1+x\,(a_2+a_3x)\big)}\]Evaluating from the inside out uses one multiplication per nesting level: \(a_3x\), then \((a_2+a_3x)x\), then \((a_1+\dots)x\). That is 3 multiplications (and 3 additions).Fewer is impossible: a cubic with all \(a_i\neq0\) needs at least \(\deg p=3\) multiplications in general.Answer: A

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com