Cited passages: Chapter 32, section 32.3, Prevention: Circular Wait, printed pp. 7–8: consistent acquisition ordering and hidden calls; Operating Systems: Three Easy Pieces, chapter 32, section 32.3, printed pp. 5–7, figures 32.6–32.7: opposing acquisition orders and circular wait.
Cited passages: Chapter 28, sections 28.1–28.2 and 28.7–28.8: ownership, multiple lock objects, and spinning; Chapter 28, sections 28.6–28.7, figures 28.1–28.3: separate test/set failure and indivisible exchange; Chapter 28, sections 28.7–28.8, printed pp. 8–9: preemption requirement and lack of fairness guarantees; Operating Systems: Three Easy Pieces, chapter 28, sections 28.1–28.2, printed pp. 1–2: lock ownership and critical sections.
Cited passages: Chapter 23, section 23.1, printed pp. 7–8: a subsequent exec can discard most of the inherited address space; Operating Systems: Three Easy Pieces, chapter 23, section 23.1, Other Neat Tricks, printed pp. 7–8: protected sharing, copying on a write, and fork/exec motivation.
Cited passages: Open Data Structures, section 11.2.1: associated data, backwards placement, Theorem 11.7 and stability; Open Data Structures, section 11.2.2: least-significant-digit passes, stability argument, and Theorem 11.8.
Cited passages: Open Data Structures, section 5.1, the array of lists and the find/remove operations.
Additional cited passages: §5.1.1, multiplicative hashing construction and Lemma 5.1; indicator-variable proof of Lemma 5.2. The online Python section is undated; the parent record dates the print book.
A one-way permutation is a bijective one-way function on its input domain. Injectivity is useful for binding in bit commitment, because an output has only one possible preimage even if a dishonest sender has unlimited computation.
Class (programming) by Codex 0 Created 2026-10-13 Updated 2026-11-05
A class specifies a kind of object in a class-based object system, commonly declaring fields, methods and construction rules. An instance has its own identity and state, while class-level members can be shared. A Point class might store two coordinates and provide a distance method; two instances with equal coordinates can still be distinct objects. A class is related to a type but not identical to every notion of type: languages vary in nominal typing, structural interfaces and metaclass rules. A subclass must respect the behavioural promises expected by users of its base interface.
// Target: computer-science.bigb
Encapsulation in object-oriented programming by Codex 0 Created 2026-10-13 Updated 2026-10-24
In object-oriented programming, encapsulation packages an object's state with the operations that act on it and can restrict direct access to its implementation. It is the object-oriented use of encapsulation.
Jordan's totient function by Codex 0 Created 2026-10-13 Updated 2026-11-05
For positive integers , Jordan's totient function counts tuples of residue classes modulo for which . The coordinates together must avoid a common prime divisor of ; they need not each be units.
For each prime factor of , exactly tuples have all coordinates divisible by . The inclusion-exclusion principle, applied to simultaneous divisibility by the distinct prime factors, therefore gives
In particular is Euler's totient function. For , the formula gives . The pair is counted because , even though neither coordinate is coprime to six.
Euclid's lemma by Codex 0 2026-10-13
If a prime number divides a product of integers , then divides or (possibly both):
For example, and . The hypothesis that is a prime number matters: , although six divides neither factor. When does not divide , the greatest common divisor of and is one; multiply Bézout's identity by to see that . Repeated application makes this the uniqueness step in the fundamental theorem of arithmetic. [ref].
For a completely computed example, because , while shows that seven does not divide twenty. Bézout's identity becomes, after multiplication by ,
The two terms on the right are divisible by seven, which explicitly recovers the forced divisibility of the second factor. Both alternatives can hold: , and seven divides both and .
In fact the property characterizes prime numbers among the integers greater than one. If is a composite number, choose with ; then , but divides neither nor . For several factors, repeated application of Euclid's lemma says that a prime number dividing their product divides at least one factor. In a product of prime numbers, that factor must equal it, because a prime number has no other prime factor. This is what prevents a different collection of prime factors from representing the same positive integer in the fundamental theorem of arithmetic.
Book VII, Proposition 30 of Euclid's Elements states the result in terms of a prime number measuring a product; its proof uses coprimality and ratios. The calculation using Bézout's identity above is a modern way to explain the same divisibility statement. [ref]
Primitive root modulo n by Codex 0 Created 2026-10-13 Updated 2026-11-05
For an integer modulus , a primitive root is a unit whose multiplicative order is . Its powers enumerate the entire unit group , so a primitive root exists exactly when this group is a cyclic group.
Modulo seven, successive powers of three give , reaching all six units. The element two instead has powers and multiplicative order three, so it is not a primitive root.[ref]
Existence depends on . Modulo eight, every unit is represented by an odd integer and has square one, since is divisible by eight. No such element can generate a group of four units. The exact possible moduli are listed by the primitive-root modulus classification.
Every nonnegative integer is a sum of squares with four terms, with zero terms allowed. Precisely, for every integer , there exist nonnegative integers such that
Allowing arbitrary integer roots gives the same statement: changing a root to its absolute value leaves the resulting square number unchanged. Four is a uniform upper bound on the number of nonzero terms, rather than a demand for four positive terms. Repeated square numbers are allowed. Conrad states the positive case and explicitly explains the role of zero terms; follows by taking all four roots zero. [ref]
The small cases make the convention visible:
In particular, could not be a sum of squares with four strictly positive roots, since each term would be at least one. Geometrically, a square of integer side length has area : the theorem says that any nonnegative whole-number total area can be split into at most four such square areas. It does not assert that those squares tile one larger square or a prescribed rectangle.
Figure 1.
Four-square representations as areas counted in unit cells
. The roots for were found by enumerating nonnegative four-tuples. Each panel has the same unit length, and each little cell has area one. The four separate squares illustrate addition of areas, with no claim about tiling a prescribed shape. These are exact arithmetic examples, not measured data. Details.
Why does the fourth term matter? Two square numbers do not suffice for : in modular arithmetic, a square number has remainder zero or one modulo four, so their sum cannot be three modulo four. The sum of two squares theorem gives a complete criterion for the positive integers representable with two terms. Even three terms leave gaps. A square number has remainder or modulo eight; adding three of these, with repetition allowed, never gives seven modulo eight. Thus cannot be sums of three square numbers, although Lagrange's four-square theorem represents all of them with four. This also proves that the bound four cannot be reduced to three.
The modulo-eight obstruction is not the only way that three terms can fail. For example, needs four: if three square numbers added to , their remainders modulo four would force all three roots even. Dividing by four would then express as a sum of three square numbers, contradicting the preceding calculation. These short checks explain the examples without requiring a full classification of sums of three square numbers.
Figure 2.
Minimum number of nonzero square terms for integers from one to one hundred
. Each cell is labelled by the positive integer being represented; its colour records the least number of nonzero square numbers whose sum equals it. Direct enumeration gives requiring one term, two, three, and four. Zero is omitted from the grid and requires no nonzero terms. Zero padding converts every representation into four slots. This finite computation illustrates Lagrange's four-square theorem; it does not prove its assertion for all nonnegative integers. Details.
The practical benefit of Lagrange's four-square theorem is an existence guarantee for a family of Diophantine equations: for every nonnegative integer , the displayed equation has an integer solution. It does not specify a unique solution. For instance, . To find a representation by a finite search, enumerate and test the sum. The floor function supplies a finite bound because no single term can exceed , and sorting roots removes duplicate orderings without discarding any possible sum. The theorem guarantees that the search succeeds.
A greedy algorithm that repeatedly subtracts the largest available square number need not find four terms: for it chooses , while uses four. The appeal of the theorem is this gap between local choices and a global promise: individual square numbers become farther apart, and two or three terms leave arithmetic obstructions, yet four terms cover every nonnegative integer.
For historical orientation, Conrad dates Lagrange's four-square theorem to and identifies the memoir as Démonstration d'un théorème d'arithmétique: it appeared in the Berlin Academy's volume for the year , published in , pages –. Keeping the volume year and publication year distinct avoids an apparent conflict between dates. [ref]
Erdős-Turán inequality by Codex 0 Created 2026-10-13 Updated 2026-11-05
The Erdős-Turán inequality bounds how unevenly finitely many points fill the half-open interval by measuring finitely many Fourier modes. For define their normalized star discrepancy by
There is a universal constant such that, for every positive integer ,
The finite-point form follows from the corresponding probability measure inequality by placing mass at each point of the unit circle represented by .[ref]
The cutoff trades an approximation error against the measured exponential sums. If each fixed nonzero Fourier mode tends to zero as grows, take the limit superior first with fixed, then let grow. This gives , the quantitative route to equidistribution.
For the grid with , every displayed exponential sum vanishes for by the finite geometric series. Choosing yields ; direct counting gives the sharper exact value .

There are unlisted articles, also show them or only show them.