# How to generate the permutation of a vector with elements selected from a certain set

**URL:** <https://discourse.julialang.org/t/how-to-generate-the-permutation-of-a-vector-with-elements-selected-from-a-certain-set/36032>\
**Category:** General Usage\
**Created:** [March 16, 2020, 6:50am UTC](https://discourse.julialang.org/t/how-to-generate-the-permutation-of-a-vector-with-elements-selected-from-a-certain-set/36032 "2020-03-16T06:50:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [March 16, 2020, 8:16am UTC](https://discourse.julialang.org/t/how-to-generate-the-permutation-of-a-vector-with-elements-selected-from-a-certain-set/36032/2 "2020-03-16T08:16:54Z")

</div>

```julia
julia> [[x,y,z] for x=0:1 for y=0:1 for z=0:1]
8-element Array{Array{Int64,1},1}:
 [0, 0, 0]
 [0, 0, 1]
 [0, 1, 0]
 [0, 1, 1]
 [1, 0, 0]
 [1, 0, 1]
 [1, 1, 0]
 [1, 1, 1]

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-generate-the-permutation-of-a-vector-with-elements-selected-from-a-certain-set/36032)._
