what is the function that the same as perms however can used n more than 10?
25 views (last 30 days)
sharifah shuthairah syed abdullah on 3 Jul 2018
when i build a coding i used n less than 10, i used perms function.. then when get the correct coding the i test the coding in various size of n, which is n more than 10, however the length for perm is less than 10. what is the same function as perm, but can used for n more than 10?
OCDER on 3 Jul 2018
I think you need to make your own function of perms, but one that only returns 1 of many permutations at a time. When you past n = 10, you'll run out of memory fast.
3.5 GB n = 11
46.0 GB n = 12
647.6 GB n = 13
9764.0 GB n = 14
One suggestion is to make a classdef object that track the ith permutation and will continuously return the the next permutation. But read this link as your attempt to compute permutations for n >> 11 gets fairly impossible...
More Answers (1)
Stephen23 on 3 Jul 2018
One option would be to use a permutation generator, which does not store all permutations in memory:
I leave it up to the reader to decide if running through all permutations is tractable or not.