Lably
Skip to content

Boolean function

Function returning one of only two values

  • 8 min read
  • 5 chapters

Related on Lably

Through Mathematics, Function (mathematics) and Computer science

A Boolean function takes the form f:{0,1}k→{0,1}, where {0,1} is known as the Boolean domain and k is a non-negative integer called the arity of the function. In the case where k=0, the function is a constant element of {0,1}. A Boolean function with multiple outputs, f:{0,1}k→{0,1}m with m>1 is a vectorial or vector-valued Boolean function (an S-box in symmetric cryptography).

There are 22k different Boolean functions with k arguments; equal to the number of different truth tables with 2k entries.

Every k-ary Boolean function can be expressed as a propositional formula in k variables x1,...,xk, and two propositional formulas are logically equivalent if and only if they express the same Boolean function.

Examples

The rudimentary symmetric Boolean functions (logical connectives or logic gates) are:

  • NOT, negation or complement - which receives one input and returns true when that input is false ("not")
  • AND or conjunction - true when all inputs are true ("both")
  • OR or disjunction - true when any input is true ("either")
  • XOR or exclusive disjunction - true when one of its inputs is true and the other is false ("not equal")
  • NAND or Sheffer stroke - true when it is not the case that all inputs are true ("not both")
  • NOR or logical nor - true when none of the inputs are true ("neither")
  • XNOR or logical equality - true when both inputs are the same ("equal")

An example of a more complicated function is the majority function (of an odd number of inputs).

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Topics in mathematics