As a first pass, let's consider integer valued lengths for the lengths
of one of the fences.  For simplicity, let's include cases where the
area is zero.
   L1=: i.101

Since I allowed this fence to be 100 meters in length, that means that
the other two sides are equal length and use the remainder of the
fencing:
   L2=:  -: 100-L1

And, since this is a rectangular fence, the areas are:
   A=: L1*L2

The largest area found so far is, thus:
   >./,A
1250

This corresponds to:
   (1250=A)#L1,.L2
50 25

One side is 50 meters, and the other sides are half that.

Plotting these values, we see that 50 meters corresponds to the apex
of a parabola, and there's no need to consider further where the
maxima is at.

FYI,

-- 
Raul

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