Kemeny Studio

We build the AI that runs your operations

Every start is equally far from a random destination

In 1960, John Kemeny and Laurie Snell proved something that still surprises mathematicians: in any finite Markov chain, the expected time to reach a randomly chosen target does not depend on where you begin. This number is called Kemeny’s constant. Here is the math, moving.

See it move
nΣj=1πjmij=Kfor every starting state i

Pick a destination j at random, weighted by the stationary distribution π. Sum the expected travel times m from your position i to each possible destination. The result K depends only on the chain, never on i. The starting point cancels out completely.

Watch the constant hold

Node size shows the stationary probability π. The glowing walker chases a secret target drawn from π. Meanwhile, thousands of simulated journeys per second measure the average travel time from every start. The bars always meet at the same line: K.

Loading 3D model…

Try "Two communities": crossing the weak bridge is rare, so K explodes

A walker on a graph

A Markov chain is a system that hops between a finite set of states. Its entire personality lives in one object: the transition matrix P, where each entry P(i, j) is the probability of jumping from state i to state j in one step. The chain has no memory. Where it goes next depends only on where it stands now.

We assume the chain is irreducible: every state can eventually reach every other state. That is the only requirement the theorem needs.

The stationary distribution π

Run the chain long enough and the fraction of time it spends in each state settles into fixed proportions. That limiting recipe is the stationary distribution π: the unique probability vector that the chain leaves unchanged.

πP=π

In the 3D model above, each sphere is scaled by its π value. Big sphere: the walker lives there often. Small sphere: a rare stop.

Mean recurrence time: 1 / π

How long does the walker take, on average, to come back to the state it just left? The answer is beautifully simple. If the chain spends a fraction π of its time in a state, returns must happen on average every 1/π steps:

mii=1πi

Spend 10% of your time somewhere and you return every 10 steps. Spend half your time there and you return every 2. The stationary distribution and the mean recurrence times are two views of the same fact.

Mean first passage times

For two different states, m(i, j) is the expected number of steps to reach j for the first time when starting from i. These times are usually asymmetric and messy: reaching a rare state takes long, reaching a popular one is quick. No individual m(i, j) is remarkable. The magic is in how they combine.

The i cancels out

Now weight every travel time by the stationary probability of its destination and add them up. Split the sum into the return trip (j = i) and everything else. Because the recurrence time is exactly 1/π, the first term is always exactly 1:

K=πimii+ Σj≠iπjmij=1+ Σj≠iπjmij

Kemeny and Snell proved the whole expression is the same number K for every start i. Equivalently: the stationary-weighted time to reach all other states is always exactly K − 1, no matter where you stand.

Take a two-state chain: from state 1 you jump to state 2 with probability 0.3, from state 2 you jump back with probability 0.1. Then π = (0.25, 0.75), the passage times are m₁₂ = 1/0.3 ≈ 3.33 and m₂₁ = 1/0.1 = 10, and the recurrence times are m₁₁ = 4 and m₂₂ = 4/3.

From state 1

0.25 × 4 + 0.75 × 3.33 = 3.5

From state 2

0.25 × 10 + 0.75 × 1.33 = 3.5

Two completely different journeys, one identical answer: K = 3.5. This is not a coincidence of the example. It is a theorem.

The prize and the secret target

Kemeny found the result so counterintuitive that a prize was offered for an intuitive explanation of why the sum ignores the starting state. The winning argument, credited to Peter Doyle, goes like this: someone secretly picks a target state, drawn from the stationary distribution, and does not tell you. You wander the chain looking for it.

Here is the key: the target is distributed exactly the way the chain behaves in equilibrium. The landscape of "where the secret probably is" looks statistically identical from everywhere. Taking a step neither helps you nor hurts you on average. So your expected search time cannot depend on where you started. That expected search time is K.

Eigenvalues and mixing

K also falls out of the spectrum of the transition matrix. If the eigenvalues of P are 1, λ₂, λ₃, …, λₙ, then:

K=1+nΣk=211 − λk

Eigenvalues close to 1 are slow modes: bottlenecks, weak bridges, isolated communities. Each one inflates K. That is why network scientists read K as a global connectivity score: small K means a random walker mixes into the network fast, large K means it gets trapped in regions. You can feel this in the model above by switching between "Fully mixed" and "Two communities".

Two Kemenys

John George Kemeny (1926-1992) was a Hungarian-American mathematician with an absurd résumé: mathematical assistant to Albert Einstein at 23, co-inventor of the BASIC programming language with Thomas Kurtz, president of Dartmouth College, and co-author, with J. Laurie Snell, of Finite Markov Chains (1960), the book where this constant first appeared.

Kemeny Studio is named after its founder, Francisco Kemeny. Different Kemeny, same obsession: systems that converge to reliable behavior no matter where they start. It is a property we admire in Markov chains and demand from the AI agents we build and operate for enterprises.

Common questions

What is Kemeny's constant?+

For a finite, irreducible Markov chain, pick a target state at random according to the stationary distribution π. The expected number of steps to reach that target is the same from every starting state. That shared value is Kemeny’s constant, K = Σ π_j m_ij, where m_ij is the mean first passage time from state i to state j. It was proven by John G. Kemeny and J. Laurie Snell in their 1960 book Finite Markov Chains.

How is the mean recurrence time related to the stationary distribution?+

They are reciprocals: m_ii = 1/π_i. If a chain spends 10% of its long-run time in a state, it returns to that state on average every 10 steps. This identity, sometimes called Kac’s formula, is what lets the recurrence term inside Kemeny’s sum simplify to exactly 1.

Why doesn't Kemeny's constant depend on the starting state?+

The winning intuition, credited to Peter Doyle, treats the target as a secret chosen from the stationary distribution. Because the target is distributed exactly as the chain behaves in equilibrium, taking one step does not change your statistical distance to it: every position is equally far from a π-random target. Algebraically, K equals the trace of the fundamental matrix Z = (I − P + Π)⁻¹, an expression with no starting state in it.

What is Kemeny's constant used for?+

It is a global measure of how fast a random walk mixes through a network. Smaller K means a walker reaches typical destinations faster. It is used in network science to score connectivity and robustness, in road traffic models, in epidemic spreading analysis, and to find critical links whose removal most damages a network.

Is Kemeny Studio related to John G. Kemeny?+

Kemeny Studio is named after its founder, Francisco Kemeny. John G. Kemeny, co-author of the theorem and co-inventor of BASIC, is a namesake we are happy to share. Different Kemeny, same obsession: systems that behave predictably no matter where they start.

Next step

Stop hiring. Deploy an AI agent.

Book your AI audit. In 10 days you'll know which workflows to hand off to an AI agent, the expected savings, and a fixed-price agent build scope. We build it. Then we run it.

Book your AI audit

20 minutes. No pitch deck. No commitment.