Maximization problem with simplex method

Click For Summary

Homework Help Overview

The discussion revolves around a maximization problem involving a profit function P = 3x - y - 2z, subject to three linear constraints. The problem is situated within the context of linear programming and the simplex method.

Discussion Character

  • Mixed

Approaches and Questions Raised

  • Participants share their attempts at solving the problem using the simplex method, with some expressing confusion regarding the correctness of their solutions compared to a provided answer. Questions arise about potential mistakes in the calculations and the interpretation of the results.

Discussion Status

Some participants have provided insights into the discrepancies in the solutions, suggesting that further verification of the calculations is necessary. There is an acknowledgment of the complexity involved in the simplex method, with participants exploring the implications of their findings and questioning the validity of their approaches.

Contextual Notes

Participants note the challenges of performing the simplex method by hand and the potential for errors in variable assignments during the pivoting process. The discussion includes references to specific tableau configurations and the importance of correctly identifying basic and non-basic variables.

s3a
Messages
828
Reaction score
8

Homework Statement


Maximize the profit function P = 3x - y - 2z subject to the following

x - y - z ≤ 15
2x - y + 2z ≤ 50
2x + y + z ≤ 39

, where x ≥ 0, y ≥ 0, z ≥ 0.

Homework Equations


Simplex method / Simplex algorithm

The Attempt at a Solution


Hello to everyone who is reading this. :)

Here is my work:
https://pastebin.com/CT6cjMBu

As you can see from my work (in the above link), I get that max P = 51, which happens when (x_1, x_2, x_3) = (18, 0, 3).

However, the answer in the PDF says "Max P = 51 at (18, 3, 0)". Should it say (18, 0, 3), or am I the one that’s wrong? If I’m wrong, could someone please point out where my mistake is? Is this just a simple typo in the PDF with the answer?

Any input would be GREATLY appreciated!
 
Physics news on Phys.org
Substituting your numbers back in, I get P=48 and the solution is valid. Substituting their numbers back in, I get P=51 and the solution is feasible.

For both solutions, the first and last constraints are both active, but the book solution gets closer to the second constraint (less slack).

You probably should have pivoted again (or you pivoted one too many times). You should double check why you terminated.
 
Last edited:
s3a said:

Homework Statement


Maximize the profit function P = 3x - y - 2z subject to the following

x - y - z ≤ 15
2x - y + 2z ≤ 50
2x + y + z ≤ 39

, where x ≥ 0, y ≥ 0, z ≥ 0.

Homework Equations


Simplex method / Simplex algorithm

The Attempt at a Solution


Hello to everyone who is reading this. :)

Here is my work:
https://pastebin.com/CT6cjMBu

It occurs to me that doing simplex by hand is deeply unpleasant. I ran this LP quickly in Julia to corroborate the official solution.

s3a said:
As you can see from my work (in the above link), I get that max P = 51, which happens when (x_1, x_2, x_3) = (18, 0, 3).

However, the answer in the PDF says "Max P = 51 at (18, 3, 0)". Should it say (18, 0, 3), or am I the one that’s wrong? If I’m wrong, could someone please point out where my mistake is? Is this just a simple typo in the PDF with the answer?

Any input would be GREATLY appreciated!

It is not hard to confirm by hand that your answer is wrong, though. This is an idea that comes up many times in computing -- for a large class of problems, its easy to check the answer though perhaps a lot of work to get said answer.

Notice that the official solution of ##P(18, 3, 0) = 3*18 - 3 - 2*0 = 51##. Your proposed solution of ##P(18, 0, 3) = 3 * 18 - 0 -2*3 = 48##. It's also easy to verify that ##(18, 3, 0)## is legal according to the supplied constraints. From this we can be certain that your solution of ##(18, 0, 3)## is not correct. Proving that we cannot do better than ##P(18, 3, 0)##, however takes a lot more work -- typically using duality.

I'm guessing that you flipped the y and z around on accident, and just need to 'unflip' them to have the correct answer.
 
  • Like
Likes   Reactions: FactChecker
Thanks for the insightful comments. :)

It turns out that the problem was that I had to put the variable that's at the top of the matrix for the pivot column on the left of the matrix, whereas what I had incorrectly done is say to myself "This is the third row, so the i in x_i is 3.", but it should have been x_2, because the pivot was on the second column.
 
s3a said:

Homework Statement


Maximize the profit function P = 3x - y - 2z subject to the following

x - y - z ≤ 15
2x - y + 2z ≤ 50
2x + y + z ≤ 39

, where x ≥ 0, y ≥ 0, z ≥ 0.

Homework Equations


Simplex method / Simplex algorithm

The Attempt at a Solution


Hello to everyone who is reading this. :)

Here is my work:
https://pastebin.com/CT6cjMBu

As you can see from my work (in the above link), I get that max P = 51, which happens when (x_1, x_2, x_3) = (18, 0, 3).

However, the answer in the PDF says "Max P = 51 at (18, 3, 0)". Should it say (18, 0, 3), or am I the one that’s wrong? If I’m wrong, could someone please point out where my mistake is? Is this just a simple typo in the PDF with the answer?

Any input would be GREATLY appreciated!

The initial tableu is
$$\begin{array}{c|cccccc|r}
\text{BV} &x&y&z&s_1&s_2&s_3&\text{rhs}\\
\hline
P&-3&1&2&0&0&0&0\\
s_1&1&-1&-1&1&0&0&15\\
s_2&2&-1&2&0&1&0&50\\
s_3&2&1&1&0&0&1&39\\
\hline
\end{array}
$$
Here, BV stands for "basic variable", so the basic variables in the first tableau are ##P, s_1, s_2, s_3.##

After the two simplex steps you outline I get the the new tableau:
$$\begin{array}{c|cccccc|r}
\text{BV}&x&y&z&s_1&s_2&s_3&\text{rhs}\\
\hline
P&0&0&1&5/3&0&2/3&51\\
x&1&0&0&1/3&0&1/3&18\\
s_2&0&0&3&-4/3&1&-1/3&17\\
y&0&1&1&-2/3&0&1/3&3\\
\hline
\end{array}
$$
The optimal basic solution is ##(P,x,y,s_2) = (51,18,3,17)## (basic variables) and ##z=s_1=s_3=0## (non-basic variables). To keep thing straight I recommend you append a column of basic-variable labels (called BV in my tableaux), and each time an old basic variable leaves and an old non-basic variable enters the new basis, the BV label is changed accordingly.
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K