In mathematics, the term "almost all" means "all but a negligible quantity". More precisely, if is a set, "almost all elements of " means "all elements of but those in a negligiblesubset of ". The meaning of "negligible" depends on the mathematical context; for instance, it can mean finite, countable, or null.
In contrast, "almost no" means "a negligible quantity"; that is, "almost no elements of " means "a negligible quantity of elements of ".
Throughout mathematics, "almost all" is sometimes used to mean "all (elements of an infinite set) except for finitely many".[1][2] This use occurs in philosophy as well.[3] Similarly, "almost all" can mean "all (elements of an uncountable set) except for countably many".[sec 1]
Examples:
Almost all positive integers are greater than 1012.[4]: 293
When speaking about the reals, sometimes "almost all" can mean "all reals except for a null set".[6][7][sec 2] Similarly, if S is some set of reals, "almost all numbers in S" can mean "all numbers in S except for those in a null set".[8] The real line can be thought of as a one-dimensional Euclidean space. In the more general case of an n-dimensional space (where n is a positive integer), these definitions can be generalised to "all points except for those in a null set"[sec 3] or "all points in S except for those in a null set" (this time, S is a set of points in the space).[9] Even more generally, "almost all" is sometimes used in the sense of "almost everywhere" in measure theory,[10][11][sec 4] or in the closely related sense of "almost surely" in probability theory.[11][sec 5]
Examples:
In a measure space, such as the real line, countable sets are null. The set of rational numbers is countable, so almost all real numbers are irrational.[12]
The Cantor set is also null. Thus, almost all reals are not in it even though it is uncountable.[6]
The derivative of the Cantor function is 0 for almost all numbers in the unit interval.[15] It follows from the previous example because the Cantor function is locally constant, and thus has derivative 0 outside the Cantor set.
In number theory, "almost all positive integers" can mean "the positive integers in a set whose natural density is 1". That is, if A is a set of positive integers, and if the proportion of positive integers in A below n (out of all positive integers below n) tends to 1 as n tends to infinity, then almost all positive integers are in A.[16][17][sec 7]
More generally, let S be an infinite set of positive integers, such as the set of even positive numbers or the set of primes, if A is a subset of S, and if the proportion of elements of S below n that are in A (out of all elements of S below n) tends to 1 as n tends to infinity, then it can be said that almost all elements of S are in A.
Examples:
The natural density of cofinite sets of positive integers is 1, so each of them contains almost all positive integers.
Almost all even positive numbers can be expressed as the sum of two primes.[4]: 489
Almost all primes are isolated. Moreover, for every positive integer g, almost all primes have prime gaps of more than g both to their left and to their right; that is, there is no other prime between p − g and p + g.[18]
Meaning in graph theory
In graph theory, if A is a set of (finite labelled) graphs, it can be said to contain almost all graphs, if the proportion of graphs with n vertices that are in A tends to 1 as n tends to infinity.[19] However, it is sometimes easier to work with probabilities,[20] so the definition is reformulated as follows. The proportion of graphs with n vertices that are in A equals the probability that a random graph with n vertices (chosen with the uniform distribution) is in A, and choosing a graph in this way has the same outcome as generating a graph by flipping a coin for each pair of vertices to decide whether to connect them.[21] Therefore, equivalently to the preceding definition, the set A contains almost all graphs if the probability that a coin-flip–generated graph with n vertices is in A tends to 1 as n tends to infinity.[20][22] Sometimes, the latter definition is modified so that the graph is chosen randomly in some other way, where not all graphs with n vertices have the same probability,[21] and those modified definitions are not always equivalent to the main one.
The use of the term "almost all" in graph theory is not standard; the term "asymptotically almost surely" is more commonly used for this concept.[20]
In abstract algebra and mathematical logic, if U is an ultrafilter on a set X, "almost all elements of X" sometimes means "the elements of some element of U".[31][32][33][34] For any partition of X into two disjoint sets, one of them will necessarily contain almost all elements of X. It is possible to think of the elements of a filter on X as containing almost all elements of X, even if it isn't an ultrafilter.[34]
Proofs
^The prime number theorem shows that the number of primes less than or equal to n is asymptotically equal to n/ln(n). Therefore, the proportion of primes is roughly ln(n)/n, which tends to 0 as n tends to infinity, so the proportion of composite numbers less than or equal to n tends to 1 as n tends to infinity.[17]
^Cahen, Paul-Jean; Chabert, Jean-Luc (7 December 2010) [First published 2000]. "Chapter 4: What's New About Integer-Valued Polynomials on a Subset?". In Hazewinkel, Michiel (ed.). Non-Noetherian Commutative Ring Theory. Mathematics and Its Applications. Vol. 520. Springer. p. 85. doi:10.1007/978-1-4757-3180-4. ISBN978-1-4419-4835-9.
^Helmberg, Gilbert (December 1969). Introduction to Spectral Theory in Hilbert Space. North-Holland Series in Applied Mathematics and Mechanics. Vol. 6 (1st ed.). Amsterdam: North-Holland Publishing Company. p. 320. ISBN978-0-7204-2356-3.
^Vestrup, Eric M. (18 September 2003). The Theory of Measures and Integration. Wiley Series in Probability and Statistics. United States: Wiley-Interscience. p. 182. ISBN978-0-471-24977-1.
^Burk, Frank (3 November 1997). Lebesgue Measure and Integration: An Introduction. A Wiley-Interscience Series of Texts, Monographs, and Tracts. United States: Wiley-Interscience. p. 260. ISBN978-0-471-17978-8.
^Prachar, Karl (1957). Primzahlverteilung. Grundlehren der mathematischen Wissenschaften (in German). Vol. 91. Berlin: Springer. p. 164. Cited in Grosswald, Emil (1 January 1984). Topics from the Theory of Numbers (2nd ed.). Boston: Birkhäuser. p. 30. ISBN978-0-8176-3044-7.
^Oxtoby, John C. (1980). Measure and Category. Graduate Texts in Mathematics. Vol. 2 (2nd ed.). United States: Springer. pp. 59, 68. ISBN978-0-387-90508-2. While Oxtoby does not explicitly define the term there, Babai has borrowed it from Measure and Category in his chapter "Automorphism Groups, Isomorphism, Reconstruction" of Graham, Grötschel and Lovász's Handbook of Combinatorics (vol. 2), and Broer and Takens note in their book Dynamical Systems and Chaos that Measure and Category compares this meaning of "almost all" to the measure theoretic one in the real line (though Oxtoby's book discusses meagre sets in general topological spaces as well).
^Sharkovsky, A. N.; Kolyada, S. F.; Sivak, A. G.; Fedorenko, V. V. (30 April 1997). Dynamics of One-Dimensional Maps. Mathematics and Its Applications. Vol. 407. Springer. p. 33. doi:10.1007/978-94-015-8897-3. ISBN978-94-015-8897-3.
^Yuan, George Xian-Zhi (9 February 1999). KKM Theory and Applications in Nonlinear Analysis. Pure and Applied Mathematics; A Series of Monographs and Textbooks. Marcel Dekker. p. 21. ISBN978-0-8247-0031-7.
^Albertini, Francesca; Sontag, Eduardo D. (1 September 1991). "Transitivity and Forward Accessibility of Discrete-Time Nonlinear Systems". In Bonnard, Bernard; Bride, Bernard; Gauthier, Jean-Paul; Kupka, Ivan (eds.). Analysis of Controlled Dynamical Systems. Progress in Systems and Control Theory. Vol. 8. Birkhäuser. p. 29. doi:10.1007/978-1-4612-3214-8. ISBN978-1-4612-3214-8.
^Clapham, Christopher; Nicholson, James (7 June 2009). The Concise Oxford Dictionary of mathematics. Oxford Paperback References (4th ed.). Oxford University Press. p. 38. ISBN978-0-19-923594-0.