mangosteen: (Default)
[personal profile] mangosteen
Realization: Polynomials and indexed arrays of integers are, if not isomorphic, then *very* useful for understanding each other.

I'm kind of embarrassed that it took my brain this long to explicitly put that one together. Which is to say, I always knew it, but I didn't previously realize the cool stuff that falls out of it, like taking the derivative to move the index into the coefficient, etc.

This is (apparently) what I do on vacation. Happy New Year!

Date: 2011-12-30 07:12 pm (UTC)
From: [identity profile] miss-chance.livejournal.com
I <3 geekery!


Happy New Year!

Date: 2011-12-30 07:26 pm (UTC)
From: [identity profile] sweh.livejournal.com
It becomes even more obvious when you think of a polynomial as a sigma equation
f(x)=sum(i=0->inf) a{sub i}x^i
ie
a0 + a1x + a2x^2 + a3x^3 + ...
which leads to a natural a[] as the representation

For full representation you need an infinitely sized array, or a lazy evaluation language :-)

Date: 2011-12-30 07:54 pm (UTC)
vatine: Generated with some CL code and a hand-designed blackletter font (Default)
From: [personal profile] vatine
And if you have your arrays in the right (and by right, I actually mean "wrong") order, stored from highest to lowest index, computing the polynmomial for a given X turns into a simple reduce (or, if your language supports reducing from the tail-end, you can have the array in the right order).

To wit:
lambda(x, polynom): reduce lambda(sum, new-poly-factor): x*sum+new-poly-factor over polynom

Date: 2011-12-30 08:01 pm (UTC)
From: [identity profile] sweh.livejournal.com
Trying to think how I'd do this in Orwell (language I last used in 1987). Hmm...

> f x a:as = f x a:as 0
> f x a:as i = a*x^i * f x as (i+1) if as <> []
>           = a*x^i otherwise


The "a:as" expression means "single element a followed by a (potentially empty) list of more a's"

Date: 2011-12-30 09:00 pm (UTC)
ext_174465: (Default)
From: [identity profile] perspicuity.livejournal.com
i've got a book in "computational algebra" some years ago. fascinating stuff. polynomial goodness.

then consider polynomials and bases and the fun you can do there.

and gah. i can reference a book if you want. i'll have to find it later.

one can write a lot of neat perl/python for such things.

#
Edited Date: 2011-12-30 09:05 pm (UTC)

Date: 2011-12-31 03:28 pm (UTC)
vatine: z^5+z^3+1 Newton-Raphson fractal (fractal)
From: [personal profile] vatine
There's always the joys of "iterated Newton-Raphson fractals". Essentially, take any polynomial, find its roots, then for a section of the complex plane, colour all points based on (a) what root is reached and (b) how long it takes to get there.

If you start from the roots, you can simply construct the polynomial and can skip the root-finding. It's also possible to do the root-finding mixed in with the point-colouring (find what root a given point tends to, see if that is a root previously found, if not add the root to the set of roots).

Date: 2011-12-31 04:31 pm (UTC)
jicama: (Default)
From: [personal profile] jicama
Ah yes, Linear Algebra.

Profile

mangosteen: (Default)
Elias K. Mangosteen

September 2021

S M T W T F S
   1234
567891011
12131415161718
192021 22232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 6th, 2026 09:05 pm
Powered by Dreamwidth Studios