Ranking documents in decreasing order of their probability of relevance $p_d$ maximizes the expected number of relevant documents, and so expected precision, at every cutoff at once. The sorted order also minimizes expected 1/0 loss at every cutoff, and the best set to return is $\{d : p_d > \tfrac12\}$. If a retrieved nonrelevant document costs $C_0$ and a missed relevant one $C_1$, the order is unchanged and the threshold moves to $C_0/(C_0 + C_1)$, the one point where probabilities must be calibrated. The principle fails when users want something other than an expected count: on an ambiguous query whose two senses are meant by 60 and 40 percent of users, it gives 60 percent of them a relevant document in the top two, where a diversified order gives all of them one.
Four documents have probabilities of relevance 0.2, 0.9, 0.5, and 0.6, and a user will read some number of them from the top of a list. The system does not know how many. In what order should they be shown, and can we prove that order is best?
Intuition says highest probability first, and the intuition is right: that order is provably best at every cutoff. The Probability Ranking Principle (PRP) states it precisely: rank documents in decreasing order of their probability of relevance, and under stated conditions no other ordering does better. The principle is the theoretical justification for ranked retrieval. Every model in this topic, from the Binary Independence Model to BM25, is an attempt to estimate the quantity the PRP says to sort by.
The idea that retrieval should rank by probability of relevance goes back to Maron and Kuhns (1960). Stephen Robertson (1977) gave the principle its standard statement, which he credited to William Cooper. He showed that it is optimal under certain assumptions but can fail when they do not hold. This article follows Manning, Raghavan, and Schütze (2008, §11.2), and the numbers in its examples are computed by tools/experiments/cranfield/prp_examples.py.
Here is the route. First we prove that the sorted order is best at every cutoff at once. Then we see the same idea as a decision, with costs that decide where to stop. Next comes an ambiguous query on which the principle fails. Finally we list the assumptions behind the proof. The probability primer reviews the notation.
The principle
Treat the relevance of document $d$ to query $q$ as a binary random variable $R$, equal to 1 if $d$ is relevant and 0 otherwise. The system cannot observe $R$. It observes only representations of the document and the query, from which it can at best estimate $P(R = 1 \mid d, q)$. Robertson's statement of the principle, in the wording of van Rijsbergen (1979, pp. 113–114) that the course text quotes (§11.2):
If a reference retrieval system's response to each request is a ranking of the documents in the collection in order of decreasing probability of relevance to the user who submitted the request, where the probabilities are estimated as accurately as possible on the basis of whatever data have been made available to the system for this purpose, the overall effectiveness of the system to its user will be the best that is obtainable on the basis of those data.
The statement is long, and its key phrase is "the best that is obtainable". The next section makes "best" precise, as expected precision at every cutoff, and proves that sorting achieves it.
Why the ordering is optimal
Suppose the user reads the top $k$ documents, for some $k$ the system does not know in advance. The expected number of relevant documents among them is the sum of their probabilities of relevance. So the expected precision at $k$ is the average of those probabilities. For the four documents above:
| Ordering | P@1 | P@2 | P@3 | P@4 |
|---|---|---|---|---|
| By probability: 0.9, 0.6, 0.5, 0.2 | 0.900 | 0.750 | 0.667 | 0.550 |
| As given: 0.2, 0.9, 0.5, 0.6 | 0.200 | 0.550 | 0.533 | 0.550 |
For any fixed $k$, the sum of $k$ probabilities is largest when it includes the $k$ largest, which is what sorting puts at the top. Sorting achieves this for every $k$ at once. So the sorted list maximizes expected precision at every cutoff simultaneously, wherever the user stops. At $k = 4$ the two orderings tie, because both include all four documents. The order matters only for users who stop earlier, which is nearly all of them.
The argument step by step
The claim "best at every cutoff at once" is stronger than it first sounds, so it is worth proving rather than asserting. Here is the plan in one sentence: fixing any one out-of-order adjacent pair helps one cutoff and harms none, and enough such fixes reach the sorted order. Two facts carry the proof, and two more steps finish it.
- Expectation is additive. Let $R_i$ be the relevance of the document at position $i$. The number of relevant documents in the top $k$ is $R_1 + \dots + R_k$, and its expectation is $p_1 + \dots + p_k$, whatever the dependence between the $R_i$. Expected precision at $k$ is this sum divided by $k$.
- An adjacent swap changes one cutoff. Take any ordering in which a document with probability $p_i$ sits directly above one with a larger probability $p_{i+1}$. Swap the two. For every cutoff $k < i$ neither document is in the top $k$, and for every $k > i$ both are, so those sums are unchanged. Only the cutoff $k = i$ changes: its top set now contains $p_{i+1}$ instead of $p_i$, and its sum rises by $p_{i+1} - p_i > 0$.
- Sort by repeated swaps. Any ordering can be turned into the sorted one by repeatedly swapping adjacent pairs that are out of order, as bubble sort does. Each swap raises one cutoff's expected precision and leaves the others unchanged.
- Conclusion. The sorted ordering is at least as good as every other ordering at every cutoff, so it is optimal for a user who stops at any $k$, and for any mixture of users who stop at different depths.
Check the argument on the example. The ordering 0.9, 0.5, 0.6, 0.2 has one pair out of order. Its expected relevant counts at $k = 1, \dots, 4$ are 0.9, 1.4, 2.0, 2.2, against 0.9, 1.5, 2.0, 2.2 for the sorted order. The single swap that fixes it changes only $k = 2$, by $0.6 - 0.5$.
Step 1 is where the argument's assumptions hide. Additivity holds for any dependence, but it makes the expected number of relevant documents the measure of success. A user who wants one good answer is not served by an expectation, as the ambiguous query below shows.
A ranking is a list. Sometimes, though, a system has to decide which documents to return at all, and the same reasoning answers that question too.
The same idea as a decision
The same reasoning applied to a single decision gives the Bayes optimal decision rule under 1/0 loss, where each retrieved nonrelevant document and each missed relevant document costs one unit. Retrieve $d$ if and only if
$$P(R = 1 \mid d, q) > P(R = 0 \mid d, q),$$
that is, if the document is more likely relevant than not. This is the decision a classifier makes. The PRP is the ranking version of the same idea, and Manning, Raghavan, and Schütze (2008, Theorem 11.1) state the result as minimizing expected loss under 1/0 loss. The textbook states the theorem and refers to Ripley (1996) for the proof. The proof is short enough to give here.
Theorem (optimality under 1/0 loss). Let each document $d$ have probability of relevance $p_d$. (a) Among all sets of documents a system could return, the set $\{d : p_d > \tfrac12\}$ has the least expected 1/0 loss. (b) Among all sets of exactly $k$ documents, the top $k$ of the ranking by decreasing $p_d$ has the least expected 1/0 loss, for every $k$.
Proof. Let $S$ be the set returned. The loss is the number of nonrelevant documents in $S$ plus the number of relevant documents outside $S$. A document in $S$ is nonrelevant with probability $1 - p_d$, and a document outside $S$ is relevant with probability $p_d$. Expectation is additive, whatever the dependence between documents, so the expected loss is
$$L(S) = \sum_{d \in S} (1 - p_d) + \sum_{d \notin S} p_d.$$
(a) Each document contributes one term to $L(S)$, and the choice for one document does not affect any other document's term. A document contributes $1 - p_d$ if returned and $p_d$ if not, so $L(S) \ge \sum_d \min(p_d,\, 1 - p_d)$ for every $S$. The set $\{d : p_d > \tfrac12\}$ attains this bound, because $1 - p_d < p_d$ exactly when $p_d > \tfrac12$. A document with $p_d = \tfrac12$ contributes $\tfrac12$ either way.
(b) Write $T = \sum_d p_d$ for the expected number of relevant documents in the collection. For a set $S$ of $k$ documents, $\sum_{d \in S}(1 - p_d) = k - \sum_{d \in S} p_d$ and $\sum_{d \notin S} p_d = T - \sum_{d \in S} p_d$, so
$$L(S) = k + T - 2 \sum_{d \in S} p_d.$$
Here $k$ and $T$ are fixed, so $L(S)$ is least when $\sum_{d \in S} p_d$ is greatest, and a sum of $k$ of the probabilities is greatest when it takes the $k$ largest. Those are the top $k$ of the sorted ranking. $\blacksquare$
Part (b) says that a ranking by probability minimizes the expected loss wherever it is cut, which is the ranking form of the theorem. Part (a) says where to cut it.
Example (the Bayes set for the four documents). Under 1/0 loss the documents at 0.9 and 0.6 go into the returned set, and the one at 0.2 stays out. The one at exactly 0.5 is a tie: including it or leaving it out costs the same. The table below confirms this. If a system returns the top $k$ of the sorted four, the expected loss is the expected number of nonrelevant documents returned plus the expected number of relevant documents left out:
| Documents returned | none | top 1 | top 2 | top 3 | all 4 |
|---|---|---|---|---|---|
| Expected loss | 2.2 | 1.4 | 1.2 | 1.2 | 1.8 |
The formula of part (b) gives the same row: with $T = 2.2$, the top 2 cost $2 + 2.2 - 2(0.9 + 0.6) = 1.2$. The loss falls while the next document is more likely relevant than not (0.9, then 0.6) and rises once it is less likely (0.2). The document with probability exactly 0.5 costs as much to include as to leave out, which is why the top-2 and top-3 sets tie. Returning the top of the sorted list and stopping where the probability crosses one half is the Bayes rule.
That threshold of one half came from treating both kinds of error as equally bad. When they are not, the order stays the same and the threshold moves, as the next section shows.
The principle with retrieval costs
Errors are rarely equally expensive. In legal discovery or a systematic medical review, missing a relevant document is far worse than reading an extra nonrelevant one. In a casual web search the reverse is closer to true. Let $C_1$ be the cost of failing to retrieve a relevant document and $C_0$ the cost of retrieving a nonrelevant one. Writing $p_d = P(R = 1 \mid d, q)$, the generalized PRP says that document $d$ should be retrieved next if, for every document $d'$ not yet retrieved,
$$C_0 (1 - p_d) - C_1\, p_d \;\le\; C_0 (1 - p_{d'}) - C_1\, p_{d'}.$$
The left side is the net expected cost of retrieving $d$: the cost of retrieving it if it is nonrelevant, minus the cost saved by not missing it if it is relevant. Collecting the terms in $p_d$ shows how it varies:
$$C_0 (1 - p_d) - C_1\, p_d = C_0 - (C_0 + C_1)\, p_d.$$
This is a straight line in $p_d$ with slope $-(C_0 + C_1)$, which is negative whenever the costs are positive. The expression therefore decreases as $p_d$ increases, the document with the least net cost is the one with the greatest probability, and the generalized rule produces the same ordering as the basic one.
What the costs change is where to stop. Retrieving a document is worthwhile when its net expected cost is negative:
$$C_0 (1 - p_d) < C_1\, p_d \quad\Longleftrightarrow\quad p_d > \frac{C_0}{C_0 + C_1}.$$
With equal costs the threshold is 0.5, the Bayes rule above.
Example (a miss nine times as costly). If missing a relevant document is nine times as costly as reading a nonrelevant one, $C_1 = 9 C_0$, all four documents are worth returning. The threshold falls to $C_0 / (C_0 + 9 C_0) = 1/10$, so every document with more than a 10 percent chance of relevance is worth reviewing, including the one at 0.2. The order in which they are shown has not changed at all.
This is the decision a filtering system or a technology-assisted legal review must make (see search in professional domains). It depends on the costs, not on the ranking.
The threshold is the one place where the PRP needs calibrated probabilities. To decide whether a document's probability exceeds 0.1, the score must actually be a probability. A ranking function such as BM25, whose scores are not probabilities, can produce the right order and still give no guidance on where to stop. Calibration and proper scoring rules defines when stated probabilities can be taken at their word and how to measure it.
So far one ordering has been best for every user and every cost. But the proof rested on one choice of what "best" means.
Where the principle fails: an ambiguous query
The proof above maximizes the expected number of relevant documents. Users often want something else: one document that answers the question. When the relevance of documents is correlated, those two goals pull apart, and the PRP can be the wrong ordering.
Consider a query with two senses, such as jaguar the car and jaguar the animal. Suppose 60 percent of the users who type it mean the car and 40 percent the animal. Four documents are candidates:
- three about the car (A1, A2, A3), each relevant exactly when the user means the car;
- one about the animal (B), relevant exactly when the user means the animal.
Each A document has probability of relevance 0.6, and B has 0.4. The PRP ranks A1, A2, A3, B. A diversified ranking puts B second. The diversified ranking gives more users at least one relevant document in the top two, although it has fewer relevant documents there on average:
| Ordering | E[relevant in top 2] | P(at least one relevant in top 2) |
|---|---|---|
| PRP: A1, A2, A3, B | 1.2 | 0.6 |
| Diverse: A1, B, A2, A3 | 1.0 | 1.0 |
The PRP order wins on the measure it was proved for. Car users find two relevant documents in the top two, so the expectation is $2 \times 0.6 = 1.2$. But the 40 percent of users who meant the animal find nothing until position four. The diverse order gives every user at least one relevant document in the top two. Over all 24 orderings (the script enumerates them), 1.2 is the most relevant documents expected in the top two, and 1.0 the highest probability of at least one. The PRP order achieves the first and not the second.
The failure comes from the measure fixed in step 1 of the proof. An expected count is blind to dependence, and the relevance of A1, A2, and A3 is not independent: if A1 is irrelevant to a user, so are A2 and A3. The PRP scores each document as if it were alone. So it cannot see that the second car document adds nothing for the users the first one failed. Robertson (1977) already allowed for failures of this kind, claiming optimality only while the assumptions hold. Cases like this one motivate the diversity methods discussed below.
Assumptions the proof depends on
The ambiguous query broke one assumption. The optimality result rests on several, and real search rarely satisfies them all. Knowing which ones fail explains much of the later history of the field.
- The probabilities are known. The proof assumes the system has $P(R = 1 \mid d, q)$, not an estimate of it. In practice the probabilities come from a model, and a ranking is only as good as its estimates. Robertson's statement already hedges on this point, promising only the best effectiveness obtainable from the data available.
- Relevance is independent across documents. The PRP scores each document in isolation. If the top three results are near-duplicates, the second and third add almost nothing for the user, but the PRP ranks them highly anyway. The ambiguous query above is the same problem in its sharpest form. This motivates diversity-aware ranking such as maximal marginal relevance (Carbonell and Goldstein, 1998). It penalizes a candidate for similarity to documents ranked above it, as described in how a web search engine answers a query.
- Relevance is binary. Users experience degrees of usefulness. Measures such as nDCG were designed for graded relevance, and learning-to-rank methods optimize them directly rather than a binary probability. Listwise losses train on whole ranked lists, and that article gives an explicit case in which one such loss's minimizer orders two documents against expected nDCG.
- The user reads top-down at uniform cost. Interfaces with snippets, images, and answer boxes break the linear reading model the proof relies on. Users also examine lower positions less often, so their clicks favor whatever was ranked high; Learning from Clicks models this with the examination hypothesis and corrects for it with inverse propensity weighting.
None of this makes the PRP wrong. It makes it a statement about an idealized setting. The useful question for any ranking model becomes how closely its scores track the true probability of relevance.
That leaves the largest gap of all. The four documents arrived with their probabilities attached, and real documents do not.
Estimating the probability
The PRP gives no recipe for computing $P(R = 1 \mid d, q)$. With unlimited relevance judgments one could estimate it directly for each query-document pair. But judgments are expensive, and the space of queries is effectively unbounded. Models therefore estimate it from features of the document and query, most simply from which query terms the document contains.
- The Binary Independence Model represents each document by the presence or absence of terms, assumes conditional independence, and derives a ranking that is monotonic in the probability of relevance.
- Okapi BM25 keeps the probabilistic framing while adding term frequency and document length.
- Inference networks compute a belief that the information need is met by propagating probabilities through a network of documents, concepts, and query operators.
- Language models rank by a different quantity, $P(q \mid d)$, which can be connected back to the PRP under further assumptions.
A common misreading is that a model following the PRP must output probabilities. It need not, and this is a convenient consequence of the principle: a model never needs calibrated probabilities to rank correctly. Any score that is a monotonic function of $P(R = 1 \mid d, q)$ produces the same ordering. The derivation of the BIM uses this freedom at every step:
- it replaces probabilities with odds;
- it drops factors that are constant for a query;
- it takes logarithms.
Calibration matters only when the scores themselves are used, as in the stopping threshold above.
Worked problems
The course text sets no exercise on the principle itself, so these three problems are posed on new sets of documents, to exercise each result of the article once. The script recomputes every number.
Problem 1. Five documents have probabilities of relevance 0.7, 0.3, 0.45, 0.85 and 0.1. Give the ranking the principle prescribes, its expected precision at each cutoff, and the set a system should return under 1/0 loss.
The principle sorts by decreasing probability: 0.85, 0.7, 0.45, 0.3, 0.1. The expected number of relevant documents in the top $k$ is the running sum, and expected precision divides it by $k$:
| Cutoff $k$ | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Expected relevant in top $k$ | 0.85 | 1.55 | 2.00 | 2.30 | 2.40 |
| Expected precision at $k$ | 0.850 | 0.775 | 0.667 | 0.575 | 0.480 |
| Expected 1/0 loss of returning the top $k$ | 1.70 | 1.30 | 1.40 | 1.80 | 2.60 |
By the swap argument no other ordering has a larger entry in the first two rows at any cutoff. The loss row uses $L = k + T - 2\sum_{d \in S} p_d$ with $T = 2.40$: for $k = 2$ it is $2 + 2.40 - 2(1.55) = 1.30$. Returning nothing costs $T = 2.40$. By part (a) of the theorem the best set holds the documents with probability above one half, which are the two at 0.85 and 0.7, and the table agrees: the loss is least, 1.30, at $k = 2$. The third document, at 0.45, is more likely nonrelevant than relevant, and adding it raises the loss by $(1 - 0.45) - 0.45 = 0.10$.
Problem 2. For the same five documents, find the set to return (a) when a missed relevant document costs three times as much as a retrieved nonrelevant one, and (b) when it costs a third as much. Confirm (a) by computing the expected cost of each cutoff.
The threshold is $C_0 / (C_0 + C_1)$. (a) With $C_1 = 3 C_0$ it is $1/4$, so the four documents with probability above 0.25 are returned: 0.85, 0.7, 0.45 and 0.3. (b) With $C_0 = 3 C_1$ it is $3/4$, and only the document at 0.85 is returned. The ranking is the same in both cases.
For the confirmation take $C_0 = 1$ and $C_1 = 3$. Returning the top $k$ has expected cost $\sum_{d \in S}(1 - p_d) + 3 \sum_{d \notin S} p_d$:
| Documents returned | none | top 1 | top 2 | top 3 | top 4 | all 5 |
|---|---|---|---|---|---|---|
| Expected cost | 7.20 | 4.80 | 3.00 | 2.20 | 2.00 | 2.60 |
For example, the top 4 cost $(0.15 + 0.30 + 0.55 + 0.70) + 3(0.10) = 2.00$. The cost is least at the top 4, as the threshold predicted. Each added document changes the cost by $(1 - p_d) - 3 p_d = 1 - 4 p_d$, which is negative exactly when $p_d > 1/4$.
Problem 3. A query has three senses, meant by 50, 30 and 20 percent of its users. Documents A1 and A2 are relevant exactly to the first sense, B to the second and C to the third. Compare the principle's ranking with the ranking A1, B, C, A2 on the expected number of relevant documents, on the probability of at least one relevant document, and on the expected reciprocal rank of the first relevant document.
The probabilities of relevance are 0.5, 0.5, 0.3 and 0.2, so the principle ranks A1, A2, B, C. A user of the first sense finds relevant documents wherever A1 and A2 stand, a user of the second only at B, and a user of the third only at C.
| Cutoff $k$ | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| PRP order, expected relevant in top $k$ | 0.5 | 1.0 | 1.3 | 1.5 |
| Diverse order, expected relevant in top $k$ | 0.5 | 0.8 | 1.0 | 1.5 |
| PRP order, P(at least one relevant in top $k$) | 0.5 | 0.5 | 0.8 | 1.0 |
| Diverse order, P(at least one relevant in top $k$) | 0.5 | 0.8 | 1.0 | 1.0 |
The principle's order is never worse on the expected count, as the proof guarantees, and strictly better at $k = 2$ and $k = 3$. The diverse order is never worse on the probability of at least one relevant document, and strictly better at the same two cutoffs. For the reciprocal rank, a user's first relevant document is at rank 1, 3 or 4 under the principle's order, according to sense, and at rank 1, 2 or 3 under the diverse order:
$$0.5 \times 1 + 0.3 \times \tfrac13 + 0.2 \times \tfrac14 = 0.650, \qquad 0.5 \times 1 + 0.3 \times \tfrac12 + 0.2 \times \tfrac13 = 0.717.$$
The diverse order is better for a user who wants one answer. Enumerating all 24 orderings, the script confirms that 0.717 is the largest expected reciprocal rank any ordering achieves, and that no ordering reaches both 1.0 expected relevant documents and probability 0.8 at $k = 2$. The two goals cannot both be met, and the principle is optimal for the first only.
What we have learned
Sorting by probability of relevance maximizes the expected number of relevant documents at every cutoff at once; the proof needs only additivity of expectation and adjacent swaps. The same additivity proves that the sorted order minimizes expected 1/0 loss at every cutoff. As a set decision, the same idea returns every document more likely relevant than not. Unequal costs move that threshold, to 0.1 when a miss costs nine times a false alarm, but leave the order unchanged. The principle can fail when relevance is correlated across documents, as the ambiguous query showed, and it says nothing about how to obtain the probabilities.
That last gap is the subject of the rest of the topic. The Binary Independence Model makes the first estimate, from nothing more than which query terms each document contains.
References
- Carbonell, J., and Goldstein, J. (1998). The use of MMR, diversity-based reranking for reordering documents and producing summaries. In Proceedings of SIGIR 1998, 335–336. record · 4 pages
- Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, section 11.2. Cambridge University Press. record · 102 pages
- Maron, M. E., and Kuhns, J. L. (1960). On relevance, probabilistic indexing and information retrieval. Journal of the ACM, 7(3), 216–244. record · 2 pages
- Ripley, B. D. (1996). Pattern Recognition and Neural Networks. Cambridge University Press. record · 3 pages
- Robertson, S. E. (1977). The probability ranking principle in IR. Journal of Documentation, 33(4), 294–304. record · 3 pages
- van Rijsbergen, C. J. (1979). Information Retrieval (2nd ed.). Butterworths. record · 8 pages
Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 11 revisions