Oh, oops.
I think you are right. Sorry about that, I'm really getting careless...
Let's go with the process specified by Erling Hellenäs:
require'stats'
perm=: A.~ i.@!@#
sper=: ,/@:(perm"1)@comb
Thanks,
--
Raul
On Mon, Nov 27, 2017 at 3:47 PM, Andrew Dabrowski wrote:
> This is the correct
This is the correct solution to a different problem. Isn't k sper n
supposed to return lists without repetitions?
On 11/27/2017 11:36 AM, Raul Miller wrote:
http://code.jsoftware.com/wiki/Essays/Odometer
sper=: ] #.^:_1 i.@^~
Thanks,
--
Nice,
Perhaps I should more time reading and less time at quick hacks. ;-)
Cheers, bob
> On Nov 27, 2017, at 8:36 AM, Raul Miller wrote:
>
> http://code.jsoftware.com/wiki/Essays/Odometer
>
> sper=: ] #.^:_1 i.@^~
>
> Thanks,
>
> --
> Raul
>
>
> On Mon, Nov 20, 2017 at 2:49 AM, 'Skip
http://code.jsoftware.com/wiki/Essays/Odometer
sper=: ] #.^:_1 i.@^~
Thanks,
--
Raul
On Mon, Nov 20, 2017 at 2:49 AM, 'Skip Cave' via Programming
wrote:
> How to find the permutations of y objects taken x at a time?
>
> 3 sper 4
>
> 0 1 2
>
> 0 1 3
>
> 0 2 1
>
> 0 2 3
>
> 0 3 1
>
> 0
hile, but here is an explicit version of your solution:
sper=:>@(#~(-: ~.)@>)@,@{@($ <@i.)
sper2=: 13 :'>((-: ~.)@>,{x$mailto:programming-boun...@forums.jsoftware.com] On Behalf
Of robert therriault
Sent: Monday, November 20, 2017 3:23 AM
To: programm...@jsoftware.com
Subje
software.com
Subject: Re: [Jprogramming] Subset Permutations
A really quick hack at the problem gave me this
sper=:>@(#~(-: ~.)@>)@,@{@($ <@i.)
3 sper 4
0 1 2
0 1 3
0 2 1
0 2 3
0 3 1
0 3 2
1 0 2
1 0 3
1 2 0
1 2 3
1 3 0
1 3 2
2 0 1
2 0 3
2 1 0
2 1 3
2 3 0
2 3 1
3 0 1
3 0 2
3 1 0
3 1 2
Hi all !
You can do it in two steps? Find all combinations, then all permutations
of each combination?
perm=: (A.~i.@!@#)
combbit=: 4 : 0
or=. 23 b.
lshift=. 33 b.
lrot=. 32 b.
shift=. 2 ((_2 lrot 2 | [) or _1 lshift ])/\ ]
n=. <:##:_1 (32 b.) 1
l=. >.y%n
p=. y->:i.>:d=.y-x
k=. <"_1(<.p%n)|."
A really quick hack at the problem gave me this
sper=:>@(#~(-: ~.)@>)@,@{@($ <@i.)
3 sper 4
0 1 2
0 1 3
0 2 1
0 2 3
0 3 1
0 3 2
1 0 2
1 0 3
1 2 0
1 2 3
1 3 0
1 3 2
2 0 1
2 0 3
2 1 0
2 1 3
2 3 0
2 3 1
3 0 1
3 0 2
3 1 0
3 1 2
3 2 0
3 2 1
2 sper 4
0 1
0 2
0 3
1 0
1 2
1 3
2 0
2 1
2 3
3 0
3 1
How to find the permutations of y objects taken x at a time?
3 sper 4
0 1 2
0 1 3
0 2 1
0 2 3
0 3 1
0 3 2
1 0 2
1 0 3
1 2 0
1 2 3
1 3 0
1 3 2
2 0 1
2 0 3
2 1 0
2 1 3
2 3 0
2 3 1
3 0 1
3 0 2
3 1 0
3 1 2
3 2 0
3 2 1
2 sper 4
0 1
0 2
0 3
1 0
1 2
1 3
2 0
2 1