I have a problem with coming up with a statement for this proof:
The following algorithm takes x, $a_i, 0 ≤ i ≤ n$, as input and returns $\displaystyle\sum_{j=0}^n a_jx^j$ as output
Input: x, a_i, 0 ≤ i ≤ n;
Output: y;
begin
1.y := 0;
2.for i := n step −1 downto 0 do
3.y := $a_i$ + x ∗ y;
end.
This is what I have right now: (not sure if correct):
for 0 to k and at the kth iteration where line is at number 3, y is the output of the summation of $a_i$ (i from zero to n) plus x multiplied by y.