\documentclass{beamer}[8pt]
\usepackage{beamerthemesplit}
\usetheme{Warsaw}
%\usepackage{verbatim}
\usepackage{pdfpages}
\usepackage{color}
\usepackage{graphicx}
\usepackage{fontspec}
\setmainfont[Script=Devanagari]{Sanskrit 2003}

\newfontfamily \dv[Script=Devanagari]{Sanskrit 2003}

\title{\textcolor{yellow}{Proof of Ku\d{t}\d{t}aka's method}}
\author{Amba Kulkarni}
\institute{ University of Hyderabad}
\date{20th March 2018}

\begin{document}
\setbeamertemplate{footline}[frame number]
%===================================slide 1=========================%
\begin{frame}

\titlepage

\end{frame}
%============================================================%
\begin{frame}
\frametitle{Ku\.t\.taka: proof}
We give below the justification of the ku\d{t}\d{t}aka's method.\\

Consider the equation: 8y = 29x + 4\\
\vspace{0.5cm}
Dividend(bh{\=a}jya) = 29, Divisor(h{\=a}ra) = 8, k\d{s}epaka(constant) = 4\\
\begin{tabular}{|l|l|l|l|} \hline
Dividend & Divisor & Quotient & Remainder\\ \hline
29 & 8 & 3 & 5\\
8 & 5 & 1 & 3\\ \hline
5 & 3 & 1 & 2\\ \hline
3 & 2 & 1 & 1\\ \hline
\end{tabular}\\
\vspace{0.2cm}
\textbf{Valli}:\\
Place the quotients, constant and zero in a column.\\
\begin{tabular}{|l|} \hline
3\\
1\\
1\\
1\\
4\\
0\\ \hline
\end{tabular}
\vspace{0.2cm}
\begin{tabular}{||lllll||} \hline
3& & &  &44(=y)\\
1& & &12&12(=x)\\
1& &8&8&   \\
1&4&4& &   \\ 
4&4& & &   \\
0& & & &   \\ \hline
\end{tabular}
\end{frame}
%============================================================%
\begin{frame}
\frametitle{Ku\.t\.taka: proof}
The equation is:\\
$8Y = 29X + 4$\\
$8Y_1 = 5X + 4$ where $Y_1= Y - \textbf{3}X$\\
$3Y_1 = 5X_1 + 4$ where $X_1 = X - \textbf{1}Y_1$\\
$3Y_2 = 2X_1 + 4$ where $Y_2 = Y_1 -\textbf{1}X_1$\\
$Y_2 = 2X_2 + 4$ where $X_2 = X_1 -\textbf{1}Y_2$\\
\end{frame}
%============================================================%
\begin{frame}
\frametitle{Ku\.t\.taka: proof}
The equation is:\\
$8Y = 29X + 4$\\
\begin{tabular}{|l|l|l|} \hline
$8Y_1 = 5X + 4$ & $Y_1= Y - \textbf{3}X$ & $Y = Y_1 + 3 * X $\\
$5X_1 = 3Y_1 - 4$ & $X_1 = X - \textbf{1}Y_1$ & $X = X_1 + 1 * Y_1$\\
$3Y_2 = 2X_1 + 4$ & $Y_2 = Y_1 -\textbf{1}X_1$ & $Y_1 = Y_2 + 1 * X_1$\\
$2X_2 = Y_2 - 4$ & $X_2 = X_1 -\textbf{1}Y_2$ & $X_1 = X_2 + 1 * Y_2 $\\ \hline
\end{tabular}\\
\vspace{0.5cm}
Let $X_2 = 0$. So $Y_2 = 4$\\
\begin{tabular}{|l|l|} \hline
$Y = Y_1 + 3 * X $ &  $Y = 8 + 3 * 12 = 44$\\
$X = X_1 + 1 * Y_1$ &  $X= 4 + 1 * 8 = 12$\\
$Y_1 = Y_2 + 1 * X_1$ &  $Y_1 = 4 + 1 * 4 = 8$\\
$X_1 = X_2 + 1 * Y_2 $ &  $X_1 = 0 + 1 * 4 = 4$\\  \hline
$Y_2 = 4 $ &  $Y_2 = 4$\\  \hline
$X_2 = 0 $ &  $X_2 = 0$\\  \hline
\end{tabular}
\end{frame}
%============================================================%
\begin{frame}
\frametitle{General Proof}
Let the equation be $ay = bx + c$ with b > a > 0\\
\vspace{0.2cm}
Let $b = aq_1 + r_1$\\
Hence, $ay = (aq_1 + r_1) x + c$\\
i.e., $a(y - q_1x) = r_1x + c$\\
\vspace{0.2cm}
Let $y - q_1 x = X_1$\\
Hence $a X_1 - c = r_1 x $\\
\vspace{0.2cm}
Let $a = r_1 q_2 + r_2$\\
Hence $(r_1 q_2 + r_2) X_1 - c = r_1 x$\\
or, $r_2 X_1 = r_1 (x - q_2 X_1) + c$\\
\vspace{0.2cm}
Let $x - q_2 X_1 = X_2$\\
Hence $r_2 X_1 = r_1 X_2 + c$\\
\end{frame}
%============================================================%
\begin{frame}
\frametitle{General Proof ... Contd}
Continuing in this way,\\
$r_{k-1} X_k = r_k X_{k-1} + (-1)^{k-1} c$, where\\
$X_k = X_{k-2} - q_k X_{k-1}$\\
\vspace{0.2cm}
Finally, we stop when $r_n = 1$.\\
\vspace{0.2cm}
Now let $X_n = 0$ in \\
$r_{n-1} X_n = r_n X_{n-1} + (-1)^(n-1) c$\\
\vspace{0.2cm}
Then we have,\\
$X_{n-1} = (-1)^n c$\\
\end{frame}
%============================================================%
\begin{frame}
\frametitle{General Proof ... Contd}
Substituting the values of $X_i$ we in fact end up creeping up as shown below.\\
\begin{tabular}{lll}\\
y & $q_1$&\\
x & $q_2$&\\
$x_1$ & $q_3$&\\
. & . & .\\
. & . & .\\
. & . & .\\
$x_{n-3}$ & $q_{n-1}$& $x_{n-3} = q_{n-1} * x_{n-2} + c$\\
$x_{n-2}$ & $q_n$ & $x_{n-2} = q_n * c + 0 $\\
$x_{n-1}$ & $c$ & \\
$x_n$ & $0$ &\\
\end{tabular}
\end{frame}
%============================================================%
\begin{frame}
\frametitle{General Proof ... Contd}
The solution we get is for $ax + c = by$, if there are even number of quotients (rows).\\
\vspace{0.2cm}
But if there are odd number of rows, this is the solution for $ax - c = by$.\\
\vspace{0.2cm}
Now, \\
$a(b-x) + c = ab - ax + c = ab - (by + c) + c = b (a-y) $\\
\vspace{0.2cm}
Hence, $(b-x, a-y)$ is the solution of $ax + c = by$.\\
\vspace{0.5cm}
This justifies Bhaskaracharya's corollory for handling odd number of quotients.
\end{frame}
%============================================================%
\end{document}
