Axis-aligned bounding box 2026-10-14
An axis-aligned bounding box is a Cartesian product of closed intervals aligned with a chosen Cartesian coordinate system:
Only the two opposite corners and need to be stored. In two dimensions it is a rectangle. Changing the Cartesian coordinate system can change how tightly the axis-aligned bounding box fits the same object.[ref]
For a nonempty finite set of points , the smallest such axis-aligned bounding box has
These minimum and maximum values also enclose the convex hull of : each coordinate of a convex combination lies between the smallest and largest input coordinates. In particular, three vertices of a polygon determine the axis-aligned bounding box of a filled triangle. For a general nonempty compact set, the same formulas use all its points; inspecting only an arbitrary finite sample is insufficient.
Given nonempty boxes and , the closed interval convention gives
Equivalently, reject as soon as or in any coordinate. The surviving set intersection has endpoints and . This is an exact box test, while its conclusion about enclosed objects remains a conservative enclosure test.[ref]
Equality counts as touching: and share an edge, so their set intersection is nonempty. Replacing every in the overlap formula by tests intersection of the interiors of full-dimensional boxes and excludes this contact. A zero-width closed interval can represent a point or a lower-dimensional enclosure, and must not automatically be discarded when touching counts. A box with some is empty; test emptiness before applying rules intended for nonempty boxes. The broad phase must retain touching candidates whenever the narrow phase counts touching as a hit.
For nonempty boxes, the smallest enclosing axis-aligned bounding box of their set union is
This operation supplies the parent boxes in a bounding volume hierarchy. It is an enclosure of the set union, rather than generally the set union itself. In floating-point arithmetic, comparisons are conclusive only for endpoints that still enclose the intended exact objects; use certified bounds such as interval arithmetic with outward rounding when that guarantee is required.
// Target: analysis.bigb
Belief state 2026-10-25
Without a prior probability distribution, a belief state is the set of physical states still compatible with an observed history. If the physical search transition model is deterministic, , and the sensor map is , action followed by observation gives
For a set-valued outcome relation, replace the image by the set union of all possible successors before filtering. A guaranteed-success goal test requires every member of the surviving belief state to satisfy the physical goal. A probabilistic belief is instead a posterior probability distribution, requiring a specified prior and observation law.
Events turn Boolean operations into operations on sets. For a die with sample space , let be the event “even outcome” and the event “outcome at least four”. At outcome , use the indicator functions and . Then
Thus logical conjunction becomes set intersection, logical disjunction becomes set union, exclusive or becomes symmetric difference, and logical negation becomes the complement of a set within . Outcome four satisfies both events, so inclusive logical disjunction includes it and exclusive or excludes it. If the die is fair, these four events have probabilities , , , and , respectively. No assumption of independent events is needed for the set identities; indeed and here are not independent, since .
If the members of a possibly infinite set family have size at most , there is a finite subset of size at most with exactly the same hitting sets of size at most . Use mathematical induction on . For nonempty , choose . When this one member suffices. Otherwise, for each , retain an inductive kernel for at parameter , and take their set union together with . Its size is at most . A hitting set for this kernel meets at some ; meets the kernel for , hence all of , while meets the other members of . If is empty no hitting set exists, and if is empty its kernel is empty. Only finite branching is used, so no finiteness assumption on is needed.
Bounding volume hierarchy 2026-10-14
A bounding volume hierarchy is a data structure arranged as a rooted tree: leaves store objects, and each internal node stores a bounding volume enclosing its children in a rooted tree. Consequently, every node encloses all objects in its subtree. A common choice is a binary tree of axis-aligned bounding boxes. The objects assigned to sibling subtrees can be different even when their bounding volumes overlap.[ref]
Here is an exact two-dimensional example. Use the triangles from bounding volume, together with having vertices of a polygon and having vertices of a polygon . Group under , and under . Their parent axis-aligned bounding boxes and the box at the root of a tree are
The diagram shows all seven nodes. Taking the coordinate-wise minimum and maximum of the two child boxes constructs each parent box; the resulting box contains the set union of the children, and can also contain empty space between them.
Figure 1.
Four exact triangles, their enclosing boxes, and a seven-node bounding volume hierarchy arranged as a binary tree
. Details.
A bounding volume hierarchy traversal starts at the root of a tree and discards a subtree when its bounding volume misses the query. Accepted internal nodes expose their children; accepted leaves supply candidates for actual shape tests. Box2D's official Collision: Dynamic Tree describes axis-aligned bounding box region queries that return overlapping leaf boxes. A query box that bounds a different query shape can produce additional false candidates.
For the closed query rectangle
left-first depth-first search tests the node boxes in order: root, , , , . The first four overlap ; does not, because its smallest -coordinate is . Pruning skips both and . Five box tests leave two broad phase candidates. The narrow phase rejects , since throughout , and accepts : the point belongs to both and . There are two detailed shape tests and one true hit.
Figure 2.
An exact rectangle query prunes the right subtree and leaves two box candidates but only one triangle hit
. Details.
For a query asking for all intersections, time complexity depends on the number of visited nodes and the cost of each candidate shape test. With fixed dimension and constant bookkeeping cost per node, the work is
where counts candidate objects and is Big O notation. A balanced binary tree has small height of a binary tree, but a query can enter both children at every level. In this example a query containing visits all seven nodes and tests all four triangles. More generally, a full binary tree with single-object leaves has nodes, so such a query takes work for constant-cost shape tests even when its height of a binary tree is . Listing hits itself requires outputs. Small height alone gives no unconditional logarithmic query bound.
For collision detection between two bounding volume hierarchies, traverse pairs of nodes: reject disjoint pairs of bounding volumes, expand a nonleaf member of an accepted pair, and apply the narrow phase at accepted leaf pairs. A single collection's self-query must exclude pairing an object with itself and avoid duplicate unordered pairs. If every object overlaps every other object, reporting all pairs already requires results. Construction quality, empty space in boxes and the queries determine how much pruning is useful.[ref]
For a short correctness outline, an object is enclosed by its leaf box, and each child box is enclosed by its parent box. Repeated subset relations carry this property to every ancestor. A true query intersection therefore prevents rejection at every ancestor of the object's leaf. Updating leaf boxes after motion also requires restoring all affected ancestor bounds before querying.
Capture-recapture model 2026-10-14
A capture-recapture model is a statistical model for repeated observations of identifiable individuals, including those missed on some occasions. A closed-population capture-recapture model estimates a fixed population cardinality; models allowing individuals to enter or leave can instead describe survival and recruitment. The sampling assumptions determine which likelihood function is appropriate.
For the two-sample closed-population capture-recapture model, condition on the sample sizes and . If the second sample selects distinct individuals from by simple random sampling, then the overlap has the hypergeometric distribution:
Here is an integer and the probability mass function is zero outside these bounds. The binomial coefficients count choices of marked and unmarked individuals, divided by all equally likely size- subsets. The hypergeometric distribution has expected value
Equating the observed overlap with this expected value gives the Lincoln-Petersen estimator. The underlying sampling without replacement, probability mass function, and expected value are developed in Raymond P. Guiteras, MIT 14.30 hypergeometric distribution handout, §§1–4 and 8.
For the toy counts , , and , hold the observations fixed and vary the unknown integer . The likelihood function is
Values below forty cannot contain the observed set union. Exact comparison of consecutive likelihoods gives two tied maximum-likelihood estimates, and . The Lincoln-Petersen estimator returns ; the Chapman estimator returns and is a different rule for estimation.
Figure 1.
Relative likelihood for the toy overlap: integer maxima at 99 and 100, ratio estimate 100, and Chapman estimate 90
. Details.
The vertical scale is . This relative likelihood compares how well candidate statistical parameters explain the same observations; it is not a posterior probability. The displayed range is only a plotting window. The likelihood function remains positive for every integer and tends to zero as increases, so the curve has a continuing right tail. The data do not justify truncating statistical inference at three hundred. The conditional hypergeometric distribution formulation also appears in Louis-Paul Rivest and Mamadou Yauck, Small Sample Estimators for Two-way Capture Recapture Experiments, §3, equation (5).
Zero recaptures require care. With and positive , the Lincoln-Petersen estimator has no finite ratio, but the capture-recapture model still gives a valid likelihood function:
This likelihood function increases toward one as grows, so there is no finite maximum-likelihood estimate. For the same sample sizes twenty and twenty-five with zero overlap, forty-five distinct individuals would be observed. Lack of overlap supplies a lower bound but very weak information about large population cardinalities.
In more elaborate capture-recapture models, a first-recapture array counts individuals released at occasion and next observed at . A probability of survival and a probability of detection contribute a no-observation continuation factor . The resulting likelihood function depends on both survival and detection; these probabilities need not be separately identifiable at the last observation interval. Missing-count EM for capture-recapture describes one way to fit such a model, and identifiability remains a separate issue from computing an estimator output.
Characteristic vector of a set Created 2026-09-24 Updated 2026-10-14
For , the characteristic vector has coordinate equal to one exactly when . Under this identification, set union becomes coordinatewise Boolean OR.
Constructive solid geometry describes a solid by combining primitive regions with Boolean set union, set intersection and difference. With primitive defining functions nonpositive inside, minimum implements union and maximum implements intersection. These formulas encode membership rather than signed distance functions. Solid modellers often regularize Boolean operations to remove isolated lower-dimensional remnants.
Assume exactly two operating-system processes, initially resident private memory pages of bytes each, initially distinct page frames shared by A and B. Neither unmaps, exits, forks again, or encounters page replacement; no other owner exists, allocation succeeds, and a first write copies one whole shared memory page. Once a page frame is exclusively owned it is reused on writes, without another copy; writable mappings remain writable. Count data storage only, excluding page tables and other bookkeeping. With B as the only writer, writing distinct memory pages gives
This depends on distinct written memory pages, not the number of store instructions or reads. For the diagrams, take and an illustrative bytes:
Access patternNew page framesWhole-page copiesResident data bytes
Both only read0012288
B writes memory page 0x12 once1116384
B writes memory page 0x12 one hundred times1116384
B writes memory pages 0x12 and 0x142220480
B writes all three memory pages3324576
B then A each write memory page 0x121116384
For both writers, let be the sets of initial memory page numbers written by A and B. Under these assumptions, new allocations and copies both equal , the cardinality of their set union, while resident data storage is . Each initially shared page frame needs at most one split: after the first writer copies it, the other owns the original exclusively. Both writing the same memory page therefore produces two versions with one copy, even if the final values happen to match. The last row can incur two protection page faults, one for each writer, while making only one copy. A handler that always allocates on a protected write can make a second copy and free the now-unreferenced original: allocation counts and final resident storage are different observables.
These are model counts, not measured Linux costs or a guaranteed bound on total computer memory. More descendants, other owners, demand paging, page replacement, different memory page sizes, and different exclusive-ownership rules change the accounting. The useful claim is conditional: deferred data copying can cost in proportion to the distinct shared memory pages that are written, while creating separate page tables has its own cost.
// Target: computer-science.bigb
Exact cover 2026-10-20
Given a set and a family of its subsets, an exact cover selects members of that family so that each element of belongs to exactly one selected member. Thus the selected members are disjoint sets whose set union is . Anchoring a recursive choice at the smallest uncovered element avoids counting a cover in different orders.
Expectimax 2026-10-25
A game tree evaluation rule using maxima at the controlled player’s decision nodes and expected values at chance nodes:
respectively. Terminal utilities fix the boundary values. These rules exactly optimize a finite-horizon expected utility objective by backward induction. For cyclic infinite-horizon reachability problems, a finite Markov decision process formulation and value iteration replace naive expansion of an infinite game tree. Start with one at successful terminal states and zero elsewhere, keep terminal values fixed, and apply the maximizing/expectation backups repeatedly. The th iterate is the greatest success probability achievable within transitions, by backward induction. These values are nondecreasing and bounded by one. For every policy, eventual success is the increasing set union of success within finite horizons, so its probability is the limit of those finite-horizon probabilities. Taking the supremum over policies and horizons in either order proves that the iterates converge to the optimal eventual-success probability. The limiting fixed-point equations can also admit larger solutions, so the initialization from terminal-success indicators matters.
A useful finite conjunction of closure assertions requires empty set, pairing, set union, set difference, Cartesian products, all finite tuple domains , and the following operations on their relations: relative complements, intersections, coordinate projections and pullbacks along finite coordinate maps, together with equality and membership restricted to . The arities and maps are quantified objects, so these requirements form finitely many first-order formulas, not an infinite schema. In a transitive set, individual finite tuples exist by pairing and union, making the tuple-domain assertions correct externally. Atomic truth relations, Boolean operations and projection then compute the truth table of each coded first-order formula correctly by finite induction. Thus satisfaction for a set structure and the relation are absolute for shared arguments. Every nonzero limit level of the relative constructible hierarchy is closed under these operations, since each result can be defined at finitely many subsequent stages.
Hall allocation model 2026-10-14
In a unit-capacity assignment problem, left vertices represent demands and right vertices represent individually usable resources; an edge records compatibility. All constraints must be encoded by those allowed pairs and by using each resource at most once. Hall's marriage theorem decides feasibility. Costs belong to an additional mathematical optimization problem; precedence between jobs or requirements for consecutive slots need additional modelling.
The authored Notes on the design of a conference scheduler by David R. MacIver (Implementation, 7 August 2022) illustrates a Hall obstruction with four talks confined to three slots. With one talk per slot, that subset has size four and a graph neighbourhood of size three. An unused slot outside its graph neighbourhood does not remove the bottleneck. In the three-job example above, the same scheduling model instead has two complete assignments.
The allocation exercise in Graph Theory by Reinhard Diestel (Matching, Covering and Packing, printed p. 20, Exercise 9) asks for disjoint subsets of prescribed nonnegative integer sizes . Replace demand by left vertices with allowed resource set . Hall's marriage theorem gives exactly the condition
For a numerical instance, let , , and . The separate demands and their combined demand fit, and works. Raising to two leaves both individual tests valid but demands four distinct resources from a set union of size three. This is the same collective obstruction with repeated demand vertices.
Represent a finite set by a list of its elements. Allowing repeated elements makes set union cheap by list concatenation; imposing uniqueness requires membership checks. A representation sorted by a total order and containing no duplicates permits set union and set intersection by a simultaneous scan in linear time. These are different representation invariants for the same abstract set.
Mark and recapture 2026-10-14
Mark and recapture estimates the cardinality of a finite set of individuals when counting everybody is impractical. The useful information is the overlap between observations: with fixed sample sizes, finding many of the same individuals again suggests a smaller population, while finding few suggests a larger one. More elaborate capture-recapture models also estimate survival and changing probabilities of detection.
In a closed-population capture-recapture model, let be the unknown population cardinality. Capture distinct individuals, mark them, release them all, and allow them to mix with the rest. Next take a second sample of distinct individuals using sampling without replacement, and count the individuals carrying a mark. The observed marked fraction estimates the population's marked fraction , giving the Lincoln-Petersen estimator
Release happens between the two samples; sampling without replacement means that an individual is counted at most once within the second sample. See Richard J. Barker, Open Population Mark-Recapture Models, §1.1.1.
For a constructed teaching example, mark individuals and later capture , including marked individuals. One fifth of the second sample is marked, suggesting that the twenty marked individuals are one fifth of the population:
Let and be the sets of individuals in the first and second samples. Their intersection has cardinality five. By the inclusion-exclusion principle, the set union contains
Thus is an observed lower bound, whereas is the output of an estimator based on the capture-recapture model. These are toy counts, not measurements from a medical or ecological study.
Figure 1.
Forty distinct observed individuals: fifteen in the first sample only, five shared, and twenty in the second sample only
. Details.
The diagram shows only observed individuals. It does not draw an assumed population of one hundred. The capture-recapture model uses the overlap to infer how many individuals may have escaped both samples; its likelihood function shows why one estimator output cannot describe all that uncertainty.
Measurable Hall theorem Created 2026-10-05 Updated 2026-10-14
For finitely many Lebesgue measurable sets and nonnegative demands , pairwise disjoint measurable subsets with exist exactly when for every index subset . Necessity is additivity and monotonicity of Lebesgue measure. For sufficiency, partition the set union into membership cells , send flow from a source through demand vertices to cells with , then to a sink. Source capacities are , cell capacities are , and intermediate capacities are . Every cut of a flow network has capacity at least by the assumed inequalities. The max-flow min-cut theorem provides the allocations, and divisibility of Lebesgue measure turns each cell allocation into disjoint pieces. If , all can simply be empty.
Minkowski addition Created 2026-10-06 Updated 2026-10-14
The Minkowski sum of subsets of a vector space collects the result of vector addition for every possible pair:
Think of fixing a point of , making a translation of the whole of by , and then taking the union of these copies over every . The points of specify displacement vectors; they need not be the centre of a shape. Minkowski addition applies to nonconvex sets too. It is different from set union: for on the real line, but .
For axis-aligned rectangles in the Euclidean plane, the coordinate intervals add separately:
Every coordinate between and can be split into one coordinate in and another in , and likewise for the vertical coordinate. Thus a rectangle plus a rectangle gives a square of area , although the two input areas total only . The Minkowski sum adds possible displacements, so its area need not be the sum of input areas.
For closed Euclidean disks centred at the origin, the triangle inequality gives . Conversely, if , split any as . Therefore , including the case . Disks of radii and give a disk of radius , with areas . For disks with centres , the resulting centre is . These two examples lead to the root-of-area comparison in the Brunn-Minkowski theorem.
Figure 1.
Minkowski addition of two rectangles and of two closed disks: exact toy shapes, sample displacement arrows, and the square-root-of-area comparison
. Details.
Minkowski addition is commutative and associative because vector addition is. Its identity is the singleton , and . For displacement vectors and , translations and uniform dilations satisfy
where uses scalar multiplication. A Minkowski sum of convex sets is convex: a line segment between and is obtained by adding the corresponding points of the line segments in and . Closure requires care; see sum of two closed sets need not be closed and sum of a compact set and a closed set.
For each user define its set of eligible ads by
This uses the intersection of demographic-group memberships: belonging to one advertised group suffices, because the eligibility condition is a set union. A user in several groups still receives at most one ad.
A direct algorithm is to process users independently. For user , scan ads until finding one for which some group belongs to both and . Assign that ad and stop processing this user. If no such ad exists, leave the user unassigned. There is no upper bound on the number of different users who can receive the same ad, so these decisions do not compete for an ad resource.
For correctness, every produced impression has a shared permitted group, and the stopping rule assigns at most one ad to each user. Conversely, a user with cannot receive an ad in any feasible solution. Since every other user can contribute at most one impression, every feasible solution has value at most
The algorithm attains this bound, proving
Represent each membership set by a length- array of Boolean variables. Testing one user-ad pair costs , so all tests and input setup take time in Big O notation, which is polynomial time in all three parameters. For positive , this simplifies to .
A maximum flow formulation gives the same result if desired: add edges with flow network edge capacity , with flow network edge capacity exactly when , and with flow network edge capacity . By the integral max-flow theorem, an integral maximum flow selects valid impressions. Setting the last flow network edge capacity to would impose an extra restriction absent from this paper.
Put and define six closed half-spaces . Their implicit equations and outward normal vectors are:
BoundaryDefining function Outward normal
The six vertices of a polygon traverse the boundary counterclockwise. Each displayed normal vector therefore points to the right of the corresponding directed boundary line segment; it need not be a unit vector. The zero level sets are full straight lines, while the actual boundary retains only the appropriate line segments.
The inward corner at prevents using the set intersection of all six half-spaces: that would incorrectly discard the upper-left part of the seat. Instead take
The last factor permits either or , removing only the upper-right region. Another way to understand the same constructive solid geometry model is as the set union of two convex polygons, obtained by distributing the last set intersection over this set union. Its constructive solid geometry tree has an intersection at the root and a union child for .
Figure 1.
Seat profile, six supporting lines with outward normals, and the right child of the initial bounding box
. Details.
The tight axis-aligned bounding box is . Bisect vertically at , giving a right child . For a scalar implicit function representing the same constructive solid geometry solid, use
With the convention inside, set intersection corresponds to the maximum, and set union to the minimum. These operations encode membership; is not a signed distance function.
Since every is an affine function, its extreme values on occur at corners. Exact real-arithmetic interval arithmetic gives:
FunctionRange on , propagated, propagated
Each leaf range is exact, but combining independent intervals forgets that the expressions share . The final enclosure need not be the exact range of . For example, equality would require both , hence , and , hence on , which is impossible. The enclosure is still sufficient for a reliable three-way decision:
Here the result is unresolved. This is a real mixed box, rather than only a pessimistic test: is strictly inside, whereas is outside. A zero endpoint alone can also mean contact with the boundary, so equality must not be treated as proof of strict interior or strict exterior. In floating-point arithmetic, certified bounds require outward rounding.
Continue splitting unresolved boxes, normally alternating axes or splitting the longest side. Propagate the interval arithmetic results through the constructive solid geometry tree, discard exterior boxes and stop refining strict interior boxes. In sufficiently small boundary boxes, locate crossings of the active implicit equations with box edges and connect them into boundary line segments. Retain corners and resolve ambiguous multiple crossings by further refinement; here every genuine boundary piece is straight, so its supporting implicit equation allows exact intersection rather than a curved approximation. A maximum boundary-box diagonal gives spatial localization at that scale, provided no boundary components are discarded; corner-sign sampling alone provides no such guarantee.
The tight box saves empty-space work, but it is awkward for extracting facets. Entire boundary line segments, notably , and , lie on the initial box boundary, and lies on the first splitting straight line. A sign-change-only method may have no exterior sample on the other side and lose such pieces; exact zeros also persist through refinement. A slightly padded initial axis-aligned bounding box, together with an explicit rule for boundary-coincident pieces, makes the faceting more robust. The tight box is therefore economical for enclosure but not the best unqualified choice for a simple faceting implementation.