in reply to RE: Re: New Jersey Lottery Probability
in thread New Jersey Lottery Probability

I like the last one, map is alway a good one to whip out. I bet it is the fastest one also.

Of course it is true that recursion is not needed. It rarely is needed. And this was a simple loop, so in a normal application: use a simple loop, not recursion. I did it because I felt like being a smart-ass :) I would not recommend using recursion where you did not absolutely have to.

Also recursion can be slower, nearly impossible to debug, and all around confusing ... but that is why it is fun for academic exercises!

For 'real' code I would go with your code or btrott's slimmed down version.

Just though I would clarify for users that arent hip on recursion
  • Comment on RE: RE: Re: New Jersey Lottery Probability