Hello, I am new to Mathematica and I want to create the following list. Suppose that each entry of a N-dimensional vector can be 0 or 1. How do I obtain all possible N-dimensional vectors where each entry could be 0 or 1? I was able to write the following code but it only works for small N.
l[1] = {0, 1};
l[n_] := l[n] = Flatten[{0, 1, l[n - 1]}, n]
A[n_] := DeleteDuplicates[Subsets[Flatten[{l[n], l[n]}], {n}]]
A[2]
(*{{0, 1}, {0, 0}, {1, 0}, {1, 1}}*)
Kind regards