Algebra Created 2026-09-24 Updated 2026-10-13
Algebra studies equations, algebraic operations, and the structures that make their rules work. Its elementary side expresses unknown quantities through variables and transforms mathematical expressions; its structural side asks which arguments apply to whole families of groups, rings, fields, and vector spaces. The useful step is identifying exactly which properties a calculation needs, so that it can be reused in a new setting.
For example, the polynomial equation over the real numbers factors as , giving roots and . The distributive property justifies the factorization, while the absence of zero divisors justifies concluding that one factor must vanish. Over the finite field , the same integer coefficients reduce to , with roots and . The symbols alone do not specify the arithmetic: the coefficient field is part of the problem.
In a ring with zero divisors, a familiar step can fail. Modulo , all four residue classes satisfy . For , the factorization holds modulo , yet neither factor is zero. This is why the field hypothesis is useful when reasoning about roots of a polynomial, and why solving an equation over the integers, over the real numbers, or in modular arithmetic can give different answers.
The structure is also useful beyond scalar arithmetic. Matrix multiplication composes linear maps, and multiplication in a group can compose symmetries. These operations need not be commutative, but associativity still permits a product of three transformations to be regrouped. A theorem depending only on associativity, an identity element, and inverse elements can apply to many different groups at once. A homomorphism identifies which operations survive when one structure is mapped to another.
Historically, al-Khwārizmī's treatise organizes equations involving squares, unknown quantities, and numbers. Frederic Rosen's 1831 English translation includes the calculation now written and geometric explanations for completing the square. In modern notation, gives or ; the historical treatment seeks the positive quantity . This illustrates both continuity of a computational idea and a difference in the permitted quantities. [ref]
Binary operation Created 2026-09-24 Updated 2026-10-13
A binary operation on a set is a function . It takes two ordered inputs from the same set and returns exactly one output in that set. The codomain is part of the definition: ordinary subtraction is a binary operation on the integers, but not on the positive integers, since leaves that set. Ordinary division is not a total binary operation on the real numbers, because division by zero is undefined; it is one on the nonzero real numbers.
The same set can carry several different binary operations. On , both and return an element of , using modular arithmetic. Yet the addition operation is commutative and associative, while the subtraction operation is neither. Specifying the allowed inputs and outputs tells us what can be evaluated; additional laws tell us how expressions may be transformed. [ref].
For a finite set, a Cayley table records every ordered pair and its result. This turns abstract laws into checkable examples. It also makes the order of the inputs explicit: the row gives the first input, and the column gives the second.
In polynomial modular arithmetic, prime-row binomial coefficient divisibility gives . Multiply by and compare coefficients of for ; the term cannot contribute.
Cayley's theorem 2026-10-14
Every group is isomorphic to a subgroup of the symmetric group on its underlying set. The construction uses the left regular action: each group element becomes a permutation of all the group elements, given by
For a finite group of group order , labeling these elements by gives a group embedding into . The same construction works for an infinite group, with the symmetric group of all bijections of its underlying set.[ref]
The beauty is that the multiplication rule itself supplies a concrete model. Whatever the group elements originally represent, each one rearranges the entire group by multiplication. A product becomes function composition, and no distinctions between group elements are lost. For a finite group, a row of its Cayley table lists the images under one : the multiplication table is already a catalogue of permutations.
Throughout this construction, products of permutations act rightmost first:
Thus first multiplies by , then by . This is a left group action, not a license to reverse the multiplication order in a nonabelian group. Ordinary right multiplication instead satisfies with this convention; replacing it by restores the group homomorphism law.[ref]
For an explicit cyclic group example, take under addition, using modular arithmetic. Its left regular action consists of . In permutation cycles on the labels ,
The function composition sends to , to , to , and to : squaring the four-point permutation cycle produces two disjoint permutation cycles. Also . These four permutations form a cyclic subgroup of , reproducing addition in exactly.
For a nonabelian group example, let , with , , and its identity element. The six group elements are , where and . Now the labels being permuted are themselves permutations of three points. Computing the left regular action gives permutations of these six labels:
For example, ; putting here would accidentally switch to right multiplication. Noncommutativity survives in the model:
These different outputs prove that . The group generators become group generators of a six-element subgroup of .
Figure 1. . Each arrow sends a label to , or to in the additive cyclic group. The top panels show the translations by and in ; the bottom panels show multiplication by and in the symmetric group . Each panel depicts one permutation, decomposed into disjoint permutation cycles. Details.
Why does a group action here produce a group embedding? Any group action on a set gives a group homomorphism ; it is a group embedding precisely when it is a faithful group action. The group kernel consists of the group elements fixing every point of . In the left regular action, , so fixing the identity element already forces . In fact every stabilizer subgroup is trivial, since forces ; this stronger property makes the left regular action a regular group action.[ref]
Compare two group actions of the same cyclic group . Its left regular action on four labels distinguishes all four group elements. On , the rule defines a transitive group action, but and both fix both points, while and both exchange them. Its group kernel is , so it is not a faithful group action. Its image is a two-element subgroup of , isomorphic to the quotient group rather than to .
Figure 2.
A faithful group action preserves all four translations; a two-point group action merges them
. Both panels start with the same cyclic group . The arrows show the group action of its group generator , and the tables show all four resulting permutations. On four points the group kernel is ; on two points it is . Reachability of every point does not imply a faithful group action. Details.
The guaranteed number of labels need not be the smallest possible for a faithful group action. The symmetric group naturally acts faithfully on : a permutation fixing all three labels is the identity element. Its left regular action uses six labels instead. Three is the smallest possible here, since and have fewer than six elements and cannot contain an isomorphic copy of . Moreover, in the natural three-point group action, the stabilizer subgroup of is : a faithful group action can have nontrivial point stabilizer subgroups. Cayley's construction supplies a universal model, while a smaller model can reveal particular symmetries.
The proof is short. Each is a bijection with inverse . Associativity gives
so is a group homomorphism. If , evaluating both at the identity element gives . Hence is injective, and its image is the required isomorphic subgroup. No finiteness assumption entered the argument.
The historical connection is unusually close to the notation. The opening paragraph of Arthur Cayley's 1854 paper already treats permutations as one example of operations on a collection of quantities and explicitly performs the rightmost operation first in a product. It also allows noncommutativity while insisting on associativity. The modern left regular action shows how that viewpoint reaches every abstract group, by choosing the group itself as the set to be acted on.[ref]
Cayley table 2026-10-14
A Cayley table records a binary operation on a finite set: the cell at row , column contains . Every cell must contain an element of the specified set. With the same ordering of row and column labels, the table is symmetric across its main diagonal exactly when the binary operation is commutative. Checking the associative property instead requires comparing with for every triple; symmetry alone cannot establish it.[ref]
Figure 1. . Read the first input from the row and the second from the column. Both tables give binary operations on . The addition table is symmetric; the subtraction table is not. The bottom calculation exhibits a failed associative property for subtraction. Details.
Circulant matrix Created 2026-09-24 Updated 2026-10-14
A circulant matrix applies the same rule at every position of a finite ring: moving both the input and output indices one step leaves its entries unchanged. Its first column determines the whole matrix. For a length- vector , index rows and columns by and define
The indices use modular arithmetic. Thus each column is the previous column shifted down one place, with the last entry wrapping around to the top. Multiplication is exactly circular convolution:
This makes a circulant matrix a natural model for a periodic finite difference rule or a filter acting on a periodic record. Strang's MIT lecture develops this connection between circulant matrices, circular convolution and the discrete Fourier transform.[ref]
For example, the first column gives
Here the indices wrap around modulo four. Each output compares a value with its two neighbors; this is the Graph Laplacian of a four-vertex cycle graph. A constant input gives zero, while an alternating input gives a large response. The Fourier diagonalization of a circulant matrix makes this distinction exact: its four eigenvalues are .
Figure 1.
Fourier eigenvectors of the four-point cycle Laplacian
. Details.
The plotted discrete Fourier modes are complex vectors, shown through their real and imaginary parts. Each entry has modulus one; the Euclidean norm of each length-four vector is two. In particular, modes and have the same real part but opposite imaginary parts, so they are distinct eigenvectors with the same eigenvalue.
The useful surprise is that every length- circulant matrix shares the same basis of eigenvectors, whatever its first column. One change of basis therefore simplifies an entire family of linear maps, instead of requiring a separate eigenvalue computation for each one. Bamieh's tutorial develops the discrete Fourier transform from precisely this simultaneous diagonalization problem.[ref]
Circular buffer Created 2026-10-13 Updated 2026-10-18
A circular buffer stores a changing sequence in a fixed-capacity array, reusing slots by wrapping array indices through modular arithmetic. A front array index and an occupied count can represent a FIFO queue without shifting entries after removal. The physical array stays in place; the position at which its logical sequence begins moves. This makes a circular buffer useful when storage must remain bounded while successive items arrive and leave.
Capacity and overflow behavior are separate choices. A rejecting FIFO queue preserves all accepted items until removal and reports failure on a full insertion. An overwriting circular buffer deliberately discards its oldest item to retain the newest arrivals. These are different application programming interfaces. The existing representation independence example specifies the rejecting policy and gives its abstraction function and correctness argument against a shifting array implementation.
Circular buffer indices Created 2026-10-18 Updated 2026-10-24
Let the capacity be a positive integer , and allocate exactly array slots . Store the front array index and count . The representation invariant is
The logical sequence and next-write array index are
Here denotes the nonnegative remainder from modular arithmetic. The count determines which slots are live: leftover bits in other slots are not members of the FIFO queue. If , has no current front item; it identifies the position where the next successful insertion begins. If , points at a live item, so writing there requires an explicit overwrite policy.
For , enqueue(x) writes , then increments , leaving fixed. For , dequeue() saves and returns , then sets and . These are sequential updates, completed before the next call. A rejecting interface tests or first and returns full or empty, respectively, without changing state. peek returns only when ; size returns .
One can instead store and , recovering . On insertion, advance and increment ; on removal, keep fixed and decrement . Thus the next-write array index is not necessarily the front array index.
Names such as head and tail require checking the actual API: the kernel documentation calls the insertion position head and the removal position tail.[ref]
Figure 1.
A wrapped circular buffer has one logical sequence across the end of its physical array
. Capacity five, front , count , and next-write index . Follow physical slots to read . Slot 1 still shows the removed label , but it is outside the live sequence. Details.
The diagram is the state after step 8 of circular buffer operation trace. Reading the physical array from slot zero would give , which includes a removed label and puts first. Reading from for exactly items gives . The next insertion uses slot , not slot . This distinction also explains why the live sequence may need two contiguous pieces of the array: here slots through , followed by slot . No items need to move to make this wrap work.
Circular convolution Created 2026-10-14 Updated 2026-10-20
Circular convolution of two length- sequences uses modular arithmetic for their indices. Extending both inputs periodically gives the displayed formula. Equivalently, fold a finite discrete convolution into residue classes modulo by adding entries whose indices are congruent. The discrete Fourier transform of the circular convolution is the product of the two discrete Fourier transforms, with the usual unnormalized forward transform and inverse convention.
Commutative ring Created 2026-09-24 Updated 2026-10-14
A commutative ring is a ring in which multiplication satisfies for every pair. The integers and the polynomial ring are examples. So is , the quotient ring whose elements are residue classes in modular arithmetic. We represent these by and reduce each sum or product to its remainder. All following calculations modulo use this convention.
In , , although neither factor is zero. Thus and are zero divisors: nonzero elements whose product with another nonzero element can vanish. Also . Removing the common factor would falsely assert . The entire row for multiplication by is
The repetitions explain the linear congruences directly. The equation has exactly the two solutions , whereas has none. A common factor can erase information, and a nonzero coefficient does not guarantee that an equation has a solution.
Figure 1.
Multiplication modulo 6 repeats outputs, while every nonzero row modulo 5 is a permutation
. Details.
A unit in a ring is an element with a multiplicative inverse, meaning for some . In , the units are exactly and , since . The other nonzero elements, , are zero divisors; for , use . In a nonzero commutative ring, a unit cannot be a zero divisor: multiplying by its multiplicative inverse forces . But a nonzero element need not be a unit or a zero divisor: the integer is neither in .
By contrast, in , every row for a nonzero multiplier is a permutation of . Each such row contains exactly once, giving a multiplicative inverse: , , , and . Hence this commutative ring is a field. For example, now has the unique solution . Reading the tables reveals which algebraic steps the arithmetic permits.
The practical reward of quadratic reciprocity is a smaller modulus: swap a pair of distinct odd primes, record the required sign, then reduce the numerator by modular arithmetic. Use multiplicativity of the Legendre symbol and the second supplementary law for quadratic reciprocity to handle a factor of two. For example,
Here are both modulo , so the first swap changes sign; gives ; the swap involving five has no sign change. An independent square check is . The method determines existence of a square root without itself finding that root.
A composite numerator is allowed in a Legendre symbol; a composite denominator instead calls for a Jacobi symbol. Its Jacobi reciprocity law supports repeated swaps and remainder reductions, in the spirit of the Euclidean algorithm.[ref]
A final Jacobi symbol of one is not a square-existence certificate for a composite number modulus. For example,
yet is impossible: reducing it modulo three would require a square congruent to two, and squares modulo three are only zero or one. The product has hidden two local failures. By contrast, for a prime denominator, a Legendre symbol of one does certify a quadratic residue.
Coprime integers Created 2026-09-24 Updated 2026-10-14
Two integers are coprime when their greatest common divisor is one:
For positive integers, this says that the only positive common divisor is one. For signed integers, use , with absolute values; changing either sign leaves coprimality unchanged. With the convention , zero is coprime precisely to , because . Both are coprime to every integer. [ref]
The word concerns shared prime factors, not whether either input is a prime number. For instance and are coprime composite numbers, even though neither is a square-free integer. Conversely, and are square-free integers but are not coprime. Consecutive integers are always coprime: any common divisor of divides their difference one. Thus provide another pair of coprime composite numbers.
For positive integers, let be the prime support of an integer. The equivalent test is
The set intersection of the two prime supports of an integer must be the empty set. Indeed, any positive common divisor greater than one has a prime factor, and any shared prime factor is a common divisor greater than one. Hence coprimality depends on which prime factors occur, rather than on their prime valuations; replacing either input by its radical of an integer preserves coprimality.
For a list of at least two integers, distinguish pairwise coprimality, requiring every pair to be coprime, from joint coprimality, requiring only the greatest common divisor of the entire list to be one. For example,
No prime factor belongs to all three prime supports of an integer, yet each pair shares one. By contrast, have pairwise coprimality. The distinction is presented by Poritz under the names pairwise and mutually relatively prime. [ref]
Figure 1. . Filled cells mark membership in the prime support of an integer; empty cells mean the prime number does not divide the row label. The first panel has two coprime integers; the middle has joint coprimality but fails pairwise coprimality; the last has pairwise coprimality. The columns exhaust all prime factors of these eight row entries. This original finite arithmetic diagram shows exact divisibility, not sampled probabilities. Details.
One use is simplifying fractions. For a fraction with integer entries and , divide its numerator and denominator by to obtain a reduced fraction with coprime entries. For example, since , and uses the same . A further common divisor would make too small, so the reduction is complete. In particular, the reduced fraction for zero is .
Another use is reversible modular arithmetic: for an integer modulus , an integer has a modular inverse precisely when are coprime. The proof outline uses Bézout's identity: makes a modular inverse, and any inverse relation forces every common divisor to divide one. For example, gives , whereas has no modular inverse modulo . Thus coprimality is the exact condition allowing division by a residue in modular arithmetic. [ref]
Coset Created 2026-09-24 Updated 2026-10-14
For a subgroup of a group , a left coset is ; a right coset is . The name refers to the side on which the representative multiplies . Think of a coset as a translated copy of a subgroup: it remembers the relative differences allowed by , while moving the whole collection to another location in the group.
Two left cosets of the same subgroup are either equal or disjoint. Thus distinct left cosets form a partition of a set covering ; the same statement holds separately for right cosets. The useful membership test is
This also defines an equivalence relation: changing a representative by right multiplication with a member of leaves its left coset unchanged. These facts hold even for infinite groups. See MIT's coset notes, definitions 3.6 and 3.9.
For an explicit additive example, take the cyclic group , with modular arithmetic, and the subgroup . Adding each representative to both members gives exactly
Representatives repeat these three cosets, respectively. For example, , since . Every residue appears once in the displayed partition of a set. Each coset has two members, so the group order of is and its index of a subgroup is . Left and right cosets coincide here because is an abelian group.
Figure 1.
Three cosets of the order-two subgroup of the additive cyclic group of order six
. Details.
A coset need not be a subgroup. In this example, lacks the identity element , and leaves it. In fact, the only left or right coset of that is a subgroup is itself: a subgroup must contain the identity element, and the coset containing that element is . Equal sizes come instead from the bijection , whose inverse is ; for right cosets, use and .
The nonabelian group , the symmetric group on three letters, separates the two sides. Use function composition with the rightmost permutation applied first, and let . Then but , giving the differing pair
The complete partition of a set into left cosets consists of , and ; the complete partition of a set into right cosets consists of , and . Each lists all six permutations exactly once. Both have three parts of size two, although their parts differ.
Figure 2.
Left and right coset partitions in S3 with rightmost-first permutation composition
. Details.
Left cosets support a group action by for every subgroup, as in the coset action. Multiplication of representatives defines a quotient group operation precisely when is a normal subgroup. Otherwise the answer can depend on the representatives: in this example, and represent the same coset , yet and differ. In the additive example, is a normal subgroup, making valid. See MIT's quotient-group notes, theorem 9.1.
Cyclic group Created 2026-09-24 Updated 2026-10-14
A cyclic group is a group that can be generated by repeating a single group element and its inverse element:
For an additive group, the same expression is written : means repeated addition, including subtraction when is negative. A finite cyclic group has a repeating cycle, while an infinite cyclic group is isomorphic to the additive integers. The notation refers to a finite cyclic group of order .
This definition compresses a whole composition rule into one repeatable operation. Once is chosen, , so working with group elements becomes working with integer exponents. In the finite case those exponents are reduced using modular arithmetic. It also proves that every cyclic group is an abelian group, because . A finite cyclic group of order has exactly solutions of for every positive integer divisor of : in exponents, has exactly solutions modulo . The standard finite and infinite models are described in Group Theory (v4.01) by James S. Milne (section 1.16).
Deterministic finite automaton Created 2026-09-24 Updated 2026-10-14
A deterministic finite automaton has exactly one automaton transition for every automaton state and input symbol. Formally, a DFA is a tuple : is a nonempty finite set of automaton states, a finite alphabet, a function, the initial automaton state, and the accepting automaton states. Its unique path on a word accepts if it ends in after consuming the entire input. Visiting earlier does not suffice.
For a concrete binary divisibility automaton, recognize the words whose values in the binary numeral system are divisible by three. Choose , , , and . Each automaton state names the congruence class of the integer read so far. Appending a binary digit changes its value to , so the automaton transition is
The modular arithmetic therefore needs only three automaton states, whatever the input length. The full function is , , , , , and .
Figure 1.
A three-state DFA for binary digits representing integers divisible by three, with accepted and rejected traces
. Details.
For , the successive automaton states are , so the word is accepted. For , they are , so it is rejected. Leading zeros are allowed: they leave the initial automaton state unchanged. We explicitly assign value zero to the empty word, which is accepted because the initial automaton state is accepting. This is a convention for a formal language, rather than a claim that ordinary written numerals include a blank numeral.
The generator checks every word of up to eight binary digits, comparing the final automaton state with the integer value modulo three. Each length includes all words, preserving leading zeros as distinct inputs:
Length Words checkedAccepted by the DFAValues divisible by three
0111
1211
2422
3833
41666
5321111
6642222
71284343
82568686
All 511 checks agree. They are useful for catching a reversed arrow or mistaken label, but the reason the DFA works at every length is its invariant: after reading any word of value , its automaton state is . The update preserves that statement by mathematical induction. Through the extended transition function of a deterministic finite automaton, this becomes .
Divisibility Created 2026-09-24 Updated 2026-10-18
For integers , divides when multiplication by some integer takes to :
Then is a divisor of , and is an integer multiple of . The notation means that no such integer exists. For , this is equivalent to saying that the quotient is an integer, or that Euclidean division by leaves remainder zero.
For example, because , whereas because . Signs do not change divisibility: because , and because . In general, changing the sign of either input preserves the relation.
The definition here permits zero as either input. Every integer divides zero, since . In particular, ; however, whenever , since is always zero. This is a statement about multiplication, and assigns no meaning to division by zero: remains undefined.
Two useful properties come directly from the defining multiplication. Divisibility is a reflexive relation, since , and a transitive relation: if and , then . Moreover, a shared divisor divides every integer linear combination:
Indeed, writing and gives . For example, and imply . This small observation explains why the Euclidean algorithm preserves common divisors, and why Bézout's identity can certify a greatest common divisor.
On the positive integers, divisibility is a partial order: if and , then . The restriction matters, since and although . The prime factorization viewpoint makes this order concrete: exactly when every prime valuation of is at most the corresponding prime valuation of . Thus one relation connects equal grouping, prime factorization, and modular arithmetic.
Book VII, definitions 3 and 5 of Euclid's Elements describe the corresponding positive-number relation through one number measuring another and through integer multiples. The sign and zero conventions above belong to the present integer formulation, rather than to those ancient definitions. [ref]
Endomorphism Created 2026-09-24 Updated 2026-10-14
An endomorphism is a morphism : its source and target are the same object, with the same specified structure. For a group it is an operation-preserving group homomorphism back into that group; for a vector space it is a linear endomorphism; for a ring it is a ring endomorphism. A self-map must satisfy the chosen compatibility conditions to qualify. The notation records the category in which these conditions are imposed. See Riehl, Category Theory in Context, Definition 1.1.10 and the following paragraph.
An endomorphism can lose information or miss part of its target. On the additive integers, preserves addition and is injective, but is not surjective: no integer maps to . On the vector space over the real numbers, the linear endomorphism loses the second coordinate, so it is neither injective nor surjective. Neither is an automorphism. The same doubling rule becomes a group isomorphism when its target is the additive even integers, as explained under isomorphism.
The finite cyclic group offers a small example of information loss that can be drawn completely. With addition in modular arithmetic, the endomorphism sends the inputs to . Its image of a group homomorphism is and its kernel of a group homomorphism is . Each reached output has two inputs; the other three outputs are missed.
Figure 1.
Two endomorphisms of the additive cyclic group modulo six
. Every arrow maps an input to its output, rather than taking one step of repeated addition. The endomorphism collapses pairs; the group automorphism is a bijection. Orange marks the kernel of a group homomorphism in each panel. Source. Details.
For an endomorphism of a group or ring with a finite underlying set, injectivity is equivalent to surjectivity by counting; either condition makes it an automorphism. The additive integers example shows why the finiteness assumption matters. A linear endomorphism of a finite-dimensional vector space also has equivalent injectivity and surjectivity, this time by the rank-nullity theorem even when its underlying set is infinite.
Self-maps can be iterated without changing the object: , , and so on. Composition in a category and the identity morphism make the endomorphisms of a fixed object in a locally small category into a monoid. This packages repeated compatible operations, including irreversible ones, into a single structure.
The general language has a documented historical milestone in the 1945 paper of Samuel Eilenberg and Saunders Mac Lane. They defined categories of objects and compatible maps, and distinguished maps admitting inverses within that category. Their examples included groups, vector spaces, and topological spaces. This gave a common framework for compatible self-maps and their invertible cases. See Eilenberg and Mac Lane, General Theory of Natural Equivalences, pp. 234 and 237–239.
Equivalence relation Created 2026-09-24 Updated 2026-10-14
An equivalence relation says which set elements should count as the same for a particular purpose. In modular arithmetic, for example, distinct integers with the same remainder are equivalent. The relation gathers interchangeable set elements into equivalence classes; the quotient set then treats each whole equivalence class as one object.
Formally, an equivalence relation on a set is a binary relation , written , satisfying three conditions for all :
These conditions make the equivalence classes a partition of a set: each set element belongs to exactly one class. [ref]
For a worked example, take the finite set and restrict integer congruence modulo three to :
Reflexivity follows because . The symmetric relation property follows by changing the sign of a difference, and transitivity follows by adding and : divisibility by three is preserved in both steps. Thus and force . The three equivalence classes are , and . Their members alternate along the number line; membership in an equivalence class need not mean being close together.
Figure 1.
Congruence modulo three divides the integers from zero through eight into three equivalence classes
. Details.
The transitivity requirement rules out a tempting alternative. On , define nearness by the absolute value condition . This binary relation is reflexive and symmetric, but is near and is near while is not near . Its neighborhoods , and overlap without being equal. They are not equivalence classes or a partition of a set.
Exclusive or Created 2026-09-28 Updated 2026-10-20
Exclusive or returns one exactly when its two input bits differ. Its truth table gives , , , and . The identities
express exclusive or using logical conjunction, logical disjunction, and logical negation. The first expression accepts at least one input and then excludes both; the second explicitly lists the two accepted input pairs.
For numerical bits, exclusive or is addition in modular arithmetic modulo two:
The binary operation is commutative and associative, because addition modulo two has those properties. It satisfies , , and . These identities explain why a bit can be toggled and restored with the same operation.
On binary strings of equal length, bitwise exclusive or applies the one-bit rule separately at each position. For example,
A bit mask of toggles exactly the middle two bits. Applying the mask twice restores the original binary string: each selected bit changes twice, and each unselected bit stays fixed. This positional operation is distinct from taking the exclusive or of the overall truth values of two integers.
Fermat number Created 2026-10-07 Updated 2026-10-13
A Fermat number is the positive integer , indexed by a nonnegative integer . The first five are , all prime numbers; the next is the composite number . This family offers a compact lesson in number theory: a very persuasive finite pattern can fail, while an exact divisibility relation settles a gigantic case with little computation.
Figure 1.
Exact Fermat numbers: five initial primes, a composite sixth term, and rapidly increasing decimal lengths
. Details.
Why does the exponent itself have the form ? Suppose is a positive integer with an odd integer factor . The polynomial factorization shows that is a proper divisor of . Consequently, if is a prime number, must be a power of two. That is a necessary condition, rather than a promise that the surviving candidates are prime.
The Fermat number product identity makes distinct Fermat numbers coprime integers. Thus every term has a prime factor absent from all earlier terms, whether or not that term is itself a prime number. This gives an explicit route to infinitely many different prime numbers, without establishing that infinitely many terms of this particular sequence are prime. Meanwhile the prime divisor of a Fermat number criterion filters possible factors through a small multiplicative order calculation.
The family also links arithmetic to Euclidean geometry: a constructible regular polygon can have a number of sides equal to a power of two times a product of distinct Fermat primes. The Gauss-Wantzel theorem gives the precise criterion. For instance, and qualify, but does not. The word "distinct" matters. Carl Pomerance describes this connection in Primality testing: then and now by Carl Pomerance (slide 18).
Historically, Leonhard Euler records Pierre de Fermat's proposed primality pattern, then refutes it by finding the factor of . His paper was presented in 1732 and published in 1738; those are different events, not competing dates for one publication.[ref]
A short modern check needs only two representations of :
In modular arithmetic these give and . Substitution yields , so . This verifies the factor directly; it does not claim to reconstruct Euler's search process.