Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Discrete Mathematics > Boolean Computation >
Mathematica > Mathematics and Algorithms > Logic & Boolean Algebra > Boolean Computation >

BooleanTable

BooleanTable[bf]
gives a list of truth values for all possible combinations of variable values supplied to the Boolean function bf.
BooleanTable[expr, {a1, a2, ...}]
gives a list of the truth values of the Boolean expression expr for all possible combinations of values of the ai.
BooleanTable[expr, {a1, a2, ...}, {b1, ...}, ...]
gives a nested table of truth values of expr with the outermost level giving possible combinations of the ai.
  • The possible combinations of variable values are given in the order Tuples[{True, False}, n].
  • Boole[BooleanTable[...]] gives 1, 0 values.
  • In BooleanTable[expr, {a1, a2, ...}], etc. any of the variables in expr that are not explicitly among the ai, etc. are left in symbolic form.
  • BooleanTable[expr, vars1, ..., varss] is equivalent to Fold[BooleanTable, expr, {varss, ..., vars1}].
  • BooleanTable[bf, {r1, r2, ...}] gives a list of truth values corresponding to possible values of the r1^(th), r2^(th), ... variables for the Boolean function bf.
  • BooleanTable[bf, {r1, ...}, {s1, ...}, ...] gives a nested table of truth values with the outermost level giving combinations of the ri^(th) variables.
The vector of truth values for Or:
Convert to 1, 0 form:
2D truth table for Or:
Generate a truth table for a Boolean expression:
A truth table with arguments and values:
Vector-valued Boolean expression:
A 2D truth table:
A 3D truth table:
Generate a truth table for a pure Boolean function:
Specify the position of arguments to use:
Position and grouping of arguments to use:
Expressions do not need to produce Boolean values:
Generate a truth table without explicitly giving a variable list:
The variables and ordering used are given by BooleanVariables:
Compute the probability for an event as the ratio of true cases to total cases:
The probabilities for some events:
The probability that exactly three variables are true:
Show that Prob(X union Y)=Prob(X)+Prob(Y)-Prob(X intersection Y):
Assume that you pay 2 units when x∧y and that you earn 1 unit when x xor y xor z:
The expected earning when it is equally probable that x, y, z are true or false:
The risk or variance is:
Generate the truth rules for a Boolean expression:
Use the rules to evolve a cellular automaton:
A BooleanTable with n variables has 2n elements:
With n and m variables the resulting matrix has 2n+m values:
BooleanTable with several variable iterators evaluates the outermost iterator first: »
An equivalent form:
BooleanTable enumerates values in the same order as Tuples[{True, False}, n]:
Three variables:
SatisfiabilityCount efficiently counts the number of True elements in BooleanTable:
In this case the BooleanTable would have 21000 elements:
Give an enumerated BooleanFunction:
Compute its truth table:
The order of enumeration is consistent with FromDigits:
Use BooleanFunction to convert a truth table to a function or expression:
Convert to a Boolean function:
Use it as any other function:
Convert to a disjunctive normal form:
Convert to a "NAND" form:
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team