# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Combinations of a number of elements

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

Message 1 of 6
(452 Views)

## Re: Combinations of a number of elements

I have no ideea how to find these

Have you searched the internet, or even this forum?

Message 2 of 6
(408 Views)

## Re: Combinations of a number of elements

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

Message 3 of 6
(404 Views)
Solution

## Re: Combinations of a number of elements

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

Message 4 of 6
(363 Views)

## Re: Combinations of a number of elements

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

N

Message 5 of 6
(338 Views)

## Re: Combinations of a number of elements

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

Message 6 of 6
(282 Views)