in reply to nCr arrays of size r

While you claim this to be a non-homework question, I would categorize as homework nevertheless, because you didn't provide any code to start with. You also did not take the trouble to super search on permutations. That would be a good starting point.

To help you on the road: have a look at this. To whack up a first solution, take only the first r items of the permutations, and filter out the duplicates.

Hope this help,

Jeroen
"We are not alone"(FZ)

Replies are listed 'Best First'.
Re: Re: nCr arrays of size r
by PsychoSpunk (Hermit) on Apr 18, 2001 at 19:18 UTC
    jeroenes as a side thread, if I had said that I was trying to implement a CGI parsing routine, someone would undoubtedly point me to use CGI;. I admit that I didn't search for permutations, because I didn't think of it (however, I did do some searching on similar topics as my little project). I did recall some discussion from the CB on similar subjects and, for lack of a useful search term, I figured this SoPW would get me a good answer (with either a link or code such as tye provided). So, instead of poorly reinventing the wheel, I asked my fellow wheelmakers for an appropriate wheel.

    So while I can fully see your point of view (as I CBed), I think that it would be remiss of me to not request an answer, considering the purpose of SoPW and PerlMonks itself. Or has the purpose of PerlMonks been perverted from this style of question? Not to be snide, but can you point me to that change in the Need Help?? or Perl Monks FAQ?

    My goal isn't to solve all of this toy project myself, but to simply finish it. If that involves requests for code (noting that this is my first such request, and happens to be the last thing I need to finish the current instantiation), then I think such questions are well within the nature of PerlMonks and SoPW.

    Note: This is not an attack on your reply, I found your link to be useful. It is simply a response to the homework statement and my own interpretation of what SoPW is supposed to be for. I just wanted to address an issue that I think I tried to avoid initially.

    ALL HAIL BRAK!!!

      PsychoSpunk I can see your point, and thank you for softening your statement in CB ;-). Of course you are free to request some code in a SoPW, naturellement. And I think we are here to help others, at least, that's my opinion. But too often there are people here who ask and expect others to solve their problems, and they clearly do so trying to minimize the effort from their side. Well, that is not polite.

      I don't think you mean to be rude, (neither do I) but simply a statement like 'this is no homework' doesn't help much (IMHO). You better state something like: I've had some discussion about this in CB, but I wouldn't know where to search for in Supersearch, etc etc...

      If I had such a question, I would simply ask it in CB, and very soon I would have got some links were to look for. But that's me.

      So, feel free to post anything you want here. SoPW is meant for such questions. It's merely the attitude of the posting I responded to, and I think just a little difference in the style/approach could have made your post somewhat politer. But again, that's just me. I know it is fairly easy to be misinterpreted when it comes to the intention of a posting.... I made some errors in that direction myself.

      Cheers,

      Jeroen
      "We are not alone"(FZ)