%**************************************%
%*    Generated from PreTeXt source   *%
%*    on 2017-09-13T15:53:31+01:00    *%
%*                                    *%
%*   http://mathbook.pugetsound.edu   *%
%*                                    *%
%**************************************%
\documentclass[11pt,]{article}
%% Custom Preamble Entries, early (use latex.preamble.early)
%% Inline math delimiters, \(, \), need to be robust
%% 2016-01-31:  latexrelease.sty  supersedes  fixltx2e.sty
%% If  latexrelease.sty  exists, bugfix is in kernel
%% If not, bugfix is in  fixltx2e.sty
%% See:  https://tug.org/TUGboat/tb36-3/tb114ltnews22.pdf
%% and read "Fewer fragile commands" in distribution's  latexchanges.pdf
\IfFileExists{latexrelease.sty}{}{\usepackage{fixltx2e}}
%% Text height identically 9 inches, text width varies on point size
%% See Bringhurst 2.1.1 on measure for recommendations
%% 75 characters per line (count spaces, punctuation) is target
%% which is the upper limit of Bringhurst's recommendations
%% Load geometry package to allow page margin adjustments
\usepackage{geometry}
\geometry{letterpaper,total={374pt,9.0in}}
%% Custom Page Layout Adjustments (use latex.geometry)
\geometry{paperheight=297mm,paperwidth=210mm,margin=20mm}
%% This LaTeX file may be compiled with pdflatex, xelatex, or lualatex
%% The following provides engine-specific capabilities
%% Generally, xelatex and lualatex will do better languages other than US English
%% You can pick from the conditional if you will only ever use one engine
\usepackage{ifthen}
\usepackage{ifxetex,ifluatex}
\ifthenelse{\boolean{xetex} \or \boolean{luatex}}{%
%% begin: xelatex and lualatex-specific configuration
%% fontspec package will make Latin Modern (lmodern) the default font
\ifxetex\usepackage{xltxtra}\fi
\usepackage{fontspec}
%% realscripts is the only part of xltxtra relevant to lualatex 
\ifluatex\usepackage{realscripts}\fi
%% 
%% Extensive support for other languages
\usepackage{polyglossia}
%% Main document language is US English
\setdefaultlanguage{english}
%% Spanish
\setotherlanguage{spanish}
%% Vietnamese
\setotherlanguage{vietnamese}
%% end: xelatex and lualatex-specific configuration
}{%
%% begin: pdflatex-specific configuration
%% translate common Unicode to their LaTeX equivalents
%% Also, fontenc with T1 makes CM-Super the default font
%% (\input{ix-utf8enc.dfu} from the "inputenx" package is possible addition (broken?)
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%% end: pdflatex-specific configuration
}
%% Symbols, align environment, bracket-matrix
\usepackage{amsmath}
\usepackage{amssymb}
%% allow page breaks within display mathematics anywhere
%% level 4 is maximally permissive
%% this is exactly the opposite of AMSmath package philosophy
%% there are per-display, and per-equation options to control this
%% split, aligned, gathered, and alignedat are not affected
\allowdisplaybreaks[4]
%% allow more columns to a matrix
%% can make this even bigger by overriding with  latex.preamble.late  processing option
\setcounter{MaxMatrixCols}{30}
%%
%% Color support, xcolor package
%% Always loaded.  Used for:
%% mdframed boxes, add/delete text, author tools
\PassOptionsToPackage{usenames,dvipsnames,svgnames,table}{xcolor}
\usepackage{xcolor}
%%
%% Semantic Macros
%% To preserve meaning in a LaTeX file
%% Only defined here if required in this document
%% Subdivision Numbering, Chapters, Sections, Subsections, etc
%% Subdivision numbers may be turned off at some level ("depth")
%% A section *always* has depth 1, contrary to us counting from the document root
%% The latex default is 3.  If a larger number is present here, then
%% removing this command may make some cross-references ambiguous
%% The precursor variable $numbering-maxlevel is checked for consistency in the common XSL file
\setcounter{secnumdepth}{3}
%% Environments with amsthm package
%% Theorem-like environments in "plain" style, with or without proof
\usepackage{amsthm}
\theoremstyle{plain}
%% Numbering for Theorems, Conjectures, Examples, Figures, etc
%% Controlled by  numbering.theorems.level  processing parameter
%% Always need a theorem environment to set base numbering scheme
%% even if document has no theorems (but has other environments)
\newtheorem{theorem}{Theorem}[section]
%% Only variants actually used in document appear here
%% Style is like a theorem, and for statements without proofs
%% Numbering: all theorem-like numbered consecutively
%% i.e. Corollary 4.3 follows Theorem 4.2
%% Definition-like environments, normal text
%% Numbering is in sync with theorems, etc
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
%% Example-like environments, normal text
%% Numbering is in sync with theorems, etc
\theoremstyle{definition}
\newtheorem{example}[theorem]{Example}
%% Miscellaneous environments, normal text
%% Numbering for inline exercises and lists is in sync with theorems, etc
\theoremstyle{definition}
\newtheorem{exercise}[theorem]{Exercise}
%% Localize LaTeX supplied names (possibly none)
%% Raster graphics inclusion, wrapped figures in paragraphs
%% \resizebox sometimes used for images in side-by-side layout
\usepackage{graphicx}
%%
%% More flexible list management, esp. for references and exercises
%% But also for specifying labels (i.e. custom order) on nested lists
\usepackage{enumitem}
%% Package for breakable boxes on WeBWorK problems from server LaTeX
\usepackage{mdframed}
%% WeBWorK problem style
\mdfdefinestyle{webwork-server}{framemethod=default, linewidth=2pt}
%% hyperref driver does not need to be specified, it will be detected
\usepackage{hyperref}
%% configure hyperref's  \url  to match listings' inline verbatim
\renewcommand\UrlFont{\small\ttfamily}
%% Hyperlinking active in PDFs, all links solid and blue
\hypersetup{colorlinks=true,linkcolor=blue,citecolor=blue,filecolor=blue,urlcolor=blue}
\hypersetup{pdftitle={Advanced Linear Algebra - Algorithms}}
%% If you manually remove hyperref, leave in this next command
\providecommand\phantomsection{}
%% Graphics Preamble Entries
\usepackage{pgfplots}
%% If tikz has been loaded, replace ampersand with \amp macro
%% extpfeil package for certain extensible arrows,
%% as also provided by MathJax extension of the same name
%% NB: this package loads mtools, which loads calc, which redefines
%%     \setlength, so it can be removed if it seems to be in the 
%%     way and your math does not use:
%%     
%%     \xtwoheadrightarrow, \xtwoheadleftarrow, \xmapsto, \xlongequal, \xtofrom
%%     
%%     we have had to be extra careful with variable thickness
%%     lines in tables, and so also load this package late
\usepackage{extpfeil}
%% Custom Preamble Entries, late (use latex.preamble.late)
%% Begin: Author-provided packages
%% (From  docinfo/latex-preamble/package  elements)
%% End: Author-provided packages
%% Begin: Author-provided macros
%% (From  docinfo/macros  element)
%% Plus three from MBX for XML characters
\newcommand{\definiteintegral}[4]{\int_{#1}^{#2}\,#3\,d#4}
\newcommand{\indefiniteintegral}[2]{\int#1\,d#2} 
\graphicspath{ {images/} }
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
%% End: Author-provided macros
%% PGML macros
%% formatted to exactly match output from PGML.pl as of 11/22/2016
%% but with some lines commented out
%\ifx\pgmlMarker\undefined
%  \newdimen\pgmlMarker \pgmlMarker=0.00314159pt  % hack to tell if \newline was used
%\fi
%\ifx\oldnewline\undefined \let\oldnewline=\newline \fi
%\def\newline{\oldnewline\hskip-\pgmlMarker\hskip\pgmlMarker\relax}%
%\parindent=0pt
%\catcode`\^^M=\active
%\def^^M{\ifmmode\else\fi\ignorespaces}%  skip paragraph breaks in the preamble
%\def\par{\ifmmode\else\endgraf\fi\ignorespaces}%
%\ifdim\lastskip=\pgmlMarker
%  \let\pgmlPar=\relax
% \else
  \let\pgmlPar=\par
%  \vadjust{\kern3pt}%
%\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%    definitions for PGML
%%
%
%\ifx\pgmlCount\undefined  % do not redefine if multiple files load PGML.pl
  \newcount\pgmlCount
  \newdimen\pgmlPercent
  \newdimen\pgmlPixels  \pgmlPixels=.5pt
%\fi
%\pgmlPercent=.01\hsize
%
\def\pgmlSetup{%
  \parskip=0pt \parindent=0pt
%  \ifdim\lastskip=\pgmlMarker\else\par\fi
  \pgmlPar
}%

\def\pgmlIndent{\par\advance\leftskip by 2em \advance\pgmlPercent by .02em \pgmlCount=0}%
\def\pgmlbulletItem{\par\indent\llap{$\bullet$ }\ignorespaces}%
\def\pgmlcircleItem{\par\indent\llap{$\circ$ }\ignorespaces}%
\def\pgmlsquareItem{\par\indent\llap{\vrule height 1ex width .75ex depth -.25ex\ }\ignorespaces}%
\def\pgmlnumericItem{\par\indent\advance\pgmlCount by 1 \llap{\the\pgmlCount. }\ignorespaces}%
\def\pgmlalphaItem{\par\indent{\advance\pgmlCount by `\a \llap{\char\pgmlCount. }}\advance\pgmlCount by 1\ignorespaces}%
\def\pgmlAlphaItem{\par\indent{\advance\pgmlCount by `\A \llap{\char\pgmlCount. }}\advance\pgmlCount by 1\ignorespaces}%
\def\pgmlromanItem{\par\indent\advance\pgmlCount by 1 \llap{\romannumeral\pgmlCount. }\ignorespaces}%
\def\pgmlRomanItem{\par\indent\advance\pgmlCount by 1 \llap{\uppercase\expandafter{\romannumeral\pgmlCount}. }\ignorespaces}%

\def\pgmlCenter{%
  \par \parfillskip=0pt
  \advance\leftskip by 0pt plus .5\hsize
  \advance\rightskip by 0pt plus .5\hsize
  \def\pgmlBreak{\break}%
}%
\def\pgmlRight{%
  \par \parfillskip=0pt
  \advance\leftskip by 0pt plus \hsize
  \def\pgmlBreak{\break}%
}%

\def\pgmlBreak{\\}%

\def\pgmlHeading#1{%
  \par\bfseries
  \ifcase#1 \or\huge \or\LARGE \or\large \or\normalsize \or\footnotesize \or\scriptsize \fi
}%

\def\pgmlRule#1#2{%
  \par\noindent
  \hbox{%
    \strut%
    \dimen1=\ht\strutbox%
    \advance\dimen1 by -#2%
    \divide\dimen1 by 2%
    \advance\dimen2 by -\dp\strutbox%
    \raise\dimen1\hbox{\vrule width #1 height #2 depth 0pt}%
  }%
  \par
}%

\def\pgmlIC#1{\futurelet\pgmlNext\pgmlCheckIC}%
\def\pgmlCheckIC{\ifx\pgmlNext\pgmlSpace \/\fi}%
{\def\getSpace#1{\global\let\pgmlSpace= }\getSpace{} }%
%
%{\catcode`\ =12\global\let\pgmlSpaceChar= }%
%{\obeylines\gdef\pgmlPreformatted{\par\small\ttfamily\hsize=10\hsize\obeyspaces\obeylines\let^^M=\pgmlNL\pgmlNL}}%
%\def\pgmlNL{\par\bgroup\catcode`\ =12\pgmlTestSpace}%
%\def\pgmlTestSpace{\futurelet\next\pgmlTestChar}%
%\def\pgmlTestChar{\ifx\next\pgmlSpaceChar\ \pgmlTestNext\fi\egroup}%
%\def\pgmlTestNext\fi\egroup#1{\fi\pgmlTestSpace}%
%
%\def^^M{\ifmmode\else\space\fi\ignorespaces}%
%% END PGML macros
%% Title page information for article
\title{Advanced Linear Algebra - Algorithms}
\date{}
\begin{document}
%% Target for xref to top-level element is document start
\hypertarget{MA500-1}{}
\maketitle
\thispagestyle{empty}
Niall Madden\\
School of Mathematics, Statistics and Applied Mathematics\\
National University of Ireland, Galway\\
\href{mailto:Niall.Madden@NUIGalway.ie}{\nolinkurl{Niall.Madden@NUIGalway.ie}}
\and
September 13, 2017\typeout{************************************************}
\typeout{Section 1 Introduction}
\typeout{************************************************}
\section[{Introduction}]{Introduction}\label{Intro}
This resource is  designed to help you master the \emph{Additive and Multiplicative Principles} from Weeks 1 and 2 of Discrete Mathematics (MA284). The notes are styled as a \emph{tutorial}, and promote learning through a  process of self-directed examination and assessment. This is done through a set of exercises, which are based on \href{http://webwork.maa.org/}{WeBWorK}, the system used for online assessment for this module. However, the exercises in this tutorial do not contribute to your continuous assessment score. Instead, they allow you to test your knowledge and skills in Discrete Mathematics. If you find you can do these exercises without difficulty, then you have validated your own learning. If no, then you will know where to focus the efforts.%
\par
You can attempt exercises as many times as you like. When you submit your answer, you will be informed it is correct or not. If not, you can re-attempt the question, with new, randomly generated data.%
\par
These notes do not contain all the core material on the Additive and Multiplicative Principles. Therefore, before proceeding, please review%
\leavevmode%
\begin{itemize}[label=\textbullet]
\item{}the \href{http://www.maths.nuigalway.ie/\~niall/MA284/\#Lectures}{the lecture notes} from those classes, which are available from \href{http://www.maths.nuigalway.ie/\~niall/MA284/\#Lectures}{the MA284 website}.%
\item{}Section 1.1 of  Oscar Levin's \href{http://discretetext.oscarlevin.com}{Discrete Mathematics: an open introduction}.%
\end{itemize}
This tutorial was produced by \href{http://www.maths.nuigalway.ie/\~niall/}{Niall Madden} as  part of a project of the module CEL263: Learning Technologies. If you have any comments, please contact Niall.%
\par
Some of the exercises and examples here are taken, or adapted, from \href{http://discretetext.oscarlevin.com}{Discrete Mathematics: an open introduction}, with attribution.%
\par
\includegraphics[width=0.15\linewidth]{/home/niall/teach/CEL263/Project/project/images/CC-BY-SA_icon_orange.png}
%
\par
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit \href{http://creativecommons.org/licenses/by-sa/4.0/}{http://creativecommons.org/licenses/by-sa/4.0/}%
\typeout{************************************************}
\typeout{Section 2 The Additive Principle}
\typeout{************************************************}
\section[{The Additive Principle}]{The Additive Principle}\label{Additive}
\begin{definition}[{Additive Principle}]\label{definition-1}
The additive principle states that if event \(A\) can occur in \(m\) ways, and event \(B\) can occur in \(n\) \emph{disjoint} ways, then the event ``\(A\) or \(B\)'' can occur in \(m + n\) ways.%
\par
See \href{http://discretetext.oscarlevin.com/dmoi/sec_counting-addmult.html}{DDOI, Section 1.1}%
\end{definition}
The key to this definition is understanding what \emph{disjoint} means. Simply put, two events are disjoint if they cannot both occur in the same context.%
\begin{example}[Disjoint events]\label{example-1}
If you  visit the animal rescue shelter with the purpose of adopting a  pet then the the event of adopting a cat is disjoint from the event of adopting a dog.%
\end{example}
\begin{example}[Disjoint and non-disjoint events]\label{example-2}
The events of choosing playing cards that belong to the heart 	♥ or club ♣ suits are disjoint, since no card can below to both suits.%
\par
The events of choosing red card and a Number 4 card are not disjoint, since there are two red "4" cards.%
\end{example}
\begin{exercise}[{When can we use the Additive Principle?}]\label{exercise-1}
\noindent%
\leavevmode%
\begin{enumerate}
\item\hypertarget{li-3}{}Can we use the additive principle to determine how many two letter "words" begin with either \(A\) \emph{or} \(B\)? (Choose one: yes / no)%
\item\hypertarget{li-4}{}Can we use the additive principle to determine how many two letter "words" contain  either \(A\) \emph{or} \(B\)? (Choose one: yes / no)%
\end{enumerate}
\par
\medskip\noindent%
\textbf{Solution.}\quad \leavevmode%
\begin{enumerate}
\item\hypertarget{li-5}{}It is not possible for a word to begin with both \(A\) \emph{and} \(B\), so these events are disjoint, and the Additive Principle applies.%
\item\hypertarget{li-6}{}A word \emph{can} contain both \(A\) \emph{and} \(B\), so these events are not disjoint, and the Additive Principle does not apply.%
\end{enumerate}
\par
\end{exercise}
\begin{exercise}[{Using the Additive Principle}]\label{exercise-2}
Use the Additive Principle to solve these problems.%
\par\medskip
\noindent%
You visit the University Animal Shelter to adopt a new pet. The shelter has \(8\) dogs, \(5\) cats, and \(3\) ducks in need of a home.%
\leavevmode%
\begin{enumerate}
\item\hypertarget{li-7}{}How many choices do you have for a new pet?  \framebox[2em]{\raisebox{1ex}{}}%
\item\hypertarget{li-8}{}How many choices do you have for a new four-legged pet?  \framebox[2em]{\raisebox{1ex}{}}%
\end{enumerate}
\par
\medskip\noindent%
\textbf{Solution.}\quad \leavevmode%
\begin{enumerate}
\item\hypertarget{li-9}{}You have \(16\) choices for a pet.%
\item\hypertarget{li-10}{}You have \(13\) choices for a four-legged pet.%
\end{enumerate}
\par
\end{exercise}
\typeout{************************************************}
\typeout{Section 3 The Multiplicative Principle}
\typeout{************************************************}
\section[{The Multiplicative Principle}]{The Multiplicative Principle}\label{Multiplicative}
\begin{definition}[{The Multiplicative Principle}]\label{definition-2}
The multiplicative principle states that if event \(A\) can occur in \(m\) ways, and each possibility for \(A\) allows for exactly \(n\) ways for event \(B\), then the event ``\(A\) and \(B\)'' can occur in \(m \times n\) ways.%
\par
See \href{http://discretetext.oscarlevin.com/dmoi/sec_counting-addmult.html}{DDOI, Section 1.1}%
\end{definition}
\begin{example}[Using the Multiplicative Principle]\label{example-3}
Suppose we go to  our favourite ice-cream shop where they stock three flavours: vanilla, strawberry and mint. They had two types of cone: plain cones and waffle cones. How many ways can I place an order (for 1 cone and 1 scoop?).%
\par
\includegraphics[width=0.25\linewidth]{/home/niall/teach/CEL263/Project/project/images/IceCream1.png}
 \includegraphics[width=0.25\linewidth]{/home/niall/teach/CEL263/Project/project/images/IceCream2.png}
%
\end{example}
\begin{exercise}[{Using the Multiplicative Principle}]\label{exercise-3}
Use the Multiplicative Principle to solve these problems.%
\par\medskip
\noindent%
You return to the University Animal Shelter, which has has \(5\) cats, \(8\) dogs,  and \(3\) ducks in need of a home.%
\leavevmode%
\begin{enumerate}
\item\hypertarget{li-11}{}You wish to adopt one cat and one dog. How many ways can you do this?  \framebox[2em]{\raisebox{1ex}{}}%
\item\hypertarget{li-12}{}How many ways can you choose one cat, one dog, and one duck to adopt?  \framebox[2em]{\raisebox{1ex}{}}%
\end{enumerate}
\par
\medskip\noindent%
\textbf{Solution.}\quad \leavevmode%
\begin{enumerate}
\item\hypertarget{li-13}{}You have \(5 \times 8=40\) choices for a cat and a dog%
\item\hypertarget{li-14}{}You have \(120\) ways of choosing one of each animal.%
\end{enumerate}
\par
\end{exercise}
\typeout{************************************************}
\typeout{Section 4 Further exercises}
\typeout{************************************************}
\section[{Further exercises}]{Further exercises}\label{Further_exercises}
\begin{exercise}\label{class_reps}
\mbox{}\\ % hack to move box after heading
\begin{mdframed}
{
{\pgmlSetup
Our Indiscrete Mathematics course has 
{\pgmlIndent\let\pgmlItem=\pgmlbulletItem
\pgmlItem{}25 students from the the College of Arts, 18 of whom are  female;
\pgmlItem{}25 students from the the College of Engineering and Informatics, 5 of whom are  female;
\pgmlItem{}39 students from the the College of Science, 19 of whom are  female.
\par}%
\vskip\baselineskip
How many ways can we choose a single class rep?
\par}%
\par 
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}
\par 

{\pgmlSetup
 How many ways can we choose {\bfseries{}three reps}, one from each of the three Colleges?
\par}%
\par 
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}
\par 

{\pgmlSetup
 How many ways can we choose {\bfseries{}three reps}, one from each of the three Colleges, so that {\bfseries{}exactly one} is female?
\par}%
\par 
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}
\par 


}\par\vspace*{2ex}%
{\tiny\ttfamily\noindent\url{Niall/DiscreteMaths/IndiscreteClassReps_OPL.pg}\\Seed: 123567890\hfill}\end{mdframed}
\end{exercise}
The next two exercises involve sets. The second one is based on Exercises 1.1.5 and 1.1.6 from the textbook.%
\begin{exercise}\label{exercise-5}
\mbox{}\\ % hack to move box after heading
\begin{mdframed}
{
{\pgmlSetup
The sets \(A\)  and \(B\) are such that \(|A|=10\), \(|B|=2\), and \(|A \cap B|=0\).
\vskip\baselineskip
Then \(|A \cup B|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}},
and \(|A \setminus B|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}.
\vskip\baselineskip
The sets \(C\)  and \(D\) are such that \(|C|=10\), \(|D|=3\), and \(|C \cap D|=1\).
\vskip\baselineskip
Then \(|C \cup D|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}},
and \(|C \setminus D|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}.
\vskip\baselineskip
The sets \(E\)  and \(F\) are such that \(|E|=18\), \(|F|=21\), and \(|E \cup F|=31\).
\vskip\baselineskip
Then \(|E \cap F|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}},
and \(|E \setminus F|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}.
\vskip\baselineskip
\par}%

}\par\vspace*{2ex}%
{\tiny\ttfamily\noindent\url{Niall/DiscreteMaths/Sets_prob1_OPL.pg}\\Seed: 123567890\hfill}\end{mdframed}
\end{exercise}
\begin{exercise}\label{exercise-6}
\mbox{}\\ % hack to move box after heading
\begin{mdframed}
{
{\pgmlSetup
The sets \(A\)  and \(B\) are such that \(|A|=19\), \(|B|=18\).
\vskip\baselineskip
The largest possible value of  \(|A \cup B|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}. 
\vskip\baselineskip
The smallest possible value of  \(|A \cup B|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}. 
\vskip\baselineskip
The largest possible value of  \(|A \cap B|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}. 
\vskip\baselineskip
The smallest possible value of  \(|A \cap B|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}.
\vskip\baselineskip
The value of  \(|A \cap B| + |A \cup B|\) is  \mbox{\parbox[t]{5.5ex}{\hrulefill}}.
\vskip\baselineskip
\par}%

}\par\vspace*{2ex}%
{\tiny\ttfamily\noindent\url{Niall/DiscreteMaths/Sets_prob2_OPL.pg}\\Seed: 123567890\hfill}\end{mdframed}
\end{exercise}
\begin{exercise}\label{rivers}
\mbox{}\\ % hack to move box after heading
\begin{mdframed}
{
{\pgmlSetup
How many ``words'' can you make from the letters DEE?
\par}%
\par 
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}
\par 

{\pgmlSetup
How many ``words'' can you make from the letters NORE?
\par}%
\par 
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}
\par 

{\pgmlSetup
How many ``words'' can you make from the letters CORRIB?
\par}%
\par 
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}
\par 


}\par\vspace*{2ex}%
{\tiny\ttfamily\noindent\url{Niall/DiscreteMaths/Rep_prob1_OPL.pg}\\Seed: 123567890\hfill}\end{mdframed}
\end{exercise}
\begin{exercise}\label{multinomial-2}
\mbox{}\\ % hack to move box after heading
\begin{mdframed}
{
{\pgmlSetup
A Discrete Mathematics student comes from the village of KILLYIKYAKYODLE. As an hilarious jape, on the way home from a late-night study session, she decides to rearrange the letters on one of the sign-posts.
\vskip\baselineskip
How many arrangements of the letters in  KILLYIKYAKYODLE are possible?
\vskip\baselineskip
\par}%
\par 
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}
\par 

{\pgmlSetup
Of these arrangements, how many have all the L's together? 
\par}%
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}

{\pgmlSetup
Of these arrangements, how may have all the letters in alphabetical order?
\par}%
Answer: \mbox{\parbox[t]{10ex}{\hrulefill}}


}\par\vspace*{2ex}%
{\tiny\ttfamily\noindent\url{Niall/DiscreteMaths/Rep_prob2_OPL.pg}\\Seed: 123567890\hfill}\end{mdframed}
\end{exercise}
\end{document}