Unit 4.2 A farewell to indices
The fundamental problem with deriving algorithms as we have encountered so far is that bugs in programs are often associated with indices and the quantifiers now used to specify the state of the variables at various points also involves relatively intricate indexing. Thus, the derivation process itself is prone to the introduction of the same kind of bugs that are introduced when programs are developed in a less mathematical fashion. We now show have abstraction comes to the rescue.
From here on, we will use lower case Greek letters for scalars and lower case Roman letters for vectors. With this, the coefficients that define the polynomial can be gathered into a vector
and the function that evaluates the polynomial given scalar \(\chi \) (the Greek letter "chi") is given by
where \(n \) equals the size of the vector \(a \text{,}\)
With this new notation, we wish to compute
where we use the Greek lower case letter psi, \(\psi \text{,}\) for what was previously the scalar \(y \text{.}\)
Rather than explicitly indexing to access the elements of a vector \(a \text{,}\) we instead partition into regions:
where you should read \(a_T \) as "a Top" and \(a_B \) as "a Bottom."
Exercise 4.1.
Show that
This last exercise shows how the evaluation of a polynomial \(p( a, \chi ) \) can be recursively defined, meaning in terms of \(p( a_T, \chi ) \) and \(p( a_B, \chi ) \text{.}\)