← Blog

How Many Countries Are There?

This post is presented in the LLM-Lensed Iterative Blogging format: a hand-written summary by me first, then a full version generated by an LLM from that summary.

Summary

Written by hand.

Disclaimer: This post is intended to be a fun new approach to an old question and an exposition of some very general math. This is not to be seen as a subjective endorsement of the legitimacy or illegitimacy of any governing bodies.

How many countries are there? It depends on who you ask. The UN gives a popular number, but doesn't capture the list of countries exactly. Every person and every country has their own set of countries they recognize.

What about an average of everyone's view? This promises a real number value for the total that could be more representative than any individual count. However, it's infeasible to collect every person's count. (This could be estimated statistically, but we don't do that here). Uniformly averaging over countries doesn't work either; it seems unintuitive to count every country's opinion equally, but also, it requires already having a list of countries!

We want a weighted average of countries' country count, which requires a country-ness for each country which should be a (country-wise) weighted average of countries' opinions of country-ness, which requires a country-ness for each country which should be... and so on.

This apparent infinite regress is exactly the domain where Google's original PageRank algorithm is applicable! We find a fixed point that properly weights the importance of nodes by the importance suggested by neighbors, weighted by their importance.

Agent instructions

Find a large overestimation of the list of countries, including micronations like Sealand.

Find a list of diplomatic relationships for each country and make informed inferences if this data isn't available.

Run the PageRank algorithm on this digraph to obtain the country-ness of every country on this long list.

Report the per-country country-ness and total (i.e. real country count) up front for readers who are already familiar with the methodology. The country-ness table should be collapsible.

The meat of the blog should be a motivation and exposition of linear algebra generally and PageRank specifically, noting that this application exhibits the broad diversity of linear algebra's utility.


Generated by claude-opus-4-8

The text below is AI-generated from the summary above.

Here is the answer, for the impatient: by this method there are about 199 countries. The precise figure the computation returns is 198.72, which is a comically exact number for a quantity that has no business being exact — and that tension is the whole point. Every entity below is assigned a country-ness between 0 and 1: a 1 is a state that essentially everyone recognizes, a 0 is a claim that essentially no one honors, and the interesting cases live in between. The “real country count” is nothing more than the sum of that column. Unlike a first draft of this post, the recognition figures below are pulled from actual diplomatic sources (listed at the end), not guessed.

A few of the entries that make the case for a fractional count:

EntityCountry-ness
United States, France, India, … (fully recognized)1.000
China0.951
Vatican City (Holy See)0.932
Israel0.873
Palestine0.820
Kosovo0.614
Western Sahara (SADR)0.296
Taiwan (ROC)0.189
Somaliland0.141
Sealand (and every other micronation)0.137
Full country-ness table (217 entities)

Recognition counts are sourced (see the end of the post); for a state recognized by many members, an arbitrary set of that many UN members stands in as the recognizers, since in the near-complete UN clique the result depends on the count, not on which members. Figures are as of mid-2026.

EntityCountry-ness
Albania1.000
Andorra1.000
Angola1.000
Antigua and Barbuda1.000
Argentina1.000
Australia1.000
Austria1.000
Azerbaijan1.000
Bahamas1.000
Bahrain1.000
Barbados1.000
Belarus1.000
Belgium1.000
Belize1.000
Benin1.000
Bolivia1.000
Bosnia and Herzegovina1.000
Botswana1.000
Brazil1.000
Bulgaria1.000
Burkina Faso1.000
Burundi1.000
Algeria1.000
Bangladesh1.000
Bhutan1.000
Cabo Verde1.000
Cambodia1.000
Cameroon1.000
Canada1.000
Central African Republic1.000
Chad1.000
Chile1.000
Colombia1.000
Afghanistan1.000
Brunei1.000
Congo (DRC)1.000
Congo (Republic)1.000
Costa Rica1.000
Cote d'Ivoire1.000
Croatia1.000
Cyprus1.000
Czechia1.000
Denmark1.000
Dominica1.000
Dominican Republic1.000
Ecuador1.000
Egypt1.000
El Salvador1.000
Equatorial Guinea1.000
Eritrea1.000
Estonia1.000
Eswatini1.000
Ethiopia1.000
Fiji1.000
Finland1.000
France1.000
Gabon1.000
Gambia1.000
Georgia1.000
Germany1.000
Nauru1.000
Nicaragua1.000
Russia1.000
Cuba1.000
Djibouti1.000
Ghana1.000
Greece1.000
Grenada1.000
Guatemala1.000
Guinea1.000
Guinea-Bissau1.000
Guyana1.000
Haiti1.000
Honduras1.000
Hungary1.000
Iceland1.000
India1.000
Ireland1.000
Italy1.000
Jamaica1.000
Japan1.000
Jordan1.000
Kazakhstan1.000
Kenya1.000
Kiribati1.000
Kyrgyzstan1.000
Latvia1.000
Lesotho1.000
Liberia1.000
Liechtenstein1.000
Lithuania1.000
Luxembourg1.000
Madagascar1.000
Malawi1.000
Malta1.000
Marshall Islands1.000
Mauritius1.000
Mexico1.000
Comoros1.000
Indonesia1.000
Iran1.000
Iraq1.000
Kuwait1.000
Laos1.000
Lebanon1.000
Libya1.000
Malaysia1.000
Mali1.000
Mauritania1.000
Micronesia1.000
Moldova1.000
Monaco1.000
Mongolia1.000
Montenegro1.000
Morocco1.000
Mozambique1.000
Myanmar1.000
Namibia1.000
Nepal1.000
Netherlands1.000
New Zealand1.000
Nigeria1.000
North Macedonia1.000
Norway1.000
Palau1.000
Panama1.000
Papua New Guinea1.000
Paraguay1.000
Peru1.000
Philippines1.000
Poland1.000
Portugal1.000
Romania1.000
Rwanda1.000
Saint Kitts and Nevis1.000
Saint Lucia1.000
Saint Vincent and the Grenadines1.000
Samoa1.000
San Marino1.000
Sao Tome and Principe1.000
Senegal1.000
Serbia1.000
Seychelles1.000
Sierra Leone1.000
Singapore1.000
Slovakia1.000
Slovenia1.000
Syria1.000
Turkey1.000
Venezuela1.000
Maldives1.000
Niger1.000
Qatar1.000
Solomon Islands1.000
South Africa1.000
South Sudan1.000
Spain1.000
Sri Lanka1.000
Suriname1.000
Sweden1.000
Switzerland1.000
Tajikistan1.000
Tanzania1.000
Thailand1.000
Timor-Leste1.000
Togo1.000
Tonga1.000
Trinidad and Tobago1.000
Turkmenistan1.000
Uganda1.000
Ukraine1.000
United Arab Emirates1.000
United Kingdom1.000
United States1.000
Uruguay1.000
Uzbekistan1.000
Vanuatu1.000
Zambia1.000
Zimbabwe1.000
Oman1.000
Pakistan1.000
Saudi Arabia1.000
Sudan1.000
Tunisia1.000
Tuvalu1.000
Vietnam1.000
Yemen1.000
Somalia1.000
Armenia0.996
North Korea0.995
South Korea0.995
China0.951
Vatican City (Holy See)0.932
Israel0.873
Palestine0.820
Kosovo0.614
Cook Islands0.418
Western Sahara (SADR)0.296
Niue0.258
Taiwan (ROC)0.189
Abkhazia0.160
South Ossetia0.160
Northern Cyprus (TRNC)0.142
Somaliland0.141
Transnistria0.139
Christiania0.137
Elleore0.137
Hutt River0.137
Ladonia0.137
Liberland0.137
Molossia0.137
Sealand0.137
Seborga0.137
Slowjamastan0.137
Westarctica0.137
Whangamomona0.137
Wirtland0.137

The rest of this post is about where those numbers come from, and it is really an excuse to talk about linear algebra — a subject whose reach is so absurdly wide that “how many countries are there” and “which web page should I show you” turn out to be, underneath, the exact same question.

The circular definition, taken seriously

Start with the paradox from the summary. We wanted to average the world's opinions about which places are countries, but weighted — a great power's recognition should count for more than a hobbyist's. So the weight we assign to each country ought to be its country-ness. But that is the very thing we set out to compute. The definition eats its own tail:

A place is a country to the extent that countries recognize it — where each recognizer's vote is worth its own country-ness.

Read as a procedure, this never terminates. Read as an equation, it is perfectly well posed, and it has a solution. The move from “infinite regress” to “solvable equation” is the single most useful idea in linear algebra, so it is worth slowing down on.

What linear algebra is actually for

Most people meet linear algebra as a bookkeeping system for solving several equations in several unknowns, and leave with the impression that it is the branch of math concerned with grids of numbers. That undersells it enormously. The real subject is linear maps: functions that respect addition and scaling, so that once you know what the map does to a handful of building-block directions, you know what it does to everything. A matrix is just a linear map written down in coordinates.

The reason this one idea shows up everywhere — in quantum mechanics, in the compression of the image you are looking at, in Google's index, in the way a population's age brackets shift year over year, in the least-squares line through a scatterplot — is that an astonishing number of real processes are linear, or close enough that pretending they are is the smartest first move you can make. “Recognition flows from country to country” is one of those processes.

Within the study of a linear map, a few directions are special: the ones the map does not rotate, only stretches or shrinks. If A is the map and it merely scales a nonzero vector v by a factor λ, so that

A v = λv,

then v is an eigenvector and λ its eigenvalue. Eigenvectors are the skeleton of a linear map: the axes along which its behavior is pure scaling and therefore easy to understand. And crucially, an eigenvector is a kind of self-consistent state — a configuration that the process reproduces instead of scrambling. That is exactly what our circular definition is asking for. A vector of country-ness values that the “pass recognition around” operation leaves pointing the same way is a country-ness assignment that is consistent with itself. The snake swallowing its tail is an eigenvector equation in disguise.

PageRank: the same trick, invented for the web

In the late 1990s Larry Page and Sergey Brin faced a structurally identical problem. A web page is important if important pages link to it — another definition that refers to itself. Their PageRank algorithm resolves the circularity by finding the eigenvector, and it is worth seeing the machinery because we are about to point it at countries instead of pages.

Model the world as a directed graph. Each entity is a node; draw an arrow from j to i when j recognizes i. Now imagine a random walker who stands on a country and, at each step, hops to one of the countries that country recognizes, chosen uniformly. Over a long walk, the fraction of time the walker spends parked on a given node is a natural measure of that node's importance — you arrive often precisely when many well-visited nodes point at you. That long-run occupancy is the eigenvector we want.

Write it in coordinates. Let N be the number of nodes and build the transition matrix M, where the entry in row i, column j is 1/dj if j recognizes i (and j hands out its vote equally among the dj places it recognizes), and 0 otherwise. Each column sums to 1, which makes M a stochastic matrix: it shuffles a distribution of “where the walker probably is” into an updated one. The country-ness vector x we are after is the one that update leaves unchanged,

M x = x,

an eigenvector with eigenvalue 1. Two famous wrinkles keep this honest. First, a node that recognizes no one would be a leak where probability drains away; and second, a graph that splits into cliques that never point at each other can have several competing steady states, so the answer would not be unique. Page and Brin patch both at once with a damping factor α (traditionally 0.85): with probability α the walker follows a recognition arrow, and with probability 1 − α it teleports to a node chosen uniformly at random. The equation becomes

x = αM x + (1 − α)/N · 1,

where 1 is the all-ones vector. The teleport term is a small egalitarian breeze blowing through the graph: it guarantees the walker can get from anywhere to anywhere, and the Perron–Frobenius theorem — a jewel of linear algebra about matrices with positive entries — then promises exactly one steady state, with all-positive entries. The circular definition has a unique answer, and it exists.

Better yet, you can compute it by brute honesty: start with any guess, apply the update over and over, and watch it converge. This is power iteration, and it is how the numbers above were produced — a few hundred multiplications of a vector by a matrix, which is to say, a few hundred rounds of every country telling its neighbors how much of a country it currently thinks they are, until nobody changes their mind.

Reading the results

For the actual computation I took a deliberately generous list of 217 entities: the 193 UN members, plus widely-but-not-universally recognized states, the awkward de facto cases, and a healthy pile of micronations down to Sealand and a fellow named Slowjamastan. The recognition counts are the real, sourced ones (collected at the end): UN members recognize one another except where they genuinely don't — the two Koreas, Pakistan's non-recognition of Armenia, and the 29 states that do not recognize Israel — and each contested entity is given its actual number of recognizers. Then I ran the walk and rescaled so a fully-recognized state sits at country-ness 1.

Even the “great powers” are not all pinned at 1. China comes in at 0.951, docked a sliver because its own One-China policy means the eleven states that recognize Taiwan do not recognize the PRC. The Holy See sits at 0.932, and Israel at 0.873 — that last number is the direct, quantified cost of 29 withheld recognitions, and it is exactly the kind of thing the method is good at: turning a diffuse political fact into a scalar.

The richest structure is in the middle. Palestine lands at 0.820 on the strength of 157 recognitions (including the 2024–25 wave that added France, the UK, and Canada), while Kosovo sits at 0.614 on a contested ~110 — heavy fractions of a country that the algorithm refuses to round off. Taiwan is the method's sharpest provocation: a place with its own government, currency, military, and twenty-three million people scores just 0.189, because country-ness here measures recognition and nothing else, and formal recognition is precisely what Taiwan has been squeezed out of. The number is not a judgment about Taiwan; it is a mirror held up to the world's diplomatic bookkeeping.

And then the floor. Everything recognized by no one — Sealand, Molossia, Liberland, the whole micronational bestiary — settles at exactly 0.137, which is not zero but the residue of the teleport term, the little democratic breeze that refuses to let any node vanish entirely. The most striking case sits just above it: Somaliland at 0.141. For thirty years a territory with a functioning government, elections, and its own currency would have been pinned to the micronation floor, mathematically indistinguishable from a gun platform in the North Sea. It lifts off that floor only because, on 26 December 2025, Israel became the first UN member to recognize it — and because Israel is itself only a 0.87-country, that single vote lifts Somaliland less than Turkey's lone vote lifts Northern Cyprus (0.142). One recognition, and you can watch its exact weight in the third decimal place.

Sum the whole column and you get 198.72. It is satisfyingly close to the UN's ~193, and the gap is honest: the fractional recognitions of Palestine, Kosovo, and the rest add up to a handful of extra countries, while the teleport floor sprinkles a little country-ness onto entities that have no real claim to it. Notably, this number is almost unchanged from a first draft of this post built on guessed recognition data — the headline is robust even though individual rows (Israel, China, Somaliland) moved a lot once real sources went in. Change the damping factor, or next year's recognition counts, and the number drifts — as it should. There was never going to be one integer here.

The point

The honest answer to “how many countries are there” is that the question presumes a sharp boundary the world does not actually have. What the world has instead is a vast web of mutual recognition, and the mathematically natural summary of that web is not a count but a distribution — a country-ness for everyone, self-consistent by construction. That we can extract a single real number from it at all, let alone the same machinery Google used to rank the internet, is a small monument to how far a good linear map will carry you. Somewhere between a hobbyist's flag and a permanent seat on the Security Council, there are about 199 countries.

Sources

Recognition counts as of mid-2026. Where a count is contested or drifts over time, the figure used is noted. Wikipedia's “international recognition” pages are used as aggregators of primary diplomatic sources; official primaries are linked where they anchor a headline number.

← All posts