2

Is there any inbuilt function in Julia language that permutes a given list with repetitions

There are n^n such permutations for a list of n elements

hanugm
  • 1,127
  • 3
  • 13
  • 44
  • 1
    Agree with Harlan's response. It's a little hard to know what you're looking for since a permutation never includes any repetitions. Permutations are just reorderings of a list. Harlan's suggestion describes Cartesian products, which would have the n^n size you mentioned. – John Myles White Feb 07 '14 at 14:25

1 Answers1

3

Not entirely sure what you're asking for, but the cartesian product iterator in the Iterators.jl package might be along those lines.

https://github.com/JuliaLang/Iterators.jl/blob/master/src/Iterators.jl#L204

(Not inbuilt, if that matters to you for some reason. Also, Iterators.jl could use better documentation...)

Harlan
  • 18,883
  • 8
  • 47
  • 56