Chapter 17: Problem 2
Given a polynomial \(g \in R[X]\) and an element \(x \in R,\) a particularly elegant and efficient way of computing \(g(x)\) is called Horner's rule. Suppose \(g=\sum_{i=0}^{k-1} a_{i} X^{i},\) where \(k \geq 0\) and \(a_{i} \in R\) for \(i=0, \ldots, k-1 .\) Horner's rule computes \(g(x)\) as follows: $$ y \leftarrow 0_{R} $$ for \(i \leftarrow k-1\) down to 0 do $$ y \leftarrow y x+a_{i} $$ output \(y\) Show that this algorithm correctly computes \(g(x)\) using \(k\) multiplications in \(R\) and \(k\) additions in \(R\).
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.