
\documentclass[10pt]{article}
\usepackage{amsmath,amssymb,amsfonts,fancyhdr}
\usepackage{graphicx}
%
\setlength{\textheight}{9in}
\setlength{\topmargin}{-0.75in}
\setlength{\textwidth}{7in}
\setlength{\oddsidemargin}{-.2in}
\setlength{\parskip}{6pt}
\setlength{\parindent}{0pt}
%\usepackage{fullpage}
\renewcommand{\headrulewidth}{1pt}
\setlength{\headsep}{1cm}
% \usepackage{txfonts}
\usepackage{newcent}
\usepackage{fancyhdr}
\usepackage{multirow}   % for table formatting
\usepackage{hyperref}  % for weblinks in pdf
\usepackage{color}


\newcommand{\ds}{\displaystyle} 
\newcommand{\QQ}{{\mathbb{Q}}} % blackboard Q
\newcommand{\Qbar}{{\overline{\QQ}}} % blackboard Qbar
\newcommand{\ZZ}{{\mathbb{Z}}} % blackboard Z
\newcommand{\NN}{{\mathbb{N}}} % blackboard N
\newcommand{\CC}{{\mathbb{C}}} % blackboard C
\newcommand{\Zplus}{{\mathbb{Z^+}}} % blackboard Z^+
\newcommand{\FF}{{\mathbb{F}}} % blackboard F
\newcommand{\RR}{{\mathbb R}} % blackboard R
\newcommand{\Rtwo}{{\mathbb R^2}} % blackboard R^2
\newcommand{\Rthree}{{\mathbb R^3}} % blackboard R^3
\newcommand{\RRn}{{\mathbb R^n}} % blackboard R^n
\newcommand{\D}{{\cdot}} % dot
\def\mod#1{{\ifmmode\text{\rm\ (mod~$#1$)}
\else\discretionary{}{}{\hbox{ }}\rm(mod~$#1$)\fi}}

\def\tra{70}   %text rotation angle in table header
\newcommand{\tablehead}[1]{\rotatebox{\tra}{\scriptsize{#1}}}


%----------- colours ------------------------------------------------------
\definecolor{SFUred}{rgb}{0.60547,0.140625,0.17969}
\definecolor{SFUblue}{rgb}{.1602, .2734, .51172}
\definecolor{SFUgrey}{rgb}{.28515,.28125,.25}

\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}
\definecolor{FuncColor}{rgb}{1.0,0.0,0.0}
%------------------------------------------------------------------------------
%amps stuff

\usepackage{enumitem}
\setlist[enumerate,1]{label=}
\setlist[enumerate,2]{label=\Alph*.}
\setlist[enumerate,3]{label=\arabic*.}
\setlist[enumerate,4]{label=(\alph*)}



% check boxes for after instructors questions
\newcommand{\insertcheckboxes}{
\begin{center}
\fbox{
\begin{tabular}{ccccc}
done & checked & corrected & study MT & study final \\
$\Box$ &  $\Box$ &  $\Box$ &  $\Box$ &  $\Box$
\end{tabular}
}
\end{center}
}


% standard basis vectors
\def\ihat{{\bf \hat{i}}}
\def\jhat{{\bf \hat{j}}}
\def\khat{{\bf \hat{k}}}

% vector arrow notation
\newcommand{\bvec}[1]{\vec{ \bf #1}}  % absolute value


\newcommand{\twovec}[2]{\left[\begin{array}{c}
#1\\ #2\\ \end{array}\right] }

\newcommand{\closethegap}{\vspace{-2mm} }

\newcommand{\threevec}[3]{\left[\begin{array}{c}
#1\\ #2\\ #3\\ \end{array}\right] }

\newenvironment{soln}[1]{ \textit{Solution #1:} }{\medskip}

\pagestyle{plain}

%------------------------------------------------
% different types of labels for lists
% 1) type of label
%\renewcommand{\theenumi}{\arabic{enumi}}   default
%\renewcommand{\theenumi}{\alph{enumi}}     alphabetic   (use capital A for capitals)
%\renewcommand{\theenumi}{\roman{enumi}}    roman numerals (use capital R for capitals)
%
% 2) formatting of label
%\renewcommand{\labelenumi}{(\theenumi)}   default
%\renewcommand{\labelenumi}{\theenumi.}    remove brackets
%------------------------------------------------


%------------ Course Information --------------------
\newcommand{\coursename}{Discrete Mathematics II}
\newcommand{\coursenum}{MACM 201 - D100 and D200}
\newcommand{\semester}{Fall 2020}
\newcommand{\instructor}{Jamie Mulholland and Michael Monagan}

%------------ Assignment Information -------------
\newcommand{\anum}{5}
\newcommand{\duedate}{Wednesday November 4, 2020}
\newcommand{\duetime}{11:59pm}

\pagestyle{fancy}
\fancyhf{} 

\lhead{\includegraphics[height=1cm]{logo.png}}
\rhead{\large\sc \coursenum ~~~~Assignment\ \#\anum}
\lfoot{ {\color{blue} \sc Copyright \instructor}}
\rfoot{{\small \thepage}}



%--------- Now for the document ----------------------------------

\begin{document}
\hfill{{\bf Due Date}:     \duedate, \duetime}
%\vspace{-0.75cm}
\subsection*{Instructions}
Answer all questions on paper or a tablet using your own handwriting.
Put your name, student ID number and page number at the top of each page.
If you use paper make a photo of each page and upload your solutions to crowdmark.
If you use a tablet, export your assignment to .pdf and upload the .pdf to crowdmark.

\begin{enumerate}
\item { \color{SFUred} \textbf{Textbook Reading} }  

		\begin{itemize}	
			\item Sections: 9.1, 9.2, 9.3
                \end{itemize}


%=====================================
% Definitions, Concepts & Keywords
%=====================================
\item {\color{SFUred}\textbf{Definitions, Concepts \& Keywords}}
%\textbf{Definitions, Concepts \& Keywords}:
%
   \begin{itemize}
   \item[$\bullet$] Construct a generating function for a counting application.
   \item[$\bullet$] Find a formula for $[x^n] A(x)$ where $A(x)$ is a rational GF.
   \item[$\bullet$] Use Wolfram Alpha or Maple to extract a coefficient of a GF.
   \end{itemize}

\item {\color{SFUred}\textbf{Exercises}}

   \begin{enumerate}

   %=====================================
   % Textbook Questions
   %=====================================	
   \item  \textbf{Textbook Questions} 

        \begin{itemize}
        \item[] 9.1 Exercises 2ac, 3.
        \item[] 9.2 Exercises 1de, 2bde.
        \item[] 9.3 Exercises 2ab, 3.
        \end{itemize}

   \item \textbf{Instructor Questions}

\medskip
\hspace*{-5mm}
Questions on 9.1

   \begin{enumerate}
      \item Execute the following command in Wolfram Alpha: \\
            \verb:Coefficient[ (x+x^2+x^3+x^4+x^5+x^6)^6, x, 18 ]: \\
            to compute the coefficient of $x^{18}$ in the polynomial $(x+x^2+x^3+x^4+x^5+x^6)^6$. \\
            Alternatively, if you have Maple, use the command \\
            \verb:coeff( (x+x^2+x^3+x^4+x^5+x^6)^6, x, 18 ):
            
      \item For each equation, express the number of integer solutions as the coefficient
            of a polynomial.  Then use Wolfram Alpha or Maple to calculate the coefficient.
            \begin{itemize}
            \item[(a)] $a_1 + a_2 + a_3 = 14$ where $a_1,a_2,a_3 \ge 0$.
            \item[(b)] $b_1 + b_2 + b_3 = 15$ where $2 \le b_1 \le 6$, $b_2$ is even and $b_3$ is odd.
            \end{itemize}

\hspace*{-2cm} \includegraphics[height=1cm]{RedDie.jpg}
\vspace*{-1cm}

      \item 
            If a fair die is rolled 5 times, how many ways
            can the sum of the rolls equal 15?  \\ Use a generating function.
            Use Wolfram Alpha or Maple to compute the required coefficient.

      \item Carol is collecting money from her cousins for a walkathon.
            Three cousins promise to give her either \$2, \$3, or \$4
            and one promises to give her either \$5 or \$10.
            Let $a_n$ be the number of ways she can get \$$n$.
            Give a generating function for $a_n$.
            How many ways can she get \$15?
%> expand( x^11*(1+x+x^2)^3*(1+x^5) );                                                    
% 22      21      20      19      18      17      16      15      14      13      12
%x   + 3 x   + 6 x   + 7 x   + 6 x   + 4 x   + 4 x   + 6 x   + 7 x   + 6 x   + 3 x
%
%        11
%     + x
% So 6 ways.

    \end{enumerate}

\hspace*{-5mm}
Questions on 9.2

    \begin{enumerate}[resume]
      \item Let $A(x) = 1-x+x^2-x^3+x^4-\dots$ and $B(x) = 0+1x+2x^2+3x^3+\dots$. \\
            Calculate rational GFs for $A(x), B(x), A(x)+B(x)$ and $B'(x)$.

      \item Let $A(x) = 1-x+x^2-x^3+x^4-\dots$.  Let $c_n = [x^n] A(x)^2$.
            Calculate a formula for $c_n$. % This is exercise 33(b)

      \item Let $a_n$ be the number of ways to select $n$ balls from a large bag
            of red, blue, and yellow balls where the selection must include an even
            number of blue balls.  Write down a generating function for $a_n$ 
            in closed form.

      \item Consider the set of six sided die where one dice has the numbers 1, 3, 4, 5, 6, 8
            and the other has the numbers 1, 2, 2, 3, 3, 4 (see figure). 

            \includegraphics[width=4cm]{sichermann.jpg}

            If these two die are rolled at the same time we'll investigate the possible 
            sums and their frequencies in two ways: by direct enumeration in (a) and (b) below,
            and by using generating functions in (c) and (d) below.

            \begin{enumerate}
            \item Determine the numbers which can occur as the sum of rolling these two dice.
            \item For each number in (a) determine the number of possible ways this sum could 
                  be rolled. From this information, write down the generating polynomial $D(x)$
                  for the sum when rolling these two die.
            \item Now, write down the generating polynomial $D_1(x)$ for the first dice,
                  and $D_2(x)$ for the second dice.
            \item Verify that $D_1(x)\cdot D_2(x) = D(x)$ by multiplying the two polynomials in part (c). 
            \item How does the generating polynomial $D(x)$ compare to the one for the sum 
                  when rolling two standard six sided die?
            \end{enumerate}

            % 9.2 Rational GFs
            \item Determine a formula for the coefficient of $x^n$ for the 
                  rational GFs  $\ds 1/(1+2x)^3$ and $\ds x/(2-x)^3$.
            \item Find a rational GF for the sequence $0,1,-2,4,-8,16,\dots$.

            % 9.2 1/(1-x)^k formula and partial fractions
            \item Consider the generating function $\ds A(x) = \frac{1}{(2-x)(2+x)}$.
                  Find a formula for $[x^n] A(x)$.
                  Note, I get $[x^4] A(x) = 1/64$.
            \item Let $A(x)= \sum_{n=0}^{\infty} a_n x^n = \ds \frac{1}{(x-1)^2 (2-x)}$.
                  Find a formula for the coefficient $a_n$.
                  Note, I get $a_2 = 17/8$.

         \end{enumerate}

\hspace*{-5mm}
Questions on 9.3

         \begin{enumerate}[resume]
            % 9.3 Partitions
            \item List all partitions of 7.
	    \item Find the generating function for the number of integer solutions of
                  $2x+3y+5z = n$ for the cases
                  \begin{itemize}
                  \item[(a)] $x,y,z \ge 0$.
                  \item[(b)] $x,y,z \ge 1$.
                  \end{itemize}
          \end{enumerate}

   \end{enumerate}
\end{enumerate}

\end{document}

%
%=======================================================
%=======================================================
%=========                              ================
%=========  Selected Hints and Answers  ================
%=========                              ================
%=======================================================
%=======================================================
\end{enumerate}
\end{enumerate}

%\item {\color{SFUred}\textbf{ Selected Hints \& Answers}}
%
%Some final answers are given below. This is to provide you instant feedback on the validity of your solution - i.e. a quick check if your line of reasoning is correct. A complete solution requires full justification as to why these are the answers. 
%
\end{itemize}
\end{document}
