PsychoSpunk has asked for the wisdom of the Perl Monks concerning the following question:
What I want to do is take every combination of nCr and place those into separate arrays. So, using the above example @t and @array = (10,11,12,13,14), I want to get the 10 arrays from combining @t and @array with regards to 5C3. I can see this as a recursive solution, but I haven't wrapped my mind around the actual solution. Ideally, the solution will allow for nC1 and nCn cases. Anyway, I'm going to give it a stab after I get some sleep, but I would like to see other ideas as well.
Note: This is for a toy project at home. All would be homework denouncers can make mental note that I have been out of school for over a year now. It occurred to me that this is rather homeworky, so I figured that I'd be better off on getting real answers if I made this statement from the beginning. Thanks.
ALL HAIL BRAK!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: nCr arrays of size r
by tye (Sage) on Apr 18, 2001 at 17:12 UTC | |
|
Re: nCr arrays of size r
by larsen (Parson) on Apr 18, 2001 at 14:41 UTC | |
|
Re (tilly) 1: nCr arrays of size r
by tilly (Archbishop) on Apr 18, 2001 at 18:32 UTC | |
|
Re: nCr arrays of size r
by jeroenes (Priest) on Apr 18, 2001 at 14:47 UTC | |
by PsychoSpunk (Hermit) on Apr 18, 2001 at 19:18 UTC | |
by jeroenes (Priest) on Apr 18, 2001 at 20:59 UTC |