Tutorials › Response-Adaptive Randomization › Generalized Urn States as Vectors

Urn Models · Tutorial 47 of 501

Generalized Urn States as Vectors

Learn to encode urn composition as a count vector and calculate the conditional probability of assigning the next participant to each treatment.

Intermediate 10 min read

What You'll Learn

  • Define a count vector for an urn with multiple treatments.
  • Calculate the total number of balls and the allocation probability for each treatment.
  • Handle treatments with zero balls and check that probabilities are valid.
  • Translate between treatment labels, vector positions, and probability statements.
  • Identify assumptions and common errors in normalizing urn counts.
  • Apply the calculations to short, hypothetical allocation scenarios.

From an Urn to a Count Vector

With two treatments, it is possible to describe an urn by stating how many balls of each treatment it contains. The same idea works for any finite number of treatments: list the treatment-specific counts in a fixed order and regard that list as a vector. This representation makes the composition precise and provides a direct way to calculate the chance of each treatment being drawn.

The vector describes the urn at a particular moment. It is not itself a random assignment, nor does it specify how the urn will change after a participant is assigned. Here the focus is the composition currently present and the allocation probabilities it implies under uniform sampling.

Definition: Suppose there are \(K\) treatments, labelled \(1,\ldots,K\). The urn composition is the count vector \(\mathbf{u}=(u_1,\ldots,u_K)^\mathsf{T}\), where \(u_j\) is the number of balls representing treatment \(j\). Each entry must be a nonnegative integer. The total number of balls is \(U=\sum_{j=1}^{K}u_j\). When \(U>0\) and one ball is drawn uniformly at random, the conditional allocation probability for treatment \(j\), given the current composition, is \(\pi_j(\mathbf{u})=u_j/U\).

The superscript \(\mathsf{T}\) indicates that the listed entries are arranged as a column vector. The order is essential: the first entry must always refer to treatment 1, the second to treatment 2, and so on. A vector such as \((4,2,1)^\mathsf{T}\) has no treatment meaning until its order has been stated.

The term conditional matters. The probability \(u_j/U\) is the probability of the next treatment assignment given the current urn composition and the uniform-draw rule. It is not necessarily the probability of treatment \(j\) over an entire trial, averaged across changing urn states. If the composition changes over time, the probability for a later assignment is calculated from the composition at that later time.

Why Normalizing the Counts Gives the Probabilities

Assume the urn contains exactly \(U\) balls, each ball is equally likely to be selected, and each ball represents exactly one of the \(K\) treatments. Of those \(U\) possible balls, \(u_j\) represent treatment \(j\). Thus the event of drawing treatment \(j\) consists of \(u_j\) equally likely outcomes out of \(U\), giving the ratio \(u_j/U\).

$$ \pi_j(\mathbf{u})=\frac{\text{number of balls representing treatment }j} {\text{total number of balls}} =\frac{u_j}{\sum_{r=1}^{K}u_r}. $$

This calculation also provides an immediate check on the full probability vector. Since the counts add to \(U\), the treatment probabilities add to one:

$$ \sum_{j=1}^{K}\pi_j(\mathbf{u}) =\sum_{j=1}^{K}\frac{u_j}{U} =\frac{\sum_{j=1}^{K}u_j}{U} =1. $$

Each probability is between zero and one because \(0\leq u_j\leq U\). If \(u_j=0\), treatment \(j\) has probability zero of being drawn from that composition. If every count is zero, then \(U=0\), so the ratio is undefined and there is no ball to draw. A valid urn state for this calculation must therefore have a positive total.

Worked Example: Three Treatments in a Fixed Order

Suppose a hypothetical trial uses treatments A, B, and C, in that order. Its current urn contains 6 A-balls, 3 B-balls, and 1 C-ball. Write the count vector and find the next-participant allocation probabilities.

The stated order gives \(\mathbf{u}=(6,3,1)^\mathsf{T}\). The total is \(U=6+3+1=10\). Dividing each entry by 10 gives:

$$ \boldsymbol{\pi}(\mathbf{u}) =\left(\frac{6}{10},\frac{3}{10},\frac{1}{10}\right)^\mathsf{T} =(0.60,0.30,0.10)^\mathsf{T}. $$

Thus, conditional on this composition and uniform sampling, the next participant has probability 0.60 of assignment to A, 0.30 to B, and 0.10 to C. The check \(0.60+0.30+0.10=1.00\) confirms that the calculated probabilities form a probability distribution. These are allocation probabilities for the next draw, not guaranteed proportions among participants in the whole trial.

Zeros, Unequal Counts, and Treatment Labels

Count-vector notation includes boundary cases without needing a new rule. A zero entry means that no ball for that treatment is currently available. A large entry gives that treatment a larger share of the total balls, and therefore a larger probability under uniform sampling. A zero probability is not a small positive probability: when \(u_j=0\), the current urn cannot produce treatment \(j\) on the next draw.

The calculation is unaffected by whether the counts are equal or whether one treatment has most of the balls. What does matter is that every entry and its treatment label stay aligned. If the order changes, the vector's interpretation changes too, even if its numerical entries do not.

Worked Example: A Treatment with No Balls

In a hypothetical four-treatment urn, the order is \(A,B,C,D\), and the counts are \(5,0,2,3\), respectively. Find the total and each next-draw probability.

The count vector is \(\mathbf{u}=(5,0,2,3)^\mathsf{T}\), and \(U=5+0+2+3=10\). Therefore:

$$ \boldsymbol{\pi}(\mathbf{u}) =\left(\frac{5}{10},\frac{0}{10},\frac{2}{10},\frac{3}{10}\right)^\mathsf{T} =(0.50,0,0.20,0.30)^\mathsf{T}. $$

The next assignment is to A with probability 0.50, to B with probability 0, to C with probability 0.20, and to D with probability 0.30. Since the urn has no B-balls, a B assignment cannot occur on this draw. The probabilities sum to \(0.50+0+0.20+0.30=1.00\).

Worked Example: Checking the Order Before Calculating

A hypothetical urn has 2 balls for treatment X, 7 for Y, and 3 for Z. A researcher records the vector in the order \(Y,Z,X\). What vector should be recorded, and what are the probabilities in the same order?

The order is \(Y,Z,X\), not \(X,Y,Z\). The correct vector is \(\mathbf{u}=(7,3,2)^\mathsf{T}\), with total \(U=7+3+2=12\). In that stated order, the probability vector is:

$$ \boldsymbol{\pi}(\mathbf{u}) =\left(\frac{7}{12},\frac{3}{12},\frac{2}{12}\right)^\mathsf{T} \approx(0.5833,0.2500,0.1667)^\mathsf{T}. $$

So the probabilities are approximately 0.5833 for Y, 0.2500 for Z, and 0.1667 for X. If the same entries were mistakenly labelled in the order \(X,Y,Z\), the reported treatment probabilities would be assigned to the wrong treatments. The total and probability sum alone would not reveal that labeling error.

Assumptions, Checks, and Limits

The normalized-count formula rests on a small set of assumptions. The vector must accurately represent the current urn; each ball must be selectable with equal probability; each ball must correspond to one treatment; and the total must be positive. Under these assumptions, the count ratio determines the probability of the next treatment. If balls are weighted, or if the draw mechanism favors some balls, counts alone do not determine the probabilities by this formula.

A practical audit has two parts. First, confirm that the treatment order in the vector matches the order used in the protocol, data record, or calculation. Second, verify that all counts are nonnegative integers, that their sum is positive, and that the normalized entries sum to one apart from rounding. Rounding can make a displayed sum differ slightly from one, but it cannot explain a substantial discrepancy.

  • Negative or fractional counts: these are not valid numbers of physical balls in an ordinary urn composition.
  • Zero total: there is no possible draw, and the normalized probabilities are undefined.
  • Incorrect denominator: divide each treatment count by the sum of all treatment counts, not by the number of treatments or by one selected count.
  • Label mismatch: even arithmetically correct ratios are wrong in context if the vector positions are attached to the wrong treatments.
  • Nonuniform selection: if the draw mechanism is not uniform, the count proportions need not equal the allocation probabilities.

For two treatments, the same calculation can be expressed as a single probability and its complement: with counts \(u_1\) and \(u_2\), treatment 1 has probability \(u_1/(u_1+u_2)\), and treatment 2 has probability \(u_2/(u_1+u_2)\). The vector form is the direct extension to \(K\) treatments: it keeps every treatment visible in one object and makes the sum-to-one check explicit. A list or table can communicate the same numerical probabilities, but it still needs a clear treatment order.

The count vector and its normalization describe a state and the allocation probabilities associated with that state. By themselves they do not explain how an urn reaches that composition, how it is updated after a draw, or how probabilities evolve over a sequence of assignments. Those questions require additional rules beyond the count-to-probability calculation.

Key takeaway: Record one nonnegative integer count for each treatment in a stated order. If the total \(U\) is positive and balls are drawn uniformly, divide every count by \(U\) to obtain the next-draw allocation probabilities in that same order.

Check Your Understanding

For each question, calculate carefully and check the interpretation against the stated treatment order.

  1. A three-treatment urn, ordered \(A,B,C\), has counts \((4,4,2)^\mathsf{T}\). What is the total and what is the next-draw probability for each treatment?
  2. A four-treatment urn has counts \((0,3,0,5)^\mathsf{T}\). What is the probability for each treatment, and which treatments cannot be drawn next?
  3. In an urn with treatment order \(R,S,T\), the counts are 2, 6, and 4. A report gives probabilities \((0.50,0.33,0.17)\) in the order \(R,S,T\). Identify and correct the error.
  4. Why can a vector of all zeros not be normalized to give next-draw probabilities?
  5. Name two assumptions needed for the probability of treatment \(j\) to equal \(u_j/U\).

Solutions. (1) \(U=4+4+2=10\), so the probabilities are \((4/10,4/10,2/10)^\mathsf{T}=(0.40,0.40,0.20)^\mathsf{T}\). (2) The total is \(0+3+0+5=8\), giving \((0,3/8,0,5/8)^\mathsf{T}=(0,0.375,0,0.625)^\mathsf{T}\). Treatments 1 and 3 cannot be drawn next because their counts are zero. (3) The total is \(2+6+4=12\). In the stated order, the correct probabilities are \((2/12,6/12,4/12)^\mathsf{T}\approx(0.1667,0.5000,0.3333)^\mathsf{T}\). The report has assigned the proportions to the wrong counts. (4) Its total is zero, so every proposed ratio has a zero denominator; moreover, there is no ball available to draw. (5) For example, the vector must accurately record the current counts, and each ball must be equally likely to be selected. It is also necessary that every ball represent one treatment and that the total be positive.

Clinical Biostats