Yes, I should have said going from a length 14 seed sequence to a
length 4 sequence.
My apologies.
I need to slow down and be more careful.
Thanks,
--
Raul
On Thu, Jan 15, 2015 at 10:59 AM, R.E. Boss wrote:
>> So going from a length 4 seed sequences to a length 14 sequence
>> results in add
> So going from a length 4 seed sequences to a length 14 sequence
> results in additional memory consumption of 4.19418e7 bytes of memory.
Isn't it the other way around?
1.14925e9 - 1.10731e9
4194
Actually, the concern is to calculate the number of 1's or 2's for length
>10e13 sequences in
great minds
> -Original Message-
> From: programming-boun...@forums.jsoftware.com [mailto:programming-
> boun...@forums.jsoftware.com] On Behalf Of Aai
> Sent: donderdag 15 januari 2015 15:07
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Kolakosky sequence
>
> Probab
Plagiarising Raul and Aai's brilliant insights (and presumably RE Boss's),
as I got nowhere near those efficiencies, it seems you can get a slight
improvement in time and space using a boolean array until termination:
1 ts'#(>:# ((1 0$~#)))^:(40) 1 '
1.62761 4.69765e8
1 ts'(# 2 1$~#)^
Probably identical to what you have:
(# 2 1$~#)^:(40) 2
R.E. Boss schreef op 15-01-15 om 13:03:
K=. 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 1 2 2 1
2 2 1 1 2 1 2 2 1 2 1 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 1 2 2
1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1
Hmm... the way that seems obvious to me seems to be less efficient
than your approach:
kolakosky=: (# 2 1 $~ #)@]^:(> #)^:_&2
timespacex 'kolakosky 21717700'
0.933105 1.16183e9
Interestingly, the length of the seed sequence seems to have a
disproportionate effect on the amount of space used
K=. 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 1 2 2 1
2 2 1 1 2 1 2 2 1 2 1 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 1 2 2
1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 2 2 1 2 2 1 1
is the start of a sequence where each i-th number gives the length of
It is similar to reading/writing bmp, ie. readjpeg and writejpeg
On Jan 15, 2015 2:31 PM, "Ryan" wrote:
--
For information about J forums see http://www.jsoftware.com/forums.htm