
%%%%%%%%%%%% Subject: template for lecture notes %%%%%%%%%%%%%%%%%%%%
%
% Thank you for the hitnadvut to write up notes on today's lecture.
%
% Here is the template file for writing up notes for this course.
% If you scribe on a Tuesday we ask that you please bring your
% notes by the following Tuesday. 
%
% To help you with your notes, I can let you copy the notes used in 
% giving the lecture. Please ask
% for help in understanding the material or if you have a question
% about how it should be presented.
%
% In order to make the notes more uniform and easier to read, we are providing
% several macros for theorems and such.  (Some examples of their use are
% included below.) Also, we ask that you follow a few stylistic conventions:
%
% Please write your notes as if you were explaining the material to another
% student, rather than as minutes of a meeting. (That is, don't write
% things like ``Today we started discussing...'' or ``next time,
% we will...'' or ``then, someone asked the question...''
% Just explain the material as clearly as you can.
%
% If you need to refer to an earlier lecture, use the lecture number.
% For example,  ``In Lecture 6 it was shown that...''
% To refer to a later lecture for which you don't know the number,
% just say something like,
% ``This impossibility result will be discussed further in a later
% lecture.'' (At the end of the course, I will go back and fill in the
% appropriate lecture numbers.)
%
% If material from a handout is covered in lecture, then we would like to
% include the text of the handout as a part of the notes to make them more
% self-contained.  To make your job easier, I will mail you the latex
% files for the relevent handouts, and you can merge them in at the
% appropriate places.  Also, you may want to annotate the handout as you
% see fit.  If you happen to take notes on a day that a homework is assigned,
% I will also mail you the exercises, which you can put at the end of your
% notes.
%
% Figures should be done in Latex, if at all possible.  You may have available
% on your system a program called ``texdraw.''  The program lets to draw
% figures with the mouse and then generates a latex file, which you can then
% insert into your text.  If you don't have this program, usually writing the
% latex commands yourself isn't that hard.  For very complicated figures, you
% may wish to leave the appropriate space in the text and draw the figures
% neatly (each on a separate page) in black ink.  For the first draft you
% hand in, you may not want to invest a lot of time drawing the figures very
% neatly, because there's a chance that we will want you to modify
% them.  Save that effort for the draft to be handed out.
%
% Please let me know if you have any questions.
%
%
\documentstyle[12pt]{book}
%\setlength{\oddsidemargin}{-.1 in}
%\setlength{\evensidemargin}{-.3 in}
\setlength{\evensidemargin}{.0 in}
\addtolength{\topmargin}{-1in}
\setlength{\textwidth}{6.5in}
\setlength{\textheight}{8in}

%
% this command enables to remove a whole part of the text 
% from the printout
% to use it just enter
% \remove{  
% before the text to be excluded and
% } 
% after the text
\newcommand{\remove}[1]{}

%
% The following macros are used to generate nice code for programs.
% See example on how to use it below
%

%%%%%%%%%%%%%%%%%%%%% program macros %%%%%%%%%%%%%%%%%

\newcommand{\Do}{{\small\bf do}\ }
\newcommand{\Return}{{\small\bf return\ }}
\newcommand{\Proc}[1]{#1\+}
\newcommand{\Returns}{{\small\bf returns}}
\newcommand{\Procbegin}{{\small\bf begin}}
\newcommand{\If}{{\small\bf if}\ \=\+}
\newcommand{\Then}{{\small\bf then}\ \=\+}
\newcommand{\Else}{\<{\small\bf else}\ \>}
\newcommand{\Elseif}{\<{\small\bf elseif}\ }
\newcommand{\Endif}{\<{\small\bf end\ if\ }\-\-}
\newcommand{\Endproc}[1]{{\small\bf end} #1\-}
\newcommand{\For}{{\small\bf for}\ \=\+}
\newcommand{\Endfor}{{\small\bf end\ for}\ \-}
\newcommand{\Loop}{{\bf loop}\ \= \+}
\newcommand{\Endloop}{{\bf end\ loop}\ \-}
\newenvironment{program}{
    \begin{minipage}{\textwidth}
    \begin{tabbing}
    \ \ \ \ \=\kill
  }{
    \end{tabbing}
    \end{minipage}
  }

% a blank line
\def\blankline{\hbox{}}

%%%%%%%%%%%%%%%%%%%%% End of PROGRAM macros %%%%%%%%%%%%%%%%%


%
% The following macro is used to generate the header.
%
%

\newcommand{\lecture}[5]{
   \pagestyle{headings}
   \thispagestyle{plain}
   \newpage
   \setcounter{chapter}{#1}
   \setcounter{page}{#2}
%  \set\thechapter{#3}
   \noindent
   \begin{center}
   \framebox{
      \vbox{
    \hbox to 6.28in { {\bf Computational  Learning Theory
                        \hfill Fall Semester, 1992/3} }
       \vspace{4mm}
       \hbox to 6.28in { {\Large \hfill Lecture #1: #3  \hfill} }
       \vspace{2mm}
       \hbox to 6.28in { {\it Lecturer: #4 \hfill Scribe: #5} }
      }
   }
   \end{center}
   \markboth{Lecture #1: #3}{Lecture #1: #3}
   \vspace*{4mm}
}

%
% Use these macros for organizing sections of your notes.
% Each command takes two arguments: (1) the title of the section and and
% (2) a keyword for that section to appear in the index.  (See examples.)
% Please don't use \section, \subsection, and \subsubsection directly!
%

\newcommand{\topic}[2]{\section{#1} \index{#2} \markright{#1}}
\newcommand{\subtopic}[2]{\subsection{#1} \index{#2}}
\newcommand{\subsubtopic}[2]{\subsubsection{#1} \index{#2}}
 
%
% Convention for citations is first author's last name followed by other
% authors' last initials, followed by the year.  For example, to cite the
% seventh entry in the course bibliography, you would type: \cite{BurnsL80}
% (To avoid bibliography problems, for now we redefine the \cite command.)
%
     
\renewcommand{\cite}[1]{[#1]}

%
% These are just to make things a little easier:
%
\newcommand{\bi}{\begin{itemize}}
\newcommand{\ei}{\end{itemize}}
\newcommand{\be}{\begin{enumerate}}
\newcommand{\ee}{\end{enumerate}}
\newcommand{\blank}{\vspace{1ex}}   % generates a blank line in the output

%
% Use these for theorems, lemmas, proofs, etc.
%
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newcommand{\qed}{\hfill $\Box$}
\newenvironment{proof}{\par{\bf Proof:}}{\qed \par}
%\newenvironment{proof}{{\em Proof:}}{\hfill\rule{2mm}{2mm}}

%
% Use the following for definitions.
% \bigdef is for definitions to be set off by themselves; \smalldef is for
% definitions given in the middle of a paragraph.
%
\newenvironment{dfn}{{\vspace*{1ex} \noindent \bf Definition }}{\vspace*{1ex}}
\newcommand{\bigdef}[2]{\index{#1}\begin{dfn} {\rm #2} \end{dfn}}
\newcommand{\smalldef}[1]{\index{#1} {\em #1}}


% **** IF YOU WANT TO DEFINE ADDITIONAL MACROS FOR YOURSELF, PUT THEM HERE:

\begin{document}
%\lecture{**LECTURE-NUMBER**}{**1ST-PAGE**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{2}{1}{November 5}{Yishay Mansour}{Itzi Rozenscriber}

% **** YOUR NOTES GO HERE

%    Some general latex examples and examples making use of the 
% macros follow.  You may want to latex this file and print out the result
% to get an idea of how things look. (You will need to latex the file twice
% to get the cross-references right.)
%    Even if you already know latex, you should take a few minutes to
% look over these examples, so that you understand the general conventions
% we're using.


\topic{Some theorems and stuff}{stuff} % Don't be this informal in your notes!

We now delve right into the proof.

\begin{lemma}
\label{L7:mylemma}   % label used to refer to the lemma later. (see below)
                        % IMPORTANT: to keep labels unique among lectures,
                        % please precede every label with the lecture number,
                        % as shown (this prefix would be used for lecture 7.
This is the first lemma of the lecture.
\end{lemma}

\begin{proof}
The proof is by induction on \ldots
\end{proof}

\begin{theorem}
This is the first theorem.
\end{theorem}

\begin{proof}
This is the proof of the first theorem theorem.
\end{proof}

\subtopic{A few items of note}{few items}

Here is an itemized list:
\bi
\item this is the first item
\item this is the second item
\ei

\subtopic{A few more items}{more items}

Here is an enumerated list:
\be
\item this is the first item
\item this is the second item
\ee

\topic{Next topic}{myword}

We are now ready for a major definition.

\bigdef{myword}{This is the definition of {\em myword}.}

\begin{corollary}
This is a corollary following from the definition of myword.
\end{corollary}

Sometimes we define terms in the middle of a paragraph.
This is a \smalldef{different term} being defined.
Wasn't that easy?

On to the next page:

\newpage  % it's not necessary to do this before a figure -- latex should
          % position the figures appropriately

%
% **** HERE'S AN EXAMPLE OF HOW TO DO FIGURES WITH LATEX -- DON'T GET SCARED:
% **** THIS FIGURE PROBABLY IS MORE COMPLICATED THAT ANY YOU WILL NEED
% **** TO DRAW...
%
\begin{figure}
\begin{picture}(400,250)(0,25) % begins picture environment

\put(200,262.5){\circle{25}}
\put(200,262.5){\makebox(0,0)[c]{U}}

\put(100,187.5){\circle{25}}
\put(100,187.5){\makebox(0,0)[c]{U}}
\put(300,187.5){\circle{25}}
\put(300,187.5){\makebox(0,0)[c]{U}}
\put(315,187.5){\makebox(0,0)[bl]{...}}

\put(50,112.5){\circle{25}}
\put(50,112.5){\makebox(0,0)[c]{U}}
\put(150,112.5){\circle{25}}
\put(150,112.5){\makebox(0,0)[c]{U}}
\put(165,112.5){\makebox(0,0)[bl]{...}}
\put(250,112.5){\circle{25}}
\put(250,112.5){\makebox(0,0)[c]{$x$}}
\put(350,112.5){\circle{25}}
\put(350,112.5){\makebox(0,0)[c]{U}}
\put(365,112.5){\makebox(0,0)[bl]{...}}

\put(25,62.5){\circle{25}}
\put(25,62.5){\makebox(0,0)[c]{$a$}}
\put(75,62.5){\circle{25}}
\put(75,62.5){\makebox(0,0)[c]{$b$}}
\put(90,62.5){\makebox(0,0)[bl]{...}}
\put(125,62.5){\circle{25}}
\put(125,62.5){\makebox(0,0)[c]{$x$}}
\put(175,62.5){\circle{25}}
\put(175,62.5){\makebox(0,0)[c]{$y$}}
\put(190,62.5){\makebox(0,0)[bl]{...}}
\put(325,62.5){\circle{25}}
\put(325,62.5){\makebox(0,0)[c]{$x$}}
\put(375,62.5){\circle{25}}
\put(375,62.5){\makebox(0,0)[c]{$a$}}
\put(390,62.5){\makebox(0,0)[bl]{...}}

\thinlines
\put(200,250){\line(-2,-1){100}}
\put(200,250){\line(2,-1){100}}

\put(100,175){\line(-1,-1){50}}
\put(100,175){\line(1,-1){50}}
\put(300,175){\line(-1,-1){50}}
\put(300,175){\line(1,-1){50}}

\put(50,100){\line(-1,-1){25}}
\put(50,100){\line(1,-1){25}}
\put(150,100){\line(-1,-1){25}}
\put(150,100){\line(1,-1){25}}

\put(350,100){\line(-1,-1){25}}
\put(350,100){\line(1,-1){25}}

\end{picture}
\caption{This is my picture.} % the figure caption (numbered by latex)
\label{L7:mypicture}       % identifies figure so you can refer to it --
                           % the label always goes after the caption
\end{figure}

%
% **** Here's how to handle figures you draw yourself:
%

\begin{figure}
   \vspace{3.5cm}                % amount of space to leave
   \caption{This is a new picture.} % the figure caption (numbered by latex)
   \label{L7:myotherpicture}  % identifies figure so you can refer to it
\end{figure}

%
% **** Here's how to refer to figures:
%
This can be seen in Figure \ref{L7:mypicture}.  Note that latex actually
places this text {\em before} the figure, even though it appears after the
figure in the .tex file.
%
% **** Here's how to write code using the program macros above:
%

\begin{figure}[phtb]
% the command below makes a frame around the code
\framebox[\textwidth]{
% the program environment 
\begin{program}
\Proc{{\sc full}$_i$}$(h)$, $h \in\ \{1$\ldots$n-1\}$  \\
  \Procbegin \\
  \If  {\sc numv}$_i(\ell _{max}, h) \geq\ n - h$ \\
   \Then \Return ({\it true})  \\
   \Else \Return ({\it false})  \-\- \\
\Endproc{{\sc full}} \\      
\\
\Proc{{\sc makelabel}$_i$} \\
      \Procbegin \\
      \If $i \neq\ i_{max}$ \\
      \Then $h'$  :=  minimum $h$ such that {\sc full}$(h) =$ {\it true} \\
	    $x_{i}$  := {\sc nextlabel\/}$(\ell _{max}, h')$ \-\-\ \\
\Endproc{{\sc makelabel}$_i$} \\  
\end{program}}
\caption{Code for {\sc makelabel}$_i$ of {\sc bctss}}. 
\label{bctss-code}
\end{figure}

\newpage
\topic{Exercises}{exercises}
\bi
\item [1.] Kama-kama yatzaa Hapoel Beer-Sheva mul Makabee Tel-Aviv 
be-onat 82?
\item [*2.] Tanin hu yoter aroch o yoter yarok? 
\item [*3.] Ma shem hamishpacha shel ha-denni sh-amar: ``$2B \vee\neg 2B$''.
\ei

% **** THIS ENDS THE EXAMPLES. DON'T DELETE THE FOLLOWING LINE:

\end{document}


