Although it's using a library definition, I like this.

times =: *

times table i.10

+-----+---------------------------+

|times|0 1 2 3 4 5 6 7 8 9|

+-----+---------------------------+

|0 |0 0 0 0 0 0 0 0 0 0|

|1 |0 1 2 3 4 5 6 7 8 9|

|2 |0 2 4 6 8 10 12 14 16 18|

|3 |0 3 6 9 12 15 18 21 24 27|

|4 |0 4 8 12 16 20 24 28 32 36|

|5 |0 5 10 15 20 25 30 35 40 45|

|6 |0 6 12 18 24 30 36 42 48 54|

|7 |0 7 14 21 28 35 42 49 56 63|

|8 |0 8 16 24 32 40 48 56 64 72|

|9 |0 9 18 27 36 45 54 63 72 81|

+-----+---------------------------+

On Sat, Mar 14, 2020 at 12:17 PM 'Bo Jacoby' via Chat <[email protected]>
wrote:

> These are my favorite one-liners.
>
>    deduce =: %~`*`:3"2@(,:(%:@*-.))@(+/@[%~1,,:)
>
>    predict =: (deduce~-@>:)~
>
>    induce =: (,:0:)+[predict(-+/)~
>
>
> Examples. First line of result: mean values. Second line of result:
> standard deviations.
>
>     50 30 20 deduce 9 NB. from the population, deduce the sample
>
> 4.5 2.7 1.8
>
> 1.43812 1.31806 1.15049
>
>
>
>    50 30 20 predict 9 NB. from the sample, predict the unknown
>
> 4.45631 2.70874 1.83495
>
> 1.55655 1.42798 1.25428
>
>
>
>    50 30 20 induce 109 NB. from the sample, induce the population
>
> 54.4563 32.7087 21.835
>
> 1.55655 1.42798 1.25428
>
> Thanks! Bo.
>
>
> Den lørdag den 14. marts 2020 18.08.00 CET skrev Skip Cave <
> [email protected]>:
>
>
>
>
>
> mean or average
>
> (+/%#)
>
>
> smallest and largest
>
> (<./,>./)
>
>
> multiplication table (and addition, subtraction, division)
>
> */~i.10
>
>
>
> Skip Cave
> Cave Consulting LLC
>
>
> On Sat, Mar 14, 2020 at 11:16 AM 'PMA' via Chat <[email protected]>
> wrote:
>
> > Hi, J gurus --
> >
> > I hazarded to regale a non-programmer friend
> > with J's (+/i.1000000).  She loved this, so
> > I've followed with a link to NuVoc, and now
> > she loves that!
> >
> > So I want to ask, could y'all suggest a list
> > of maybe a dozen favorite J one-liners, that
> > I could send too?
> >
> > (Somewhere, I've still got one for APL from
> > eons ago.)
> >
> > I know you're busy.  Thanks in advance.
> >
> > Pete
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> 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