\documentclass[12pt]{article}
\usepackage{fullpage,amsmath,amsfonts,graphicx}

\newcommand{\x}{\boldsymbol{x}}
\newcommand{\y}{\boldsymbol{y}}
\renewcommand{\a}{\boldsymbol{a}}
\renewcommand{\b}{\boldsymbol{b}}
\renewcommand{\c}{\boldsymbol{c}}

\begin{document}

\title{Operations Research}
\author{Homework 4}
\date{Due via Moodle (Pyomo) or Mailbox (Question 1) \\ on Tuesday, September 29, 2020}
\maketitle


\begin{enumerate}

\item Use the simplex method to solve the WYNDOR company problem:
\emph{Maximize}
\[
  z = 3 \, x + 5 \, y
\]
\emph{subject to}
\begin{gather*}
  x  \leq 4 \,, \\
  2 \, y \leq 12 \,, \\
  3 \, x + 2 \, y \leq 18 \,, \\
  x, y \geq 0 \,.
\end{gather*}
(First convert the problem to standard form!)


\item Reconsider Problem~1 from Homework Sets 1 \& 2:  \emph{Minimize}
\[
  z = 8 \, x + 12 \, y
\]
\emph{subject to}
\begin{gather*}
  5 \, x + 2 \, y \geq 20 \,, \\
  4 \, x + 3 \, y \geq 24 \,, \\
  y \geq 2 \,, \\
  x, y \geq 0 \,.
\end{gather*}
\begin{enumerate}
\item Take your Pyomo program from Homework~2.  Pyomo can return the
values of slack variables via the the \verb+lslack()+ and
\verb+uslack()+ attributes on each constraint.

Re-run your code, call \verb+lslack()+ and \verb+uslack()+ on each
constraint, and explain the numbers which are returned.  

\item Pyomo can return the dual variables as shown in class.  Compute
the dual variables.  What do you notice in relation to the values of
the slack variables from part (a)?

\item Write out the dual of this problem explicitly and solve it in
Pyomo.  Compare to your result from part (b).

\item Give an interpretation of the meaning of all parameters and
decision variables in the primal and dual problem.  (E.g., in terms of
unit profit, capacities, capacity requirement per unit, shadow prices,
and number of units produced.  Note that these are just suggestions;
it is certainly possible to give alternative interpretations from
completely different problem domains.)

\end{enumerate}

\item \emph{(This is a variation of Exercise 6.8-8 from HL.)} David,
LaDeana, and Lydia are the sole partners and workers in a company
which produces fine clocks.  David and LaDeana each are available to
work a maximum of 40 hours per week at the company, while Lydia is
available to work a maximum of 20 hours per week.  The company makes
two different types of clocks: a grand-father clock and a wall clock.
To make a clock, David (a mechanical engineer) assembles the inside
mechanical parts of the clock while LaDeana (a woodworker) produces
the handcarved wood casings.  Lydia is responsible for taking orders
and shipping the clocks.  The amount of time required for each of
these tasks is shown below.


\begin{center}
\begin{tabular}{lcc}
\hline
& \multicolumn{2}{c}{\textbf{Time Required}$\vphantom{1^{1^1}}$} \\
  \textbf{Task}$\vphantom{1^{1^1}}$ & \textbf{Grandfather Clock} &
                                                                   \textbf{Wall Clock}
                                                      \\
\hline
Assemble clock mechanism$^{\vphantom{\tfrac11}}$ & $6$ hours & $4$ hours \\
Carve wood casing & $8$ hours & $4$ hours \\
Shipping & $3$ hours & $3$ hours \\
\hline
\end{tabular}
\end{center}

Each grandfather clock built and shipped yields a profit of \$300
while each wall clock yields a profit of \$200.

\begin{enumerate}
\item Formulate and solve the problem in Pyomo, and ask Pyomo to
compute shadow prices (dual variables) for each activity.  Please
submit a printout of your Ipython notebook showing code and output.

\item Occasionally, someone stops by asking for help with restoring
antique clocks.  How much should David charge per hour for mechanical
repairs and how much should LaDeana charge per hour for wood
restoration assuming that they do not wish to add more working hours
and also do not wish to reduce company profit if one of them is taking
on a repair job?
\end{enumerate}
\end{enumerate}

\end{document}
