UnateQ
Details
- A positive unate Boolean function is also known as a Boolean increasing function.
- A negative unate Boolean function is also known as a Boolean decreasing function.
- The Boolean expression bexpr is positive unate in the variable xi if Boole[bexpr/.xi->False]≤Boole[bexpr/.xi->True] for all values of other variables.
- The Boolean expression bexpr is negative unate in the variable xi if Boole[bexpr/.xi->False]≥Boole[bexpr/.xi->True] for all values of other variables.
- Any combination of variables and their negation can be used.
- UnateQ[bf,{ind1,ind2,…}] tests whether the Boolean function bf is unate in variable k according to the indicator indk.
- The indicators indk can take the following values:
-
True,1 test for positive unate False,0 test for negative unate _ do not test for unateness
Examples
open all close allBasic Examples (2)
Scope (5)
UnateQ[(x∧y)∨z]UnateQ[(x∧y)∨z, {¬x, ¬y, ¬z}]Test for unateness in one variable:
UnateQ[(x∧y)∨z, {z}]Test for positive unate in one variable, negative unate in another:
UnateQ[Implies[x, y], {¬x, y}]Check for unateness of a pure function:
UnateQ[#1∧#2∨#3&]UnateQ[BooleanFunction[30, 3]]Test for negative unateness in the first variable and positive unateness in the second:
UnateQ[Implies[#1, #2]&, {False, True}]Test for whether a function is positive unate in its first and last variables:
UnateQ[#1∧¬#2∨#3&, {True, _, True}]Applications (2)
Enumerate all unate functions of three variables:
Select[Table[BooleanFunction[i, {x, y, z}], {i, 0, 2 ^ 2 ^ 3 - 1}], UnateQ]ReliabilityDistribution only takes positive unate functions:
vars = Array[Subscript[x, #]&, 5];
dists = Table[{Subscript[x, i], ExponentialDistribution[λ]}, {i, 5}];f = BooleanFunction[4294967282, 5, vars]//BooleanConvertDistributionParameterQ[ReliabilityDistribution[f, dists]]Find out which variables are not positive unate:
Extract[Array[Subscript[x, #]&, 5], Position[Map[UnateQ[f, #]&, vars], False]]Remove x4 by setting it to False:
f /. Subscript[x, 4] -> FalseDistributionParameterQ[ReliabilityDistribution[%, dists]]Properties & Relations (6)
Basic positive unate functions:
UnateQ /@ {x, And[x, y], Or[x, y], Majority[x, y, z]}Basic negative unate functions:
UnateQ[#, {¬x, ¬y}]& /@ {Not[x], Nand[x, y], Nor[x, y]}Implies is negative unate in one variable and positive unate in the other:
UnateQ[Implies[x, y], {¬x, y}]Some Boolean functions are not unate in any variable:
Table[UnateQ[Xor[x, y], {v}], {v, {x, y, ¬x, ¬y}}]Table[UnateQ[Xnor[x, y], {v}], {v, {x, y, ¬x, ¬y}}]Table[UnateQ[Equivalent[x, y], {v}], {v, {x, y, ¬x, ¬y}}]The fraction of Boolean functions that are positive unate for dimension
:
countFraction[n_] := Count[Table[BooleanFunction[i, n], {i, 0, 2 ^ 2 ^ n - 1}], _ ? UnateQ] / 2 ^ 2 ^ nBarChart[Table[countFraction[i], {i, 4}], ChartLabels -> Range[4], AxesLabel -> {n, None}]Combinations of positive unate functions are unate:
UnateQ[(x∧y)∨z]Combinations of negative unate functions are not necessarily negative unate:
UnateQ[(x⊼y)⊼z, {¬x, ¬y, ¬z}]The negation of a positive unate function is negative unate:
expr = (x∨y)∧z;UnateQ[expr, {x, y, z}]UnateQ[¬expr, {¬x, ¬y, ¬z}]Neat Examples (1)
Show in how many variables each Boolean function with three variables is positive unate:
PieChart[Map[{Total[#], 3 - Total[#]}&, Boole@Table[Map[UnateQ[BooleanFunction[i, 3][x, y, z], #]&, {x, y, z}], {i, 0, 2 ^ 2 ^ 3 - 1}]], ChartBaseStyle -> Directive[EdgeForm[None]], ChartLegends -> {"Positive unate", "Not positive unate"}, ChartStyle -> "TemperatureMap", ImageSize -> Medium]Related Guides
History
Introduced in 2012 (9.0)
Text
Wolfram Research (2012), UnateQ, Wolfram Language function, https://reference.wolfram.com/language/ref/UnateQ.html.
CMS
Wolfram Language. 2012. "UnateQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UnateQ.html.
APA
Wolfram Language. (2012). UnateQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UnateQ.html
BibTeX
@misc{reference.wolfram_2026_unateq, author="Wolfram Research", title="{UnateQ}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/UnateQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_unateq, organization={Wolfram Research}, title={UnateQ}, year={2012}, url={https://reference.wolfram.com/language/ref/UnateQ.html}, note=[Accessed: 12-June-2026]}