12-08-2022 03:47 PM
Hi guys,
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
a,b,c,d,e,f,g,h,i, j
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).
Thanks
Solved! Go to Solution.
12-08-2022 06:24 PM
@nitad54448 wrote:I have no ideea how to find these
Have you searched the internet, or even this forum?
12-08-2022 06:31 PM - edited 12-08-2022 06:33 PM
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. 🙂
12-08-2022 08:09 PM - edited 12-08-2022 08:12 PM
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.)
12-09-2022 01:47 AM
no need to be that harsh, yes I searched this forum (maybe you could point me to a link that I missed)
N
12-09-2022 01:20 PM
Hi
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.
Thanks