Showing results for 
Search instead for 
Did you mean: 

Combinations of a number of elements

Go to solution

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).


0 Kudos
Message 1 of 6

@nitad54448 wrote:

I have no ideea how to find these

Have you searched the internet, or even this forum?




0 Kudos
Message 2 of 6

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. 🙂 

0 Kudos
Message 3 of 6
Accepted by topic author nitad54448

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.)


0 Kudos
Message 4 of 6

no need to be that harsh, yes I searched this forum (maybe you could point me to a link that I missed)


0 Kudos
Message 5 of 6


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.


0 Kudos
Message 6 of 6