ArticleslgStudy

engineering

BIT predicate

BIT predicate is a engineering topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand BIT predicate rather than just read about it. In short: In mathematics and computer science, the BIT predicate, sometimes written BIT(i,j), is a predicate that tests whether the jth bit of the number i (starting from the least significant bit) is 1, when i 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.

BIT predicate — main illustration
BIT predicate — illustration

Key takeaways

  • BIT predicate belongs to engineering; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect BIT predicate to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of BIT predicate from memory before moving on to harder problems.

Reference excerpt

In mathematics and computer science, the BIT predicate, sometimes written BIT(i,j), is a predicate that tests whether the jth bit of the number i (starting from the least significant bit) is 1, when i 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.

History 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: BIT(i,j) is true if and only if the set encoded by j is a member of the set encoded by i. Ackermann denoted the predicate BIT(i,j) as 𝔈𝔩(j,i), using a Fraktur font to distinguish it from the notation El(j,i) that he used for set membership (short for "j is an element of i" in German). The notation BIT(i,j), 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.

Description and implementation The binary representation of a number i is an expression for i as a sum of distinct powers of two, i=⋯b323+b222+b121+b020 where each bit bj in this expression is either 0 or 1. It is commonly written in binary notation as just the sequence of these bits, ⋯b3b2b1b0. Given this expansion for i, the BIT predicate BIT(i,j) is defined to equal bj. It can be calculated from the formula BIT(i,j)=⌊i2j⌋mod2, 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 i and j for which both BIT(i,j) and BIT(j,i) 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 BIT(i,j) can be implemented by the expression (i>>j)&1. The subexpression i>>j shifts the bits in the binary representation of i so that bit bj 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 BIT(i,j) is true or false.

Applications

Set data structures 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 {0,1,…} may be represented by a bit array with a one in position i when i 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 {i,j,k,…} for distinct i,j,k,… is represented as the binary number 2i+2j+2k+⋯. If S is a set, represented in this way, and i is a number that may or may not be an element of S, then BIT(S,i) returns a nonzero value when i is a member and zero when it is not. The same technique may be used to test membership in subsets of any sequence x0,x1,… 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.

Private information retrieval 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 i, wishes to determine the result of a BIT predicate BIT(i,j) without divulging the value of j to the servers. Chor et al. (1998) describe a method for replicating i 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 i.

Complexity and logic The BIT predicate is often examined in the context of first-order logic, where systems of logic result from adding the BIT predicate to first-order logic. In descriptive complexity, the complexity class FO describes the class of formal languages that can be described by a formula in first-order logic with a comparison operation on totally ordered variables (interpreted as the indexes of characters in a string) 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, FO[BIT], meaning that it is less sensitive to minor variations in its definition. The class FO[BIT] is the same as the class FO[+,×], of first-order logic with addition and multiplication predicates. It is also the same as the circuit complexity class DLOGTIME-uniform AC0. Here, AC0 describes the problems that can be computed by circuits of AND gates and OR gates 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 whose time is logarithmic in the size of the circuit (DLOGTIME).

Construction of the Rado graph

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with BIT predicate

Start with the simplest possible case. Write down what BIT predicate claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In engineering, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to BIT predicate before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about BIT predicate ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of BIT predicate

In research
BIT predicate appears in engineering research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses BIT predicate in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
BIT predicate is common in secondary-school and first-year university syllabi. It links to neighbouring topics Binary arithmetic, Binary relations, Circuit complexity, so understanding it makes those chapters shorter.
In everyday life
Look for BIT predicate outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “BIT predicate” →

How to study BIT predicate in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what BIT predicate means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain BIT predicate out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is BIT predicate in simple terms?

In mathematics and computer science, the BIT predicate, sometimes written BIT(i,j), is a predicate that tests whether the jth bit of the number i (starting from the least significant bit) is 1, when i is written as a binary number. Its mathematical applications include modeling the membership relat…

Why does BIT predicate matter?

Because it connects several engineering ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study BIT predicate?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on BIT predicate.

Tags

  • Binary arithmetic
  • Binary relations
  • Circuit complexity
  • Descriptive complexity
  • Set theory

Keep exploring