\documentclass{book}
\title{Grinstead and Snell's Introduction to Probability}
\author{TSILB\thanks{
This Space Intentionally Left Blank.
Copyright (C) 2005 Peter G. Doyle.
This work is a version of
Grinstead and Snell's `Introduction to Probability, 2nd edition',
published by the American Mathematical Society,
Copyright (C) 2003 Charles M. Grinstead and J. Laurie Snell.
This work is freely redistributable under the terms of
the GNU Free Documentation License.
}}
\date{Version 3.0.2, 28 October 2005}

\usepackage{theorem}
\theorembodyfont{\rmfamily}
\usepackage[dvips]{epsfig}	% specify `dvips' driver
%\usepackage[pdftex]{epsfig}	% specify `pdftex' driver
\usepackage{makeidx}
\setlength{\textheight}{8.1in}
\setlength{\textwidth}{5in}
\setlength{\topmargin}{.25in}
\setlength{\oddsidemargin}{.75in} % 1.25 for book Change to .75 for web version
\setlength{\evensidemargin}{.75in} % .25 for book Change to .75 for web version

%
% Low-level figure positioning.  Change as appropriate to your system.
%
\newcommand{\barefig}[2]{\makebox{\includegraphics*[width=#2] {figures/#1.ps}}} 
%
% Higher-level figure commands.
%
\newcommand{\NA}{{\rm NA}}
\usepackage{latexsym}
\newif\ifdiscrete
%\discretetrue
\discretefalse
\newcommand{\choice}[2]{\ifdiscrete{#1}\else{#2}\fi}

%\putfig{3.5truein}{PSfig1.3}{Peter's winnings in 40 plays of heads or tails.}{fig 1.3}
\newcommand{\putfig}[4]
{\begin{figure}
\centerline{\barefig{#2}{#1}}
\caption{#3}
\label{#4}
\end{figure}}

\newcommand{\putfigdouble}[6]
{\begin{figure}
\centerline{\barefig{#2}{#1}}
\centerline{\barefig{#4}{#3}}
\caption{#5}
\label{#6}
\end{figure}}

\newcommand{\nocaption}[4]
{\begin{figure}
\centerline{\barefig{#2}{#1}}
%\caption{#3}
\label{#4}
\end{figure}}
%
\newenvironment{example}
{\noindent\begin{examp}}
{\hfill $\Box$ \end{examp}}

\newenvironment{definition}
{\noindent\begin{defn}}
{\hfill $\Box$ \end{defn}}

\newenvironment{theorem}
{\noindent\begin{thm}}
{\hfill $\Box$ \end{thm}}

\newenvironment{corollary}
{\noindent\begin{cor}}
{\hfill $\Box$ \end{cor}}

\newenvironment{lemma}
{\noindent\begin{lem}}
{\hfill $\Box$ \end{lem}}

\newenvironment{proposition}
{\noindent\begin{prop}}
{\hfill $\Box$ \end{prop}}
%
\newtheorem{examp}{Example}[chapter]
\newtheorem{defn}{Definition}[chapter]
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{cor}{Corollary}[chapter]
\newtheorem{prop}{Proposition}[chapter]
\newtheorem{lem}{Lemma}[chapter]
\newcommand{\exercises}{\subsection*{Exercises}}
\newcommand{\proof}{\vskip .2in\noindent{\bf Proof.\ }}
%\newcommand{\emx}[1]{{\emx{#1}\/}}
%\newcommand{\mat}[1]{{\mbox{\bf#1}\/}}
\newcommand{\emx}[1]{{\em{#1}\/}}
\newcommand{\mat}[1]{{\mbox{\bf#1}\/}}


\newenvironment{scope}{}{}
\newenvironment{shrink}{\begin{scope} \small}{\end{scope}}
\newenvironment{progout}{\begin{shrink}}{\end{shrink}}


\newcount\exerciseno
\def\i{\advance\exerciseno by 1\bigskip
\item[\bf{\the\exerciseno}]}
\def\istar{\advance\exerciseno by 1\bigskip
\item[\bf{*\the\exerciseno}]}

\newenvironment{LJSItem}{

\newcommand{\exref}[1]{\ref{##1}}
\def\i{\renewcommand{\labelenumi}{\bf\theenumi}\item}

\def\istar{\renewcommand{\labelenumi}{\bf*\theenumi}\item}

\begin{enumerate}}
{\end{enumerate}}

\def\partone{ch1,ch2,ch3,ch4,ch5,ch6}
\def\parttwo{ch7,ch8,ch9,ch10,ch11,ch12}
\def\all{front,\partone,\parttwo,back}
\newcommand{\secstoprocess}{\all}
%\typein[\secstoprocess]{enter the sections to process: }
\includeonly{\secstoprocess}

\makeindex
\begin{document}
\addtolength{\normalbaselineskip}{1pt}
\normalbaselines

\frontmatter
\include{front}

\mainmatter
\include{ch1}
\choice{}{\include{ch2}}
\include{ch3}
\include{ch4}
\include{ch5}
\include{ch6}
\include{ch7}
\include{ch8}
\include{ch9}
\choice{}{\include{ch10}}
\include{ch11} 
\choice{}{\include{ch12}}

\backmatter
\include{back}

\end{document}
