Hello!
I would like to understand how to work with boolean functions in a better way. Can you show me how to convert from a closed form to the truth table, ANF or DNF? For example, say I have a polynomial on four variables,
f(w,x,y,z) = wx + yz
This should be in ANF like this:
[Xor[x1x2,x3x4] so I feel like I should be able to get Mathematica to spit out a truth table, but this>
Boole[BooleanTable[Xor[x1*x2, x3*x4]]]
does not work at all.
How can I get the truth table from that? Doing it out by hand gets old real fast:)
Thanks! Mary
Something like this?
In[1]:= Boole@BooleanTable[ Xor[ And[x1, x2], And[x3, x4] ], {x1, x2, x3, x4} ] Out[1]= {0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}
What do you mean by multiplication? In Mathematica True and False are NOT treated as 1 and 0. So one can not create an AND function by multiplying. Use the proper functions: And, Or, Xor, Nand, Nor, Xnor et cetera. Furthermore BooleanTable needs a second argument with the variables...