I am trying to list the total number of combinations of a number of elements. Let's say that I want all the combinations of
There are 1024 of these :
-; a, b,c,...., ab, ac, ad,.... abc,
and so on
I have no ideea how to find these. Any clues ? (the number of elements, 10 here, is just an indication... for 14 elements I should get 16384).
Solved! Go to Solution.
One possible idea (sorry, posting by phone).
Count in binary from 1 (or 0) to 1111111111 (each bit representing one character) and create the corresponding string for each. Code probably fits on a postage stamp. 🙂
See if this can give you some ideas (indicator is shown twice (scrolled to each end)).
This is pretty explicit. I am sure there are fancier versions if performance matters. Not sure what primary sort order you want for the output (alphabetical? By length?, etc.)
no need to be that harsh, yes I searched this forum (maybe you could point me to a link that I missed)
Thanks for the solution, it works very well.
To explain further what I was trying to do : I want to make a programmable "resistance" by using a switch and a multiplexer/matrix. I am putting 10 different resistances in parallel and programming with channels to cross. I converted your program to output arrays of booleans (which close/open channels) and it works very well.