I have a string of length 5. Each element of the string can take on two values 0 and 1.
I would like to write down all possible permutations.
For example:
0 0 0 0 0
1 0 0 0 0
0 1 0 0 0
.
.
.
1 1 1 1 1
There are 2^5 such combinations.
I know there is a command called combn
but I do not know how to handle the fact that each digit can take on two possible values.