ForHosting KIT · Math

Galileo's paradox of infinity

Galileo paired every counting number with its square, 1 with 1, 2 with 4, 3 with 9, and found that neither list runs out first. Choose a limit up to 10,000 and see that pairing written out in full, number by number. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Limit
5
You get
Quantity
5

Galileo's paradox of infinity is one of the earliest rigorous observations about infinite sets, recorded in Galileo's 1638 Discourses and Mathematical Demonstrations Relating to Two New Sciences. Perfect squares become scarcer and scarcer among the counting numbers, yet Galileo paired each counting number with exactly one square: 1 with 1, 2 with 4, 3 with 9, and so on forever. Neither collection runs out before the other, so in the infinite case the two sets have the same size even though one is a proper part of the other. This tool lists that pairing explicitly for every counting number from 1 up to a positive integer limit you choose, so the correspondence can be inspected, quoted, and verified directly.

What Galileo actually observed

In his final book, Galileo Galilei put a disquieting argument into the mouth of his character Salviati. On one hand, the perfect squares are a tiny minority of the counting numbers: among the first one hundred counting numbers only ten are squares, and among the first ten thousand only one hundred are, so the proportion keeps falling toward zero.

On the other hand, every counting number has a square, and every square has exactly one positive square root, so there is a perfect one-to-one matching between the counting numbers and the squares. If two collections can be matched member for member with nothing left over on either side, said Galileo, then neither collection can honestly be called larger.

He concluded that the ordinary language of 'more', 'fewer', and 'equal' simply does not apply to infinite collections in the way it applies to finite ones, and he left the matter there as a genuine paradox. The finite prefix that this tool produces is the concrete, checkable shadow of that argument: for any positive limit, the list of pairs shows each number next to its own square with no repetition and no gap on either side.

The one-to-one correspondence, made finite and visible

A one-to-one correspondence, or bijection, is a pairing in which every element of the first collection is matched with exactly one element of the second, and nothing in either collection is left unmatched or matched twice. The map that sends each counting number n to its square n squared is exactly such a pairing: different starting numbers always give different squares, and each square comes from one positive root. Scanning the pairs demonstrates the two defining properties by inspection.

First, the n column visits every counting number in the range exactly once, so the pairing is total and single-valued. Second, the square column contains no duplicates, because the squaring function is strictly increasing on the positive integers. Any limit up to ten thousand is accepted, which keeps the output small enough to read in full while still making the density argument vivid: at the maximum limit the squares occupy only one percent of the range.

From Galileo's paradox to Cantor's theory of infinite sets

Galileo treated the paradox as a warning that infinity resists everyday comparison, and mathematics left the question there for roughly two and a half centuries. In the 1870s Georg Cantor turned the observation upside down and made it a definition: two sets, finite or infinite, have the same cardinality precisely when a one-to-one correspondence exists between them.

Under that definition the counting numbers and the perfect squares really are the same size, and so are the even numbers and the integers, which is the fact Galileo had found too strange to accept. Cantor then proved that not all infinite sets pair with the counting numbers — the real numbers famously do not — so infinity comes in different sizes after all, just measured by matching rather than by counting.

Working through explicit finite pairings, as this tool produces, is the standard classroom route into that theory: the pattern 1-1, 2-4, 3-9 is a bijection you can see, and extending it mentally beyond any bound is the exact move Cantor formalized.

Set theory and infinity lessons

Teachers introducing bijections and Cantor's notion of cardinality can show the explicit number-to-square pairing for a chosen limit instead of drawing it by hand on the board.

History of mathematics reading groups

Groups working through Galileo's Two New Sciences can reproduce the exact correspondence Salviati describes and check the density of squares within any finite range.

What is Galileo's paradox of infinity?

Galileo observed in 1638 that although perfect squares grow ever rarer among the counting numbers, each counting number n pairs exactly with its square n², so the two infinite collections can be matched one-to-one — a contradiction for everyday ideas of 'more' and 'fewer'.

Why does this show the two sets have the same size?

The pairing is a bijection: every counting number appears exactly once in the n column and every listed square appears exactly once in the square column. Since nothing on either side is left unmatched or duplicated, neither collection can outnumber the other.

Who described Galileo's paradox, and when?

Galileo Galilei, in his last book, the 1638 Discourses and Mathematical Demonstrations Relating to Two New Sciences. He put the argument in the mouth of his character Salviati and left it standing as a genuine paradox.

How rare are perfect squares among the counting numbers?

They get rarer the further you go: only 10 of the first 100 counting numbers are squares, and only 100 of the first 10,000. The share keeps falling toward zero, yet every number still has its own square.

What is a one-to-one correspondence?

It is a pairing in which every member of one collection is matched with exactly one member of the other, with nothing left over and nothing used twice. Sending each counting number to its square is exactly such a pairing.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/math/galileos-paradox-of-infinity

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/math/galileos-paradox-of-infinity \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":10}'
{
  "limit": 10
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.galileos_paradox_of_infinity",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_limit10000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The one-to-one correspondence, made finite and visible

When you send a limit to this capability, the response contains one record per counting number from one through that limit, each record holding the number and its square.

From Galileo's paradox to Cantor's theory of infinite sets

The error behavior is simple and deterministic too: any limit that is not a positive integer, or that exceeds ten thousand, is rejected with an invalid_input error naming the offending field.

Programmatic generation of square tables

Notebooks, demos, and test fixtures that need a reliable table of n alongside n² for n from 1 to a bound can fetch it in one deterministic call.

How do I get the pairing with this API?

Send a JSON body with a positive integer field 'limit' to math.galileos_paradox_of_infinity. The response lists pairs, one record per n from 1 through limit with its square, plus the count of pairs.

What input values are accepted?

Only positive integers from 1 to 10000. Zero, negative values, non-integers, and values above the maximum are rejected with an invalid_input error that names the field 'limit'.

How much does each call cost?

The capability costs $0.002 per item, the catalog floor for analytic tier-A parse capabilities. The same pairing logic also runs free in the browser widget.

Read the full KIT documentation →