[Jprogramming] statistical induction
Raul Miller
rauldmiller at gmail.com
Tue Oct 4 21:19:10 HKT 2011
On Tue, Oct 4, 2011 at 4:52 AM, Bo Jacoby <bojacoby at yahoo.dk> wrote:
> Verbs for deduction and induction are defined like this.
>
> a =. *`%`:3"2
> b =. ,: (%:@* -.)
> c =. (,: , 1:) % +/@]
> deduc =. a at b@c f.
> T =. -@(+ #)
> induc =. (T@}: , }.)@(T~ deduc T) f.
This looks fun.
I do have some cosmetic suggestions.
First, I prefer =: over =. for definitions that I am going to use,
because =. definitions in a script I load from file vanish before I
can use them.
Second, I would probably use / instead of `:3 -- I know that J will
convert gerund/ to gerund`:3 but / is still more concise (and, for me,
saves a round trip to the vocabulary page -- but that might not be the
case for someone else).
Also, it's interesting (and educational) to try to put names to each
of the intermediate results that arise in this kind of computation.
--
Raul
More information about the Programming
mailing list