%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                                                          %%%
%%% file:      s1.tex                                                        %%%
%%% author:    Tatiana Jajcayová, Ján Komara                                 %%%
%%% email:     Jan.Komara@fmph.uniba.sk                                      %%%
%%% copyright: public domain                                                 %%%
%%% version:   2015/10/4                                                     %%%
%%%                                                                          %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt,a4paper]{article}

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

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{lmodern}
\usepackage{indentfirst}

\renewcommand{\labelenumi}{{\normalfont (\alph{enumi})}}

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

\begin{document}

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

\title{1. domáca úloha z predmetu \\ 1-AIN-121 Matematika (1) ZS 2015/16}

\author{Tatiana Jajcayová \and Ján Komara}

%\date{}
\date{\today}

\maketitle

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

\section*{1. príklad}

Koľko je takých rôznych šesťciferných celých čísel, ktoré 
\begin{enumerate}
\item
sú deliteľné dvomi a žiadna číslica sa v nich neopakuje?
\item
sú deliteľné piatimi a  číslice sa v nich môžu opakovať?
\end{enumerate}

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

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

Táto časť obsahuje riešenie 1. príkladu.

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

\section*{2. príklad}

Koľkými spôsobmi môžeme usadiť okolo okrúhleho stola
\begin{enumerate}
\item 
alternujúco 10 žien a 10 mužov?
\item 
5 mužov a 12 žien tak, aby žiadni dvaja muži nesedeli vedľa seba?
\end{enumerate}

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

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

Táto časť obsahuje riešenie 2. príkladu.

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

\section*{3. príklad}

Rovnako ako na prednáške uvažujme digitálne hodiny, ktoré sú nastavené na
európsky 24 hodinový cyklus a ukazujú hodiny minúty a sekundy. (Tak napr.
16:31:57 je čas, ktorý sa na takýchto hodinách môže vyskytnúť.)
Koľkokrát za deň sa na hodinách vyskytne čas, kde každá z troch dvojíc číslic
(pre hodiny, pre minúty, pre sekundy) oddelene tvorí \emph{neklesajúcu}
postupnosť a počet minút a počet sekúnd sa odlišujú v parite?

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

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

Táto časť obsahuje riešenie 3. príkladu.

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

\section*{4. príklad}

\begin{enumerate}
\item
Koľkými rôznymi spôsobmi  sa dajú usporiadať písmena zo slova MATEMATIKA?
\item 
Koľko reťazcov z časti (a) má K a I vedľa seba?
\item 
Koľko reťazcov z časti (a) má všetky samohlásky spolu?
\end{enumerate}

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

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

Táto časť obsahuje riešenie 4. príkladu.

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

\section*{5. príklad (Malý programovací projekt)}

Na prednáške sme uviedli Stirlingovu formulu na aproximáciu $n!$:
\[
n! \sim \sqrt{2 \pi n} \left( \frac {n}{e} \right)^n.
\]
Trochu sa s touto formulou pohráme. Vytvorte malý program, ktorý pre veľké
množstvo (aspoň 30) hodnôt $n$ vypočíta faktoriál presne z definície aj pomocou
Stirlingovej formuly. Dosiahnuté výsledky porovnajte v tabuľke, kde pre každé
$n$, vypočítate aj rozdiel, aj podiel vašich dvoch získaných hodnôt. Na základe
takto získaných dát interpretujte vzťah medzi presne vyrátaným faktoriálom a
jeho aproximáciou.

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

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

Táto časť obsahuje riešenie 5. príkladu.
Pozri tiež Obr.~\ref{tabulka}.

\begin{figure}
\begin{center}
\begin{tabular}{|r|c|l|}\hline
n   & rozdiel & podiel \\ \hline\hline
1   & 12      & 1,1    \\ \hline
5   & 567     & 1,01   \\ \hline
30  & 3031    & 1,001  \\ \hline
100 & 100101  & 1,0001 \\ \hline
\end{tabular}
\end{center}
\caption{Riešenie 5. príkladu}
\label{tabulka}
\end{figure}

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

\end{document}

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