Is there any simpler formula than
Tuples[{False, True}, 3]
to generate tuples of all combinations of boolean values?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityIs there any simpler formula than
Tuples[{False, True}, 3]
to generate tuples of all combinations of boolean values?
As said in comments, that's an efficient way of generating combinations. If you want to do something with them, BooleanTable is pretty neat:
TableForm[
BooleanTable[{{a, b, c}, And[a, b, c], Or[a, b, c], Xor[a, b, c], Xnor[a, b, c]}, {a, b, c}],
TableHeadings -> {None, {"Vars", "And", "Or", "Xor", "Xnor"}}]
Just to give another way to this goal:
IntegerDigits[#, 2, 3] & /@ Range[2^3] /. {1 -> "True", 0 -> "False"}
;-)