How Galileo's Paradox of Infinity Works
In his 1638 book Two New Sciences, Galileo Galilei noticed something strange about infinite sets. Every natural number n has exactly one perfect square, n², and every perfect square has exactly one square root. That means the map f(n) = n² pairs each natural number with a unique perfect square, and no square is ever left unpaired — a perfect one-to-one correspondence (a bijection). Yet, if you look at any finite stretch of numbers, like 1 to 100, the perfect squares (1, 4, 9, 16, ..., 100) are clearly a small minority — only 10 out of 100. So are there "more" natural numbers than squares, or exactly as many? Galileo's answer was that the ideas of "more," "fewer," and "equal" simply do not carry over from finite sets to infinite ones the way intuition suggests. This calculator lets you explore both sides of the paradox at once: the shrinking density of squares in a finite range, and the exact bijection that pairs every number with its square.
The two formulas behind the paradox
Given an upper bound N, the count of perfect squares in the range 1 to N is ⌊√N⌋ (the greatest integer whose square does not exceed N) — for example, ⌊√100⌋ = 10, since 10² = 100 and 11² = 121 overshoots. The density of squares in that range is that count divided by N, or ⌊√N⌋ / N ≈ 1/√N, which shrinks toward 0 as N grows — at N = 10,000 only about 1% of the numbers are perfect squares, and at N = 1,000,000 only about 0.1% are. At the same time, the bijection n ↔ n² never breaks down: for any n you pick, there is exactly one square n² waiting for it, no matter how large n gets. This calculator computes both the density for your chosen N and the specific pair (n, n²) for your chosen n.
Why it looks like a paradox — and how it's resolved
The apparent contradiction is between two different ways of comparing sets: subset comparison ("a proper subset should be smaller") and bijection comparison ("if every element can be uniquely paired, the sets are the same size"). For finite sets these two methods always agree, so we never notice a conflict. Georg Cantor's 19th-century set theory resolved the paradox by making bijection the actual mathematical definition of "same cardinality" (size). Under that definition, the natural numbers and the perfect squares both have cardinality ℵ₀ (aleph-null, "countably infinite") — even though the squares are a proper subset of the naturals. In fact, mathematicians now define an infinite set as precisely one that can be put into bijection with a proper subset of itself; finite sets can never do this. Galileo's puzzle wasn't a flaw in the math — it was an early, accurate observation of exactly how infinite sets behave, two centuries before Cantor gave it a rigorous foundation.