Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 7 of 22

Multinomial counts: derive allocation and diagnose dependence

Connect ordered records, count vectors, covariance and changed collection protocols.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

Four independently sampled requests each fall into categories A, B or C with probabilities 1/2,1/4,1/4. What is the probability of seeing counts 2,1,1? One eligible ordered record is AABC, with probability 1/64. The count event also includes ABAC, ABCA and other orders. List the eligible records or count their positions before multiplying probabilities.

There are 4!/(2!1!1!)=12 records, so the answer is 12/64=3/16. The coefficient records the information discarded when four ordered labels are summarized by a count vector.

Predict

If the four trials are independent, are the three category counts independent? Increasing the count of A leaves fewer positions for B and C, because their sum is exactly four. Now change the protocol to two independent records each copied twice. Predict the probability of counts 2,1,1 and the expected category counts. Can the expectation detect the copying?

Experiment

Independent trials, dependent counts

Predict before changing a setting. These are exact probabilities for specified synthetic models, not sampled observations or a fitted model. Settings are temporary; record your prediction and explanation in the written task. Recalculation does not supply new independent evidence or award mastery.

Compare 4 iid categorical observations with 2 iid observations each copied twice. Both have expected counts (2, 1, 1), but copied records are dependent. Count totals are exactly 4 in both protocols; independent trials do not make the category counts independent.

Independent records

4 independent draws; covariance entries in squared counts.

Covariance of counts A, B, C
CountABC
A1-0.500000-0.500000
B-0.5000000.750000-0.250000
C-0.500000-0.2500000.750000

Every row sum is zero: multiplying by the all-ones vector gives zero. The fixed total forces a singular covariance matrix.

Copied pairs

2 independent draws; covariance entries in squared counts.

Covariance of counts A, B, C
CountABC
A2-1-1
B-11.500000-0.500000
C-1-0.5000001.500000

Every row sum is zero: multiplying by the all-ones vector gives zero. The fixed total forces a singular covariance matrix.

Compare every count vector and its exact probability
All 15 count vectors, including impossible outcomes
Counts A,B,CIID sequence coefficientIID probabilityCopied-pair probability
(0, 0, 4)11/2561/16
(0, 1, 3)41/640
(0, 2, 2)63/1281/8
(0, 3, 1)41/640
(0, 4, 0)11/2561/16
(1, 0, 3)41/320
(1, 1, 2)123/320
(1, 2, 1)123/320
(1, 3, 0)41/320
(2, 0, 2)63/321/4
(2, 1, 1)123/160
(2, 2, 0)63/321/4
(3, 0, 1)41/80
(3, 1, 0)41/80
(4, 0, 0)11/161/4

IID mass sums to 1; copied-pair mass sums to 1. Odd recorded counts are impossible in the copied protocol. A category with probability zero can only have count zero; a factor with exponent zero contributes one, including 0⁰ in this counting convention.

No chi-square reference, inferred p-value or independence claim is produced by this table. Equal marginal means are insufficient to choose the correct joint law.

Bounded CPU calculation: at most 12 stopping bins, 13 fixed-count terms or 45 categorical count vectors. Integer numerators/denominators are exact in these bounds (largest probability denominator 4¹²); displayed decimal covariance summaries are separate. No random simulation, worker or network is used.

Compare the exact probability of counts 2,1,1 under both protocols. Then choose a zero-probability category: identify impossible rows before opening the table. Change to a deterministic category and explain why the covariance becomes zero. These controlled models illustrate assumptions; they do not infer the collection protocol from real data.

Understand

Assume n independent trials, each with the same k mutually exclusive category probabilities p₁,…,pₖ, nonnegative and summing to one. Let Nᵢ count category i. For nonnegative integer counts n₁,…,nₖ summing to n, choose positions successively for the categories. Multiplying the binomial position counts cancels intermediate factorials and gives n!/(n₁!⋯nₖ!). Every such ordered record has probability p₁^n₁⋯pₖ^nₖ, so

P(N1=n1,…,Nk=nk)=n!n1!⋯nk!∏i=1kpini,∑ini=n.P(N_1=n_1,\ldots,N_k=n_k)=\frac{n!}{n_1!\cdots n_k!}\prod_{i=1}^k p_i^{n_i},\qquad \sum_i n_i=n.

Outside this integer support the mass is zero. Summing over all count vectors partitions all possible ordered records and gives (p₁+⋯+pₖ)ⁿ=1 by the multinomial expansion. This proves normalization, not just a numerical check on a few rows.

A category with pᵢ=0 cannot have positive count. A zero exponent contributes a factor of one, including the symbol 0⁰ in this finite counting convention: no record of that category was requested. For n=0, the empty record has probability one and all counts are zero. Structural-zero cells do not become positive-probability cells merely because a generic formula lists them.

Indicator arithmetic explains the covariance

Let Iₜᵢ be one when trial t belongs to category i and zero otherwise, so Nᵢ is the sum of these indicators over trials. Each indicator has mean pᵢ and variance pᵢ(1−pᵢ). For i≠j within the same trial, the product IₜᵢIₜⱼ is always zero: a trial cannot occupy two exclusive categories. Hence their covariance is −pᵢpⱼ. Indicators from different trials are independent under the model and contribute zero covariance.

Adding all contributions gives

E(Ni)=npi,Var⁡(Ni)=npi(1−pi),Cov⁡(Ni,Nj)=−npipj (i≠j).E(N_i)=np_i,\quad \operatorname{Var}(N_i)=np_i(1-p_i),\quad \operatorname{Cov}(N_i,N_j)=-np_ip_j\ (i\ne j).

At n=4 and p=(1/2,1/4,1/4), the means are (2,1,1), variances (1,3/4,3/4), and cross-covariances −1/2,−1/2,−1/4. Independently check a row sum in the displayed covariance table. Independent trials produced dependent count totals; there is no contradiction.

Why the covariance is singular

The count sum is exactly n, so its variance is zero. Multiplying the covariance matrix Σ by the all-ones vector gives zero. Even when every pᵢ is positive, Σ is singular and cannot be inverted as a full k-dimensional covariance. This is a constraint, not a numerical failure.

For a real coefficient vector x, the variance of the weighted count sum is

xTΣx=n(∑ipixi2−(∑ipixi)2)=n∑ipi(xi−xˉ)2,xˉ=∑ipixi.x^{\mathsf T}\Sigma x=n\left(\sum_i p_i x_i^2-\left(\sum_i p_i x_i\right)^2\right)=n\sum_i p_i(x_i-\bar x)^2,\quad \bar x=\sum_i p_i x_i.

For n>0 this expression is zero exactly when x is constant on categories with positive probability. If exactly s probabilities are positive, the kernel has k−s unrestricted zero-probability coordinates plus one common value on the support, dimension k−s+1. Thus the rank is s−1. With n=0 the entire matrix is zero regardless of s. The weighted-variance expression also proves the matrix is positive semidefinite despite its negative off-diagonal entries.

Merging and conditioning answer different questions

Merge categories 1 and 2 before collecting data. Each trial enters their union with probability p₁+p₂, so N₁+N₂ is Binomial(n,p₁+p₂). Keeping three categories and then conditioning on N₃=m is different. When the conditioning event has positive probability and p₁+p₂>0, dividing the joint mass by the mass of N₃=m gives

P(N1=a∣N3=m)=(n−ma)(p1p1+p2)a(p2p1+p2)n−m−a.P(N_1=a\mid N_3=m)=\binom{n-m}{a}\left(\frac{p_1}{p_1+p_2}\right)^a\left(\frac{p_2}{p_1+p_2}\right)^{n-m-a}.

One can see the cancellation directly: cancel p₃ᵐ and n!/(m!(n−m)!) from the numerator, then divide the remaining probabilities by (p₁+p₂)ⁿ⁻ᵐ. This yields a Binomial(n−m,p₁/(p₁+p₂)) law. For n=4,p=(1/4,1/2,1/4),m=1, the conditional probability that N₁=1 is 3·(1/3)·(2/3)²=4/9.

If p₃=1, only m=n is possible and the other counts are deterministically zero; do not form 0/0. Conditioning on an impossible count has no conditional probability under the elementary ratio definition. These restrictions matter in structural-zero examples.

Copied records keep means but change support and covariance

For four iid records, count vector N has covariance 4(diag(p)−ppᵀ). For two iid records with count vector M, copying each record twice gives N′=2M. Its mean is still 4p, but covariance scales by the square of two:

Cov⁡(N′)=4Cov⁡(M)=8(diag⁡(p)−ppT).\operatorname{Cov}(N')=4\operatorname{Cov}(M)=8(\operatorname{diag}(p)-pp^{\mathsf T}).

All copied counts are even. Therefore (2,1,1) has probability zero under copying, versus 3/16 under four iid records. A copied pair has two observations but only one independent category draw. The table enumerates each protocol’s law separately; it does not treat all permutations of copied records as independently generated outcomes.

Apply

Explain why the same sample proportions could support different uncertainty calculations under these two protocols. Connect your argument to categorical goodness-of-fit and model revision: its asymptotic reference starts from an iid covariance, so doubling dependent records does not supply new independent information. The finite count law here does not prove a multivariate central limit theorem or automatically provide a calibrated fitted-model test.

Attempt the changed protocol mixed task before opening its solution. Name what is held fixed, derive the sample space, and distinguish the exact model result from evidence that the model fits a real collection process.

Continue

Return to negative-binomial stopping for a random-length record, or sums and covariance for the indicator calculation. Without-replacement counts are already treated in P-1’s sampling task; their finite-population covariance is a different protocol.

Primary comparison: MIT 18.600, Fall 2019, Lecture 2: multinomial coefficients and Lecture 24: covariance, retrieved 28 October 2026. This lesson combines their counting/covariance mechanisms with the local diagnostics prerequisite; it does not claim the source assigns this exact investigation.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

For n iid categorical trials with probabilities p₁,…,p_k summing to one, derive the joint count mass and normalize it. State the convention for zero probabilities.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For n=4 and p=(1/2,1/4,1/4), compute P(N=(2,1,1)). Compare the probability of the single ordered record AABC. Explain the difference.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Derive means, variances and off-diagonal covariances of multinomial counts using trial indicators. Evaluate the full covariance for n=4,p=(1/2,1/4,1/4).

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Why is multinomial covariance singular even when every pᵢ is positive? For n>0 prove its rank is s−1 when exactly s category probabilities are positive, and discuss n=0.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For three categories, derive the law of N₁+N₂ and of N₁ conditional on N₃=m when the conditioning event has positive probability. Evaluate the conditional law for n=4,p=(1/4,1/2,1/4),m=1.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Compare four iid categorical records at p=(1/2,1/4,1/4) with two iid categorical records each copied twice. Give the means, covariance relationship and probability of counts(2,1,1). Why does matching the means not justify a multinomial fit to copied data?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.