In
mathematics
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, the BIT predicate, sometimes is a
predicate that tests whether the
bit
The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
of the (starting from the
least significant digit) when
is written as a
binary number
A binary number is a number expressed in the Radix, base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may ...
. Its mathematical applications include modeling the membership relation of
hereditarily finite set
In mathematics and set theory, hereditarily finite sets are defined as finite sets whose elements are all hereditarily finite sets. In other words, the set itself is finite, and all of its elements are finite sets, recursively all the way down to t ...
s, and defining the adjacency relation of the
Rado graph
In the mathematics, mathematical field of graph theory, the Rado graph, Erdős–Rényi graph, or random graph is a Countable set, countably infinite graph that can be constructed (with probability one) by choosing independently at random for eac ...
. In computer science, it is used for efficient representations of set
data structure
In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
s using
bit vector
A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that compactly stores bits. It can be used to implement a simple set data structure. A bit array is effective at exploiting bit-level p ...
s, in defining the
private information retrieval
In cryptography, a private information retrieval (PIR) protocol is a protocol that allows a user to retrieve an item from a server in possession of a database without revealing which item is retrieved. PIR is a weaker version of 1-out-of-''n'' obl ...
problem from
communication complexity, and in
descriptive complexity theory
Descriptive complexity is a branch of computational complexity theory and of finite model theory that characterizes complexity classes by the type of logic needed to express the languages in them. For example, PH, the union of all complexity cla ...
to formulate logical descriptions of
complexity class
In computational complexity theory, a complexity class is a set (mathematics), set of computational problems "of related resource-based computational complexity, complexity". The two most commonly analyzed resources are time complexity, time and s ...
es.
History
The BIT predicate was first introduced in 1937 by
Wilhelm Ackermann
Wilhelm Friedrich Ackermann (; ; 29 March 1896 – 24 December 1962) was a German mathematician and logician best known for his work in mathematical logic and the Ackermann function, an important example in the theory of computation.
Biograph ...
to define the
Ackermann coding, which encodes
hereditarily finite set
In mathematics and set theory, hereditarily finite sets are defined as finite sets whose elements are all hereditarily finite sets. In other words, the set itself is finite, and all of its elements are finite sets, recursively all the way down to t ...
s as The BIT predicate can be used to perform membership tests for the encoded sets:
is true if and only if the set encoded is a member of the set encoded
Ackermann denoted the predicate
using a
Fraktur
Fraktur () is a calligraphic hand of the Latin alphabet and any of several blackletter typefaces derived from this hand. It is designed such that the beginnings and ends of the individual strokes that make up each letter will be clearly vis ...
font to distinguish it from the notation
that he used for set membership (short for an element in German). The notation and the name "the BIT predicate", come from the work of
Ronald Fagin
Ronald Fagin (born 1945) is an American mathematician and computer scientist, and IBM Fellow at the IBM Almaden Research Center. He is known for his work in database theory, finite model theory, and reasoning about knowledge.
Biography
Ron F ...
and
Neil Immerman
Neil Immerman (born 24 November 1953, Manhasset, New York) is an American theoretical computer science, theoretical computer scientist, a professor of computer science at the University of Massachusetts Amherst. , who applied this predicate in
computational complexity theory
In theoretical computer science and mathematics, computational complexity theory focuses on classifying computational problems according to their resource usage, and explores the relationships between these classifications. A computational problem ...
as a way to encode and decode information in the late 1980s and early
Description and implementation
The
binary representation
A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may also ...
of a number
is an expression for
as a sum of distinct
powers of two
A power of two is a number of the form where is an integer, that is, the result of exponentiation with number two as the base and integer as the exponent. In the fast-growing hierarchy, is exactly equal to f_1^n(1). In the Hardy hi ...
,
where each
bit
The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
in this expression is either 0 or 1. It is commonly written in binary notation as just the sequence of these bits,
. Given this expansion for
, the BIT predicate
is defined to equal
. It can be calculated from the formula
where
is the
floor function
In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
and mod is the
modulo function.
The BIT predicate is a
primitive recursive function
In computability theory, a primitive recursive function is, roughly speaking, a function that can be computed by a computer program whose loops are all "for" loops (that is, an upper bound of the number of iterations of every loop is fixed befor ...
. As a
binary relation
In mathematics, a binary relation associates some elements of one Set (mathematics), set called the ''domain'' with some elements of another set called the ''codomain''. Precisely, a binary relation over sets X and Y is a set of ordered pairs ...
(producing true and false values rather than 1 and 0 respectively), the BIT predicate is
asymmetric: there do not exist two numbers
and
for which both
and
are true.
In programming languages such as
C,
C++,
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
, or
Python that provide a and a the BIT predicate
can be implemented by the expression
(i>>j)&1
. The subexpression
i>>j
shifts the bits in the binary representation of
so that is shifted to and the
masks off the remaining bits, leaving only the bit in As with the modular arithmetic formula above, the value of the expression is respectively as the value of
is true or false.
Applications
Set data structures
For a set represented as a
bit array
A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that compactly stores bits. It can be used to implement a simple set data structure. A bit array is effective at exploiting bit-level par ...
, the BIT predicate can be used to test set membership. For instance, subsets of the non-negative integers
may be represented by a bit array with a one in when
is a member of the subset, and a zero in that position when it is not a member. When such a bit array is interpreted as a binary number, the set
for distinct
is represented as the binary number
. If
is a set, represented in this way, and
is a number that may or may not be an element of
, then
returns a nonzero value when
is a member and zero when it is not.
The same technique may be used to test membership in subsets of any sequence
of distinct values, encoded using powers of two whose exponents are the positions of the elements in this sequence, rather than their values. For instance, in the
Java collections framework
The Java collections framework is a set of classes and interfaces that implement commonly reusable collection data structures.
Although referred to as a framework, it works in a manner of a library. The collections framework provides both inte ...
,
java.util.EnumSet
uses this technique to implement a set data structure for
enumerated type
In computer programming, an enumerated type (also called enumeration, enum, or factor in the R (programming language), R programming language, a status variable in the JOVIAL programming language, and a categorical variable in statistics) is a data ...
s. Ackermann's encoding of the hereditarily finite sets is an example of this technique, for the recursively-generated sequence of hereditarily finite sets.
Private information retrieval
In the mathematical study of
computer security
Computer security (also cybersecurity, digital security, or information technology (IT) security) is a subdiscipline within the field of information security. It consists of the protection of computer software, systems and computer network, n ...
, the
private information retrieval
In cryptography, a private information retrieval (PIR) protocol is a protocol that allows a user to retrieve an item from a server in possession of a database without revealing which item is retrieved. PIR is a weaker version of 1-out-of-''n'' obl ...
problem can be modeled as one in which a client, communicating with a collection of servers that store a binary wishes to determine the result of a BIT predicate
without divulging the value to the servers. describe a method for replicating
across two servers in such a way that the client can solve the private information retrieval problem using a substantially smaller amount of communication than would be necessary to recover the complete value
Complexity and logic
The BIT predicate is often examined in the context of
first-order logic
First-order logic, also called predicate logic, predicate calculus, or quantificational logic, is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantified variables over ...
, where systems of logic result from adding the BIT predicate to first-order logic. In
descriptive complexity
Descriptive complexity is a branch of computational complexity theory and of finite model theory that characterizes complexity classes by the type of logic needed to express the formal language, languages in them. For example, PH (complexity), PH, ...
, the
complexity class
In computational complexity theory, a complexity class is a set (mathematics), set of computational problems "of related resource-based computational complexity, complexity". The two most commonly analyzed resources are time complexity, time and s ...
FO describes the class of
formal language
In logic, mathematics, computer science, and linguistics, a formal language is a set of strings whose symbols are taken from a set called "alphabet".
The alphabet of a formal language consists of symbols that concatenate into strings (also c ...
s that can be described by a formula in first-order logic with a comparison operation on
totally ordered
In mathematics, a total order or linear order is a partial order in which any two elements are comparable. That is, a total order is a binary relation \leq on some set X, which satisfies the following for all a, b and c in X:
# a \leq a ( r ...
variables (interpreted as the indexes of characters in a
string
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
) and with predicates that test whether this string has a given character at a given numerical index. A formula in this logic defines a language consisting of its
finite models. However, with these operations, only a very restricted class of languages, the
star-free regular languages, can be described. Adding the BIT predicate to the repertoire of operations used in these logical formulas results in a more robust complexity class, , meaning that it is less sensitive to minor variations in its definition.
The class is the same as the class , of first-order logic with addition and multiplication predicates.
It is also the same as the
circuit complexity
In theoretical computer science, circuit complexity is a branch of computational complexity theory in which Boolean functions are classified according to the size or depth of the Boolean circuits that compute them. A related notion is the circui ...
class
DLOGTIME In computational complexity theory, DLOGTIME is the complexity class of all computational problems solvable in a logarithmic amount of computation time on a deterministic Turing machine. It must be defined on a random-access Turing machine, since ...
-
uniform
A uniform is a variety of costume worn by members of an organization while usually participating in that organization's activity. Modern uniforms are most often worn by armed forces and paramilitary organizations such as police, emergency serv ...
AC0. Here, AC
0 describes the problems that can be computed by circuits of
AND gate
The AND gate is a basic digital logic gate that implements the logical conjunction (∧) from mathematical logic AND gates behave according to their truth table. A HIGH output (1) results only if all the inputs to the AND gate are HIGH (1). If a ...
s and
OR gate
The OR gate is a digital logic gate that implements logical disjunction. The OR gate outputs "true" if any of its inputs is "true"; otherwise it outputs "false". The input and output states are normally represented by different voltage levels.
...
s with polynomial size, bounded height, and unbounded fanout. "Uniform" means that the circuits of all problem sizes must be described by a single algorithm. More specifically, it must be possible to index the gates of each circuit by numbers in such a way that the type of each gate and the adjacency between any two gates can be computed by a
deterministic algorithm
In computer science, a deterministic algorithm is an algorithm that, given a particular input, will always produce the same output, with the underlying machine always passing through the same sequence of states. Deterministic algorithms are by fa ...
whose time is logarithmic in the size of the circuit (DLOGTIME).
Construction of the Rado graph

In 1964, German–British mathematician
Richard Rado used the BIT predicate to construct the infinite
Rado graph
In the mathematics, mathematical field of graph theory, the Rado graph, Erdős–Rényi graph, or random graph is a Countable set, countably infinite graph that can be constructed (with probability one) by choosing independently at random for eac ...
. Rado's construction is just the
symmetrization of Ackermann's 1937 construction of the hereditary finite sets from the BIT predicate: two vertices numbered
and
are adjacent in the Rado graph when either
or
is nonzero.
The resulting graph has many important properties: it contains every finite undirected graph as an
induced subgraph
In graph theory, an induced subgraph of a graph is another graph, formed from a subset of the vertices of the graph and ''all'' of the edges, from the original graph, connecting pairs of vertices in that subset.
Definition
Formally, let G=(V,E) ...
, and any
isomorphism
In mathematics, an isomorphism is a structure-preserving mapping or morphism between two structures of the same type that can be reversed by an inverse mapping. Two mathematical structures are isomorphic if an isomorphism exists between the ...
of its induced subgraphs can be extended to a symmetry of the whole graph.
Notes
References
{{DEFAULTSORT:Bit Predicate
Binary arithmetic
Binary relations
Descriptive complexity
Circuit complexity
Set theory