When I read it I thought the problem was to find the largest area as a
function of the size of the existing barn wall.  If size is zero or
less then the area is (*:100%4); if it is (100%3) or larger the the area is
(*:100%3); and the interesting part is in between.  The function, I think,
is:

   (area=. (*:100%4) >. (*:100%3) <. 16 %~ *:@:(100&+))
625 >. 1111.1111111111113 <. 16 %~ *:@:(100&+)

   load'plot'
   plot (];area) (i:50)


On Sat, Feb 23, 2013 at 9:42 AM, km <k...@math.uh.edu> wrote:

> Use J to solve the farmer's fence problem:
>
> A farmer with 100 meters of wire fence wants to make a rectangular chicken
> yard using an existing barn wall for one of the north-south sides.  What is
> the largest area he can enclose if he uses the 100 meters of fence for the
> other three sides, and what are the dimensions of the largest-area chicken
> yard?
>
> Kip Murray
>
> Sent from my iPad
>
> ----------------------------------------------------------------------
> 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