Hi guys I am looking for some function that generates the permutation of a vector of a certain length with elements taken from a certain set. For example let us say we are generating the permutation of vectors of length 3 with elements taken from set (0, 1) and we have:

If you want the â€śuncollectedâ€ť form to only extract the length without the allocaiton, you can do:

all_perm(x, n) = Iterators.product([x for i = 1:n]...)

You can still do length(all_perm([0, 1], 3)) on this but you didnâ€™t allocate all the permutations (in case there are many). But you would have to use vec(collect(all_perm([0,1], 3)) to get the result as a vector rather than a matrix (the default for ProductIterator).

Hi guys and thank you so much for your answers and the the help provided. I have not been in laboratory for days because of covid 19 and thatâ€™s the reason for this late answer and I am sorry for this. I will let you know later after the â€śrestrictionâ€ť to access laboratory will be lifted for my decision which one will be the solution for me. I appreciate very much the help from all of you thou. Cheers Ergnoor.