Why a Multi-Category Worked Path Matters
A generalized urn can adapt allocation using more than two response categories. In that setting, a treatment assignment alone does not determine the next urn state: the observed response category matters too. A reliable calculation therefore keeps track of three things at each step: the current treatment-specific ball counts, the treatment assigned, and the response category observed.
The example below uses three treatments and three response categories. Its replacement rule is deliberately small enough to calculate by hand, but it illustrates the bookkeeping needed whenever an urn has multiple treatments and outcomes. The rule is hypothetical and is used only to demonstrate the calculations.
State, Allocation, and Replacement Rule
The response categories are G (good), M (intermediate), and P (poor). The components of each increment are always ordered A, B, C. For example, \((0,1,0)\) means add one B ball and no A or C balls. The draw itself is returned; the listed increment is the additional replacement, not a substitute for the drawn ball.
| Assigned treatment | G: good | M: intermediate | P: poor |
|---|---|---|---|
| A | (2, 0, 0) | (0, 1, 0) | (0, 0, 1) |
| B | (0, 2, 0) | (0, 0, 1) | (1, 0, 0) |
| C | (0, 0, 2) | (1, 0, 0) | (0, 1, 0) |
For this rule, a good response adds two balls of the assigned treatment. An intermediate or poor response adds one ball of a treatment specified in the table. The rule is part of the hypothetical design; the calculations do not imply that these particular replacements are medically preferable.
To use the rule, assume the initial counts are nonnegative integers with positive total, the table has a defined increment for every treatment-response combination that can occur, and each update is applied exactly once after the response is observed. In this example all increments are nonnegative, so counts remain nonnegative and the total stays positive. The allocation probability is conditional on the current urn state; it is not itself a probability of a particular response.
Worked Example: Three Successive Assignments
Suppose the initial urn is \(X_1=(2,2,2)\). Consider the hypothetical observed path: patient 1 is assigned A and has response M; patient 2 is assigned B and has response P; patient 3 is assigned C and has response G. Calculate each allocation probability and each resulting state.
Before patient 1. The total is \(S_1=2+2+2=6\), so the allocation probabilities are \(P(J_1=A)=2/6=1/3\), \(P(J_1=B)=2/6=1/3\), and \(P(J_1=C)=2/6=1/3\).
The stated assignment is A. Given the observed intermediate response, the table gives \(\Delta_{A,M}=(0,1,0)\). Thus \(X_2=(2,2,2)+(0,1,0)=(2,3,2)\), with total \(S_2=7\).
Before patient 2. The allocation probabilities are \(2/7\) for A, \(3/7\) for B, and \(2/7\) for C. The stated assignment, B, therefore has conditional allocation probability \(3/7\). For the observed poor response, \(\Delta_{B,P}=(1,0,0)\), giving \(X_3=(2,3,2)+(1,0,0)=(3,3,2)\), with total \(S_3=8\).
Before patient 3. The probabilities are \(3/8\) for A, \(3/8\) for B, and \(2/8=1/4\) for C. After the stated assignment C and good response, \(\Delta_{C,G}=(0,0,2)\), so \(X_4=(3,3,2)+(0,0,2)=(3,3,4)\), with total \(S_4=10\). The next patient's allocation probabilities would be \(3/10\), \(3/10\), and \(4/10\) for A, B, and C, respectively.
Each allocation probability uses the state before the patient is assigned. Each replacement uses the treatment just assigned and the response just observed. Keeping those two moments separate prevents the common error of using a post-response state to calculate the allocation that has already occurred.
Justifying the State Update and Probability Calculation
The one-step recursion has a simple accounting justification. Immediately before an assignment, there are \(X_{t,i}\) balls of treatment color \(i\) among \(S_t\) total balls. Under a draw proportional to color counts, the chance of drawing color \(i\) is therefore \(X_{t,i}/S_t\). Returning the drawn ball leaves those original counts in place. Adding the increment specified by the observed treatment-response pair gives the next state.
The total-size equation follows by summing the three component updates. It is a useful check: in the example, each good response adds two balls and each intermediate or poor response adds one. Thus the total increases by two or one, respectively, at every step. A state update that does not have the corresponding total increase has an arithmetic or transcription error.
A realized response path is sufficient to calculate the urn states and the conditional allocation probabilities along that path. To calculate the probability of a response-and-assignment path, however, response probabilities are also needed. The following example specifies them explicitly rather than treating observed responses as if they had known probabilities.
Worked Example: Probability of a Short Path
Return to the initial state \((2,2,2)\). For illustration, suppose responses have the following fixed conditional probabilities, in G, M, P order: under A, \((0.50,0.30,0.20)\); under B, \((0.20,0.50,0.30)\); under C, \((0.40,0.40,0.20)\). Assume these response probabilities apply at each patient and that, conditional on assigned treatments, responses follow these specified distributions. Find the probability that the first patient is assigned A and has response M, and that the second patient is assigned B.
The first assignment probability is \(2/6=1/3\). Given assignment A, the probability of response M is \(0.30\). Hence \(P(J_1=A,R_1=M)=(1/3)(0.30)=0.10\).
After that response, the state is \((2,3,2)\), as calculated above. The conditional probability that patient 2 is assigned B is \(3/7\). Multiplying the successive conditional probabilities gives \(P(J_1=A,R_1=M,J_2=B)=0.10(3/7)=3/70\approx0.04286\).
This is a probability for the specified two-patient event under the stated response model and urn rule. It does not include a response for patient 2. Without response probabilities, the state and allocation probabilities can still be calculated along a specified path, but the probability of that response path cannot be determined.
Averaging Over an Unobserved Response
Before a response is observed, the next state is not yet known. If response probabilities are specified, the chance of a particular allocation at the following step can be averaged over the possible responses. Let \(q_{jr}=P(R_t=r\mid J_t=j)\), with \(\sum_r q_{jr}=1\). Conditional on the current state \(x\) and the current assignment \(j\), the probability of assigning treatment \(i\) to the next patient, averaged over the current response, is
This follows by considering each possible response in turn. If response \(r\) occurs, its probability is \(q_{jr}\), and the next allocation probability is the updated count for treatment \(i\) divided by the updated total. The average is the sum of those products. Importantly, the denominator can vary across response categories when the replacement rule adds different numbers of balls.
Worked Example: Expected Next Allocation Probability
Suppose the current state is \((2,3,2)\) and the current assignment is B. Use B's response probabilities from the previous example to find the probability of assigning A to the next patient, averaged over B's possible responses.
If the response is G, which has probability \(0.20\), the increment is \((0,2,0)\). The new state is \((2,5,2)\), total 9, and the next allocation probability for A is \(2/9\).
If the response is M, with probability \(0.50\), the increment is \((0,0,1)\). The new state is \((2,3,3)\), total 8, and the next probability for A is \(2/8\).
If the response is P, with probability \(0.30\), the increment is \((1,0,0)\). The new state is \((3,3,2)\), total 8, and the next probability for A is \(3/8\). Therefore,
The current-state probability of A is \(2/7\approx0.2857\), but that is not the averaged next-step probability: the current assignment and its response can change both A's count and the total. The calculated \(0.2819\) is a probability averaged over the specified response distribution, conditional on the current B assignment and state. It is not a guarantee of the realized next allocation.
Checks, Alternatives, and Limitations
A few checks catch most errors in a small multi-category calculation:
- Check the count order. Use A, B, C consistently in every state and replacement vector. A valid-looking vector in the wrong order updates the wrong treatment.
- Check the denominator. Add the current counts to get the total before calculating an allocation probability. The treatment probabilities must sum to one.
- Check the response-specific increment. Select the table entry using both the assigned treatment and the observed response category, not the response category alone.
- Check the total change. The new total must equal the old total plus the sum of the chosen increment's components.
- Check what is conditional. A probability based on a stated state is conditional on reaching that state; a path probability also requires probabilities for the responses along the path.
The same state-accounting approach works for a binary-response urn, but there are fewer response branches to check. A fixed-allocation design is different: its allocation probabilities are set independently of the response-updated urn state. The generalized urn instead makes the next probabilities depend on accumulated assignments and responses through the current counts. These approaches answer different design questions; neither calculation alone establishes which design is preferable.
The hand calculation is informative for a short path, but it has limits. It does not establish long-run allocation behavior, clinical benefit, or inferential performance. Those questions require additional analysis and assumptions. Likewise, response probabilities supplied for an illustrative calculation should not be mistaken for estimates from a real trial. If a response category is undefined, a replacement entry is missing, or an update can produce a zero total, the stated urn model cannot be applied as written.
Common mistake: “The first patient was assigned A, so add the A-response replacement and use the new A count to calculate that patient’s assignment probability.” The correction is that the assignment probability is calculated from the state before the draw. Only after the assignment and response are observed is the corresponding increment applied to determine probabilities for a later patient.
Check Your Understanding
Use the replacement table in this tutorial. The answers follow the questions so that each calculation can be checked directly.
- From state \((1,2,3)\), what are the three allocation probabilities?
- From state \((1,2,3)\), a patient is assigned C and has response M. Find the next state and total.
- From state \((2,3,2)\), what is the probability of assigning B? If B then has response P, what is the following state?
- Why is the probability of a specified sequence of response categories not determined by allocation probabilities alone?
Solutions. 1. The total is \(1+2+3=6\), so the probabilities are \(1/6, 2/6,\) and \(3/6\) for A, B, and C. 2. The table gives \(\Delta_{C,M}=(1,0,0)\), so the next state is \((1,2,3)+(1,0,0)=(2,2,3)\), with total 7. 3. The probability of B is \(3/(2+3+2)=3/7\). For response P, \(\Delta_{B,P}=(1,0,0)\), so the following state is \((3,3,2)\). 4. Allocation probabilities give the chance of each treatment conditional on the current state; to find the probability of responses, one must also specify the response distribution under each assigned treatment.