Why Total Urn Size Matters
In an urn allocation rule, the probability of assigning the next participant to a treatment is determined by that treatment's share of the balls currently in the urn. A response can change both the number of balls of each treatment color and the total number of balls. Even when a treatment gains balls, its allocation probability need not increase by the same amount as its count: the denominator may have changed too.
The key calculation is therefore two-part. First find the count change for each treatment from the applicable replacement row. Then add those changes to the current counts and divide by the updated total. This tutorial derives that normalization and gives checks for recognizing an incorrectly calculated total.
Notation and Replacement-Row Convention
For binary responses, write \(S\) for success and \(F\) for failure. The outcome-specific replacement matrices \(R^S\) and \(R^F\) have rows indexed by the treatment drawn and columns indexed by the color whose count changes. If treatment \(i\) is drawn and response \(y\) occurs, use row \(i\) of \(R^y\). The entries in that row are net changes, not the new counts.
At a state with \(T>0\), treatment \(k\) is selected with probability \(p_k=x_k/T\). After the response and update, the corresponding probability is based on the new counts and new total. For a valid update, every updated count must be nonnegative and the updated total must be positive.
Replacement matrices are sometimes recorded using a different convention: the selected ball is removed first, and the row lists balls subsequently added. If that add-after-removal row is \(a_{i,y}\), the equivalent net-change row is \(r_{i,y}=a_{i,y}-e_i\), where \(e_i\) has a 1 in position \(i\) and zeros elsewhere. Under that convention, the total changes by the row sum of \(a_{i,y}\) minus 1. Confusing these conventions creates an error of exactly one ball in the total.
Deriving the Total and the New Allocation Probabilities
Suppose treatment \(i\) is drawn and response \(y\) is observed. The new count of color \(k\) is \(x_k+r_{i,y,k}\). Summing over all colors gives the new total:
Thus the response-specific change in total size is the sum of the entries in the selected net-change row. Denote this change by \(\Delta T_{i,y}\). Then \(\Delta T_{i,y}=\sum_k r_{i,y,k}\) and \(T'=T+\Delta T_{i,y}\). Positive, zero, and negative row sums respectively mean that the urn grows, keeps the same size, or shrinks.
The probability of treatment \(k\) at the next assignment is its updated count divided by the updated total. Therefore,
This formula requires a positive updated total and nonnegative updated counts. It also shows why one cannot update a treatment probability by looking only at that treatment's count change: every treatment probability shares the new denominator.
A Short Derivation of the Probability Shift
The updated probability can also be compared directly with the probability before the response. Write \(r_k=r_{i,y,k}\), \(\Delta T=\sum_k r_k\), and \(p_k=x_k/T\). Subtracting the original probability from the updated one gives
The last equality follows by placing the fractions over the common denominator \(T(T+\Delta T)\): the numerator is \(T(x_k+r_k)-x_k(T+\Delta T)=Tr_k-x_k\Delta T\). Since \(x_k=T p_k\), the same expression can be written as
This identity separates the two effects. The numerator includes the direct change \(r_k\) to color \(k\), offset by the share \(p_k\) of the overall total change. If the urn grows, an unchanged color count can lose probability share; if the urn shrinks, it can gain share. A positive count change does not, by itself, guarantee a positive probability shift.
Worked Example: A Success Increases the Total
Suppose the urn has two treatment colors, \(A\) and \(B\), with \(x=(10,6)^\mathsf{T}\), so \(T=16\). The success row for drawing \(A\) is \(r_{A,S}=(2,1)^\mathsf{T}\). These are net changes: after an \(A\) assignment with success, add 2 to the \(A\) count and 1 to the \(B\) count.
Total change. Sum the entries in the selected row: \(\Delta T_{A,S}=2+1=3\). The updated total is \(T'=16+3=19\).
Updated counts and probabilities. The new count vector is \((10+2,6+1)^\mathsf{T}=(12,7)^\mathsf{T}\). Thus \(p'_A=12/19\approx0.6316\) and \(p'_B=7/19\approx0.3684\). Before the update, the probabilities were \(10/16=0.6250\) and \(6/16=0.3750\).
The \(A\) probability rises by about \(0.00658\), while the \(B\) probability falls by about \(0.00658\). The counts and total both increased, so the allocation probabilities must be computed from \(12/19\) and \(7/19\), not by adding the count changes to the old probabilities.
Worked Example: A Failure Decreases the Total
Now let \(x=(8,7)^\mathsf{T}\), with \(T=15\). Suppose the failure row for drawing \(B\) is \(r_{B,F}=(0,-1)^\mathsf{T}\). This response removes one \(B\) ball and leaves the \(A\) count unchanged. The resulting counts are nonnegative, and the urn remains nonempty, so the update is feasible.
The row sum gives \(\Delta T_{B,F}=0+(-1)=-1\), hence \(T'=15-1=14\). The updated state is \((8,6)^\mathsf{T}\), giving \(p'_A=8/14\approx0.5714\) and \(p'_B=6/14\approx0.4286\).
Before the update, \(p_A=8/15\approx0.5333\) and \(p_B=7/15\approx0.4667\). Although the number of \(A\) balls did not change, its probability increased because the total decreased. The total-size change is essential to interpreting this update.
Worked Example: A Constant-Size Replacement
Suppose \(x=(6,4)^\mathsf{T}\), so \(T=10\), and the failure row for drawing \(A\) is \(r_{A,F}=(-1,1)^\mathsf{T}\). This is a net transfer: one \(A\) ball is removed and one \(B\) ball is added.
The row sum is \(\Delta T_{A,F}=-1+1=0\), so \(T'=10\). The updated counts are \((5,5)^\mathsf{T}\), and the next-assignment probabilities are \(p'_A=5/10=0.5000\) and \(p'_B=5/10=0.5000\). Initially, the probabilities were \(6/10=0.6000\) and \(4/10=0.4000\).
For comparison, under an add-after-removal convention, the same physical rule would be represented by removing the drawn \(A\) ball and adding one \(B\) ball. The added-ball row is \((0,1)^\mathsf{T}\), whose entries sum to 1; subtracting 1 for the removed draw gives a total change of 0. Both conventions produce the same updated state when applied consistently.
Assumptions and Calculation Checks
These calculations are conditional on the state before the assignment, the treatment drawn, the response observed, and the replacement rule that applies to that response. The urn update itself is deterministic once those are specified; randomness enters through treatment selection and response. The treatment probabilities are proportional to the current treatment-color counts, and the replacement row used must match both the treatment drawn and the observed response.
Before using the updated probabilities, check the state and the normalization:
- Use the correct row. Select the row for the treatment actually drawn from the matrix for the response actually observed.
- Check every updated count. For each \(k\), verify \(x_k+r_{i,y,k}\geq 0\). A positive total does not make a state valid if one of its color counts is negative.
- Check the updated total. Verify \(T'=T+\sum_k r_{i,y,k}=\sum_k(x_k+r_{i,y,k})\), and require \(T'>0\) to define the next allocation probabilities.
- Check normalization. The probabilities must sum to 1: \(\sum_k p'_k=\sum_k(x_k+r_{i,y,k})/T'=T'/T'=1\).
A common error is to use a row sum as the total change even though the matrix records additions after the drawn ball has been removed. In that convention, the selected ball's removal must also be counted, giving total change equal to the additions-row sum minus 1. The correction is to identify the matrix convention first and convert the row to net changes before normalizing.
What the Total-Size Calculation Does and Does Not Tell You
Summing a replacement row answers a specific bookkeeping question: how many balls does the urn gain or lose after this treatment-response event? It does not by itself determine which response will occur, the probability of that response, or the long-run behavior of the design. Those require additional parts of the urn model. For the one-step allocation calculation here, the relevant information is the current state, the observed response, and the corresponding replacement row.
| Update representation | Total change | What to use for the next probability |
|---|---|---|
| Net-change row \(r\) | Sum of entries in \(r\) | Updated count divided by updated total |
| Additions row \(a\) after removal of the drawn ball | Sum of entries in \(a\), minus 1 | Current count minus the drawn ball, plus additions; then divide by the resulting total |
| Count changes stated separately | Sum all color-count changes | Updated count divided by the sum of updated counts |
A constant-size replacement is a useful special case, not a general assumption. It occurs exactly when the selected net-change row sums to zero. If different response rows have different sums, the urn size depends on the observed response; applying a single fixed denominator to every possible outcome would then misstate at least some next-assignment probabilities.
Common Mistakes
- Using the wrong row sum. A row for success cannot be used after failure merely because the same treatment was drawn. The update is indexed by both the drawn treatment and observed response.
- Updating the numerator but not the denominator. The next probability is not the new count divided by the old total when the selected row has a nonzero sum.
- Assuming the total must increase. A row can have a negative sum, a zero sum, or a positive sum. Its entries, not the label “reinforcement,” determine the total change.
- Mixing conventions. If the draw is removed before the row of additions is applied, include that removal. If entries already are net changes, do not subtract the drawn ball again.
- Ignoring feasibility. A negative updated count or a zero updated total makes the proposed next-state probability calculation invalid, even if the arithmetic of the row sum is correct.
Check Your Understanding
For each question, identify the total-size change and use the updated state where requested. Brief solutions follow the questions.
- An urn has counts \((9,5)\). A selected response uses net-change row \((1,0)\). What is the new total, and what is the new probability of the first treatment?
- With counts \((4,6)\), a net-change row is \((-2,1)\). Is the resulting state feasible? Find the total change and the new total.
- A replacement rule removes the drawn ball and then adds three balls. What is the total change under the add-after-removal convention? What would the total change be if the replacement row were instead a net-change row whose entries sum to 3?
- With counts \((5,5)\), a net-change row \((2,-1)\) is applied. Find both updated probabilities and explain why the first probability does not increase by 0.2.
Solutions. (1) The row sum is \(1+0=1\), so the new total is \(14+1=15\). The new first count is \(9+1=10\), giving probability \(10/15\approx0.6667\). (2) The updated state is \((4-2,6+1)=(2,7)\), whose counts are nonnegative. The row sum is \(-2+1=-1\), so the new total is \(10-1=9\). (3) Removing the drawn ball and adding three gives total change \(3-1=2\). A net-change row summing to 3 instead gives total change 3, because the removal is already included. (4) The updated state is \((7,4)\) and the total is \(11\). The probabilities are \(7/11\approx0.6364\) and \(4/11\approx0.3636\). The first count increased by 2, but its probability changes from \(5/10=0.5000\) to \(7/11\), not to \(0.7000\), because the total also increased by 1.