After studying the many diverse methods that were put forward to solve my
"3-integers, no repeats or zeros" problem, I find I have learned quite a
few new J idioms, as well as some new uses for familiar primitives. Thanks
all so much for your efforts in all the solutions.
Quora has hundreds of the
Sorry for my poor coding of your suggestion!
Either I hadn't spotted your own code, or perhaps I'd forgotten you'd
posted it.
Mike
On 14/08/2017 21:21, Raul Miller wrote:
If you are going to time one of my implementations, I'd really prefer
you time the second one rather than the first on
If you are going to time one of my implementations, I'd really prefer
you time the second one rather than the first one. It's approximately
1500 times faster.
To save you from having to reread my post, here's the implementation:
require'stats'
perms=: A.&i.~ !
,10#.(perms 3){"1/1+3 comb
Yes, much better!
cf my suggestion a few days ago, and another constructive one using
tap and comb, q_tap_comb :
... time & space for Skip's original problem:
ts'10 #.(,/@:(],"1 0 -."1)^:2 ,.)>:i.9'NB. AG
0.000120949 40448
ts'10#.(#~(-:~.)"1) >: 9#.inv i. 9^3' NB. MD
0.000774292 84
My version of variations (without repetitions) :
10 #. (,/@:(],"1 0 -."1)^:2 ,.)1+i.9
More general:
(3) 4 :'y,/@:(],"1 0 -."1)^:(x-1) ,.y' 'abcd'
Op 12-08-17 om 11:16 schreef Skip Cave:
How can I use J to generate all the possible 3-digit integers that can be
constructed using the digits 1-9
This discussion really belongs on chat, But it looks like my previous
attempt to move it there is being ignored, so I'll respond here:
Value to who, though? Value is a subjective judgement, and subject to
change, so there's also potential accuracy gains in identifying when
it would have had that v
The value of a partially known oil reserve could be reported like this:
$100*10^(±1)
Den 20:26 søndag den 13. august 2017 skrev Jimmy Gauvin
:
It gets even better with blind faith put into "algorithms" :
A nice read on the subject can be found in Cathy O'Neil's book:
http