TITLE: Examples of back of envelope calculations leading to good intuition?
QUESTION [57 upvotes]: Some time ago, I read about an "approximate approach" to the Stirling's formula in M.Sanjoy's Street Fighting Mathematics. In summary, the book used a integral estimation heuristic from spectroscopy
$$\int_{\mathbb{R_{\ge 0}}} f(x) dx  \approx   \max(f) * (\text{point where}\ \frac{1}{2} \max(f)\  \text{is achieved}) $$
to estimate the Gamma function with $f(x) = f_t(x) = x^{t}e^{-x} $. This leads to the estimate
$$\Gamma(n) = \int_{\mathbb{R}_{\ge 0}} x^{n}e^{-x} dx \approx \sqrt{8 n} \left(\frac{n}{e}\right)^n$$
which is an extremely good estimate (the "proportionality constant" $\sqrt{8}$ is correct to within 10% with correct order of growth.) This heuristic was very helpful in understanding the growth of the actual formula $\Gamma(n) \approx \sqrt{2\pi n} \left(\frac{n}{e}\right)^n$.
I think approximations of this sort is useful because

It gives a sense of what the answer "ought" to be.
When the approximation deviates from the actual answer, it's interesting to think about which part of the approximation failed.

Another "back-of-envelope calculation" is the calculation for the Prime Number Theorem in Courant and Robbins, What is Mathematics?
My Question. I am looking for similar instances in mathematics where "back-of-envelope calculations" such as the above leading to good intuition in mathematics.
For the purpose of my question, let's require that the calculation addresses questions in pure mathematics (so, no physics, engineering, etc. since there seems to already be plenty of literature on this).
Edit: as per helpful feedback from Peter LeFanu Lumsdaine, I removed two requirements: "Does not require anything beyond, say undergraduate mathematics" and "Does not formalize into a rigorous proof."
Edit 2 (as per helpful discussion in the comments): part of what I am interested in is how people use various techniques to compute/approximate objects of interest. For instance, I think we can all agree that the use of integral approximation demonstrated above is quite creative (if not, a nonstandard way of approaching Stirling). In response to Meow, topological invariants for "similar" (homotopy equivalent, homeomomorphic, etc) mostly amounts to the "same sort" of argument, so I would count that as "one" approximation argument unless there is a particular example where the heuristic argument is highly nontrivial.

REPLY [16 votes]: Minkowski theorem
The Poisson summation formula writes
$$\sum_{n \in \mathbb Z^n} \phi(n) = \sum_{n \in \mathbb Z^n} \widehat{\phi}(n)$$
where $\hat{\phi}$ is the Fourier transform of $\phi$. Let's take $\phi = \mathbf 1_A$ the characteristic function of a set $A$. Roughtly, the outcome is expected to be
$$
|A \cap \mathbb Z^n| = \sum_{x \in \mathbb Z^n} \mathbf{1}_A(x) = \sum_{x \in \mathbb Z^n} \widehat{\mathbf{1}_A}(x) \geqslant \widehat{\mathbf{1}_A}(0) = \mathrm{vol}(A),
$$
and this would prove that there are two distinct points of the lattice $\mathbb Z^n$ in $A$ as soon as $\mathrm{vol}(A)>1$: this is the idea of Minkowski's theorem. Of course, $\mathbf 1_A$ is not an admissible function in the Poisson summation formula and this idea has to be massaged a bit. Doing so, we realize that we need to assume some nice properties on $A$ (viz. convex and symmetric) and that the volume has to be a bit larger (viz. $2^n$).
Trace formulas
More generally, trace formulas enjoy a lot from these heuristics. They are distributional equalities of the form
$$\sum_{\lambda \in \mathrm{spec}} \phi(\lambda) = \sum_{\lambda \in \mathrm{geom}} \widehat{\phi}(\lambda)$$
where the left sum runs over "spectral" terms (e.g. automorphic forms, eigenvalues of the Laplacian), the right sum over "geometric terms" (e.g. geodesics, conjugacy classes) and $\hat{\phi}$ is an explicitly defined integral transform of $\phi$. They are in particular used to establish results on average, and the (illegal) use of characteristic functions on one side often gives you the right main term when estimating the trivial term on the other side (similarly to the $0 \in \mathbb Z^n$ above). Two examples on a compact surface $S$:

if you take the characteristic function on the spectral side, you guess the Weyl law counting the eigenvalues of the laplacian $\Delta$:
$$|\{\lambda \in \mathrm{spec}(\Delta) \ : \ |\lambda| \leqslant X\}| \sim \frac{\mathrm{vol}(S)}{4\pi}X$$
if you take the characteristic function on the geometric side, you guess the prime geodesic theorem counting the closed geodesics of bounded length $\ell$ on $S$:
$$|\{\gamma \text{ geodesic on } S \ : \ \exp(\ell(\gamma)) \leqslant X\}| \sim \mathrm{li}(X)$$

The extent of these ideas in geometry, number theory, automorphic forms, spectral theory, etc. is impressive, and these back of envelope calculations are a strong 'and reliable guide. (and, of course, turning these heuristics into proofs are another matter)