9 #93 The birthday problem (number of injections) forget
The number of injections from a \(k\)-element set to a \(k+j\)-element set, \(q\), is \(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 ) \}\) 9.1 Proof 1 (induction) forget
PreparationRemoving one pointLet the image of \(z \in X\) be \(a\); the set \(F\) of all such injections 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_s ,∖1 ,∈∖1Sum over fibersIf the number of injections from \(k\) elements to \(k + j\) elements is \(q\), then the number of injections from \(k + 1\) to \((k + j) + 1\) elements is \(q \cdot ((k + j) + 1)\) (split according to 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 ,∖1 ,∈∖1 ,LFibI ,L∖# ,Lfib ,L#=Induction on the numberSince factorials are nonzero, 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ℤ ,!𝕄 ,⋅𝕄:D ,⋅0XThe only injection from \(0\) elements is the empty function (just 1).
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 ,!𝕄 ,!∈𝕄 ,#1 ,⋅𝕄:D ,⋅0XInductive step: if it holds for \(k\), it holds for \(k + 1\) (\(j\) 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 ,!𝕄 ,!∈𝕄 ,∖1 ,∈∖1 ,LFibI ,L∖# ,Lfib ,LIN ,Lq1 ,Lar ,⋅𝕄:D ,⋅0XInduction on \(k\) (\(j\) 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 ,!𝕄 ,!∈𝕄 ,∖1 ,∈∖1 ,LFibI ,L∖# ,Lfib ,LIN ,Lbase ,Lq1 ,Lar ,Lstep ,#1 ,⋅𝕄:D ,⋅0XMain theoremFrom a \(k\)-element set \(X\) to a \(k + j\)-element set \(Y\), the set of all injections \(X \to_I Y\) has \(q\) elements, with \(q \cdot j! = (k + j)!\), i.e. \(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, #52). In the model where each person's birthday is independent and equally likely on each of the \(n\) days, the probability that no two coincide 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 ,!𝕄 ,!∈𝕄 ,∖1 ,∈∖1 ,LFibI ,L∖# ,Lfib ,LIN ,Lbase ,Lq1 ,Lar ,Lstep ,Lind ,#1 ,⋅𝕄:D ,⋅0X9.2 Proof 2 (from the number of combinations) forget
The number of injections from a \(k\)-element set to a \(k + j\)-element set is \(q\), with \(q \cdot j! = (k + j)!\) (a proof different from Proof 1).
Split the injections by image: the image is a \(k\)-element subset (\(\binom{k+j}{k}\) choices), and the injections with image \(A\) are the bijections 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 ,!𝕄 ,LIi ,LIr ,Lc∈ ,LfibR ,→IS=#! ,L#= ,⋅𝕄:D ,⋅0XFrom the formula for combinations \(\binom{k+j}{k}\,k!\,j! = (k+j)!\) (#58), \(q = k! \binom{k+j}{k}\) is the answer.
\(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 ,!𝕄 ,LIi ,LIr ,Lc∈ ,LfibR ,→IS=#! ,L#= ,Lmain ,Lch ,⋅𝕄:D ,⋅0X