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

\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 1. domácu úlohu}

\author{Ján Komara}

%\date{}
\date{\today}

\maketitle

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

\section*{1. príklad}

Uvažujme digitálne hodiny, ktoré sú nastavené na európsky 24-hodinový cyklus. 
Tie ukazujú denný časový údaj vo formáte 
\begin{center}
hodiny:minúty:sekundy.
\end{center}
Tak napríklad 01:24:58 je časový údaj, ktorý sa na takýchto hodinách môže vyskytnúť.

Spočítajme, koľkokrát za deň sa na hodinách vyskytne časový údaj
\begin{align*}
H_1 H_2 : M_1 M_2 : S_1 S_2
\end{align*}
taký, že
\begin{align*}
H_1 < H_2 < M_1 < M_2 < S_1 < S_2
.
\end{align*}

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

\subsection*{Riešenie}

Najprv si všimnime, že prvý časový údaj s uvedenými vlastnosťami má tvar 01:23:45, 
zatiaľ čo posledný takýto údaj má tvar 12:34:59.

Desiatky sekúnd $S_1$ sa musia vyberať spomedzi čísel $\{ 4, 5 \}$.
Pre každé také $S_1 \in \{ 4, 5 \}$  vyberieme ďalej pätice čísel 
$H_1 H_2 M_1 M_2 S_2$ tak, aby platilo
\begin{align*}
0 \leq H_1 < H_2 < M_1 < M_2 < S_1 < S_2 \leq 9
.
\end{align*}
Ak $S_1 = 4$, tak počet možností takýchto výberov je rovný číslu 5, 
pretože vtedy musí platiť
\begin{align*}
H_1 = 0 \land H_2 = 1 \land M_1 = 2 \land M_2 = 3 \land 5 \leq S_2 \leq 9
.
\end{align*}
Ak $S_1 = 5$, tak počet možností takýchto výberov je rovný číslu $5 \times 4$, 
pretože vtedy musí platiť
\begin{align*}
0 \leq H_1 < H_2 < M_1 < M_2 \leq 4 \land 6 \leq S_2 \leq 9
.
\end{align*}
Hľadaný počet časových údajov je tak rovný číslu
\begin{align*}
5 + 5 \times 4 = 25
.
\end{align*}

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

\section*{2. príklad}

Koľko $6$-ciferných čísel pozostávajúcich len z nenulových cifier 
neobsahuje dve za sebou idúce tie isté cifry? 

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

\subsection*{Riešenie}

Podľa pravidla súčinu hľadaný počet je rovný číslu
\begin{align*}
9 \times 8 \times 8 \times 8 \times 8 \times 8 = 9 \times 8^5
.
\end{align*}

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

\end{document}

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