Lots of ways to approach the problem.

On Sat, Aug 22, 2009 at 12:25 AM, Bo Jacoby <[email protected]> wrote:

> As far as I understand it:
>
> Kip is doing Newton transformation, explicitely using binomial coefficients
> (!) and creating a n*n matrix, where n is #data. The inverse transformation
> is different from the forward transformation.
>
> Don is computing polynomial coefficients by inverting an n*n matrix. The
> inverse transformation is different from the forward transformation.
>
> Bo is computing a variant of the Newton transformation where the difference
> operator ( }. - }: ) is replaced by ( }: - }. ). The inverse transformation
> T^:_1 equal to the forward transformation T. The transform is done in-line
> in the vector, and no matrix is involved.
>


> (By the way the odd cubes are not (1 27 125 etc~15) but rather
>   1 27 125 343 etc~15 NB. odd cubes
> 1 27 125 343 729 1331 2197 3375 4913 6859 9261 12167 15625 19683 24389
> Sorry about that.)
>
> Bo
>
> --- Den lør 22/8/09 skrev Don Guinn <[email protected]>:
>
> > Fra: Don Guinn <[email protected]>
> > Emne: Re: [Jprogramming] A better conjunction
> > Til: "Programming forum" <[email protected]>
> > Dato: lørdag 22. august 2009 00.09
> > Why. It's not advanced. Matrix
> > operations are covered in schools before
> > difference calculus. Besides, it is a basic tool of J.
> >
> > On Fri, Aug 21, 2009 at 2:51 PM, Bo Jacoby <[email protected]>
> > wrote:
> >
> > > That's nice Don, but isn't the matrix inversion tool
> > more advanced than
> > > necessary?
> > >
> > >   1 3 etc~15 NB. odd numbers
> > > 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29
> > >   0 1 3 etc~15 NB. triangular numbers
> > > 0 1 3 6 10 15 21 28 36 45 55 66 78 91 105
> > >   0 1 5 14 etc~15 NB. pyramidal
> > numbers
> > > 0 1 5 14 30 55 91 140 204 285 385 506 650 819 1015
> > >   0 1 4 etc~15 NB. square numbers
> > > 0 1 4 9 16 25 36 49 64 81 100 121 144 169 196
> > >   0 1 8 27 etc~15 NB. cube numbers
> > > 0 1 8 27 64 125 216 343 512 729 1000 1331 1728 2197
> > 2744
> > >   1 27 125 etc~15 NB. odd cubes
> > > 1 27 125 295 537 851 1237 1695 2225 2827 3501 4247
> > 5065 5955 6917
> > >
> > > Of course I would like a tacit definition of T.
> > >
> > > --- Den fre 21/8/09 skrev Don Guinn <[email protected]>:
> > >
> > > > Fra: Don Guinn <[email protected]>
> > > > Emne: Re: [Jprogramming] A better conjunction
> > > > Til: "Programming forum" <[email protected]>
> > > > Dato: fredag 21. august 2009 18.19
> > > > If one wants a polynomial solution to
> > > > a series there is always matrix
> > > > divide.
> > > >    p=.3 : '(>:0
> > > > i:~0=r){.r=.y%.(i.x:#y)^/i.x:#y'
> > > >    p 0 1 8 27 64 125 216 343 512 729
> > 1000
> > > > 0 0 0 1
> > > >
> > > > On Fri, Aug 21, 2009 at 7:37 AM, Bo Jacoby <[email protected]>
> > > > wrote:
> > > >
> > > > > How to use involutoric newtontransform to
> > extrapolate
> > > > a list of numbers.
> > > > >
> > > > >   ]data =. 3 ^~ i. 4 NB. test
> > data
> > > > > 0 1 8 27
> > > > >   T data NB. transform once
> > > > > 0 _1 6 _6
> > > > >   T T data NB. transform
> > twice,
> > > > reproducing data
> > > > > 0 1 8 27
> > > > >   T NB. transform using only
> > '-',
> > > > neither '*' nor '%' nor even '+'.
> > > > > 3 : 0
> > > > > a =. 0 $ 0
> > > > > while. # y do.
> > > > >  a =. a , {. y
> > > > >  y =. ( }: - }. ) y
> > > > > end.
> > > > > a
> > > > > )
> > > > >   etc NB. extend transform
> > with zeroes
> > > > and transform back.
> > > > > [: T [ {. [: T ]
> > > > >   11 etc data
> > > > > 0 1 8 27 64 125 216 343 512 729 1000
> > > > >
> > > > > - Bo
> > > > >
> > > > > --- Den fre 21/8/09 skrev Kip Murray <[email protected]>:
> > > > >
> > > > > > Fra: Kip Murray <[email protected]>
> > > > > > Emne: Re: [Jprogramming] A better
> > conjunction
> > > > > > Til: "Programming forum" <[email protected]>
> > > > > > Dato: fredag 21. august 2009 14.41
> > > > > > And, of course,
> > > > > >
> > > > > > diff =: 2&(-~/\)  NB.
> > differences of a
> > > > vector
> > > > > >
> > > > > > (For the notes at the end)
> > > > > >
> > > > > > Kip Murray wrote:
> > > > > > > In  (long sentence here,
> > watch for the
> > > > period)
> > > > > > >
> > > > > > >
> >    ]data =: 3 ^~
> > > > i. 11
> > > > > > > 0 1 8 27 64 125 216 343 512 729
> > 1000
> > > > > > >
> > > > > > >    p =: 3 interp data
> > > > > > >
> > > > > > >
> > p   NB.
> > > > conjunction interp
> > > > > > embedded
> > > > > > > (3) (2 : '(y !~ i. >: m) +/ . *
> > {. (>:
> > > > m) difftb
> > > > > > n') 0 1 8 27 64 125 216
> > > > > > > 343 512 729 1000
> > > > > > >
> > > > > > > the conjunction interp is supposed
> > to look
> > > > at the
> > > > > > difference table
> > > > > > >
> > > > > > >    4 difftb
> > > > data   NB.
> > > > > > successive differences of first column,
> > see note
> > > > [1]
> > > > > > >  0  1  6 6
> > > > > > >  1  7 12 0
> > > > > > >  8 19  0 0
> > > > > > > 27  0  0 0
> > > > > > >
> > > > > > > and, reading the first line,
> > produce the
> > > > equivalent
> > > > > > of
> > > > > > >
> > > > > > >    q =: 0 1 6 6 +/ . *
> > (i.4) !
> > > > > > ]   NB. A Newton series,
> > see note
> > > > [2]
> > > > > > > .
> > > > > > >
> > > > > > > Conjunction interp _does_ produce
> > an
> > > > equivalent:
> > > > > > >
> > > > > > >    (p"0 ,: q"0) i. 11
> > > > > > > 0 1 8 27 64 125 216 343 512 729
> > 1000
> > > > > > > 0 1 8 27 64 125 216 343 512 729
> > 1000
> > > > > > >
> > > > > > > But I don't want p to recreate
> > the
> > > > difference table
> > > > > > every time it is
> > > > > > > called.  Is there a way to
> > rewrite
> > > > conjunction
> > > > > > interp so that
> > > > > > >
> > > > > > >    q =: 3 interp1 data
> > > > > > >
> > > > > > >    q
> > > > > > > 0 1 6 6 +/ .* 0 1 2 3 ! ]
> > > > > > >
> > > > > > > ?
> > > > > > >
> > > > > > > Kip
> > > > > > >
> > > > > > > ----------
> > > > > > >
> > > > > > >
> > > > > > > [1] x difftb y is an x by x table
> > whose kth
> > > > column
> > > > > > has
> > > > > > >     kth
> > differences for
> > > > vector x
> > > > > > {. y  (y is a vector and x <:
> > #y)
> > > > > > >
> > > > > > >    difftb =: 4 : '|:
> > diff^:(i.x) x
> > > > {. y'
> > > > > > >
> > > > > > >
> > > > > > > [2] In algebra notation q is the
> > third
> > > > degree Newton
> > > > > > series
> > > > > > >
> > > > > > >     q(x) = 0 +
> > 1
> > > > x/1  + 6
> > > > > > (x*(x-1))/(1*2) + 6
> > (x*(x-1)*(x-2))/(1*2*3)
> > > > > > >
> > > > > > >     This one
> > simplifies
> > > > to q(x) =
> > > > > > x^3 .
> > > > > > >
> > > > > > > For Newton series, see pages
> > 190-191 of
> > > > Graham, Knuth,
> > > > > > and Patashnik,
> > > > > > > Concrete Mathematics Second
> > Edition.
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > ----------------------------------------------------------------------
> > > > > > For information about J forums see
> > > http://www.jsoftware.com/forums.htm
> > > > > >
> > > > >
> > > > >
> > > > >       Find din nye
> > laptop på
> > > > kelkoo.dk. Se de gode tilbud her -
> > > > > http://dk.yahoo.com/r/pat/mm
> > > > >
> > > >
> > ----------------------------------------------------------------------
> > > > > For information about J forums see
> http://www.jsoftware.com/forums.htm
> > > > >
> > > >
> > ----------------------------------------------------------------------
> > > > For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >
> > >
> > >       Trænger du til at se
> > det store billede? Kelkoo giver dig gode tilbud
> > > på LCD TV! Se her http://dk.yahoo.com/r/pat/lcd
> > >
> > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>      Find din nye laptop på kelkoo.dk. Se de gode tilbud her -
> http://dk.yahoo.com/r/pat/mm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to