%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%% file:      v2.tex                                                        %%%
%%% author:    Ján Komara                                                    %%%
%%% email:     komara@fmph.uniba.sk                                          %%%
%%% copyright: public domain                                                 %%%
%%% version:   2021/10/15                                                    %%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt,a4paper]{article}

\usepackage[slovak]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{lmodern}
\usepackage{indentfirst}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{Vzorové príklady pre 2. domácu úlohu}

\author{Ján Komara}

%\date{}
\date{\today}

\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section*{1. príklad}

Spočítajte, koľko celočíselných riešení má rovnica
\begin{align}
x_1 + x_2 + x_3 + x_4 = 15
,
\label{eq15}
\end{align}
ak $x_1 \geq 1$, $x_2 \geq 2$, $x_3 \geq 3$ a $x_4 \geq 4$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection*{Riešenie 1. príkladu}

Rovnica \eqref{eq15} je ekvivalentná rovnici
\begin{align}
x_1 - 1 + x_2 - 2 + x_3 - 3 + x_4 - 4 = 15 - 1 - 2 - 3 - 4 = 5
,
\label{eq5}
\end{align}
pričom $x_1 - 1 \geq 0$, $x_2 - 2 \geq 0$, $x_3 - 3 \geq 0$ a $x_4 - 4 \geq 0$.

Počet celočíselných riešení rovnice \eqref{eq5} s uvedenými ohraničeniami je
ten istý ako počet celočíselných riešení rovnice
\begin{align*}
y_1 + y_2 + y_3 + y_4 = 5
,
\end{align*}
kde $y_i \geq 0$ pre každé $i = 1,2,3,4$.
Ale ten je rovný počtu kombinácií s opakovaním 5-tej triedy zo 4 druhov:
\begin{align*}
\binom{5 + 4 - 1}{4 - 1} = 
\binom{8}{3} = 
\frac{8 \times 7 \times 6}{3 \times 2} = 
56
.
\end{align*}
A to je hľadaný počet riešení rovnice \eqref{eq15}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section*{2. príklad}

Určite koeficient pri $x^4$ vo výraze $(1 - x + 2x^2)^5$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection*{Riešenie 2. príkladu}

Podľa multinomickej vety platí
\begin{align*}
&
(1 - x + 2x^2)^5 =
\\ &
\sum_{n_1+n_2+n_3=5} 
\binom{5}{n_1, n_2, n_3} 1^{n_1} (-x)^{n_2} (2x^2)^{n_3} =
\\ &
\sum_{n_1+n_2+n_3=5} 
\binom{5}{n_1, n_2, n_3} (-1)^{n_2} 2^{n_3} x^{n_2+2n_3}
.
\end{align*}
Potrebujeme preto určiť trojice prirodzených čísel $n_1,n_2,n_3$ také, že
\begin{align*}
n_1 + n_2 + n_3=5 \qquad n_2 + 2n_3 = 4
.
\end{align*}
Podmienky spĺňajú len tieto trojice $1,4,0$, $2,2,1$ a $3,0,2$:
\begin{align*}
1 + 4 + 0 & = 5 & 4 + 2 \times 0 & = 4
\\
2 + 2 + 1 & = 5 & 2 + 2 \times 1 & = 4
\\
3 + 0 + 2 & = 5 & 0 + 2 \times 2 & = 4
.
\end{align*}
Hľadaný koeficient je teda rovný číslu
\begin{align*}
\binom{5}{1,4,0} (-1)^{4} 2^{0} + 
\binom{5}{2,2,1} (-1)^{2} 2^{1} + 
\binom{5}{3,0,2} (-1)^{0} 2^{2} = 
105
.
\end{align*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section*{3. príklad}

Koľko permutácií množiny $\{ 1,2,\dotsc,n \}$ nenecháva žiadne číslo na svojom 
mieste?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection*{Riešenie 3. príkladu}

Nech $U$ je množina všetkých permutácií množiny
\(
S = \{ 1,2,\dotsc,n \}
\).
Symbolom $A_i$ pre $1 \leq i \leq n$ označme množinu tých permutácií z $U$,
ktoré nechajú $i$-tý prvok množiny $S$ na svojom mieste.
Množiny
\(
A_{i_1} \cap A_{i_2} \cap \dotsm \cap A_{i_k} 
\)
majú rovnako veľa prvkov pre ľubovolný výber $k$ čísel
\(
1 \leq i_1 < i_2 < \dotsc < i_k \leq n
\).
Platí totiž
\begin{align*}
|A_{i_1} \cap A_{i_2} \cap \dotsm \cap A_{i_k}| =
|A_1 \cap A_2 \cap \dotsm \cap A_k| = 
(n-k)!
.
\end{align*}
Hľadaný počet je preto rovný číslu
\begin{align*}
\left| \overline{A_1} \cap \overline{A_2} \cap \dotsm \cap \overline{A_n} \right| & =
\sum_{k=0}^{n} (-1)^k \binom{n}{k} |A_{1} \cap A_{2} \cap \dotsm \cap A_{k}| =
\\ & =
\sum_{k=0}^{n} (-1)^k \binom{n}{k} (n-k)!
.
\end{align*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
