# almost all

Often mathematicians use expressions such as "almost
every positive integer is composite" or "almost all real
numbers are irrational." In each case **almost every**
or **almost all** means all but a "negligible" fraction,
but how we define that fraction (and negligible) depends on
the underlying set.

In the positive integers (the usual case in this glossary):

Let P(

n) be a predicate (a statement about the integernsuch as "nis prime"). Let #P(N) be the number of positive integersnless thanNwhich satisfy P(n). For example, if P(n) = "nis even," then #P(N) is floor(N/2).If the ratio #P(

N)/Ngets arbitrarily close to 1 asNgets big (that is, lim #P(N)/N= 1 asNapproaches infinity), then we say "for almost every."n, P(n)For example, if P(

n) is "nis composite," then #P(N) is about (1 - 1/logN)N(by the prime number theorem), so #P(N)/Nis about 1-1/logN. This clearly gets close to 1 asNgets large; so,almost every positive integer is composite.

In other sets:

In other sets the concept "almost every" is defined in different ways. For example, in the real numbers a common way to define "almost every" is to specify all but a set of measure zero (usually using the Lebesgue measure). These ideas are beyond the scope of this glossary.