Math 381 Midterm Practice Problem Solutions

Similar documents
Spring 2018 IE 102. Operations Research and Mathematical Programming Part 2

Review Questions, Final Exam

Review Questions, Final Exam

Name: Section Registered In:

MATH 408N PRACTICE MIDTERM 1

Math 111, Introduction to the Calculus, Fall 2011 Midterm I Practice Exam 1 Solutions

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2:

CS 124 Math Review Section January 29, 2018

A Primer on Statistical Inference using Maximum Likelihood

Math 381 Discrete Mathematical Modeling

Practice Questions for Math 131 Exam # 1

Computational Integer Programming. Lecture 2: Modeling and Formulation. Dr. Ted Ralphs

Systems of Equations. Red Company. Blue Company. cost. 30 minutes. Copyright 2003 Hanlonmath 1

CS173 Lecture B, November 3, 2015

Linear Programming II NOT EXAMINED

Chapter 6 Outline Systems of Linear Inequalities

CLASS NOTES: BUSINESS CALCULUS

k P (X = k)

Optimization Methods in Management Science

Solution to Proof Questions from September 1st

Math 5a Reading Assignments for Sections

Integer Linear Programs

GRE Quantitative Reasoning Practice Questions

EXAM 2 REVIEW DAVID SEAL

Math 3C Midterm 1 Study Guide

Major Ideas in Calc 3 / Exam Review Topics

Problems from Probability and Statistical Inference (9th ed.) by Hogg, Tanis and Zimmerman.

Operations and Supply Chain Management Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

University of California Berkeley CS170: Efficient Algorithms and Intractable Problems November 19, 2001 Professor Luca Trevisan. Midterm 2 Solutions

Section 2.5 Linear Inequalities

OPTIMISATION 2007/8 EXAM PREPARATION GUIDELINES

Math 251 Midterm II Information Spring 2018

MATH 1130 Exam 1 Review Sheet

Section K MATH 211 Homework Due Friday, 8/30/96 Professor J. Beachy Average: 15.1 / 20. ), and f(a + 1).

Preparing for the CS 173 (A) Fall 2018 Midterm 1

MA 1128: Lecture 08 03/02/2018. Linear Equations from Graphs And Linear Inequalities

Main topics for the First Midterm Exam

Math Lab 10: Differential Equations and Direction Fields Complete before class Wed. Feb. 28; Due noon Thu. Mar. 1 in class

MATH 56A SPRING 2008 STOCHASTIC PROCESSES

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

Finding Limits Graphically and Numerically

Optimization Methods in Management Science

Notes for Lecture 21

Sometimes the domains X and Z will be the same, so this might be written:

Probability (Devore Chapter Two)

ACT Elementary Algebra Review Contents

Introduction to linear programming

Math 1071 Final Review Sheet The following are some review questions to help you study. They do not

CS 125 Section #12 (More) Probability and Randomized Algorithms 11/24/14. For random numbers X which only take on nonnegative integer values, E(X) =

Algebra 2 CP Semester 1 PRACTICE Exam

UC Berkeley, CS 174: Combinatorics and Discrete Probability (Fall 2008) Midterm 1. October 7, 2008

Lecture Note 1: Introduction to optimization. Xiaoqun Zhang Shanghai Jiao Tong University

Mathematics Level D: Lesson 2 Representations of a Line

Math M111: Lecture Notes For Chapter 3

Section Notes 8. Integer Programming II. Applied Math 121. Week of April 5, expand your knowledge of big M s and logical constraints.

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

Math (P)Review Part I:

College Algebra: Midterm Review

Systems of Nonlinear Equations and Inequalities: Two Variables

1.4 Techniques of Integration

In economics, the amount of a good x demanded is a function of the price of that good. In other words,

North Carolina State University

Lecture 10: Powers of Matrices, Difference Equations

Descriptive Statistics (And a little bit on rounding and significant digits)

Review for Final Exam, MATH , Fall 2010

Solutions to Second Midterm

(arrows denote positive direction)

15-780: LinearProgramming

Math 3 Variable Manipulation Part 7 Absolute Value & Inequalities

Mathematics 1104B. Systems of Equations and Inequalities, and Matrices. Study Guide. Text: Mathematics 11. Alexander and Kelly; Addison-Wesley, 1998.

Alex s Guide to Word Problems and Linear Equations Following Glencoe Algebra 1

Math 164-1: Optimization Instructor: Alpár R. Mészáros

Solutions to Review Questions, Exam 1

Algebra 1 Winter Break Extra Credit Fall Semester 2013

OPTIMISATION /09 EXAM PREPARATION GUIDELINES

Chapter 3 Introduction to Linear Programming PART 1. Assoc. Prof. Dr. Arslan M. Örnek

June If you want, you may scan your assignment and convert it to a.pdf file and it to me.

Chapter 1 Review Applied Calculus 31

PROJECT MANAGEMENT CHAPTER 1

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

36106 Managerial Decision Modeling Linear Decision Models: Part II

Chapter 1 Review of Equations and Inequalities

COMPSCI 611 Advanced Algorithms Second Midterm Exam Fall 2017

MATH 115 SECOND MIDTERM

1 Basic continuous random variable problems

MA 3280 Lecture 05 - Generalized Echelon Form and Free Variables. Friday, January 31, 2014.

How hard is it to find a good solution?

1 Basic continuous random variable problems

IE 5112 Final Exam 2010

Math Practice Final - solutions

COMPSCI 611 Advanced Algorithms Second Midterm Exam Fall 2017

= (6)(1) ( 4)( 1) 2( 11 ) = 2 11 = 9.

Math 112 Group Activity: The Vertical Speed of a Shell

Another max flow application: baseball

Midterm Study Guide and Practice Problems

MATH MW Elementary Probability Course Notes Part I: Models and Counting

Linear equations The first case of a linear equation you learn is in one variable, for instance:

2. Find the intervals where function is increasing and decreasing. Then find all relative extrema.

CLASS NOTES: INTERMEDIATE ALGEBRA AND COORDINATE GEOMETRY

Physics 6A Lab Experiment 6

Transcription:

Math 381 Midterm Practice Problem Solutions Notes: -Many of the exercises below are adapted from Operations Research: Applications and Algorithms by Winston. -I have included a list of topics covered on the midterm, as well as topics you may likely be tested on. This is not meant to be an exhaustive list, but constitutes the main focus of the midterm material. Mathematical Modeling You should know the Modeling Process and the steps involved. Exercise 1. Try to write down the Mathematical Modeling Process from memory (if you forgot, it s in Lecture 1). What are some examples we have seen of the various steps involved in the Mathematical Modeling Process? Solution. Translate: We translate problems into math every time we do a word problem. Equipment replacement, fixedcharge problems, and shortest path problems, can all be tricky because of this initial step of translating the problem into math. Solve/approximate: We have seen several different kinds of solving techniques: Dijkstra s algorithm, Kruskal s algorithm, etc. Interpret: Often the interpretation is quite obvious, but understanding if the solution is reasonable can be subtle. For example, if you are solving a diet problem with an IP and the solution tells you that you should eat primarily cookies every day, you should have the common sense to realize that maybe there is something wrong with your IP, or maybe some parameters or constraints need to be tuned. One helpful bit of information when using LPs is to look at which constraints are tight and interpret why these ones are tight and the others are not. Test and revise: In this phase you should use the intuition you gained in the interpretation phase to figure out how you should fine-tune your model. For example, if you have gained knowledge in the interpretation stage about which constraints in your LP are tight, maybe those are the constraints you should focus on. Linear Programs You should know all of the LP terminology we ve discussed, how to convert a word problem into a linear program, how to convert an LP into matrix form, how to sove a 2-dimensional LP graphically. Exercise 2. Leary Chemical manufactures three chemicals: A, B, and C. These chemicals are produced via two production processes: 1 and 2. Running process 1 for an hour costs $4 and yields 3 units of A, 1 of B, and 1 of C. Running process 2 for an hour costs $1 and produces 1 unit of A and 1 of B. To meet customer demands, at least 10 units of A, 5 of B, and 3 of C must be produced daily. Graphically determine a daily production plan that minimizes the cost of meeting Leary Chemical s daily demands. 1

Solution. Let x be the amount of time process 1 is run, and y be the amount of time process 2 is run. min 4x + y subject to 3x + y 10 x + y 5 x 3 y 0 This one is tricky to graph by hand, since the lines are fairly close together. You can figure out that 3x+y 10 is an unnecessary constraint without graphing, though, by observing that x + y 5 together with 2x 6 already imply that 3x + y 11, meaning that 3x + y 10 is unnecessary. On an exam, I would give you something easier to graph by hand, and then you might be required to sketch a graph of the feasible region. Here is what Desmos gives you. The dark green shaded region is the feasible region (restricted to y 0). You can figure out that the intersection of the two lines, (3, 2), is the optimum by comparing the slope of the isocost lines 4x + y = C with the slope of the line x + y = 5. Since the slope of the isocost line is 4, and the slope of the line x + y = 5 is 1, then since the isocost line is steeper, then the minimum must be attained at the higher vertex of the feasible region, which is the intersection of the lines x = 3 and x + y = 5. Therefore, process 1 should run for 3 hours and process 2 for 2 hours, resulting in a cost of $14. Exercise 3. For each of the following, determine the direction in which the objective function increases. Your answer should be a single vector. (a) 4x 1 x 2 (b) x 1 + 2x 2 (c) x 1 3x 2 (Big Hint: If the objective function can be written as c T x, then the direction of maximum increase is in the direction of the vector c. Think about how to justify this using the concept of a gradient from Calculus, or even just elementary geometry.) Solution. With the Big Hint in mind, then all we have to do is convert the coefficients into a vector, and we are done! The answers are (a) 4, 1, (b) 1, 2, and (c) 1, 3. In order to justify this, we can use the concept of the gradient from calculus. If f(x, y) is a function of two variables, then given a point (a, b), the gradient of f evaluated at (a, b) is denoted f (a,b), which is the vector 2

which points in the direction of the greatest increase of f starting from the point (a, b). In our case, f is a linear function. For example, for part (a) we have f(x 1, x 2 ) = 4x 1 x 2. Then the gradient does not depend on the point (a, b). It is the constant vector f f =, f = 4, 1. x 1 x 2 Exercise 4. Furnco manufactures desks and chairs. Each desk uses 4 units of wood, and each chair uses 3. A desk contributes $40 to profit, and a chair contributes $25. Marketing restrictions require that the number of chairs produced be at least twice the number of desks produced. If 20 units of wood are available, formulate an LP to maximize Furnco s profit. Then graphically solve the LP. Solution. Let x be the number of desks manufactured and y the number of chairs manufactured, then max 40x + 25y s.t. 4x + 3y 20 2x y x 0 If you compare the slope of the objective, which is 40/25 = 1.6, to the slope of the line 4x + 3y = 20, which is 4/3 = 1.3 3, the objective is steeper. Therefore, from the graph you can see that the optimum should occur at the intersection of the two lines 4x + 3y = 20 and 2x = y. Solving, you get that the optimum is obtained at (2, 4), with a maximum value of 180. Exercise 5. Graphically find all optimal solutions to the following LP: min x 1 x 2 s.t. x 1 + x 2 6 x 1 x 2 0 x 2 x 1 3 x 1, x 2 0 Solution. The two constraints x 1 x 2 0 and x 2 x 1 3 contradict each other. Therefore, the feasible region is empty. Therefore, there is no optimal solution to the LP. This problem was taken straight from a textbook, so I take no credit for the wording of the problem. Typically if I put a problem like this on an exam where there is no solution, I would phrase the question more like find all optimal solutions to the LP, or state that there is no optimal solution, so it doesn t sound so much like a trick question. However, I might phrase a question this way if there is a solution, so don t automatically assume the problem has no solution if you see a question worded like this. Graph Theory You should know all of the graph theory terminology, Held-Karp algorithm, Dijkstra s algorithm, Kruskal s algorithm, and applications of these algorithms to decision problems such as Equipment Replacement. Exercise 6. Run Dijkstra s algorithm on the following graph to find the shortest path from node 1 to node 5. 3

Solution. For this one, I ll just give the answer: The shortest path from 1 to 5 is 1 2 5 which has cost 14. The final l(v) values are l(1) = 0, l(2) = 2, l(3) = 7, l(4) = 6, and l(5) = 14. Typically on a Dijkstra s algorithm on an exam, I ll require that you also list the data of the set R and l(v) function at each step. Exercise 7. A library must build shelving to shelve 200 4-inch high books, 100 8-inch high books, and 80 12-inch high books. Each book is 0.5 inch thick. Shelving comes in three options: 4, 8 or 12 inches high, and the library must decide which of these kinds of shelves to build. For example, the library may build an 8-inch high shelf to store all books of height less than or equal to 8 inches, and a 12-inch high shelf to store all of the 12-inch books. Alternatively, a 12-inch high shelf might be built to store all books, so that the 4 and 8-inch shelving are not needed. The library believes it costs $2, 300 to build a shelf and that a cost of $5 per square inch is incurred for book storage. (Assume that the area required to store a book is given by height of storage area times book s thickness.) Formulate and solve a shortest-path problem that could be used to help the library determine how to shelve the books at minimum cost. (Hint: Have nodes 0, 4, 8, and 12, with c ij being the total cost of shelving all books of height > i and j on a single shelf.) Solution. Using the hint, we have that c 0,4 = 2300 + 200 5(4 0.5) = 4300 c 4,8 = 2300 + 100 5(8 0.5) = 4300 c 8,12 = 2300 + 80 5(12 0.5) = 4700 c 0,8 = 2300 + 300 5(8 0.5) = 8300 c 4,12 = 2300 + 180 5(12 0.5) = 7700 c 0,12 = 2300 + 380 5(12 0.5) = 13, 700 Using this data and running Dijkstra s algorithm on the resulting directed graph with edge costs, we find that the optimal solution is the path 0 4 12 with cost $12, 000. This path represents building a 4-inch shelf for all of the 4-inch books, and building a 12-inch shelf for all of the 8 and 12-inch books. 0-1 IPs You should be familiar with the various applications of 0-1 IPs to graph theory we have discussed. You should also be able to apply 0-1 IPs to various real-world applications, including knapsack problems (like on the homework), cargo loading, scheduling problems, fixed-charge problems, either-or constraints. Exercise 8. There are six cities (cities 1-6) in Kilroy County. The county must determine where to build fire stations. The county wants to build the minimum number of fire stations needed to ensure that at least one fire station is within 15 minutes (driving time) of each city. The times (in minutes) required to drive between the cities in Kilroy County are shown in the following table. Formulate an IP that will tell Kilroy how many fire stations should be built and where they should be located. Distance To From City 1 City 2 City 3 City 4 City 5 City 6 City 1 0 10 20 30 30 20 City 2 10 0 25 35 20 10 City 3 20 25 0 15 30 20 City 4 30 35 15 0 15 25 City 5 30 20 30 15 0 14 City 6 20 10 20 25 14 0 Solution. First, I would record which cities are within 15 minutes of each other: 4

City Cities which are 15 min away 1 1,2 2 1,2,6 3 3,4 4 3,4,5 5 4,5,6 6 2,5,6 Let x i be the binary variable which is 1 if and only if a fire station is built in City i. Then for each row in the table we have a constraint: min x 1 + x 2 + + x 6 s.t. x 1 + x 2 1 x 1 + x 2 + x 6 1 x 3 + x 4 1 x 3 + x 4 + x 5 1 x 4 + x 5 + x 6 1 x 2 + x 5 + x 6 1 x i {0, 1} Exercise 9. Ford has four automobile plants. Each is capable of producing the Taurus, Lincoln, or Escort, but it can only produce one of these cars. The fixed cost of operating each plant for a year and the variable cost of producing a car of each type at each plant are given in the table below. Ford faces the following restrictions: (a) Each plant can produce only one type of car. (b) The total production of each type of car must be at a single plant; that is, for example, if any Tauruses are made at plant 1, then all Tauruses must be made there. (c) If plants 3 and 4 are used, then plant 1 must also be used. Suppose that each year, Ford must produce exactly 500,000 of each type of car. Formulate an IP whose solution will tell Ford how to minimize the annual cost of producing cars. Variable Cost($) Plant Fixed Cost($) Taurus Lincoln Escort 1 7 billion 12,000 16,000 9,000 2 6 billion 15,000 18,000 11,000 3 4 billion 17,000 19,000 12,000 4 2 billion 19,000 22,000 14,000 Solution. This is probably the hardest problem on here because part (c) is hard to interpret in terms of an inequality. Also, it uses fixed-charge in an interesting way and it can be hard to figure out what the decision variables should be. Furthermore, I forgot to add the last two lines of the problem statement in the first version of this document (sorry!). Because of (a) and (b), our decision variables can be binary variables: y i,t which is 1 if and only if plant i produces Tauruses, y i,l which is 1 if and only if plant i produces Lincolns, and y i,e which is 1 if and only if plant i produces Escorts. Then we have the constraints y i,t + y i,l + y i,e 1 5

for each i since each plant can make at most one type of car. Furthermore, we have y 1,T + y 2,T + y 3,T + y 4,T = 1 since exactly one plant must produce Tauruses. Similarly for Lincolns and Escorts. Notice that the number of Tauruses made at plant i is 500, 000y i,t by our assumptions. Now let z i = y i,t + y i,l + y i,e for each i. Then z i is a binary variable which is 1 if and only if plant i is used. Then (c) is equivalent to the logical statement: We can accomplish this with the inequality If z 3 = 1 and z 4 = 1, then z 1 = 1. z 3 + z 4 1 z 1, since if z 3 = z 4 = 1, then this forces 1 z 1 so z 1 = 1. Otherwise, if one of z 3 or z 4 is zero, then it will not be a constraint on z 1, which is exactly what we wanted to encode. Finally, the objective function is min (7, 000, 000z 1 + 12 500, 000y 1,T + 16 500, 000y 1,L + 9 500, 000y 1,E ) + +(2, 000, 000z 4 + 19 500, 000y 4,T + 22 500, 000y 4,L + 14 500, 000y 4,E ) where here I have scaled everything to be in thousands of dollars (and hid the terms for plants 2 and 3). You can scale this down even more to min (70z 1 + 12 5y 1,T + 16 5y 1,L + 9 5y 1,E ) + (60z 2 + 15 5y 2,T + 18 5y 2,L + 11 5y 2,E ) +(40z 3 + 17 5y 3,T + 19 5y 3,L + 12 5y 3,E ) + (20z 4 + 19 5y 4,T + 22 5y 4,L + 14 5y 4,E ) Minimizing this objective subject to the previous constraints will minimize cost. Stochastic Processes You should know the basic statistics we have covered and basic probability terminology. You should know how to create a histogram, how to compute expected value, the definition and properties of normal distribution, Central Limit Theorem, and Markov Chains. Exercise 10. Now suppose you have a red, a green, and a blue six-sided die. Let R, G, and B be the discrete random variables which determine the face values of the red, green and blue dice, respectively. What is the sample space, probability density function and expected value of R + G + B? (Hint: If X and Y are discrete random variables with finite expected values, then it is not hard to show that E(X + Y ) = E(X) + E(Y ), the expected values add. ) Solution. Sample space is S = {3, 4,..., 18}. The probability density function for R + G + B is also symmetric, so it turns out you only have to calculate p(y) for 3 y 10. Furthermore you can calculate the probability density function of R + G + B by using the probability density function for R + G. For example, an outcome of 8 can be written as 7 + 1, 6 + 2, 5 + 3, 4 + 4, 3 + 5, or 2 + 6, where the first number in the sum is the result of adding together the first two dice, and the second numer is the value of the third roll. Then p(8) = (6/36)(1/6) + (5/36)(1/6) + (4/36)(1/6) + (3/36)(1/6) + (2/36)(1/6) + (1/36)(1/6) = (6 + 5 + 4 + 3 + 2 + 1)/216 = 21/216. Continuing in this way, after a little bit of calculation we get y 3 4 5 6 7 8 9 10 p(y) 1/216 3/216 6/216 10/216 15/216 21/216 25/216 27/216 6

so we can complete the table for 11,..., 18 as well by symmetry, y 11 12 13 14 15 16 17 18 p(y) 27/216 25/216 21/216 15/216 10/216 6/216 3/216 1/216 In order to compute the expected value, use the hint: E(R + G + B) = E(R) + E(G) + E(B) = 3E(R) = 3 3.5 = 10.5 Exercise 11. There is a dinner party where n people check their hats. The hats are mixed up during dinner, so that afterward each person receives a random hat. In particular, each person gets their own hat with probability 1/n. What is the expected number of people who get their own hat? (Hint: Use the fact that expected values add from the previous exercise.) Solution. The idea is to write the random variable for the number of people who get their own hat as a sum of variables. Consider the random variable Y to be the numer of people who get their own hat. Define the random variable X i to be 1 if the ith person gets their own hat, and 0 otherwise. Here, the state space for Y and the X i is the set of all permutations of the n people. Then we have Y = X 1 + X 2 + + X n. By the hint from the last exercise, we have that the expected number of people who get their own hat is E(Y) = E(X 1 ) + E(X 2 ) + + E(X n ) To calculate E(X i ), just write down the definition of expected value, E(X i ) = 0P (X i = 0) + 1P (X i = 1) = P (X i = 1) But since each person gets their own hat with probability 1/n, we have P (X i = 1) = 1/n, so E(X i ) = 1 n + 1 n + + 1 n = 1 where above, there are n many 1/n s in the sum. Therefore, the expected number of people who get their own hat back is 1. Exercise 12. Consider the following transition matrix of a time-independent Markov Chain, [ ] 0.3 0.7 P =. 0.9 0.1 (a) Draw the weighted directed graph associated to this Markov Chain. (b) Compute the two-step transition matrix. Solution. (a) 0.3 0.9 1 2 0.7 0.1 (b) P 2 = [ ] 0.09 + 0.63 0.21 + 0.07 = 0.27 + 0.09 0.63 + 0.07 [ 0.72 ] 0.28 0.36 0.7 7

Scheduling the Italian National Volleyball Tournament You should be able to define the keywords and terms in the article. I won t test you on your memory of the specifics in the article, but I may ask you to translate a verbal description of a constraint in the article into math, or something similar. The following is an example of the type of question that could appear on the midterm. Exercise 13. Recall from the article Scheduling the Italian National Volleyball Tournament that δi,j k is the decision variable with value 1 if and only if team i plays at home in slot k. The variable Hi k is defined to be a binary variable with value 1 if and only if team i plays at home in slot k, so its mathematical description is Hi k = j i δk i,j. The variable HHi k is defined to be a binary variable that states if team i plays at home in both slot k and k + 1. Write down a mathematical description of HHi k in terms of linear inequalities in the variables Hk i and Hk+1 i. (Big Hint: If x and y are 0-1 variables, in order to define a new 0-1 variable z which is equal to 1 if and only x = y = 1, simply add the constraints z x z y x + y 1 z to your list of constraints. Think about why these are the correct inequalities to write down.) Solution. Using the hint, all we have to do is replace x with H k i HHi k Hi k HHi k H k+1 i Hi k + H k+1 i 1 HHi k, y with Hk+1 i, and z with HH k i, This makes sense because if Hi k = H k+1 i = 1 (if we have a break HH), then the third inequality forces 1 + 1 1 HHi k so 1 HHk i so HHk i = 1. Also, the other two inequalities are trivially true. On the other hand, if Hi k = 0 (so we don t have a HH break), then the first inequality forces HHi k 0, so HHi k = 0. Also, the other two inequalities are trivially true. The same logic holds if H k+1 i = 0. 8