Tutorials › Response-Adaptive Randomization › Urn States and Treatment Allocation

Urn Models · Tutorial 35 of 501

Urn States and Treatment Allocation

Learn to represent the urn immediately before a draw, calculate each treatment’s conditional allocation probability, and check that the state and assignment record agree.

Intermediate 10 min read

What You'll Learn

  • Define the two-treatment urn state using the counts of each colour immediately before a patient’s draw.
  • Derive the conditional allocation probability from the number of balls of that colour and the total number of balls.
  • Distinguish a current state and a pre-draw probability from the treatment actually assigned.
  • Check state records for timing, count, and treatment-label errors.
  • Compare state-based urn allocation probabilities with fixed probabilities and block-based allocation.

Why Represent an Urn by Its State?

In an urn allocation design, the treatment assigned to the next patient is determined by drawing a ball whose colour identifies the treatment. To calculate the probability of either assignment, the relevant information is the urn’s contents immediately before the draw. A concise record of those contents makes the randomization step explicit and auditable.

This tutorial focuses on a two-treatment urn. It does not specify how the urn contents are changed after a draw; that is a separate part of an urn design. Keeping the draw rule distinct from the update rule prevents a common source of confusion: the state gives the probabilities for the current draw, while an update policy determines what the state will be at a later draw.

Definition: For two treatments, A and B, the urn state before patient \(i\) is the ordered pair \(S_i=(a_i,b_i)\), where \(a_i\) is the number of A-coloured balls and \(b_i\) is the number of B-coloured balls in the urn immediately before patient \(i\)'s draw. The total number of balls is \(m_i=a_i+b_i\), which must be positive for a draw to be possible.

The order in the pair matters: the first entry always counts A-coloured balls and the second always counts B-coloured balls. The state is a count of available balls, not a record of how many patients have previously received each treatment. Those two sets of counts may coincide in a particular design, but they are not interchangeable definitions.

Let \(H_{i-1}\) denote the observed randomization history before patient \(i\)'s draw. If the state is known from that history and each ball is equally likely to be drawn, the probability of assigning patient \(i\) to A is the fraction of balls that are A-coloured. The corresponding probability for B is the fraction that are B-coloured.

$$ P(T_i=A\mid H_{i-1})=\frac{a_i}{a_i+b_i}, \qquad P(T_i=B\mid H_{i-1})=\frac{b_i}{a_i+b_i}. $$

Here \(T_i\) is the treatment assigned to patient \(i\). These are conditional allocation probabilities: they describe the draw for this patient, given the information available before that draw. They are not the probabilities that A or B will be assigned over the entire trial, and they do not say which treatment the patient will actually receive. The draw realizes one of the two possibilities.

Why the Count Ratios Give the Probabilities

Suppose the urn contains \(m_i=a_i+b_i\) balls, and the draw selects one ball uniformly from those \(m_i\) balls. There are \(a_i\) individual balls that would assign A. Each individual ball has probability \(1/m_i\) of being selected, and these \(a_i\) outcomes are mutually exclusive. Adding their probabilities gives \(a_i/m_i\). The same argument for the \(b_i\) B-coloured balls gives \(b_i/m_i\).

$$ P(T_i=A\mid H_{i-1}) =\sum_{j=1}^{a_i}\frac{1}{m_i} =\frac{a_i}{m_i} =\frac{a_i}{a_i+b_i}. $$

The two treatment probabilities must add to one, because every possible draw assigns exactly one of the two treatments:

$$ \frac{a_i}{a_i+b_i}+\frac{b_i}{a_i+b_i} =\frac{a_i+b_i}{a_i+b_i}=1. $$

This argument relies on a specific set of conditions. The urn must contain a positive, well-defined number of balls; each ball must be equally likely to be drawn; each ball’s colour must map unambiguously to a treatment; and the recorded state must describe the urn at the time of the draw. If the draw is biased, if the state is recorded at the wrong time, or if a ball can assign either treatment for some other reason, the simple count-ratio formula need not apply.

Key distinction: The state determines the conditional probabilities under the uniform-draw rule. It does not determine the realized treatment: that is determined by the random draw. A valid pre-draw state can therefore support either A or B as the next assignment, provided both colours are present.

Calculating and Reading a State

Worked Example: A State With More A-Coloured Balls

Immediately before a hypothetical patient’s draw, an urn contains 6 A-coloured balls and 4 B-coloured balls. Assume one ball is selected uniformly at random and its colour determines treatment. Find the state and the two conditional allocation probabilities.

The pre-draw state is \(S_i=(6,4)\), and the total is \(m_i=6+4=10\) balls. Therefore,

$$ P(T_i=A\mid H_{i-1})=\frac{6}{10}=0.600, \qquad P(T_i=B\mid H_{i-1})=\frac{4}{10}=0.400. $$

The probabilities sum to \(0.600+0.400=1.000\), as required. Before the draw, A is more likely than B to be assigned to this patient. The calculation does not imply that A will be assigned: the actual draw could still select one of the four B-coloured balls.

The denominators in both probabilities are the total number of balls, not the number of balls of the treatment being considered and not the number of patients already assigned. Writing the total explicitly before dividing is a useful check when the state is being calculated by hand.

Worked Example: A State With Unequal Allocation Probabilities

In a second hypothetical allocation, the pre-draw state is \(S_i=(3,7)\). The balls are drawn uniformly, and their colours identify treatments A and B. Calculate the probability of each assignment and interpret the result for the next patient.

There are \(3+7=10\) balls. Thus,

$$ P(T_i=A\mid H_{i-1})=\frac{3}{10}=0.300, \qquad P(T_i=B\mid H_{i-1})=\frac{7}{10}=0.700. $$

For this draw, the conditional allocation probability is 0.300 for A and 0.700 for B. These are the probabilities given the current state, not a claim that the whole trial will have a 30:70 allocation ratio. Probabilities for later patients depend on the urn state that exists before each later draw.

Keeping State, History, and Assignment Separate

A randomization record can include several different kinds of information: the state before the draw, the probability implied by that state, and the treatment actually assigned. They answer different questions. The state is a count summary of the urn; the probability is calculated from that state under the draw rule; and the assigned treatment is the result of the random draw.

When the state is known from the history, it supplies all the information needed for the immediate allocation probability under the stated uniform-draw rule. Earlier events may explain how the urn reached that state, but they are not needed again in the count-ratio calculation. Conversely, the state alone does not explain how the urn reached its current contents or what its contents will be later.

Worked Example: Auditing a Pre-Draw Record

A hypothetical randomization log records that immediately before patient \(i\)'s draw, the urn contained 5 A-coloured balls and 3 B-coloured balls. It records an A assignment and lists the conditional probability for A as 0.500. Assume the balls were drawn uniformly and colour determined treatment. Check whether the listed probability is consistent with the state, and assess what can be concluded from the A assignment.

The state gives a total of \(5+3=8\) balls. The probability implied by the recorded state is

$$ P(T_i=A\mid H_{i-1})=\frac{5}{8}=0.625. $$

Therefore, the logged value 0.500 is inconsistent with the stated state and draw rule; the probability entry should be investigated. The observed A assignment is possible under the state, since an A-coloured ball can be drawn. Its occurrence does not make the correct pre-draw probability equal to 1, nor does it resolve the discrepancy in the logged probability.

A useful audit checks the record in a fixed order: verify that the counts are nonnegative integers, add them to obtain the total, compute both colour proportions, confirm that they sum to one, and then compare the observed assignment with the colour actually drawn. A mismatch between the calculated probability and the logged probability points to a state, timing, arithmetic, or recording problem. An observed assignment with positive probability is not, by itself, evidence of an error.

1
Fix the time point.
Use the urn contents immediately before the patient’s draw, not a count recorded after the draw or after some later event.
2
Write the ordered counts.
Record \(S_i=(a_i,b_i)\), keeping A first and B second.
3
Calculate the probabilities.
Divide each colour count by \(a_i+b_i\), and check that the two results sum to one.
4
Compare with the draw record.
Check that the assigned treatment matches the drawn colour and distinguish this observed assignment from its pre-draw probability.

Comparison With Other Allocation Descriptions

An urn state is a way to express the immediate randomization probabilities using the current contents. It is different from specifying a fixed probability for every patient or specifying a schedule with constraints. The contrast matters because identical overall treatment counts can arise from different rules, and a treatment count by itself does not determine the probability for the next patient.

Allocation descriptionWhat determines the next assignment probability?What the description does not imply by itself
Urn state under a uniform drawThe current numbers of balls of each treatment colourHow the urn reached that state or how it will be updated
Fixed-probability randomizationA specified probability that does not change with the current urn countsThat the realized assignments will match the target proportion in a short run
Permuted-block allocationThe schedule constraints and position within the blockThat the next probability can be found from urn-ball counts unless an urn representation is separately specified

In particular, a state such as \((6,4)\) gives a probability of 0.600 for A on the current draw under the uniform-draw assumption. It does not establish that this urn design behaves like complete randomization, a fixed-probability design, or a permuted-block schedule. Those procedures define their assignment mechanisms differently. A comparison requires the actual rules, not just a snapshot of treatment counts.

Assumptions, Diagnostics, and Limitations

The count-ratio calculation is simple, but its interpretation depends on the design being implemented as specified. The main diagnostic questions are whether the state was measured at the correct time, whether both colour counts refer to the same urn, whether all balls are equally likely to be selected, and whether colour-to-treatment mapping is recorded correctly. These checks concern the mechanism and its records; they cannot be replaced by checking whether the observed assignments happen to look balanced.

  • Zero total: If \(a_i+b_i=0\), no draw can be made and the allocation probabilities are undefined. A record claiming a draw from an empty urn indicates that the state or the procedure is incomplete.
  • Impossible counts: Negative or non-integer ball counts cannot describe an urn. They usually signal a data-entry or bookkeeping error.
  • Wrong time point: Counts recorded after a draw cannot automatically be used as the pre-draw state for that same patient. The probability must be based on the contents before selection.
  • Nonuniform selection: If balls have unequal chances of selection, colour counts alone do not give the probabilities. The selection mechanism must then be described and used directly.
  • Confusing probability with outcome: A draw from a state with probability 0.700 for B can still assign A. The realized treatment does not change the probability that applied before the draw.

The state is also limited in what it summarizes. It identifies the current colour counts, but it does not encode the full sequence of previous assignments or explain the rule that generated the current inventory. It is enough for the immediate probability only when the stated uniform-draw mechanism applies and the state correctly describes all available balls. If the design has additional rules that affect selection, the state and the simple ratio may not be sufficient.

Key takeaway: Under a uniform draw from an urn containing \(a_i\) A-coloured balls and \(b_i\) B-coloured balls, the next patient’s conditional allocation probabilities are \(a_i/(a_i+b_i)\) for A and \(b_i/(a_i+b_i)\) for B. These probabilities are determined before the draw; the treatment assigned is the draw’s realized result.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A hypothetical urn has 8 A-coloured and 2 B-coloured balls immediately before a uniform draw. What is the state, and what are the two conditional allocation probabilities?
  2. Why must the two allocation probabilities calculated from a valid two-colour state sum to one?
  3. A log reports state \((4,6)\), a uniform draw, and an A assignment. It lists the probability for A as 0.600. Is the listed probability consistent with the state? Is the A assignment possible?
  4. Give two reasons why the count-ratio calculation might fail to give the correct conditional allocation probability.

Solutions. (1) The state is \(S_i=(8,2)\), with \(8+2=10\) balls. Hence \(P(T_i=A\mid H_{i-1})=8/10=0.800\) and \(P(T_i=B\mid H_{i-1})=2/10=0.200\). (2) Every draw selects exactly one ball, which is either A-coloured or B-coloured. Algebraically, \(a_i/(a_i+b_i)+b_i/(a_i+b_i)=1\). (3) The A probability implied by the state is \(4/(4+6)=0.400\), so 0.600 is inconsistent with the state. An A assignment is possible because the urn contains four A-coloured balls. (4) The formula may fail if balls are not equally likely to be selected, or if the recorded counts do not describe the urn immediately before the draw. A zero total or an incorrect colour-to-treatment mapping would also invalidate the calculation.

Clinical Biostats