On Wed, Mar 11, 2009 at 1:30 PM, Brian Schott <[email protected]> wrote:
>        This is sort of a puzzle for which I have a solution
> but have unsuccessfully puzzled over an alternative solution
> and wonder if anyone would like to solve the "puzzle" of
> finding how to find the same result but using I. instead of
> @. .
>
>        My existing solution for the variable trap is as
> follows.

I am lost here.

> aa =: {...@]
> dd =: {:@]
> bb =: 1&{...@]
> cc =: _2&{...@]

aa bb cc and dd are four points on a trapazoid which is the right arg?

In other words:
   aa=: 0&{...@]
   bb=: 1&{...@]
   cc=: 2&{...@]
   dd=: 3&{...@]


> ls =: leftsupp =:(([-aa)%bb-aa)
> rs =: rightsupp =:((dd-[)%dd-cc)
> co =: core =: 1:
> ns =: nonsupport =: 0:

Presumably ls means left support and rs means right
support, but what is a support?  What does scaling
supports by the distance between to points help?
Also, what's "core" mean?

> ge =:  +/"1@(>:/)
> le =: 4: - +/&.|."1@(<:/)
> ag =: ge`2:@. (2: <: ge - le)

ge means greater or equal?  Presumably using
sum because you have scaled things appropriately
for your concept of fuzziness?  And le means
less or equal?  4 seems to come from your
list of gerunds...

Does ag mean  2 <. ge - le?

> trap =: (ns`ls`co`rs`ns) @. ag

>         An example of using trap is as follows.
>
>   x:1|:((],:3&+)i. 15) (([,trap)"0 1)/_4]\0 5 10 14 2 6 10 14.5
...

>        Notice that all of the outputs of trap are between 0
> and 1 and they are expressed as proper fractions in the
> example, but that is only for prettying up the readout here.
>
>        If you load 'plot', execute the next line, and watch
> carefully, you will see why these are  called trapezoids.
>
> plot"1 |: ,./;"1/ x:1|:((],:3&+)i. 15) (([,trap)"0 1)/_4]\0 5 10 14 2 6 10 
> 14.5

I see that you have a range of potential values which I guess essentially
say "how close is x to the thing on the right".  But I do not know the
data well enough to even begin to understand this one.

Clarification please?

Thanks,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to