10 #93 Birthday problem (number of injections) forget
The number of injections from a set of \(k\) elements to a set of \(k+j\) elements is \(q\), with \(q \cdot j! = (k+j)!\) (that is, \((k+j)!/j!\)).
The set of injections \(X \to_I Y\): functions in which distinct \(p, q\) do not go to the same value \(y\).
word(ss,s) …
\(\stackrel{\rm I}\to\)→I. …
\(X \stackrel{\rm I}\to Y = \{ f \in X \to Y \mid \forall p , q , y \, ( \langle p , y \rangle \in f , \langle q , y \rangle \in f \Longrightarrow p = q ) \}\) 10.1 Proof 1 (induction) forget
PreparationRemoving one pointThe set of all injections for which the image of \(z \in X\) is \(a\), \(F\), has the same number of elements as the set of all injections from \(X \setminus \{z\}\) to \(Y \setminus \{a\}\), \(G\).
LFibI …
\(z \in X , a \in Y , F = \{ f \in X \stackrel{\rm I}\to Y \mid \langle z , a \rangle \in f \} , G = ( X \mathop\setminus \{ z \} ) \stackrel{\rm I}\to ( Y \mathop\setminus \{ a \} ) \Longrightarrow F \stackrel{\#}= G\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,ax_sSum over fibersIf injections from \(k\) elements to \(k + j\) elements number \(q\), then injections from \(k + 1\) elements to \((k + j) + 1\) elements number \(q \cdot ((k + j) + 1)\) (split by where \(z\) goes, \(a\)).
LIN …
\(k , j \in \mathbb{M} , q \in \mathbb{M} , \forall U , V \, ( \operatorname{\#} U = k , \operatorname{\#} V = k + j \Longrightarrow \operatorname{\#} ( U \stackrel{\rm I}\to V ) = q ) , \operatorname{\#} X = k + 1 , \operatorname{\#} Y = ( k + j ) + 1 , z \in X \Longrightarrow \operatorname{\#} ( X \stackrel{\rm I}\to Y ) = q \cdot ( ( k + j ) + 1 )\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,ax_s ,LfibInduction on the countFactorials are nonzero, so if \(q \cdot j! = r \cdot j!\) then \(q = r\).
If \(q \cdot j! = (k+j)!\) then \((q \cdot ((k+j)+1)) \cdot j! = ((k+1)+j)!\).
Lar …
\(q , k , j \in \mathbb{M} , q \cdot j ! = ( k + j ) ! \Longrightarrow ( q \cdot ( ( k + j ) + 1 ) ) \cdot j ! = ( ( k + 1 ) + j ) !\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,!𝕄 ,⋅0XThe only injection from \(0\) elements is the empty function (1 of them).
Lbase …
\(j \in \mathbb{M} \Longrightarrow \forall U , V \, ( \operatorname{\#} U = 0 , \operatorname{\#} V = 0 + j \Longrightarrow \exists q \in \mathbb{M} . \operatorname{\#} ( U \stackrel{\rm I}\to V ) = q , q \cdot j ! = ( 0 + j ) ! )\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,ax_s ,!𝕄 ,⋅0XInduction step: if it holds for \(k\), it holds for \(k + 1\) (\(j\) is fixed).
Lstep …
\(k , j \in \mathbb{M} , \forall U , V \, ( \operatorname{\#} U = k , \operatorname{\#} V = k + j \Longrightarrow \exists q \in \mathbb{M} . \operatorname{\#} ( U \stackrel{\rm I}\to V ) = q , q \cdot j ! = ( k + j ) ! ) , \operatorname{\#} U = k + 1 , \operatorname{\#} V = ( k + 1 ) + j \Longrightarrow \exists q \in \mathbb{M} . \operatorname{\#} ( U \stackrel{\rm I}\to V ) = q , q \cdot j ! = ( ( k + 1 ) + j ) !\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,ax_s ,!𝕄 ,⋅0XInduction on \(k\) (\(j\) is fixed).
Lind …
\(k , j \in \mathbb{M} \Longrightarrow \forall U , V \, ( \operatorname{\#} U = k , \operatorname{\#} V = k + j \Longrightarrow \exists q \in \mathbb{M} . \operatorname{\#} ( U \stackrel{\rm I}\to V ) = q , q \cdot j ! = ( k + j ) ! )\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,ax_s ,!𝕄 ,⋅0XMain theoremFrom a set of \(k\) elements \(X\) to a set of \(k + j\) elements \(Y\), the set of all injections \(X \to_I Y\) has \(q\) elements, with \(q \cdot j! = (k + j)!\), that is, \(q = (k+j)!/j!\). In the birthday problem (\(k\) people, \(n = k + j\) days), the total number of cases is \(n^k\) (the number of functions in #52). In the model where each person's birthday is independent and equally likely to be any of the \(n\) days, the probability that nobody shares a day is \(q / n^k\).
\(k , j \in \mathbb{M} , \operatorname{\#} X = k , \operatorname{\#} Y = k + j \Longrightarrow \exists q \in \mathbb{M} . \operatorname{\#} ( X \stackrel{\rm I}\to Y ) = q , q \cdot j ! = ( k + j ) !\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,ax_s ,!𝕄 ,⋅0X10.2 Proof 2 (from combinations) forget
Injections from a set of \(k\) elements to a set of \(k + j\) elements number \(q\), with \(q \cdot j! = (k + j)!\) (a proof different from Proof 1).
Split injections by image: the image is a \(k\)-element subset (\(\binom{k+j}{k}\) choices), and an injection with image \(A\) is a bijection from \(X\) to \(A\) (\(k!\) of them).
PreparationAn injection is a bijection onto its image, which is a subset of \(Y\). Conversely, a bijection onto a subset of \(Y\), \(A\), is an injection with image \(A\).
LIi …
\(f \in X \stackrel{\rm I}\to Y \Longrightarrow f \in X \stackrel{\rm IS}\to f ( X ) , f ( X ) \subset Y\) \(\blacktriangleleft\) \(\mathbb{W}.\)LIr …
\(A \subset Y , f \in X \stackrel{\rm IS}\to A \Longrightarrow f \in X \stackrel{\rm I}\to Y , f ( X ) = A\) \(\blacktriangleleft\) \(\mathbb{W}.\)Main theoremLmain …
\(k , j \in \mathbb{M} , \operatorname{\#} X = k , T = \{ A \mid A \subset Y , \operatorname{\#} A = k \} , \operatorname{\#} T = ( k + j ) \mathrm{C} k \Longrightarrow \operatorname{\#} ( X \stackrel{\rm I}\to Y ) = k ! \cdot ( ( k + j ) \mathrm{C} k )\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,ax_s ,!𝕄 ,Lc∈ ,⋅0XFrom the formula for combinations \(\binom{k+j}{k}\,k!\,j! = (k+j)!\) (#58), the answer is \(q = k! \binom{k+j}{k}\).
\(k , j \in \mathbb{M} , \operatorname{\#} X = k , \operatorname{\#} Y = k + j \Longrightarrow \exists q \in \mathbb{M} . \operatorname{\#} ( X \stackrel{\rm I}\to Y ) = q , q \cdot j ! = ( k + j ) !\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ ,ax_s ,!𝕄 ,Lc∈ ,Lch ,⋅0X