\usepackage{ifthen}
\usepackage{soul}
\usepackage{fullpage, prettyref}
\usepackage{fancyhdr}
\usepackage{times}
\usepackage{graphicx}
\usepackage{marvosym}
\usepackage{ifthen}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\algrenewcomment[1]{\(\triangleright\) {\tiny{#1}}}
\algnewcommand{\LineComment}[1]{\State \(\triangleright\) \emph{\color{blue} #1}}
\newcommand{\Lim}{\lim}

\renewcommand{\theenumi}{\alph{enumi}}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{url}
\usepackage{fullpage, prettyref}
%\usepackage{pstricks,pst-node,pst-text}
\usepackage{boxedminipage}
\usepackage{hyperref}
\usepackage{wrapfig}
\usepackage{ifthen}
\usepackage{mdframed}
\usepackage{color,xcolor}
\usepackage{transparent}
\usepackage{enumitem}
\usepackage{varwidth}
\usepackage{thmtools}


\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{claim}{Claim}
\newtheorem{corollary}{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{proposition}{Proposition}
\newtheorem{fact}{Fact}
\newtheorem{example}{Example}
\newtheorem{exercise}{Problem}
\newtheorem{assumption}{Assumption}
\newtheorem{observation}{Observation}

\newcommand{\comment}[1]{\textsl{\small[#1]}\marginpar{\tiny\textsc{To Do!}}}
\newcommand{\ignore}[1]{}

\newcommand{\NN}{\mathbb{N}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}


\def\eps{\varepsilon}
\def\bar{\overline}
\def\floor#1{\lfloor {#1} \rfloor}
\def\ceil#1{\lceil {#1} \rceil}
\def\script#1{\mathcal{#1}}

\def\plus{{\tt (+)}}
\def\2plus{{\tt (++)}}
\def\3plus{{\tt (+++)}}
\def\4plus{{\tt (++++)}}
\def\5plus{{\tt (+++++)}}

\def\opt{{\tt opt}}
\def\alg{{\tt alg}}

\def\bv{\mathbf{v}}

\newenvironment{proofof}[1]{\smallskip\noindent{\bf Proof of #1:}}%
{\hspace*{\fill}$\Box$\par}
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{0in}
\setlength{\textheight}{8.5in}
\newlength{\algobox}
\setlength{\algobox}{6.5in}

\newenvironment{thm}{
	\begin{mdframed}[backgroundcolor=gray!20,topline=false,bottomline=false,leftline=false,rightline=false]\begin{theorem}
		}{
		\end{theorem}
	\end{mdframed}
}

\newcommand{\true}{\mathsf{true}}
\newcommand{\false}{\mathsf{false}}
\newcommand{\xor}{\oplus}
\newcommand{\lxor}{\oplus}
\newcommand{\limplies}{\Rightarrow}
\newcommand{\lbicond}{\Leftrightarrow}
\newcommand{\universe}{\mathcal{U}}
\newcommand{\implication}{\ensuremath{P \limplies Q}}



\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\range}{\mathrm{range}}
\newcommand{\dom}{\mathrm{dom}}


\ifthenelse{\equal{\showsol}{1}}
{
	\newcommand{\solution}[1]{\noindent {\color{blue} {\bf Solution:}} {\color{gray} {#1}}}
	\newcommand{\rubric}[1]{\ignore{#1}}%{\noindent {\color{red} {\bf Rubric:}} {\texttransparent{0.5} {\bf #1}}}
	\newcommand{\hint}[1]{\ignore{#1}}
	\newcommand{\announce}[1]{{\begin{quote}\Large \bf These are solution sketches to a problem set assigned in CS 30, Summer 2021 at Dartmouth College, Hanover, NH. If you are not a student in this course in this term, 
				please STOP READING and delete this file (if email) or shred this paper (if hard copy). 
				
				You may be violating an Honor Code at your institution.\end{quote}}}
	\setlength{\headheight}{16pt}
	\pagestyle{fancy}
	\fancyhead{}
	\chead{{\Large \bf Only for the eyes of CS 30, Summer 2021 students, Dartmouth College}}
	\rhead{}
}
{
	\newcommand{\solution}[1]{\ignore{#1}}
	\newcommand{\rubric}[1]{\ignore{#1}}
	\newcommand{\announce}[1]{\ignore{#1}}
	\newcommand{\hint}[1]{\noindent   {\texttransparent{0.5}{Hint: #1}}}
}



\newcommand{\bone}{\mathbf{1}}

\def\calP{\mathcal{P}}
\def\calF{\mathcal{F}}
\def\calE{\mathcal{E}}
\def\calA{\mathcal{A}}
\def\calB{\mathcal{B}}
\def\calC{\mathcal{C}}
\def\calS{\mathcal{S}}
\def\calI{\mathcal{I}}
\newcommand{\Exp}{\mathbf{Exp}}
\newcommand{\Var}{\mathbf{Var}}
\newcommand{\Enc}{\mathsf{Enc}}
\newcommand{\Dec}{\mathsf{Dec}}
\ifthenelse{\equal{\showhints}{1}}
{
	\renewcommand{\hint}[1]{\begin{mdframed}[backgroundcolor=brown!20,topline=false,bottomline=false,leftline=false,rightline=false]{\color{brown}{\bf Hint}}: {\color{gray} {#1}}\end{mdframed}}
}
{
	\renewcommand{\hint}[1]{\ignore{#1}}	
}

\def\Coursename{CS30 (Discrete Math in CS), Summer 2021~}