Re: [Jprogramming] Combinatorial Maths with J

2014-02-26 Thread robert therriault
d, 26 Feb 2014 08:31:45 -0700 >> From: dongu...@gmail.com >> To: programm...@jsoftware.com >> Subject: Re: [Jprogramming] Combinatorial Maths with J >> >> ((!3)*!(7-3))%~!7 >> >> 35 >> >> 3!7 >> >> 35 >> >>

Re: [Jprogramming] Combinatorial Maths with J

2014-02-26 Thread Mike Day
Jon, You need the dyadic version of !, though it does yCx rather than xCy: 3!7 35 The following idiom delivers your required number of Steiner subsets: ({.%~/@:!}. ) 2 3 7 7 ... if you're happy to treat the triples in this way. It's derived from this verb which delivers 2!3 and 2!7:

Re: [Jprogramming] Combinatorial Maths with J

2014-02-26 Thread Don Guinn
((!3)*!(7-3))%~!7 35 3!7 35 On Wed, Feb 26, 2014 at 8:25 AM, Jon Hough wrote: > I have a question about doing combinations and permutations with J. > There is an easy to use factorial function (or is that verb) : ! > !5120 > Is there a combination verb? Or do I make my own? > ((!3)*!(7

Re: [Jprogramming] Combinatorial Maths with J

2014-02-26 Thread Jon Hough
Well that's embarrassing. I should have read the definition more carefully. > Date: Wed, 26 Feb 2014 08:31:45 -0700 > From: dongu...@gmail.com > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Combinatorial Maths with J > >((!3)*!(7-3))%~!7 > > 35 &

Re: [Jprogramming] Combinatorial Maths with J

2014-02-26 Thread Dan Bron
bject: [Jprogramming] Combinatorial Maths with J From: Jon Hough Date: Wed, 26 Feb 2014 15:25:31 + To: "programm...@jsoftware.com" I have a question about doing combinations and permutations with J. There is an easy to use factorial function (or is that verb) : ! !

[Jprogramming] Combinatorial Maths with J

2014-02-26 Thread Jon Hough
I have a question about doing combinations and permutations with J. There is an easy to use factorial function (or is that verb) : ! !5120 Is there a combination verb? Or do I make my own? ((!3)*!(7-3))%~!7 Gives 7 choose 3. I think I butchered that. Is there a better way to do this, without all t