Tutorials › Response-Adaptive Randomization › Worked Binary-Response Generalized Urn

Urn Models · Tutorial 65 of 501

Worked Binary-Response Generalized Urn

Learn to translate a binary-response urn rule into exact one-step state probabilities and the allocation probabilities that follow from those states.

Intermediate 10 min read

What You'll Learn

  • Define a binary-response generalized urn using treatment-specific response probabilities and replacement increments.
  • Calculate the probability of each one-step urn state from the draw and response probabilities.
  • Combine distinct draw-response paths when they lead to the same state.
  • Derive conditional and unconditional probabilities for the next treatment allocation.
  • Check that state updates are feasible and that transition and allocation probabilities sum to one.

From an Urn Rule to Exact Probabilities

A generalized urn rule becomes concrete when its starting composition, response model, and replacement rule are all specified. The resulting calculations answer two different questions: what urn composition can follow the next assignment, and how likely is each treatment to be assigned after that update? Keeping those questions separate is essential. A state probability describes the urn; an allocation probability describes a draw from the urn.

Suppose there are \(K\) treatments. Just before patient \(n\) is assigned, let \(X_n=(X_{n1},\ldots,X_{nK})\) be the numbers of balls of the respective treatment types, and let \(S_n=\sum_{j=1}^K X_{nj}\) be the total. The patient receives treatment \(j\) with probability \(X_{nj}/S_n\). Write \(A_n=j\) when this occurs. The response \(R_n\) is binary, with \(R_n=1\) for success and \(R_n=0\) for failure. For each treatment \(j\), assume the response probability is \(p_j\), so that \(P(R_n=1\mid A_n=j,X_n)=p_j\).

For this tutorial, the response probability does not otherwise depend on the current urn composition or previous patients’ outcomes. Once treatment and response are known, the replacement increment is fixed by the rule. These assumptions define a simple one-step model; they are not claims that response probabilities are known in an actual trial.

Definition: A binary-response generalized urn is specified by an initial composition \(x\), treatment-specific response probabilities \(p_j\), and replacement increments \(d_{j,1}\) and \(d_{j,0}\) for each treatment \(j\). If treatment \(j\) is drawn and the response is \(r\), the next composition is \(x+d_{j,r}\). Each increment is a vector whose \(k\)-th entry is the change in the number of balls of treatment type \(k\); it is not the resulting composition.

All compositions that can be reached must have nonnegative entries and a positive total, so that a subsequent draw is defined. Increments may in principle contain negative entries, but feasibility must be checked on every reachable path. The calculations below use fixed increments and feasible states.

One-Step State Probabilities

Given a current composition \(x=(x_1,\ldots,x_K)\) with total \(S=\sum_j x_j>0\), the probability of drawing treatment \(j\) is \(x_j/S\). Conditional on that draw, success has probability \(p_j\) and failure has probability \(1-p_j\). Therefore, the joint probabilities of the two possible draw-response events are

$$ P(A_n=j,R_n=1\mid X_n=x)=\frac{x_j}{S}p_j,\qquad P(A_n=j,R_n=0\mid X_n=x)=\frac{x_j}{S}(1-p_j). $$

Each event produces a composition \(x+d_{j,r}\). If different events produce the same composition, their probabilities must be added. For any candidate next state \(y\), the transition probability is

$$ P(X_{n+1}=y\mid X_n=x) =\sum_{j=1}^K\frac{x_j}{S} \left[ p_j\,\mathbf{1}\{y=x+d_{j,1}\} +(1-p_j)\,\mathbf{1}\{y=x+d_{j,0}\} \right]. $$

Here \(\mathbf{1}\{\cdot\}\) equals 1 when its condition is true and 0 otherwise. This expression accounts for all draw-response events leading to \(y\), including ties in the resulting state. Summing the transition probabilities over all distinct next states gives 1: for each treatment, the success and failure probabilities add to 1, and the treatment-draw probabilities add to 1.

Worked Example: Combining Paths to the Same State

Consider two treatments with initial composition \(x=(3,2)\). Let \(p_1=0.80\) and \(p_2=0.25\). Use increments \(d_{1,1}=(1,0)\), \(d_{1,0}=(0,1)\), \(d_{2,1}=(0,2)\), and \(d_{2,0}=(1,0)\). The total is \(S=5\), so the initial draw probabilities are \(3/5\) and \(2/5\). All resulting compositions below have nonnegative entries and positive totals.

Drawing treatment 1 and observing success has probability \( (3/5)(0.80)=0.48 \) and produces \((3,2)+(1,0)=(4,2)\). Drawing treatment 1 and observing failure has probability \( (3/5)(0.20)=0.12 \) and produces \((3,2)+(0,1)=(3,3)\).

Drawing treatment 2 and observing success has probability \( (2/5)(0.25)=0.10 \) and produces \((3,2)+(0,2)=(3,4)\). Drawing treatment 2 and observing failure has probability \( (2/5)(0.75)=0.30 \) and produces \((3,2)+(1,0)=(4,2)\).

The first and fourth events both reach \((4,2)\). Thus the exact state probabilities are \(P(X_{n+1}=(4,2)\mid X_n=x)=0.48+0.30=0.78\), \(P(X_{n+1}=(3,3)\mid X_n=x)=0.12\), and \(P(X_{n+1}=(3,4)\mid X_n=x)=0.10\). They sum to \(0.78+0.12+0.10=1\). In particular, the probability of state \((4,2)\) is not just the probability of one path that reaches it.

Allocation Probabilities After the Update

After the urn changes to state \(y\), the next patient’s probability of receiving treatment \(k\), conditional on that state, is \(y_k/\sum_{\ell=1}^K y_\ell\). This is a conditional allocation probability. Before the updated state is observed, the probability averages over its possible values:

$$ P(A_{n+1}=k\mid X_n=x) =\sum_y P(X_{n+1}=y\mid X_n=x) \frac{y_k}{\sum_{\ell=1}^K y_\ell}. $$

This is an application of the law of total probability: the next assignment can be calculated within each possible updated state and then averaged using that state’s probability. The state total can differ across states when replacement increments add or remove different numbers of balls, so the conditional allocation fraction must be calculated separately for each state.

Worked Example: Three Treatments and Binary Responses

Suppose the initial composition is \(x=(2,1,2)\), with total \(S=5\). The treatment-specific success probabilities are \(p_1=0.75\), \(p_2=0.40\), and \(p_3=0.60\). Specify the increments as follows:

  • Treatment 1: success \(d_{1,1}=(2,0,0)\); failure \(d_{1,0}=(0,1,0)\).
  • Treatment 2: success \(d_{2,1}=(1,1,0)\); failure \(d_{2,0}=(0,2,0)\).
  • Treatment 3: success \(d_{3,1}=(0,1,1)\); failure \(d_{3,0}=(1,0,1)\).

For each draw-response event, multiply the treatment’s draw probability by the relevant response probability, then add the increment to \((2,1,2)\). The six events give:

Draw and responseEvent probabilityNext state
Treatment 1, success\((2/5)(0.75)=3/10\)\((4,1,2)\)
Treatment 1, failure\((2/5)(0.25)=1/10\)\((2,2,2)\)
Treatment 2, success\((1/5)(0.40)=2/25\)\((3,2,2)\)
Treatment 2, failure\((1/5)(0.60)=3/25\)\((2,3,2)\)
Treatment 3, success\((2/5)(0.60)=6/25\)\((2,2,3)\)
Treatment 3, failure\((2/5)(0.40)=4/25\)\((3,1,3)\)

The six states are distinct, so their listed probabilities are the state-transition probabilities. Their sum is \(3/10+1/10+2/25+3/25+6/25+4/25=1\). Every updated state has positive entries and positive total, so each defines valid probabilities for the next draw.

For example, after state \((4,1,2)\), the next allocation probabilities for treatments 1, 2, and 3 are respectively \(4/7\), \(1/7\), and \(2/7\). After state \((2,2,2)\), they are \(1/3\) each. These fractions are conditional on the indicated state; they are not the probabilities of reaching those states.

Worked Example: Averaging to Get the Next Allocation Probability

Continue with the three-treatment urn. To find the probability that the next patient receives treatment 1, weight the treatment-1 fraction in each state by the probability of that state:

$$ \begin{aligned} P(A_{n+1}=1\mid X_n=(2,1,2)) ={}&\frac{3}{10}\frac{4}{7} +\frac{1}{10}\frac{2}{6} +\frac{2}{25}\frac{3}{7} +\frac{3}{25}\frac{2}{7}\\ &+\frac{6}{25}\frac{2}{7} +\frac{4}{25}\frac{3}{7}\\ ={}&\frac{180+35+36+36+72+72}{1050} =\frac{431}{1050}\approx 0.4105. \end{aligned} $$

Thus the probability of assigning treatment 1 to the next patient, averaging over the current patient’s possible draw and response, is about 0.4105. It is not the fraction of treatment-1 balls in the initial urn, \(2/5=0.40\), because the current assignment and response may alter the composition first.

As a check, the same calculation for treatment 2 gives \(3/10(1/7)+1/10(2/6)+2/25(2/7)+3/25(3/7)+6/25(2/7)+4/25(1/7)=254/1050\). The treatment-3 probability is the remaining \(1-431/1050-254/1050=365/1050\). The three unconditional next-allocation probabilities sum to 1.

Why the Calculation Works—and How to Check It

The transition formula follows directly by partitioning the next state according to the current draw and response. These events are mutually exclusive and exhaustive: exactly one treatment is drawn, and its response is either success or failure. For a fixed treatment \(j\), the probabilities of the two events sum to

$$ \frac{x_j}{S}p_j+\frac{x_j}{S}(1-p_j)=\frac{x_j}{S}. $$

Summing this identity over treatments gives \(\sum_j x_j/S=1\). Each event contributes its probability to exactly one resulting state, although several events may contribute to the same state. Therefore the probabilities of all distinct next states sum to 1. For the next allocation, the conditional treatment fractions in each possible state also sum to 1. Averaging those fractions over states consequently gives allocation probabilities that sum to 1 as well.

A practical calculation can be organized as a short sequence: list each treatment-response event, calculate its joint probability, apply its increment, aggregate probabilities for any duplicate states, and only then calculate the next allocation probabilities. This order keeps state transitions distinct from subsequent urn draws.

1
Specify the current state and response model.
Record every treatment count, the total, and the success probability for each treatment.
2
Enumerate draw-response events.
For treatment \(j\), use \(x_j/S\) for the draw probability and multiply by \(p_j\) or \(1-p_j\).
3
Update and aggregate.
Add the appropriate increment, check feasibility, and combine event probabilities that lead to the same state.
4
Calculate subsequent allocation probabilities.
Within each state, divide each treatment count by that state’s total; average across states if the updated state is not conditioned upon.

Diagnostics, Comparisons, and Limitations

Several checks catch common errors. The current treatment-draw probabilities must sum to one. For every treatment, its success and failure probabilities must sum to one. The event probabilities must therefore sum to one, and after aggregating paths, the distinct state probabilities must still sum to one. Each updated composition must have nonnegative counts and a positive total. Finally, the allocation fractions within every state must sum to one.

A frequent mistake is to report \(x_j/S\) as the probability of the next allocation even after an update has occurred. That is the draw probability from the current state. The next patient’s probability conditional on updated state \(y\) is \(y_j/\sum_k y_k\); if \(y\) is not known, average this fraction over the possible updated states. Another mistake is to treat an increment as a final count. For example, adding \(d_{j,r}\) means \(x+d_{j,r}\), not replacing \(x\) with \(d_{j,r}\).

This calculation is more explicit than simply stating a generalized urn rule: it gives exact finite-step probabilities for a specified state and response model. A rule with a different replacement scheme changes the increments and therefore the transition probabilities; a state-dependent scheme requires using the increment appropriate to the current state as well as the draw and response. A fixed allocation plan, by contrast, does not update treatment probabilities through urn replacement. These approaches answer related design questions but are not interchangeable calculations.

The one-step calculation is exact under the stated model, but it does not establish that the assumed response probabilities are correct, that outcomes are observed immediately, or that a particular replacement rule is desirable. If responses are delayed, the update may occur after a different number of assignments; if response probabilities vary over time or depend on history, the constant \(p_j\) model needs modification. Exact arithmetic cannot compensate for an incorrectly specified rule or response model.

Check Your Understanding

Try the questions first, then compare your work with the solutions below.

  1. With composition \((2,1)\), what are the current draw probabilities for treatments 1 and 2?
  2. For treatment 1, let \(p_1=0.7\), \(d_{1,1}=(1,0)\), and \(d_{1,0}=(0,1)\). If the current state is \((2,1)\), calculate the joint probabilities and next states for the two events involving treatment 1.
  3. Two different draw-response events each have probability \(0.15\) and both lead to state \((3,2)\). What is the transition probability of that state, considering just these two events?
  4. In state \((2,3)\), what are the conditional probabilities of assigning the next patient to each of two treatments?

Solutions. (1) The total is \(2+1=3\), so the draw probabilities are \(2/3\) and \(1/3\). (2) Treatment 1 is drawn with probability \(2/3\). Success has joint probability \((2/3)(0.7)=7/15\) and leads to \((2,1)+(1,0)=(3,1)\). Failure has joint probability \((2/3)(0.3)=1/5\) and leads to \((2,1)+(0,1)=(2,2)\). (3) Add the mutually exclusive path probabilities: \(0.15+0.15=0.30\). (4) The state total is 5, so the probabilities are \(2/5\) for treatment 1 and \(3/5\) for treatment 2; they sum to 1.

Clinical Biostats