-
Notifications
You must be signed in to change notification settings - Fork 0
/
cs480preamble.tex
178 lines (160 loc) · 5.43 KB
/
cs480preamble.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
%% $Header: /usr/local/cvsroot/courses/cs480/latex/cs480preamble.tex,v 1.1 2006/10/04 18:23:43 neffr Exp $
%% this file should be included with a command like
%% \input{/home/cs480/latex/cs480preamble.tex}
%
% Set lengths
%
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}
%
% mathify-- ensure argument is in math mode
%
\newcommand{\mathify}[1]{\ifmmode{#1}\else\mbox{$#1$}\fi}
%
% Header box to go at the top of the first page
%
\def\subjnum{CS480}
\def\subjname{Computational Theory}
\newcommand{\headerbox}[3]{
\renewcommand{\thepage}{\arabic{page}}
\noindent
\begin{center}
\framebox{
\vbox{
\hbox to 5.78in { {\bf \subjnum} \hfill {\bf \subjname} }
\vspace{4mm}
\hbox to 5.78in { {\Large \hfill #1 \hfill} }
\vspace{2mm}
\hbox to 5.78in { {\it #2 \hfill #3} }
}
}
\end{center}
\vspace*{4mm}
}
\newcommand{\exploration}[2]{\headerbox{#1}{#2}{Exploration}}
\newcommand{\assignment}[3]{\headerbox{#1}{Assignment #1}{#2}{#3}}
\newcommand{\exercises}[2]{\headerbox{#1}{#2}{Exemplary Answers}}
\newcommand{\inclassexercise}[2]{\headerbox{#1}{In-class exercise}{#2}}
\newcommand{\handout}[3]{\headerbox{#1}{Handout #2}{#3}}
\newcommand{\handin}[3]{\headerbox{#1}{#2}{#3}}
%
% Useful symbols
%
\newcommand{\qed}{\rule{7pt}{7pt}}
\newcommand{\ihat}{\hat{\imath}}
\newcommand{\jhat}{\hat{\jmath}}
\newcommand{\Nat}{\bf N} % natural numbers
\newcommand{\Int}{\mathbf{Z}} % integers
\newcommand{\Bool}{\it Bool} % booleans
\newcommand{\true}{\tt t}
\newcommand{\false}{\tt f}
\newcommand{\I}{\cal I} % interpretations
\newcommand{\M}{\cal M} % meaning functions
\newcommand{\A}{\cal A} % arithmetic interpretation
\newcommand{\B}{\cal B} % binary word interpretation
\newcommand{\TIME}{\mathop{\rm TIME}\nolimits}
\newcommand{\NTIME}{\mathop{\rm NTIME}\nolimits}
\newcommand{\SPACE}{\mathop{\rm SPACE}\nolimits}
\newcommand{\NSPACE}{\mathop{\rm NSPACE}\nolimits}
\newcommand{\union}{\cup}
\newcommand{\intersect}{\cap}
% \newcommand{\implies}{\Rightarrow}
%
% Useful functions
%
\newcommand{\abs}[1]{\mathify{\left| #1 \right|}}
\renewcommand{\Pr}[1]{\mathify{\mbox{Pr}\left[#1\right]}}
\newcommand{\Exp}[1]{\mathify{\mbox{Exp}\left[#1\right]}}
\newcommand{\set}[1]{\mathify{\left\{ #1 \right\}}}
\newcommand{\cset}[2]{\set{#1\ :\ #2}} % a conditional notation to define sets
\newcommand{\lset}[2]{\set{#1,\ldots,#2}} % set {from,...,to}
\newcommand{\suchthat}{\vert}
\newcommand{\st}{\suchthat}
%
% For pseudo-code
%
\newcommand{\FOR}{{\bf for}}
\newcommand{\TO}{{\bf to}}
\newcommand{\DO}{{\bf do}}
\newcommand{\WHILE}{{\bf while}}
\newcommand{\AND}{{\bf and}}
\newcommand{\IF}{{\bf if}}
\newcommand{\THEN}{{\bf then}}
\newcommand{\ELSE}{{\bf else}}
%
% Useful environments-- theorem-like
%
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{assumption}[theorem]{Assumption}
%
% Useful environments for proofs
%
\newenvironment{proof}{\noindent{\bf Proof:}\hspace*{1em}}{\qed\bigskip}
\newenvironment{proof-sketch}{\noindent{\bf Sketch of Proof:}\hspace*{1em}}{\qed\bigskip}
\newenvironment{proof-idea}{\noindent{\bf Proof Idea:} \hspace*{1em}}{\qed\bigskip}
\newenvironment{proof-of-lemma}[1]{\noindent{\bf Proof of Lemma #1:}\hspace*{1em}}{\qed\bigskip}
\newenvironment{proof-attempt}{\noindent{\bf Proof Attempt:}\hspace*{1em}}{\qed\bigskip}
\newenvironment{proofof}[1]{\noindent{\bf Proof}
of #1:\hspace*{1em}}{\qed\bigskip}
%\newenvironment{remark}{\noindent{\bf Remark:}\hspace*{1em}}{\bigskip}
%
% abbreviations
%
\newcommand{\ie}{{\em i.e.}}
\newcommand{\etc}{{\em etc.}}
\newcommand{\eg}{{\em e.g.}}
%\newcommand{\wlog}{\em w.l.o.g.}
\newcommand{\cf}{{\em cf.}}
\newcommand{\viz}{{\em viz.}}
\newcommand{\eqdef}{\stackrel{\rm def}{=}} % ``equals by definition''
\newcommand{\hint}{{\em Hint}:\ } % for in-line hints
\newcommand{\note}{{\em Note}:\ } % for in-line notes
\newcommand{\remark}{{\em Remark}\/:\ } % for in-line remarks
%
% CS480/theocomp specific symbols
%
\newcommand{\bigO}O
\newcommand{\emptystring}{\epsilon} % empty string
\def\P{{\cal P}}
\def\NP{{\cal NP}}
\def\PP{{\cal BPP}}
\def\IP{{\cal IP}}
\def\RP{{\cal RP}}
\newcommand{\bit}{\set{0,1}}
\newcommand{\strings}{\bit^*}
%
% problems and subproblems
%
\newcounter{exercise}
\newcounter{problem}
%\newcounter{subproblem}[problem]
\newcounter{subproblem}
\renewcommand{\theexercise}{\arabic{exercise}}
\renewcommand{\theproblem}{\arabic{problem}}
\renewcommand{\thesubproblem}{\arabic{subproblem}}
\newenvironment{exercise} {\stepcounter{exercise} \textbf{Exercise
\theexercise}:} {\vspace{.1in}}
\newenvironment{problem} {\stepcounter{problem} \textbf{Problem
\theproblem}:} {\vspace{.1in}}
\newenvironment{subproblem} {\stepcounter{subproblem}
\thesubproblem :} {}
\newenvironment{solution} {\textbf{Solution
\theproblem}:} {\vspace{.1in}}
%
% machines
%
\newcommand{\rep}[1]{\left\langle #1 \right\rangle}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: