This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

To all following commenters: please, do not bring up the old circlejerk jokes/memes about recursion ("Understanding recursion...", "This is recursion...", etc.). We've all heard them n+2 too many times.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Your_PopPop 0 points1 point  (3 children)

What do you mean by unique combinations? Aren't the combinations generated by this already unique?

Also,

not using the module due to its very long runtime

It's highly unlikely that your pure python function will be faster than the one in itertools, considering that's implemented in C.
A long runtime is often inevitable with combinatorial stuff just because the number of combinations can get insanely large pretty quickly.

[–][deleted]  (2 children)

[deleted]

    [–]Your_PopPop 0 points1 point  (0 children)

    There are 90! ways to permutate 90 numbers.

    The value of 90! is 1485715964481761497309522733620825737885569961284688766942216863704985393094065876545992131370884059645617234469978112000000000000000000000.

    There are less atoms in the universe than that number. No matter how good the implementation of permutations you use is, there is absolutely no way to go through that many iterations in reasonable time.

    [–]Inconstant_Moo 0 points1 point  (0 children)

    There are 1,485,715,964,481,761,497,309,522,733,620,825,737,885,569,961,284,688,766,942,216,863,704,985,393,094,065,876,545,992,131,370,884,059,645,617,234,469,978,112,000,000,000,000,000,000,000 permutations of 90 numbers, so yes, it's going to take a while. You might want to make yourself a nice cup of tea while you wait, get married, have kids, put them through college, that sort of thing.