Probabilistic retrieval rests on a few rules of probability. In odds form, Bayes' rule says that posterior odds equal prior odds times the likelihood ratio $P(x_t \mid R = 1) / P(x_t \mid R = 0)$: a term in 80 percent of relevant and 5 percent of other documents lifts a 1 percent prior to 0.139. If terms are conditionally independent given relevance, their log likelihood ratios add, the form of the Binary Independence Model. For related terms this overcounts: on Cranfield query 185 it inflates ninefold the odds for abstracts containing panel and flutter. A term in $s$ of $S$ judged documents is estimated as $(s + \alpha)/(S + 2\alpha)$, the posterior mean under a Beta($\alpha$, $\alpha$) prior (add-½ for the Robertson–Spärck Jones weight, add-1 for Naive Bayes).
One percent of the documents in a collection are relevant to a query. A particular term appears in 80 percent of the relevant documents but only 5 percent of the others. The term is clearly good evidence. If a document contains it, how likely is the document to be relevant? About 14 percent.
That answer follows from a few rules of probability. The same rules, applied term by term, produce the Binary Independence Model and the weight of every term in BM25. This article collects the probability the topic relies on, following Manning, Raghavan, and Schütze (2008, §11.1 and §11.3.2). Later articles build on its treatment of odds, conditional independence and smoothing. The numbers are computed by tools/experiments/cranfield/probability_primer.py and rounded as shown.
Here is the route. First we answer the opening question with Bayes' rule, once with probabilities and once with counts. Next we rewrite it in log odds, where evidence adds up. We then test the independence assumption on two real Cranfield terms. Finally we estimate probabilities from a handful of judged documents.
Events, random variables, and the basic rules
The Rules of Probability introduces these at length; here is the minimum. A probability $P(A)$ measures how likely an event $A$ is, on a scale from 0 (impossible) to 1 (certain). Two rules follow from the axioms:
- The probabilities of all possible outcomes sum to 1.
- The complement of $A$, the event that $A$ does not happen, has probability $P(\bar{A}) = 1 - P(A)$.
A random variable assigns a value to each outcome. Many retrieval models use binary random variables. $R$ is 1 if a document is relevant and 0 if not, and $x_t$ is 1 if a document contains term $t$ and 0 if not. Writing $P(R = 1)$ means the probability that a document drawn at random is relevant.
Joint and conditional probability
The joint probability $P(A, B)$ is the probability that both $A$ and $B$ occur. The conditional probability $P(A \mid B)$ is the probability of $A$ given that $B$ is known to have occurred:
$$P(A \mid B) = \frac{P(A, B)}{P(B)}, \qquad \text{provided } P(B) > 0.$$
Conditioning restricts attention to the outcomes in which $B$ happened. In retrieval, two conditional probabilities look alike and mean different things:
- $P(x_t = 1 \mid R = 1)$ is the fraction of relevant documents that contain $t$.
- $P(R = 1 \mid x_t = 1)$ is the fraction of documents containing $t$ that are relevant.
Confusing them is a common error. Retrieval needs the second, but data about relevant documents naturally gives the first. The opening example states the first (80 percent) and asks for the second.
Rearranging the definition gives the chain rule, $P(A, B) = P(A \mid B)\, P(B) = P(B \mid A)\, P(A)$. It extends to any number of events:
$$P(A, B, C) = P(A \mid B, C)\, P(B \mid C)\, P(C).$$
The law of total probability splits an event by cases: $P(B) = P(B \mid A)\, P(A) + P(B \mid \bar{A})\, P(\bar{A})$. These two rules are all we need to turn one conditional probability into the other.
Bayes' rule
The chain rule writes the same joint probability two ways. Equating the two and dividing by $P(B)$ gives Bayes' rule:
$$P(A \mid B) = \frac{P(B \mid A)\, P(A)}{P(B)}.$$
$P(A)$ is the prior probability of $A$, before $B$ is observed. $P(A \mid B)$ is the posterior, after. $P(B \mid A)$ is the likelihood of the evidence under $A$.
Example (strong evidence, low posterior). A document that contains the term is still much more likely to be nonrelevant than relevant, although the term is sixteen times as common in relevant documents as in nonrelevant ones. The prior probability of relevance is $P(R = 1) = 0.01$. The term appears in relevant documents with probability $P(x_t = 1 \mid R = 1) = 0.8$, and in nonrelevant documents with probability $P(x_t = 1 \mid R = 0) = 0.05$. By Bayes' rule, with the denominator expanded by total probability,
$$P(R = 1 \mid x_t = 1) = \frac{0.8 \times 0.01}{0.8 \times 0.01 + 0.05 \times 0.99} = \frac{0.008}{0.0575} \approx 0.139.$$
The term is strong evidence, yet the prior is so low that the posterior stays at 14 percent. Reading the 80 percent as the answer is the confusion of the two conditional probabilities above. That is typical of retrieval. Relevant documents are rare, so any single clue is insufficient on its own, and models must combine many clues. A screening test for a rare disease has the same structure (Predictive Values and Bayes' Theorem).
The same calculation as counts
Bayes' rule is easier to trust when it is done with counts. Imagine 10,000 documents with exactly the stated proportions:
| Contain the term | Lack the term | Total | |
|---|---|---|---|
| Relevant | 80 | 20 | 100 |
| Nonrelevant | 495 | 9,405 | 9,900 |
| Total | 575 | 9,425 | 10,000 |
Each row applies one conditional probability: 80 percent of the 100 relevant documents contain the term, and 5 percent of the 9,900 nonrelevant ones do. The question "how likely is a document containing the term to be relevant?" reads down the first column. Of the 575 documents that contain the term, 80 are relevant, and $80 / 575 = 0.139$. The 495 nonrelevant documents outnumber the 80 relevant ones because there are 99 times as many nonrelevant documents to begin with. Bayes' rule is exactly this division, written with probabilities instead of counts.
The same table answers the opposite question as well. A document that lacks the term is relevant with probability $20 / 9425 = 0.0021$, a fifth of the prior. The absence of a good term is evidence too, and the BIM uses it.
How the prior controls the answer
The posterior depends as much on the prior as on the evidence. The figure plots the posterior against the prior for three strengths of evidence: the term above, a second term discussed below, and both together.
For a fixed query the prior is the same for every document, so it does not change the order in which documents are ranked. It does decide whether a score can be read as a probability. That distinction between ranking and calibration returns in the Probability Ranking Principle. Calibration and proper scoring rules defines when stated probabilities can be taken at their word and how to measure it.
One part of the calculation is awkward: the denominator $P(x_t)$ needs both classes at once. Odds remove it.
Odds and log odds
The odds of an event are the ratio of its probability to the probability of its complement:
$$O(A) = \frac{P(A)}{1 - P(A)}.$$
A probability of 0.5 is odds of 1. Odds range from 0 to infinity, and they increase whenever the probability does, so ranking by odds gives the same order as ranking by probability.
In odds form, Bayes' rule becomes a multiplication. Write it once for $R = 1$ and once for $R = 0$ and divide; the shared denominator $P(x_t)$ cancels:
$$O(R \mid x_t) = \frac{P(R = 1 \mid x_t)}{P(R = 0 \mid x_t)} = \frac{P(x_t \mid R = 1)\, P(R = 1) / P(x_t)}{P(x_t \mid R = 0)\, P(R = 0) / P(x_t)} = O(R) \times \frac{P(x_t \mid R = 1)}{P(x_t \mid R = 0)}.$$
The second factor is the likelihood ratio: how much more probable the evidence is if the document is relevant. The same identity, with two models in place of relevance and nonrelevance, is the Bayes factor of Bayes factors: posterior odds between models equal their prior odds times the ratio of their marginal likelihoods. In the example:
- the prior odds are $0.01/0.99 \approx 0.0101$;
- the likelihood ratio is $0.8/0.05 = 16$;
- the posterior odds are $0.0101 \times 16 \approx 0.162$.
Converting back with $p = O / (1 + O)$ gives the probability 0.139 found above; in the table of counts the posterior odds are simply $80 : 495$. Losing the denominator is exactly why the BIM derivation ranks by odds rather than probability.
Example (the evidence of an absent term). Lacking the term multiplies a document's odds of relevance by $P(x_t = 0 \mid R = 1) / P(x_t = 0 \mid R = 0) = 0.2 / 0.95 = 0.2105$, about a fifth. The posterior odds are $0.0101 \times 0.2105 = 0.00213$, and the posterior probability is $0.00213 / 1.00213 = 0.0021$, as the table of counts gave.
Taking logarithms turns the multiplication into addition:
$$\log O(R \mid x_t) = \log O(R) + \log \frac{P(x_t \mid R = 1)}{P(x_t \mid R = 0)}.$$
Each piece of evidence now adds its log likelihood ratio, and a ranking function becomes a sum of term weights. The logarithm also preserves order, so the ranking is still unchanged. A model that is linear on the log-odds scale is also the form of logistic regression, which fits the weights to labeled outcomes by maximum likelihood instead of deriving them from per-class term rates.
On this scale a term weight is a distance, and a document's score is where its evidence carries it. A term that is equally common in relevant and nonrelevant documents has likelihood ratio 1 and weight 0. A term that is rarer in relevant documents has a negative weight and moves the score left.
Adding the second arrow to the first quietly assumed that the second term's evidence does not depend on the first.
Conditional independence
Two events are independent if $P(A, B) = P(A)\, P(B)$. They are conditionally independent given $C$ if
$$P(A, B \mid C) = P(A \mid C)\, P(B \mid C).$$
The BIM and Naive Bayes assume that terms are conditionally independent given relevance. Then the likelihood ratio for a whole document is the product of the per-term ratios, and the log odds are a sum of per-term weights.
Suppose a second term appears in 60 percent of relevant documents and 10 percent of nonrelevant ones, a likelihood ratio of 6. If the two terms are conditionally independent given relevance, a document containing both has posterior log odds
$$\log 0.0101 + \log 16 + \log 6 = -4.5951 + 2.7726 + 1.7918 \approx -0.031,$$
using natural logarithms. That corresponds to odds of 0.970 and a probability of 0.492: two clues, each insufficient alone, raise a 1 percent prior to nearly even odds.
Real terms about the same subject tend to occur together, so this calculation overcounts correlated evidence. The models often rank well anyway, since ranking depends only on the order of the scores and the overcounting tends to inflate related documents together, as the next section and the BIM article show on a real query. Term dependence models treat what happens when the assumption is relaxed.
Two kinds of independence
Conditional independence and plain independence are different claims, and neither implies the other. In the example, the two terms are independent within the relevant documents and within the nonrelevant documents, by assumption. The example below shows that they are nonetheless associated across the collection. The converse fails as well. Toss two fair coins independently. Let $A$ be the event that the first comes up heads, $B$ that the second does, and $C$ that the two agree. Then $P(A, B) = \tfrac14 = P(A)\,P(B)$, but given $C$, $P(A, B \mid C) = \tfrac12$ while $P(A \mid C)\,P(B \mid C) = \tfrac14$: independent events need not be conditionally independent.
Example (conditionally independent, yet associated). Across the whole collection, mixing both classes, the two terms co-occur more often than plain independence predicts. The joint probability, by total probability over the two classes, is
$$P(t_1, t_2) = 0.01 \times 0.8 \times 0.6 + 0.99 \times 0.05 \times 0.1 = 0.00975,$$
while $P(t_1)\, P(t_2) = 0.0575 \times 0.105 = 0.00604$. The terms co-occur 1.61 times as often as independence predicts, purely because both are more common in the relevant documents. Relevance is a common cause, and conditioning on it removes the association it creates. That is what the BIM assumes: whatever links terms together runs through relevance.
Testing the assumption on real counts
For real terms the assumption can be far from true, and two terms of the Cranfield collection show it. The collection holds 1,400 aerodynamics abstracts and is used throughout this topic, as in comparing ranking models. Counted as Porter stems, the forms the index stores (so panels counts as panel), panel occurs in 45 abstracts and flutter in 56. If they occurred independently, about $45 \times 56 / 1400 = 1.8$ abstracts would contain both. In fact 20 do, eleven times as many: panel flutter is a named phenomenon. Conditioning on relevance does not remove the association either. Take Cranfield query 185, experimental studies on panel flutter. Among the 1,391 abstracts not relevant to it, 11 contain both words, where independence within that class predicts 1.2. The terms are associated because they name one subject, and that subject is shared by relevant and nonrelevant documents alike. These counts come from part 4 of probability_primer.py, which reads the collection through the ir_datasets package and stems with NLTK's Porter stemmer.
A model that assumes conditional independence double counts. A document containing both words receives credit for panel and again for flutter, though the second adds less than its weight claims. Among the relevant abstracts it always accompanies the first (all nine contain both), and among the nonrelevant ones the two co-occur nine times as often as independence predicts (11 against 1.22). Across the whole collection the association is weaker: 20 of the 45 abstracts with panel contain flutter. For ranking, the damage is limited when the overcounting is similar across the documents being compared. All the abstracts that mention panel flutter are inflated together. How the BIM fares on this very query is worked through in the BIM article.
Estimating probabilities from counts
Every formula so far took probabilities such as 0.8 as given. Models need numbers for quantities like $P(x_t = 1 \mid R = 1)$. The natural estimate is a relative frequency. If 8 of 10 known relevant documents contain $t$, estimate 0.8. This is the maximum likelihood estimate, the value that makes the observed data most probable. (Maximum Likelihood Estimation proves this for a proportion and treats the method in general, including estimates that fall at 0 or 1.)
Maximum likelihood estimates fail on small samples. If none of 10 relevant documents contains a term, the estimate is 0, and a log odds weight becomes infinite. If all 10 contain it, $1 - p = 0$ and the weight is again infinite. Smoothing adds a small pseudo-count to each outcome so that no estimate is exactly 0 or 1. Adding $\tfrac{1}{2}$ to each count, as in the Robertson–Spärck Jones weight (Robertson and Spärck Jones, 1976), gives
$$\hat{p} = \frac{s + \tfrac{1}{2}}{S + 1}$$
for a term in $s$ of $S$ relevant documents. Adding 1 instead (Laplace smoothing) is common in Naive Bayes. Both are Bayesian estimates under a prior belief about the probability, as the last part of this section derives. Both pull small-sample estimates toward the middle, which is what a careful estimate from little evidence should do.
With only four judged relevant documents, the three estimators disagree sharply at the extremes:
| Relevant documents containing $t$ ($s$ of 4) | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| Maximum likelihood $s/S$ | 0.000 | 0.250 | 0.500 | 0.750 | 1.000 |
| Add $\tfrac12$: $(s + \tfrac12)/(S + 1)$ | 0.100 | 0.300 | 0.500 | 0.700 | 0.900 |
| Add 1: $(s + 1)/(S + 2)$ | 0.167 | 0.333 | 0.500 | 0.667 | 0.833 |
| Log odds $\log \frac{p}{1-p}$, add $\tfrac12$ | −2.197 | −0.847 | 0.000 | 0.847 | 2.197 |
Under maximum likelihood the outer columns give log odds of minus and plus infinity, so one term absent from four documents would veto a document outright. The smoothed estimates keep the weight finite and say, in effect, that four observations are not enough to be certain.
Example (panel in query 185). Cranfield query 185 has nine judged relevant abstracts, and all nine contain panel. The maximum likelihood estimate of $p_t$ for panel is $9/9 = 1$, which makes the log odds infinite. Adding a half gives $9.5/10 = 0.95$, the value the BIM article uses.
Where the pseudo-counts come from
Adding a half may look like an arbitrary patch. Here is the idea in one sentence: if the prior belief about $p$ is itself shaped like a set of counts, observed counts simply add to it.
The formal version. Treat the unknown probability $p$ as a random variable with a Beta prior, whose density is proportional to $p^{\alpha - 1} (1 - p)^{\alpha - 1}$. With $\alpha = 1$ this is uniform: every value of $p$ equally plausible.
- Likelihood. Observing the term in $s$ of $S$ documents has probability proportional to $p^{s} (1 - p)^{S - s}$.
- Posterior. By Bayes' rule the posterior density is proportional to prior times likelihood, $p^{s + \alpha - 1} (1 - p)^{S - s + \alpha - 1}$. This is again a Beta density, with the counts added to the prior's parameters; a prior with this property is called conjugate. That is why the prior's parameter behaves like a count.
- Posterior mean. The mean of a Beta density proportional to $p^{a - 1}(1 - p)^{b - 1}$ is $a / (a + b)$, as shown below. Here $a = s + \alpha$ and $b = S - s + \alpha$, which gives
$$E[p \mid s, S] = \frac{s + \alpha}{S + 2\alpha}.$$
The mean of a Beta density. Write $I(a, b) = \int_0^1 p^{a - 1} (1 - p)^{b - 1}\, dp$ for $a, b > 0$. The density is $p^{a-1}(1-p)^{b-1} / I(a, b)$, so its mean is $\int_0^1 p \cdot p^{a-1}(1-p)^{b-1}\, dp \,/\, I(a, b) = I(a + 1, b) / I(a, b)$. Two facts give the ratio.
- Since $p + (1 - p) = 1$, multiplying the integrand of $I(a, b)$ by it splits the integral: $I(a, b) = I(a + 1, b) + I(a, b + 1)$.
- Integrating by parts, with $p^{a}$ differentiated and $(1 - p)^{b - 1}$ integrated to $-(1 - p)^{b} / b$, $$I(a + 1, b) = \left[ -\frac{p^{a} (1 - p)^{b}}{b} \right]_0^1 + \frac{a}{b} \int_0^1 p^{a - 1} (1 - p)^{b}\, dp = \frac{a}{b}\, I(a, b + 1).$$ The bracket vanishes at both ends because $a$ and $b$ are positive.
Substituting $I(a, b + 1) = \tfrac{b}{a}\, I(a + 1, b)$ into the first fact gives $I(a, b) = I(a + 1, b)\,(1 + \tfrac{b}{a})$, so $I(a + 1, b) / I(a, b) = a / (a + b)$.
With $\alpha = 1$ the posterior mean is add-one (Laplace) smoothing, and with $\alpha = \tfrac12$ it is the add-a-half estimate above. For $s = 1$ of $S = 4$ the formula gives $1.5 / 5 = 0.300$ and $2 / 6 = 0.333$, the table's entries, and the script's numerical integration of the two posteriors agrees to four decimal places. A larger $\alpha$ expresses a stronger prior belief that $p$ is near one half, and needs more data to overcome. Choosing a Prior treats the choice of $\alpha$ itself: add-one is the uniform prior, add-half is Jeffreys' prior, and on the Cranfield abstracts the strength of a Dirichlet prior is chosen from the data. Manning, Raghavan, and Schütze (2008, §11.3.2 and §11.3.4) present the same idea, calling the estimate maximum a posteriori: the same add-$\alpha$ value is also the posterior mode under a Beta prior with parameter $\alpha + 1$. They use it again in relevance feedback, where the previous estimate of $p_t$ serves as the prior for the next.
The quantities this topic uses
| Quantity | Meaning |
|---|---|
| $P(R = 1 \mid d, q)$ | What the Probability Ranking Principle says to rank by |
| $O(R \mid d, q)$ | The same ranking, without the hard-to-estimate denominator |
| $p_t = P(x_t = 1 \mid R = 1)$ | How often relevant documents contain term $t$ |
| $u_t = P(x_t = 1 \mid R = 0)$ | How often nonrelevant documents contain $t$, close to $\mathit{df}_t / N$ |
| $\log \frac{p_t (1 - u_t)}{u_t (1 - p_t)}$ | The log odds ratio weight of term $t$ in the BIM |
| $\hat p_t = \frac{s + \frac12}{S + 1}$, $\hat u_t = \frac{\mathit{df}_t - s + \frac12}{N - S + 1}$ | Add-½ estimates of $p_t$ and $u_t$ from $S$ judged relevant documents, $s$ of which contain $t$, in a collection of $N$ documents |
Substituting the two add-½ estimates into the log odds ratio gives the weight a system can compute from counts alone. With no relevance judgments ($S = s = 0$) $\hat p_t = \tfrac12$, and the weight reduces to $\log \frac{N - \mathit{df}_t + \frac12}{\mathit{df}_t + \frac12}$, an inverse document frequency. The Binary Independence Model derives this weight and works it on query 185.
Worked problems
Problem 1 is Exercise 11.3 of the course text (Manning, Raghavan, and Schütze, 2008). Problems 2 to 4 are posed on this article's own examples, and the script recomputes every number in them.
Problem 1 (Exercise 11.3 of the course text). A term's presence is observed in each of the $S$ relevant documents of a collection, and the term occurs in $s$ of them. Taking those $S$ observations as the data, show that the value of $p_t = P(x_t = 1 \mid R = 1)$ that maximizes the probability of the data is $s / S$.
Each relevant document contains the term with probability $p$ and lacks it with probability $1 - p$, and the observations are treated as independent. The probability of a particular set of observations with $s$ presences and $S - s$ absences is therefore the likelihood
$$L(p) = p^{s} (1 - p)^{S - s}, \qquad 0 \le p \le 1.$$
Suppose first that $0 < s < S$. Then $L(0) = L(1) = 0$ and $L(p) > 0$ in between, so the maximum is at an interior point where the derivative vanishes. The logarithm is increasing, so $\log L$ has its maximum at the same point, and
$$\frac{d}{dp} \log L(p) = \frac{s}{p} - \frac{S - s}{1 - p} = 0 \iff s(1 - p) = (S - s)\,p \iff p = \frac{s}{S}.$$
The second derivative, $-s/p^2 - (S - s)/(1 - p)^2$, is negative everywhere, so this single stationary point is the maximum. In the two remaining cases the formula still holds. If $s = 0$, then $L(p) = (1 - p)^S$ decreases in $p$ and is largest at $p = 0 = s/S$. If $s = S$, then $L(p) = p^S$ increases and is largest at $p = 1 = s/S$. So the maximum likelihood estimate is $s/S$ in every case. For panel in query 185 it is $9/9 = 1$, the boundary case that makes the unsmoothed weight infinite.
Problem 2. In the opening example the prior is 0.01, and the first term has $P(x_1 = 1 \mid R = 1) = 0.8$ and $P(x_1 = 1 \mid R = 0) = 0.05$. For which priors does the first term alone make a document that contains it more likely relevant than not?
A posterior above one half is posterior odds above 1. In odds form the posterior odds are the prior odds times the likelihood ratio 16, so the condition is $O(R) > 1/16$. Converting with $p = O/(1 + O)$, which increases with $O$, the prior must exceed $\tfrac{1/16}{1 + 1/16} = 1/17 \approx 0.0588$. At the example's prior of 0.01 the posterior is 0.139; at a prior of exactly $1/17$ it is exactly one half. The figure's middle curve crosses 0.5 at that point.
Problem 3. With the same prior and the two terms of the conditional-independence example (the second has probabilities 0.6 and 0.1 of occurring in relevant and nonrelevant documents), find the probability of relevance of a document that contains the first term and lacks the second.
Under conditional independence the likelihood ratios multiply. Presence of the first term contributes $0.8 / 0.05 = 16$. Absence of the second contributes $(1 - 0.6)/(1 - 0.1) = 0.4/0.9 = 0.4444$. The posterior odds are
$$0.010101 \times 16 \times 0.4444 = 0.07183,$$
and the probability is $0.07183 / 1.07183 = 0.0670$. In log odds this is $-4.5951 + 2.7726 - 0.8109 \approx -2.633$. The missing second term multiplies the odds by 0.444 and so roughly halves the 0.139 that the first term alone gave: absence is evidence, with a negative weight.
Problem 4. In Cranfield, counting Porter stems, panel occurs in 45 abstracts, flutter in 56 and both in 20. All nine abstracts relevant to query 185 (experimental studies on panel flutter) contain both words. (a) Find $P(\textit{flutter} \mid \textit{panel})$ and $P(\textit{panel} \mid \textit{flutter})$ over the collection and check Bayes' rule on them. (b) Find the true probability of relevance to query 185 of an abstract containing both words, and the probability a model would compute by multiplying the two terms' likelihood ratios as if they were conditionally independent.
(a) Of the 45 abstracts with panel, 20 contain flutter, so $P(\textit{flutter} \mid \textit{panel}) = 20/45 = 0.444$, eleven times the unconditional $56/1400 = 0.040$. Of the 56 with flutter, 20 contain panel: $P(\textit{panel} \mid \textit{flutter}) = 20/56 = 0.357$. Bayes' rule gives the same value from the other direction: $\tfrac{20}{45} \times \tfrac{45}{1400} \big/ \tfrac{56}{1400} = \tfrac{20}{56}$.
(b) By counting, 20 abstracts contain both words and 9 of them are relevant, so the true probability is $9/20 = 0.45$, odds of $9 : 11 = 0.818$. For the model's figure we need each term's rate in the two classes. All 9 relevant abstracts contain each word. Among the 1,391 nonrelevant abstracts, $45 - 9 = 36$ contain panel and $56 - 9 = 47$ contain flutter. The prior odds are $9/1391$, and the likelihood ratios are $1 \big/ \tfrac{36}{1391} = 38.64$ and $1 \big/ \tfrac{47}{1391} = 29.60$. Their product with the prior odds is
$$\frac{9}{1391} \times \frac{1391}{36} \times \frac{1391}{47} = \frac{9 \times 1391}{36 \times 47} = 7.40,$$
a probability of $7.40 / 8.40 = 0.881$. The independence assumption nearly doubles the probability (0.881 against 0.45) and inflates the odds by a factor of $7.40 / 0.818 = 9.04$. That factor is exactly the excess co-occurrence among the nonrelevant abstracts found above: 11 observed against $36 \times 47 / 1391 = 1.22$ predicted. The double counting does not reorder the 20 abstracts that contain both words, since all receive the same inflated score.
What we have learned
A good term can leave a document unlikely to be relevant: sixteen-to-one evidence lifts a 1 percent prior only to 14 percent. In odds, Bayes' rule multiplies by a likelihood ratio, and in log odds each piece of evidence adds a weight. That sum assumes conditional independence, which panel and flutter violate. Smoothing keeps small-sample estimates finite, and its pseudo-counts are a Beta prior.
All of this assumes that ranking by probability of relevance is the right goal. The Probability Ranking Principle states when it is, and shows a case where it is not.
References
- Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, sections 11.1 and 11.3. Cambridge University Press. record · 102 pages
- Robertson, S. E., and Spärck Jones, K. (1976). Relevance weighting of search terms. Journal of the American Society for Information Science, 27(3), 129–146. record · 4 pages
Reviewed: verified, 16 Nov 2026 · second opinion, 23 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 11 revisions