You know the Pareto Principle? The 80/20 rule? That 80% of the work gets done by 20% of the people? Or 80% of the money belongs to 20% of the people? And so on?

Well it is 'recursive' inasmuch as it can be applied again to the 20% first recognised.

i.e. if 20% do 80% of the work then 20% of the 20% do 80% of they work THEY do.

And so on.

While I can get my head around recursion generally and can fully comprehend the standard recursive algorithm for calculating factorial - I'm not smart enough to put this one together. It always seems to me I have two parameters rather than just the one - the 'n' we watch in the factorial - and can't figure out how to do it.

Yep, I'm not real bright.

Can anyone do that?

Votes + Comments
Bright enough to know when to ask for help - that's brighter than the average!
3 Weeks
Discussion Span
Last Post by JamesCherrill

Why 2 parameters? Isn't there just one (the amount to be split)?

If so you may be worrying about returning 2 values from each call, in which case:

  1. You could package the two values into an array, tuple, trivial class etc depending on your chosen language
  2. You only need to return one, because the other is (the original value to be split minus the one you return).
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.