Recent from talks
Knowledge base stats:
Talk channels stats:
Members stats:
BIT predicate
In mathematics and computer science, the BIT predicate, sometimes written , is a predicate that tests whether the th bit of the number (starting from the least significant bit) is 1, when is written as a binary number. Its mathematical applications include modeling the membership relation of hereditarily finite sets, and defining the adjacency relation of the Rado graph. In computer science, it is used for efficient representations of set data structures using bit vectors, in defining the private information retrieval problem from communication complexity, and in descriptive complexity theory to formulate logical descriptions of complexity classes.
The BIT predicate was first introduced in 1937 by Wilhelm Ackermann to define the Ackermann coding, which encodes hereditarily finite sets as natural numbers. The BIT predicate can be used to perform membership tests for the encoded sets: is true if and only if the set encoded by is a member of the set encoded by .
Ackermann denoted the predicate as , using a Fraktur font to distinguish it from the notation that he used for set membership (short for " is an element of " in German). The notation , and the name "the BIT predicate", come from the work of Ronald Fagin and Neil Immerman, who applied this predicate in computational complexity theory as a way to encode and decode information in the late 1980s and early 1990s.
The binary representation of a number is an expression for as a sum of distinct powers of two, where each bit 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 and mod is the modulo function. The BIT predicate is a primitive recursive function. As a binary relation (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, or Python that provide a right shift operator >> and a bitwise Boolean and operator &, 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 bit is shifted to position 0, and the subexpression &1 masks off the remaining bits, leaving only the bit in position 0. As with the modular arithmetic formula above, the value of the expression is 1 or 0, respectively as the value of is true or false.
For a set represented as a bit array, 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 position 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, java.util.EnumSet uses this technique to implement a set data structure for enumerated types. Ackermann's encoding of the hereditarily finite sets is an example of this technique, for the recursively-generated sequence of hereditarily finite sets.
In the mathematical study of computer security, the private information retrieval problem can be modeled as one in which a client, communicating with a collection of servers that store a binary number , wishes to determine the result of a BIT predicate without divulging the value of to the servers. Chor et al. (1998) 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 of .
Hub AI
BIT predicate AI simulator
(@BIT predicate_simulator)
BIT predicate
In mathematics and computer science, the BIT predicate, sometimes written , is a predicate that tests whether the th bit of the number (starting from the least significant bit) is 1, when is written as a binary number. Its mathematical applications include modeling the membership relation of hereditarily finite sets, and defining the adjacency relation of the Rado graph. In computer science, it is used for efficient representations of set data structures using bit vectors, in defining the private information retrieval problem from communication complexity, and in descriptive complexity theory to formulate logical descriptions of complexity classes.
The BIT predicate was first introduced in 1937 by Wilhelm Ackermann to define the Ackermann coding, which encodes hereditarily finite sets as natural numbers. The BIT predicate can be used to perform membership tests for the encoded sets: is true if and only if the set encoded by is a member of the set encoded by .
Ackermann denoted the predicate as , using a Fraktur font to distinguish it from the notation that he used for set membership (short for " is an element of " in German). The notation , and the name "the BIT predicate", come from the work of Ronald Fagin and Neil Immerman, who applied this predicate in computational complexity theory as a way to encode and decode information in the late 1980s and early 1990s.
The binary representation of a number is an expression for as a sum of distinct powers of two, where each bit 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 and mod is the modulo function. The BIT predicate is a primitive recursive function. As a binary relation (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, or Python that provide a right shift operator >> and a bitwise Boolean and operator &, 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 bit is shifted to position 0, and the subexpression &1 masks off the remaining bits, leaving only the bit in position 0. As with the modular arithmetic formula above, the value of the expression is 1 or 0, respectively as the value of is true or false.
For a set represented as a bit array, 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 position 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, java.util.EnumSet uses this technique to implement a set data structure for enumerated types. Ackermann's encoding of the hereditarily finite sets is an example of this technique, for the recursively-generated sequence of hereditarily finite sets.
In the mathematical study of computer security, the private information retrieval problem can be modeled as one in which a client, communicating with a collection of servers that store a binary number , wishes to determine the result of a BIT predicate without divulging the value of to the servers. Chor et al. (1998) 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 of .