Subset Permutations

One interesting result is kPn: (!n)%(!n-k) permutations of
n unique items in k places, 
or ordered subsets of k items from set of unique n ones.

http://mathworld.wolfram.com/Permutation.html

   load'viewmat'

   kPn1=: [EMAIL PROTECTED]@[ /:~@(,/)@:(A."1) comb

   ([EMAIL PROTECTED] viewmat) 3 kPn1 4
24 3

which by observing the spectrum is the same as

   kPn2=: - ~.@:(}."1) ([EMAIL PROTECTED] A. i.)@]

   ([EMAIL PROTECTED] viewmat) 3 kPn2 4
24 3

   3 (kPn1 (-: , [EMAIL PROTECTED]) kPn2) 5
1 60 3
   3 (kPn1 (-: , [EMAIL PROTECTED]) kPn2) 6
1 120 3


   3 (] %&! -~) 4 5 6
24 60 120



--- Roger Hui <[EMAIL PROTECTED]> wrote:

> What is the answer supposed to be?
> 
> 
> 
> ----- Original Message ----- 
> From: "bill lam" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Monday, March 06, 2006 10:22 PM
> Subject: [Jprogramming] permutation
> 
> how to define a dyad perm similar to comb?
> 
>    3 comb 5
> 0 1 2
> 0 1 3
> 0 1 4
> 0 2 3
> 0 2 4
> 0 3 4
> 1 2 3
> 1 2 4
> 1 3 4
> 2 3 4
> 
>    3 perm 5
> |index error: perm
> |   3     perm 5
> 
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to