This was very helpful.  Thanks.

Linda

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Aai
Sent: Sunday, June 15, 2014 3:41 AM
To: [email protected]
Subject: Re: [Jprogramming] fibonacci performance

f7 is

f ^: (<`(1,1:)) y

where f is

+/\@|.^:2

Here is an example:

    +:^:(<`(1,1:)) 3
1 1
2 2
4 4


it's the same as:

    +:^:(<3) (1,1:) 3
1 1
2 2
4 4

Mind this

    (1,1:) 3
1 1

Constant function:

    1: 3
1

But I'm not sure if this is what you want to know.


On 15-06-14 08:25, Linda Alvord wrote:
> Function  g  and  f7  each contain  tie.  I can't understand where and how
> it is used in  f7.  The tree looks just like h rather than g. Where is
tie
> used in  f7?
>
>      g=:<`(1,1:)
>     
>     5!:4 <'g'
> -- (<,'<'),<(<,'3'),<(<(,'0');1),(<,','),<'1:'
>     
>     h=:<(1,1:)
>     
>     5!:4 <'h'
>    -- <
> --+   -- 1
>    L---+- ,
>        L- 1:
>     
>     f7=:[:,([:+/\|.)^:2^:(<`(1,1:))
>     
>     5!:4 <'f7'
>    -- [:
>    +- ,
>    │                 -- [:
> --+             ----+- \ --- / --- +
>    │      -- ^: -+   L- |.
>    │      │      L- 2
>    L- ^: -+
>           │      -- <
>           L------+   -- 1
>                  L---+- ,
>                      L- 1:
>     
>     f7 6
> 1 1 2 3 5 8 13 21 34 55 89 144
>     
> Linda
>     
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Aai
> Sent: Wednesday, June 11, 2014 5:09 AM
> To: [email protected]
> Subject: Re: [Jprogramming] fibonacci performance
>
> Also:
>
> ([:,+/\@|.^:2^:(<`(1x,1:)))
>
> or
>
> ([:,|.@(+/\.)^:2^:(<`(1x,1:)))
>
>
> On 07-06-14 12:08, R.E. Boss wrote:
>> [:, ([:+/\ +/\.)^: (<@]`(1x 1"_))
>>
>>    
>>
>>
>
http://www.jsoftware.com/jwiki/RE%20Boss/J-blog/Fibonacci#New_performance_re
>> cord
>>
>>    
>>
>>    
>>
>> R.E. Boss
>>
>>    
>>
>> (Add your info to
<http://www.jsoftware.com/jwiki/Community/Demographics>
>> http://www.jsoftware.com/jwiki/Community/Demographics )
>>
>>    
>>
>>    
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
Met vriendelijke groet,
@@i = Arie Groeneveld

----------------------------------------------------------------------
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