<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="description">
    <name>
      <text>7.2.2 (Example of linear programming question)</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<h3>Example</h3>
<p>Find the maximum and minimum values of the equation \(z = 3x+4y\) subject to the following constraints \[ \begin{align*} &amp;x+2y \leq 14 \\ &amp;3x-y \geq 0 \\ &amp; x - y \leq 2. \end{align*} \]</p>
<h3>Solution</h3>
<p>The area on the graph that these three equations mark off is called the feasibility region. The formula \(z = 3x+4y\) is called the optimisation equation. We need to find the coordinates of the corner points of the feasibility region that return the smallest and largest values of \(z\). Let us begin by rewriting the constraints so that \(y\) is the subject, so we can graph them more easily. This gives \[ \begin{align*} &amp;y \leq -\frac{1}{2}x + 7 \\ &amp;y \leq 3x \\ &amp; y \geq x-2, \end{align*} \] we can plot these on the same graph as follows, where the shaded area is the feasibility region.</p>
<p> </p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="@@PLUGINFILE@@/Feasibility%20region%201.png" alt="graph showing feasibility region" width="394" height="363" /></p>
<p> </p>
<p>To find the coordinates of the corner points we can read them from the graph. Recall that this is exactly what we were doing in the previous section when we were solving linear simultaneous equations graphically. So if we cannot immediately read off the coordinates from the graph we can take each pair of lines and solve them simultaneously as in the previous section. In this case we can see that the coordinates of the corner points are 
\[
(2,6), \qquad (6,4) \qquad \mbox{and} \qquad (-1,-3).
\]
So to find the maximum and minimum with respect to the constraints above, we insert these coordinates into the optimisation equation. This gives us:
\[
\begin{align*}
&(2,6): z = 3 \cdot 2 + 4 \cdot 6 = 30
\\
&(6,4): z = 3 \cdot 6 + 4 \cdot 4 = 34
\\
&(-1,-3): z = 3 \cdot -1 + 4 \cdot -3 = -15.
\end{align*}
\]
Hence the maximum of \(z\) is \(34\) and occurs at \((6,4)\). The minimum of \(z\) is \(15\) which occurs at \((-1,-3)\).</p>]]></text>
<file name="Feasibility region 1.png" path="/" encoding="base64">[encoded data, 99132 characters]</file>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text/>
    </generalfeedback>
    <defaultgrade>0</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber/>
  </question>
</quiz>
