Salta al contenuto
Note per Studenti Sampling and Allocation Problems Report

Sampling and Allocation Problems

In questa pagina 4

Counting problems can be modelled in two different ways: as sampling problems or as allocation problems. The choice of the model is a matter of taste; a sampling problem can often be restated as an allocation problem and vice versa. The tool underneath is the multiplication principle of Counting PrinciplesCounting finite sets rests on the addition principle for disjoint sets and the multiplication principle for staged procedures, which requires a constant number of outcomes at each stage and distinct composite outcomes.Counting Principles →.

Sampling problems

In a sampling problem there is an urn containing balls that are drawn.

  1. The urn contains nn balls. The balls can be all distinct (e.g. numbered) or distinct in groups (e.g. n1n_1 black and n2n_2 red, n1+n2=nn_1+n_2=n).
  2. kk draws are made from the urn. They can be with replacement (after drawing the ball and recording the result the ball is returned to the urn) or without replacement (the ball is thrown away).
  3. Count how many distinct results of the kk draws are possible. This can be done in two ways:
    • count dispositions: two results that differ in the order in which the balls are drawn are considered distinct;
    • count combinations: all results that differ only in the order of appearance of the balls are counted as identical.

Example (academic records). Count how many academic records for the major courses of Information Engineering are possible. There are 17 major courses (12 CFU and 9 CFU) and each can be passed with a grade from 18 to 30 laude, for a total of 14 passing grades.

As a sampling problem: the urn contains 14 distinct balls numbered 18,19,…,30,30L18,19,\dots,30,30L; a total of 17 draws with replacement are made in sequence; count the dispositions of the 17 balls. Interpretation: the 14 balls are the possible grades of each exam; each draw is the passing grade of one exam (the first draw is e.g. Calculus 1, the second Linear Algebra, and so on in a specified order); the ball is replaced because at each exam all passing grades are possible; dispositions are counted because the order matters (27,2127,21 means 27 in Calculus 1 and 21 in Linear Algebra, while 21,2721,27 is a different record).

Counting: 1st draw 14 outcomes, 2nd draw 14 outcomes irrespective of the 1st, ..., 17th draw 14 outcomes irrespective of the previous draws. All results of the 17 draws produce different academic records. Constraints (A) and (B) of the multiplication principle are satisfied and the total number of academic records is 141714^{17}.

"Sampling" is the name because the action of drawing is also called sampling.

Allocation problems

An allocation problem has:

  1. nn cells (distinct, e.g. numbered);
  2. kk tokens, which can be distinct (e.g. numbered) or identical (the notes insist: never call the tokens of an allocation problem "balls", to avoid confusion with sampling);
  3. allocation constraints of tokens in cells: no constraints (any cell can contain from 00 to kk tokens), or insert all tokens with at most 1 per cell (each cell has either 00 or 11 token).

The problem is to count the number of distinct allocations given 1, 2, 3.

Example. The academic-records count as an allocation problem: n=14n=14 cells (the grades) and k=17k=17 distinct tokens (the courses) with no allocation constraints. By the multiplication principle: the first token can go into any of the 14 cells, the second into any of the 14 cells, ..., the 17th into any of the 14 cells, for a total of 141714^{17} allocations, the same result as before.

Dictionary

Sampling Allocation
nn balls nn cells
kk draws kk tokens
draws with replacement no allocation constraints
draws without replacement at most one token per cell
count dispositions tokens are distinct (e.g. numbered)
count combinations identical tokens

Traditional definitions

I. Dispositions with repetitions

nn distinct objects taken kk at a time (any kk, possibly larger than nn). Sampling model: urn with nn distinct balls, kk draws with replacement (repetitions), count dispositions: n×n×⋯×n⏟k times=nk.\underbrace{n\times n\times\dots\times n}_{k\text{ times}} = n^k. Example: academic records.

II. Dispositions without repetitions

nn distinct objects taken kk at a time, k≤nk\le n. Sampling model: urn with nn distinct balls, kk draws without replacement (no repetitions), count dispositions: n(n−1)⋯(n−k+1)n(n-1)\cdots(n-k+1).

Definition. Dn,k≜n(n−1)⋯(n−k+1).D_{n,k}\triangleq n(n-1)\cdots(n-k+1). Example: cross-country race (podiums D10,3=10⋅9⋅8D_{10,3}=10\cdot9\cdot8).

IIa. Special case k=nk=n (permutations). Dn,n=n!=n(n−1)⋯2⋅1.D_{n,n}=n!=n(n-1)\cdots2\cdot1. Example: all orders of arrival in the cross-country race.

III. Combinations without repetitions

nn distinct objects taken kk at a time, k≤nk\le n. Sampling model: urn with nn distinct (numbered) balls, kk draws without replacement, count combinations.

The k!k! permutations of a given disposition all give rise to the same combination. For instance the 3!=63!=6 permutations of the disposition 237237, namely 237,273,327,372,723,732237,273,327,372,723,732, count as only 1 combination. Calling Cn,kC_{n,k} the number of combinations without repetitions, k! Cn,k=Dn,k,Cn,k=Dn,kk!=n(n−1)⋯(n−k+1)k!=n!k! (n−k)!=(nk),k!\,C_{n,k}=D_{n,k},\qquad C_{n,k}=\frac{D_{n,k}}{k!}=\frac{n(n-1)\cdots(n-k+1)}{k!}=\frac{n!}{k!\,(n-k)!}=\binom nk, where (nk)\binom nk is the alternative notation (the binomial coefficient, see Binomial CoefficientsBinomial coefficients count the k-element subsets of an n-element set, satisfy the symmetry and Pascal recursion, and combined with equiprobable measures they give probabilities such as team selection, train boarding and urn draws.Binomial Coefficients →). (The page writes the last factor of the numerator as (n−k−1)(n-k-1); the correct last factor, consistent with the definition of Dn,kD_{n,k} and with the next pages, is (n−k+1)(n-k+1).)

Counting Cn,kC_{n,k} as an allocation problem. nn distinct cells, kk identical tokens, insert all tokens with at most 1 per cell (k≤nk\le n). It is easier to consider the tokens first as if they were numbered: the number of possible allocations is Dn,k=n(n−1)⋯(n−k+1)D_{n,k}=n(n-1)\cdots(n-k+1), since there are nn choices for the first token, n−1n-1 for the second, and so on (multiplication principle). Now all k!k! permutations of a given allocation give the same combination (think of erasing the numbers from the tokens, which then become all identical). The number of allocations with identical tokens is therefore Dn,k/k!=Cn,kD_{n,k}/k!=C_{n,k}, as computed before.

Other problems solved by Cn,kC_{n,k}

  • Number of sequences of nn bits containing kk bits equal to 1. This is the problem of counting how many sequences of nn coin tosses show kk heads: nn cells (the nn bits), kk identical tokens (the kk bits equal to 1); in how many ways can one allocate kk bits 1 in nn cells? The solution is (nk)\binom nk.
  • Subsets of cardinality kk of a set of cardinality nn. Natural as a sampling problem: draw kk elements without replacement from the nn elements and count combinations: the number of subsets is (nk)\binom nk. Equivalent example: the number of committees of kk people chosen among nn people.

Summary of the four counting formulas

Model Count
dispositions with repetitions of nn objects taken kk at a time nkn^k
dispositions without repetitions (k≤nk\le n) Dn,k=n(n−1)⋯(n−k+1)D_{n,k}=n(n-1)\cdots(n-k+1)
permutations (k=nk=n) n!n!
combinations without repetitions (k≤nk\le n) Cn,k=(nk)=n!k! (n−k)!C_{n,k}=\binom nk=\dfrac{n!}{k!\,(n-k)!}

Probability applications of these counts are in Binomial CoefficientsBinomial coefficients count the k-element subsets of an n-element set, satisfy the symmetry and Pascal recursion, and combined with equiprobable measures they give probabilities such as team selection, train boarding and urn draws.Binomial Coefficients → and The Birthday ProblemThe probability that at least two of n children share a birthday is computed through the complementary event of all-distinct birthdays, and already n = 23 gives probability above one half.The Birthday Problem →.

Versione ripasso

  • Sampling: urn with nn balls, kk draws with or without replacement; count dispositions (order matters) or combinations (order ignored).
  • Allocation: nn distinct cells, kk tokens (distinct or identical; never call them balls), constraints: none, or at most one per cell.
  • Dictionary: with replacement = no constraints; without replacement = at most one token per cell; dispositions = distinct tokens; combinations = identical tokens.
  • Dispositions with repetitions: nkn^k (academic records: 141714^{17}).
  • Dispositions without repetitions: Dn,k=n(n−1)⋯(n−k+1)D_{n,k}=n(n-1)\cdots(n-k+1); permutations Dn,n=n!D_{n,n}=n!.
  • Combinations: the k!k! orderings of one disposition give the same combination, so Cn,k=Dn,kk!=n!k!(n−k)!=(nk).C_{n,k}=\frac{D_{n,k}}{k!}=\frac{n!}{k!(n-k)!}=\binom nk.
  • (nk)\binom nk also counts: bit sequences of length nn with kk ones; subsets of size kk of an nn-set; committees of kk among nn people.
  • Typical mistakes: confusing dispositions with combinations; using nkn^k when draws are without replacement.

Teoria collegata