Preparatory course for opre.315 Written by Yoosef Khadem Excel, PH Stat 2 or SPSS in UB Computer Labs These computer applications are available in all UB labs. Any UB student, staff, or faculty with a net ID can also access these applications from home using Citrix. Instructions are at http://www.ubalt.edu/about-ub/offices-and-services/technology-services/faqs/citrix_remote_access.cfm. Below is the link that gives you the instructions on how to connect to install Citrix for Mac. http://www.ubalt.edu/about-ub/offices-and-services/technology-services/faqs/citrix_remote_access.cfm Dear students of opre.315, The prerequisite of opre.315 is completion of Math111 (College Algebra) here at UB or elsewhere. This preparatory class is neither perquisite of opre.315 (Decision sciences) nor will guarantee your success in completion of oper.315. I will try to cover the following subjects to boost your confidence level and brush up your rusty basic algebra skills for a good start in Decision sciences class where you face more challenging problems. It will also increase your problem solving skills for universal test such as GRE or GMAT. Wish you the best. Contents covered in this handout are: 1) Linear equations and inequalities 2) Solving two equations and two unknowns 3) Slope and y-intercept of a line 4) Graph of the equation of a line 5) Graphing linier inequalities 6) Introduction to linear programming 7) Solving a basic linear programming problem by Excel Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 2 of 35 Solving linear equality and inequalities: EQUALITIES Definition: An equality is two algebraic expressions linked by an equal sign =. If a, b, and c are real numbers then the following properties can be used in solving equalities. If a = b then a + c = b + c or a - c = b - c. If a = b then for any c 0, ac = bc and a c = b c. Note: The second property is good for removing fractions in equalities. If a(b+c), use distributive property to remove the parentheses, hence a(b+c) = ab + ac. INEQUALITIES Definition: When two algebraic expressions are linked by inequality signs such as > , < , <, and > they form an inequality. To solve an inequality use the following properties, which in many cases are similar to the properties used in solving equalities. If a, b, and c are real numbers then the following properties can be used in solving inequalities If a > b and b > c then a > c. If a > b then a+ c > b + c or a - c > b - c. If a > b and c > 0 (this means c is a positive number) then ac > bc or a / c > b / c. Note: If you notice you see these properties so far are similar to the equations properties. If a > b and c < 0 (this means c is negative) then ac < bc or a/c < b/c. EXAMPLES 1. Solve the following equation for X. 2(3 - X) + 10 = 5 - 2(3X + 2) Solution: 6 – 2X + 10 = 5 – 6X – 4 2X + 16 = -6X + 1 6X – 2X = -16 + 1 4X = -15 = -15/4 = -3.75 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 3 of 35 2. Solve for y if 2x + 5y = 12 Note: When you solve for y in terms of you will find slope and y-intercept of the line. In equation y =mx + b , m is the slope of the line and b is the y-intercept. Usually yintercept should be written as a pair point like (0, b). 3. TWO EQUATIONS AND TWO UNKNOWNS Our main focus in this section is to solve systems of equations with two unknown variables. The solutions to these types of equations can be very tricky, especially in the data sufficiency questions of the GMAT exam. Our objective is, not only to be able to solve the equations and find answers, but to be able to convert verbal expressions into equations and find the unknowns. The most popular way to solve two equations and two unknowns is called the elimination method. In some books it is called the addition or subtraction method. There are three possible answers for these types of equations. The system may have a unique solution, infinite many solutions or no solutions at all. My main objective is to show you how to find answers to application problems. However, before solving application problems, it is appropriate to learn the mechanics of solving systems of two equations and two unknowns using the elimination method. Solve for X and Y 2X - Y = 3 X + 2Y =14 Solution: When X and Y in both equations are in the left side and the constant terms in the right hand side, multiply first and second equations by numbers that leads to the discovery of two opposite terms in the left side of the two equations. Add the two equations together to eliminate one of the two variables. When this is done, the result is one equation and one unknown. Solve this equation for the unknown variable. To find the other unknown, simply substitute the unknown found in the previous step into one of the original equations to find the other unknown. This is illustrated below. 2 {2X - Y = 3 } X + 2Y = 14 4X – 2Y = 6 X +2Y = 14 5X = 20 X= 4 Now substitute X = 4 in first equation and find the Y value. Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 4 of 35 2(4) - Y = 3 8-Y=3 -Y = -8 + 3 -Y = -5 Y=5 Note: This system could have been given like following: Solve for X1 and X2 2 X1 X2= 3 X1 + 2 X2 =14 Sustitution Method Using the first equation solve for Y in terms of X. The answer is Y = 2 - X. Since one of the two variables can be arbitrary, we let X be equal to any value and then calculate Y using the arbitrary X value. For example if X = 5 then Y = 2 - 5 that is Y = -3. In this case we can say a particular solution of this system is X = 5 and Y = -3. Some more examples: Solve the following systems of two equations and two unknowns 1) 3x+ 4y = 5 -x +2 y = 5 2) 2x = - y + 4 x- 3y = -5 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 5 of 35 Solving Linear inequalities and finding feasible regions. Examples: Find the feasible region for the following linear inequalities: 1) X +Y ≤ 10 2X + 3Y ≥ 12 y x 2) X -Y ≤ 20 -2X + 3Y ≥ 12 y x Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 6 of 35 Basic word problem A daily diet consists of 300 grams of a mixture of two foods, low calorie food and high calorie food. The low calorie and high calorie and high calorie foods each consists of 10% and 15% protein, respectively. If the diet must provide exactly 38 grams of protein daily, how many grams of low calorie food are in the mixture? a) 100 b) 140 c) 150 d) 160 e) 200 Answer B General questions regarding systems of equations and the equation of a straight line. Slope of a line: To find the slope of a line, solve the given line equation for dependent variable in term of independent variable. Generally find standard equation of the line, Y = mX + b. Once you find this equation refer to coefficient of X(independent variable). The coefficient of independent variable is called the slope of the line. If dependent variable is X2 , solve the given equation for X2 in terms of X1. Examples Find the slope of given lines: a) Line 7 X1 + 10 X2 = 70 Solution: Solve for X2 in terms of X1 , the coefficient of X1 is the slope of the line. 7 X1 + 10 X2 = 70 10 X2 = -7 X1 + 70 divide by 10 to isolate X2. (10/10) X2 = ( -7/10) X1 + (70/10) X2 = ( -7/10) X1 + 7 , hence the slope is -7/10. Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications b) Page 7 of 35 Line X1 = 10 Solution: The is a vertical line and the slope of it is undefined or infinity. c) Line X2 = 5 Solution: this is a horizontal line and the slope is zero. d) Line 1 x 2 y 3 . 2 5 Solution: to get rid of fractions, multiply all terms by LCD of all denominators. In this case the LCD is 10. Hence 10( 1 x 2 y 3 ) that gives 5x 4 y 30 now isolate y, 4y = -5x + 30. 2 5 5 15 5 Dividing all terms by 4 we get y x hence the slope is . 4 2 4 e) Graph the following linear inequality and find feasible region. x-2y ≤4 2x+4y ≤12 y x Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 8 of 35 Now let’s see how knowing these basic algebra concepts are going to help a student with a good starts in Decision Sciences class. Problem statement Assume a department in a furniture company is only assigned to produce chairs and tables. Past statistics show profit per chair is $7 while the profit per table is $10. Manufacturing chairs and tables require labors and materials. The required labor and material for each chair and table is given in the following table: Labor Material A Chair 2 1 A Table 3 1 There are no more than 36 hours of labors and 16 units of materials available for this department. Also because of space limitation the department can’t accommodate more than 14 chairs per day. Formulate a linear program problem that allows you to produce a daily output of chairs and tables for a maximum daily profit, using least amount of labors and materials and not exceeding the space limitation. SOLUTION Step 1. Define decision variables. Decision variables tell how much or how many of something to produce, invest, purchase, hire, etc. In this problem, decision variables are: X1 = daily number of chairs to produce. X2 = daily number of tables to produce. Note: X1 and X2 are similar to X and Y dimensions in a two dimensional systems. The reason for choosing a letter followed by indices 1, 2, … is because in a higher level formulations you may have to choose several variables at a time in a linear program formulation. Choosing different indices limits the number of letters used in a linear program. Step 2. Find the objective function. In this problem, the goal is to maximize the daily profit. Problem statement Indicate that profit per chair is $7 while the profit per table is $10, hence the objective function in this is 7 X1 + 10 X2 or P =7 X1 + 10 X2 . Step 3. The most challenging part of a linear programming problem is to translate all problem statements into linear equality or inequalities. There are not many standard format to formulate a linear programming problem. Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 9 of 35 Sometimes translation of problem statements is very simple while the other times very complex and tedious. In order to be able to find answers by hand and computer we must simplify inequalities in the form that all variables in simplest form are in left side of equality or inequality signs and the constant is in right hand side of equality or inequality signs. Constraints in our problem are: 2 X1 + 3X2 ≤ 36 X1 + X2 ≤ 16 X1 ≤ 14 Labor Hours Materials Limitation for the number of chairs So all together, we can say: Maximize 7 X1 + 10 X2 Subjected to: 2 X1 + 3X2 ≤ 36 Labor Hours X1 + X2 ≤ 16 Materials X1 ≤ 14 Limitation for number of chairs Since number of chairs and tables can’t be negative, we should add to more constraints. They are: X1 ≥0 and X2 ≥0 We can rewrite all as: Max 7 X1 + 10 X2 s.t. 2 X1 + 3X2 ≤ 36 X1 + X2 ≤ 16 X1 ≤ 14 X1 , X2 ≥0 Solution by graphing method To solve this problem, start with non-negativity constraints, X1 , X2 ≥0 X2 Quadrant II X1<0 X2>0 Quadrant I X1>0 X2>0 X1 Quadrant III X1<0 X2<0 Quadrant IV X1>0 X2<0 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications X2 Page 10 of 35 As you see non-negativity constraints, X1 , X2 ≥0 indicate final answer should fall in the Quadrant I. X1 X2 0 12 18 0 X1 Notice: The equation of X2 axis (in basic algebra is known as y axis) is X1 = 0 and the equation of X1 axis(in basic algebra is known as x axis) is X2 = 0. Line X1 = 0 is a vertical line and its slope is undefined. Line X2 = 0 is a horizontal line and its slope is zero. Now we should draw each constraint individually or simultaneously and identify whether pair points below, above, left or right side of the line are feasible. Graph 2 X1 + 3X2 ≤ 36 , using x-intercept and y-intercept method: X2 X1 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Graph X 1 + X2 Page 11 of 35 ≤ 16 , using x-intercept and y-intercept method: X2 X1 Graph X1 ≤ 14. X2 X1 0 16 14 X2 16 0 X1 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 12 of 35 Now let’s combine three regions to find the final feasible region. X2 x1 + x2 = 16 C A 2x1 + 3x2 = 36 B D X1 As you see the shaded region is the set of all pair points that satisfy all constraints. Each pair point represents the number of chairs and tables produce in one day. We have to select a pair point that gives us the maximum profit. Obviously pair points closer to origin (0,0) result to smaller profit so we do our best to evaluate the objective function using pair points that are feasible but far away from the origin. Faraway pair points in boundaries of feasible set should be tested in order to find the best answer for the problem. Since there are so many pair points in the boundaries of feasible region, we only test pair points that are found by intersecting any two lines in feasible region. In this problem the pair points that we call VERTICES OF FEASIBLE REGION are: C, A, B and D. Of course the origin (pair point (0,0) ) is a vertex of feasible region but since the results when evaluating the objective function is always zero, we don’t care about it. Once we clearly identify measurements of vertices of feasible region, we evaluate the objective function for each vertex to see which one give the largest value in a maximization problem and the smallest value in a minimization problem. Referring to graph we see it is easy to find the measurement of some of these vertices but not all. A vertex such as C is simply y-intercept of line 2 X1 + 3X2 = 36. So using this equation we can simply let X1 = 0 and find X2 as shown below: Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 13 of 35 Let’s set X1 = 0 in the equation 2 X1 + 3X2 = 36 and find X2 that is 2 (0 )+ 3X2 = 36 or solving for X2 we get X2 = 12. Hence pair point C is (0 , 12). Similarly you can see measurement of pair point D that is (14, 0). This is x-intercept of line X1 =14. To fond pair points A and B, we have to solve to separate systems of two equations and two unknowns. To find A, solve: 2 X1 + 3X2 = 36 X1 + X2 = 16 Solution: As I mentioned in review algebra part, usually you can use elimination method to solve a system with two equations and two unknowns. In this problem as you see if you multiply the second equation by -2 you can discover two opposite X1 terms in left sides of each equation. 2 X1 + 3X2 = 36 -2 X1 - 2X2 = -32 Add left sides and right sides in order we get X2 = 4. If we substitute X2 = 4 in the first or the second equation, we find X1 value as following: X2 = 4 2 X1 + 3X2 = 36 or 2 X1 + 3(4) = 36 that gives X1 =12. Pair point A is (12,4). To find B, solve system: X1 + X 2 X1 = 16 = 14 Solution: As you see X1 = 14 so substituting this value in first equation we get X2 = 2. Therefore pair point B is ( 14 ,2 ). Now in a table we evaluate the objective function using these vertices. Corner Points origin C A B D Pair point value (0,0) (0,12) (12,4) (14,2) (14,0) Objective function 7 X1 + 10 X2 7(0) + 10(0) =0 7 (0) + 10 (12) =120 7 (12) + 10 (4) =124 7 (14) + 10 (2) =118 7 (14) + 10 (0) =98 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 14 of 35 As you see the best answer occurs at (12,4) for a maximum of $124. This means the department should produce 12 chairs and 4 tables for a maximum profit of $124. The optimal value is X1 =12, X2 = 4 and optimal solution is $124. Unused resources The original problem: Maximize 7 X1 + 10 X2 2 X1 + 3X2 ≤ 36 X1 + X2 ≤ 16 X1 ≤ 14 X1 , X2 ≥0 Labor Hours Materials Limitation for the number of chairs Could be converted to the standard form by adding a slack to constraints with ≤ or subtracting a surplus from constraint with ≥ signs. Hence the standard form of our system is: Maximize s.t. 7 X1 + 10 X2 2 X1 + 3X2 + S1 = 36 X1 + X2 + S2 = 16 X1 + S3 = 14 Labor Hours Materials Limitation for the number of chairs In this standard format, S1 is the unused labor hour, S2 is the unused material and S3 is the left over (if any) of our limitation constraint. To find these values, we solve the system using our optimal value X1 =12, X2 = 4. 2 (12) + 3(4) + S1 = 36 12 + 4 + S2 = 16 12 + S3 = 14 Labor Hours Materials Limitation for the number of chairs S1= 0 , S2 = 0 and S3 =2. This means we used all of the labor hours and materials and did not exceed our Limitation for the number of chairs. Constraints number 1 and 2 are called binding constraints and the third one is non-binding. A binding constraint is also is a fully utilized constraint with slack of zero. Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 15 of 35 Now let’s solve the same problem with Excel Solver. Maximize 7 X1 + 10 X2 Subjected to: 2 X1 + 3X2 ≤ 36 X1 + X2 ≤ 16 X1 ≤ 14 Number of Labor Hours Number of units of Materials Limitation for number of chairs Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 16 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 17 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 18 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 19 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 20 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 21 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 22 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 23 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 24 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 25 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 26 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 27 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 28 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 29 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 30 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 31 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 32 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 33 of 35 Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Review for OPRE 315: Algebra with Applications Page 34 of 35 Microsoft Excel 14.0 Answer Report Worksheet: [Book1]Sheet1 Report Created: 1/15/2014 3:40:29 PM Result: Solver found a solution. All Constraints and optimality conditions are satisfied. Solver Engine Engine: Simplex LP Solution Time: 0.031 Seconds. Iterations: 2 Subproblems: 0 Solver Options Max Time Unlimited, Iterations Unlimited, Precision 0.000001, Use Automatic Scaling Max Subproblems Unlimited, Max Integer Sols Unlimited, Integer Tolerance 1%, Assume NonNegative Objective Cell (Max) Cell $D$1 Name Original Value Objective Function 0 Final Value 124 Variable Cells Cell $B$1 $B$2 Name Original Value 0 0 Name Cell Value x1 x2 Final Value Integer 12 Contin 4 Contin Constraints Cell $A$4 $A$5 $A$6 x2 x2 x2 Formula 36 $A$4<=$C$4 16 $A$5<=$C$5 12 $A$6<=$C$6 Status Binding Binding Not Binding Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc Slack 0 0 2 Review for OPRE 315: Algebra with Applications Page 35 of 35 Microsoft Excel 14.0 Sensitivity Report Worksheet: [Book1]Sheet1 Report Created: 1/15/2014 3:40:29 PM Variable Cells Cell $B$1 $B$2 Final Name Value x1 12 x2 4 Reduced Cost 0 0 Objective Coefficient 7 10 Allowable Increase Final Name Value x2 36 x2 16 x2 12 Shadow Price 3 1 0 Constraint R.H. Side 36 16 14 Allowable Increase 12 0.666666667 1E+30 3 0.5 Allowable Decrease 0.333333333 3 Constraints Cell $A$4 $A$5 $A$6 Allowable Decrease 2 4 2 Microsoft Excel 14.0 Limits Report Worksheet: [Book1]Sheet1 Report Created: 1/15/2014 3:40:30 PM Objective Name Cell Value $D$1 Objective Function Cell $B$1 $B$2 Variable Name x1 x2 124 Value 12 4 Lower Limit 0 0 x1 x2 12 4 Objective Function 36 16 12 <= <= <= 36 16 14 Objective Result 40 84 Upper Objective Limit Result 12 124 4 124 124 Based on this output, we can find the optimal solution and answer many different questions related to range of optimality and range of feasibilities. Achievement and Learning Center | Academic Center, Room 113 | 410.837.5383 |alc@ubalt.edu | www.ubalt.edu/alc