doc-src/Exercises/2003/a3/generated/a3.tex
author obua
Sun, 09 May 2004 23:04:36 +0200
changeset 14722 8e739a6eaf11
parent 14526 51dc6c7b1fd7
permissions -rw-r--r--
replaced apply-style proof for instance Multiset :: plus_ac0 by recommended Isar proof style
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14526
mehta
parents:
diff changeset
     1
%
mehta
parents:
diff changeset
     2
\begin{isabellebody}%
mehta
parents:
diff changeset
     3
\def\isabellecontext{a{\isadigit{3}}}%
mehta
parents:
diff changeset
     4
\isamarkupfalse%
mehta
parents:
diff changeset
     5
%
mehta
parents:
diff changeset
     6
\isamarkupsubsection{Computing with natural numbers - Magical Methods%
mehta
parents:
diff changeset
     7
}
mehta
parents:
diff changeset
     8
\isamarkuptrue%
mehta
parents:
diff changeset
     9
%
mehta
parents:
diff changeset
    10
\begin{isamarkuptext}%
mehta
parents:
diff changeset
    11
A book about Vedic Mathematics describes three methods to make the calculation of squares of natural numbers easier:
mehta
parents:
diff changeset
    12
mehta
parents:
diff changeset
    13
\begin{itemize}
mehta
parents:
diff changeset
    14
\item {\em MM1}: Numbers whose predecessors have squares that are known or can easily be calculated. For example:
mehta
parents:
diff changeset
    15
\\ Needed: $61^2$  
mehta
parents:
diff changeset
    16
\\ Given: $60^2 = 3600$
mehta
parents:
diff changeset
    17
\\ Observe: $61^2 = 3600 + 60 + 61 = 3721$
mehta
parents:
diff changeset
    18
mehta
parents:
diff changeset
    19
\item {\em MM2}: Numbers greater than, but near 100. For example:
mehta
parents:
diff changeset
    20
\\ Needed: $102^2$
mehta
parents:
diff changeset
    21
\\ Let $h = 102 - 100 = 2$ , $h^2 = 4$
mehta
parents:
diff changeset
    22
\\ Observe: $102^2 = (102+h)$ shifted two places to the left $ + h^2 = 10404$
mehta
parents:
diff changeset
    23
 
mehta
parents:
diff changeset
    24
\item {\em MM3}: Numbers ending in $5$. For example:
mehta
parents:
diff changeset
    25
\\ Needed: $85^2$
mehta
parents:
diff changeset
    26
\\ Observe: $85^2 = (8 * 9)$ appended to $ 25 = 7225$
mehta
parents:
diff changeset
    27
\\ Needed: $995^2$
mehta
parents:
diff changeset
    28
\\ Observe: $995^2 = (99 * 100)$ appended to $ 25 = 990025 $
mehta
parents:
diff changeset
    29
\end{itemize}
mehta
parents:
diff changeset
    30
mehta
parents:
diff changeset
    31
mehta
parents:
diff changeset
    32
In this exercise we will show that these methods are not so magical after all!
mehta
parents:
diff changeset
    33
mehta
parents:
diff changeset
    34
\begin{itemize}
mehta
parents:
diff changeset
    35
\item Based on {\em MM1} define a function \isa{sq} that calculates the square of a natural number.
mehta
parents:
diff changeset
    36
\item Prove the correctness of \isa{sq} (i.e.\ \isa{sq\ n\ {\isacharequal}\ n\ {\isacharasterisk}\ n}).
mehta
parents:
diff changeset
    37
\item Formulate and prove the correctness of {\em MM2}.\\ Hints:
mehta
parents:
diff changeset
    38
  \begin{itemize}
mehta
parents:
diff changeset
    39
  \item Generalise {\em MM2} for an arbitrary constant (instead of $100$).
mehta
parents:
diff changeset
    40
  \item Universally quantify all variables other than the induction variable.
mehta
parents:
diff changeset
    41
\end{itemize}
mehta
parents:
diff changeset
    42
\item Formulate and prove the correctness of {\em MM3}.\\ Hints:
mehta
parents:
diff changeset
    43
  \begin{itemize}
mehta
parents:
diff changeset
    44
  \item Try to formulate the property `numbers ending in $5$' such that it is easy to get to the rest of the number.
mehta
parents:
diff changeset
    45
  \item Proving the binomial formula for $(a+b)^2$ can be of some help.
mehta
parents:
diff changeset
    46
  \end{itemize}
mehta
parents:
diff changeset
    47
\end{itemize}%
mehta
parents:
diff changeset
    48
\end{isamarkuptext}%
mehta
parents:
diff changeset
    49
\isamarkuptrue%
mehta
parents:
diff changeset
    50
\isamarkupfalse%
mehta
parents:
diff changeset
    51
\end{isabellebody}%
mehta
parents:
diff changeset
    52
%%% Local Variables:
mehta
parents:
diff changeset
    53
%%% mode: latex
mehta
parents:
diff changeset
    54
%%% TeX-master: "root"
mehta
parents:
diff changeset
    55
%%% End: