[Edu-sig] synthetic division
mpaul213 at gmail.com
Sun Dec 14 05:26:51 CET 2008
On Friday we were studying synthetic substitution/division in Algebra 2.
After going through the algorithm and after showing through factoring why it
worked, I had them look at this code:
def evaluate(polynomial, x):
value = 0
for coefficient in polynomial:
value = value*x + coefficient
*polynomial *is a list of coefficients.
This algorithm is identical to the factoring analysis I showed them. To
then create the function 'divide' is a simple matter of returning a list of
coefficients rather than one final value.
This 'concept map' shows exactly the same thing as the diagram in our text,
but it would be even more accurate to initialize *value* as polynomial
and to then make the for-loop 'for coefficient in polynomial[1:]', but I
thought that in an environment where programming in math classes is still
considered something alien, the indexing might cause some silly
grade-anxiety reactions. How sad that this has to be an issue.
But I figure that for the kids that are interested, and there are some,
looking at indexing and splicing might be enticing.
This has been my experience - looking at math concepts I have long taken for
granted and thinking about how to express them in computational form as
interacting functions/classes has shed new light on my own understanding. I
can't help think that this would be invaluable for education.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Edu-sig