Yes i had considered that, That will mean I have to complete all 20 first before I find the first 7 and also
that will also give me duplicates.
For example start with a smaller number for simplicity sake 10 numbers and I want to find 7 out of 10
01234569870
01234567908
as you can see , both are unique combination, however the first 7 number are the same.
I am trying to get all posible permutations for 7 out of 20 numbers available, and yet have 7 unique combinations for each
( 20! ) possible combinations
Isnt there a much faster way to do this?
Main Topics
Browse All Topics





by: VGRPosted on 2003-09-28 at 09:33:38ID: 9445745
to speed it up, yes, get 7 out of 20. Just add a parameter (&$nbsofar) that is incrtemented each time a perutation is finished ; your recursive function will then stop and traceback if the threashold of 7 (for instance) is reached.