Question Number 158955 by mr W last updated on 11/Nov/21
Answered by mr W last updated on 15/Nov/21
$${let}'{s}\:{look}\:{at}\:{the}\:{general}\:{case}\:{with}\:{n} \\ $$$${students}\:{into}\:{r}\:{schools}.\:{both}\:{students} \\ $$$$\left({objects}\right)\:{and}\:{schools}\:\left({boxes}\right)\:{are} \\ $$$${distinct}. \\ $$$${let}'{s}\:{say}\:{the}\:{school}\:{S}_{\mathrm{1}} \:{obtains}\:{n}_{\mathrm{1}} \: \\ $$$${students},\:{the}\:{schools}\:{S}_{\mathrm{2}} \:{obtains}\:{n}_{\mathrm{2}} \\ $$$${students},\:{etc}. \\ $$$${n}_{\mathrm{1}} +{n}_{\mathrm{2}} +{n}_{\mathrm{3}} +…+{n}_{{r}} ={n} \\ $$$$\left.\mathrm{1}\right)\:{no}\:{restriction}:\:{n}_{\mathrm{1}} \geqslant\mathrm{0},\:{n}_{\mathrm{2}} \geqslant\mathrm{0},\:{etc}. \\ $$$$\left.\mathrm{2}\right)\:{each}\:{schools}\:{obtains}\:{at}\:{least}\:{one} \\ $$$${student}:\:{n}_{\mathrm{1}} \geqslant\mathrm{1},\:{n}_{\mathrm{2}} \geqslant\mathrm{1},\:{etc}. \\ $$$$ \\ $$$${to}\:{distribute}\:{n}\:{students}\:{into}\:{r}\:{schools} \\ $$$${such}\:{that}\:{S}_{\mathrm{1}} \:{obtains}\:{n}_{\mathrm{1}} \:{students}, \\ $$$${S}_{\mathrm{2}} \:{obtains}\:{n}_{\mathrm{2}} \:{students},\:{etc}.\:{and} \\ $$$${S}_{{r}} \:{obtains}\:{n}_{{r}} \:{students},\:{there}\:{are} \\ $$$${C}_{{n}_{\mathrm{1}} } ^{{n}} {C}_{{n}_{\mathrm{2}} } ^{{n}−{n}_{\mathrm{1}} } …{C}_{{n}_{{r}} } ^{{n}−{n}_{\mathrm{1}} −{n}_{\mathrm{2}} −…−{n}_{{r}−\mathrm{1}} } \:{ways}, \\ $$$${which}\:{is} \\ $$$$\frac{{n}!}{{n}!\left({n}−{n}_{\mathrm{1}} \right)!}×\frac{\left({n}−{n}_{\mathrm{1}} \right)!}{{n}_{\mathrm{2}} !\left({n}−{n}_{\mathrm{1}} −{n}_{\mathrm{2}} \right)!}×…×\frac{\left({n}−{n}_{\mathrm{1}} −{n}_{\mathrm{2}} −…−{n}_{{r}−\mathrm{1}} \right)!}{{n}_{{r}} !\mathrm{0}!}, \\ $$$${i}.{e}.\:\frac{{n}!}{{n}_{\mathrm{1}} !{n}_{\mathrm{2}} !{n}_{\mathrm{3}} !…{n}_{{r}} !}\:{ways}. \\ $$$${using}\:{generating}\:{function}\:{method} \\ $$$${we}\:{can}\:{see}\:{that} \\ $$$$\left.\underline{\boldsymbol{{for}}\:\boldsymbol{{case}}\:\mathrm{1}\right)} \\ $$$${number}\:{of}\:{ways}\:{is}\:{the}\:{coef}.\:{of}\:{x}^{{n}} \:{in} \\ $$$${n}!\left(\mathrm{1}+\frac{{x}}{\mathrm{1}!}+\frac{{x}^{\mathrm{2}} }{\mathrm{2}!}+\frac{{x}^{\mathrm{3}} }{\mathrm{3}!}+…\right)^{{r}} \\ $$$$={n}!\left({e}^{{x}} \right)^{{r}} \\ $$$$={n}!{e}^{{rx}} \\ $$$$={n}!\left(\mathrm{1}+\frac{{rx}}{\mathrm{1}!}+\frac{{r}^{\mathrm{2}} {x}^{\mathrm{2}} }{\mathrm{2}!}+\frac{{r}^{\mathrm{3}} {x}^{\mathrm{3}} }{\mathrm{3}!}+…\right) \\ $$$${coef}.\:{of}\:{x}^{{n}} \:{is}\:{n}!×\frac{{r}^{{n}} }{{n}!}={r}^{{n}} . \\ $$$${that}\:{means}\:{there}\:{are}\:{r}^{{n}} \:{ways}\:{to} \\ $$$${distribute}\:{n}\:{students}\:{into}\:{r}\:{schools} \\ $$$${without}\:{restriction}. \\ $$$$\left.\underline{\boldsymbol{{for}}\:\boldsymbol{{case}}\:\mathrm{2}\right)} \\ $$$${number}\:{of}\:{ways}\:{is}\:{the}\:{coef}.\:{of}\:{x}^{{n}} \:{in} \\ $$$${n}!\left(\frac{{x}}{\mathrm{1}!}+\frac{{x}^{\mathrm{2}} }{\mathrm{2}!}+\frac{{x}^{\mathrm{3}} }{\mathrm{3}!}+…\right)^{{r}} \\ $$$$={n}!\left({e}^{{x}} −\mathrm{1}\right)^{{r}} \\ $$$$={n}!\underset{{k}=\mathrm{0}} {\overset{{r}} {\sum}}\left(−\mathrm{1}\right)^{{k}} {C}_{{k}} ^{{r}} \left({e}^{{x}} \right)^{{r}−{k}} \\ $$$$={n}!\underset{{k}=\mathrm{0}} {\overset{{r}} {\sum}}\left\{\left(−\mathrm{1}\right)^{{k}} {C}_{{k}} ^{{r}} \left[\mathrm{1}+\frac{\left({r}−{k}\right){x}}{\mathrm{1}!}+\frac{\left({r}−{k}\right)^{\mathrm{2}} {x}^{\mathrm{2}} }{\mathrm{2}!}+…\right]\right\} \\ $$$${the}\:{coef}.\:{of}\:{x}^{{n}} \:{is} \\ $$$${n}!\underset{{k}=\mathrm{0}} {\overset{{r}} {\sum}}\left[\left(−\mathrm{1}\right)^{{k}} {C}_{{k}} ^{{r}} \frac{\left({r}−{k}\right)^{{n}} }{{n}!}\right] \\ $$$$=\underset{{k}=\mathrm{0}} {\overset{{r}} {\sum}}\left(−\mathrm{1}\right)^{{k}} {C}_{{k}} ^{{r}} \left({r}−{k}\right)^{{n}} \\ $$$$=\:{r}^{{n}} −{C}_{\mathrm{1}} ^{{r}} \left({r}−\mathrm{1}\right)^{{n}} +{C}_{\mathrm{2}} ^{{r}} \left({r}−\mathrm{2}\right)^{{n}} −…+\left(−\mathrm{1}\right)^{{r}−\mathrm{1}} {C}_{{r}−\mathrm{1}} ^{{r}} \\ $$
Commented by Tawa11 last updated on 11/Nov/21
$$\mathrm{Great}\:\mathrm{sir}. \\ $$
Commented by mr W last updated on 11/Nov/21
$${example}:\:\mathrm{10}\:{students}\:{into}\:\mathrm{5}\:{schools} \\ $$$${n}=\mathrm{10},\:{r}=\mathrm{5} \\ $$$$\left.\mathrm{1}\right)\:{no}\:{restriction} \\ $$$${number}\:{of}\:{ways}\:=\mathrm{5}^{\mathrm{10}} =\mathrm{9}\:\mathrm{765}\:\mathrm{625} \\ $$$$\left.\mathrm{2}\right)\:{at}\:{least}\:{one}\:{student}\:{in}\:{each}\:{school} \\ $$$${number}\:{of}\:{ways}\:{is} \\ $$$$\mathrm{5}^{\mathrm{10}} −\mathrm{4}^{\mathrm{10}} {C}_{\mathrm{1}} ^{\mathrm{5}} +\mathrm{3}^{\mathrm{10}} {C}_{\mathrm{2}} ^{\mathrm{5}} −\mathrm{2}^{\mathrm{10}} {C}_{\mathrm{3}} ^{\mathrm{5}} +{C}_{\mathrm{4}} ^{\mathrm{5}} \\ $$$$=\mathrm{5}^{\mathrm{10}} −\mathrm{5}×\mathrm{4}^{\mathrm{10}} +\mathrm{10}×\mathrm{3}^{\mathrm{10}} −\mathrm{10}×\mathrm{2}^{\mathrm{10}} +\mathrm{5} \\ $$$$=\mathrm{5}\:\mathrm{103}\:\mathrm{000} \\ $$
Commented by otchereabdullai@gmail.com last updated on 12/Nov/21
$$\mathrm{more}\:\mathrm{blessing}\:\mathrm{prof}! \\ $$