geometor / polynumbers

python modules and notebooks for analyzing polynomial series
https://geometor.github.io/polynumbers/
MIT License
3 stars 2 forks source link

clarify generator functions #2

Open phiarchitect opened 2 years ago

phiarchitect commented 2 years ago

Typically the polynomial generator function is in the form of F(n) and returns just the result for n.

But in nearly all the cases we will study, all the preceding results must be calculated before n.

So, building a list this:

polys = []
for n in range(0, 5):
    polys.append(F(n))

results in a lot of redundant calculations.

So, I propose that the generator always return the whole list up to n. After all, we always want the list.

phiarchitect commented 2 years ago

Let's always use x for our univariate polynomials.

I understand that there may be conventions in the mathematics world - particularly using s for the spread polys, but it will be more advantageous to make the polynomial series we are studying as uniform as possible. This will facilitate creating analysis functions.

If we need to print expressions with different variables, we can do substitutions before rendering.