"The Early Years" provides the APL solution
v domino v=v (5 words).
In J, the same thing works:
v%.v=v
48.7087
(+/%#)v
48.7087
However in J there is a shorter solution:
v%.#v
48.7087
This shorter solution is not available in APL because
APL does not have # . The nearest thing APL has
is rho but the result of rho has the "wrong" rank.
v%.$v
|length error
| v %.$v
v%.0{$v
48.7087
----- Original Message -----
From: Dan Bron <[EMAIL PROTECTED]>
Date: Thursday, October 25, 2007 14:22
Subject: Re: [Jprogramming] Puzzle from "The Early Years"
To: Programming forum <[email protected]>
> I note that we can elide the parens:
>
> +/v%#v
>
> Which is shorter than (+/%#)v . Further, it
> contains only one word more than the "obvious minimum" of the
> "essential" five + / % # v .
>
> By the same token, the APL solution can be similarly condensed:
>
> +/v div rho v
>
> which is identical, if we allow that % #
> and div rho are analogs, is identical.
>
> Roger: if we prohibit cheats like ".'+/v%#v'
> (containing only 2 words), are you aware of a solution shorter
> than 6 words?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm