Home Work Questions

download Home Work Questions

of 23

description

Home Work Questions for Compiler Construction. These are the practice question.

Transcript of Home Work Questions

  • 5/21/2018 Home Work Questions

    1/23

    Chapter 01 introduction to operations research

    Note: ch#01 download from site: orimranshah.webs.com

    Problem Set 1.1A

    4. Amy, Jim, John, and Kelly are standing on the east bank of a river and wish to cross to the

    west side using a canoe. The canoe can hold at most two people at a time. Amy, being the

    most athletic, can row across the river in 1 minute. Jim, John, and Kelly would take 2, 5, and10 minutes, respectively. If two people are in the canoe, the slower person dictates the

    crossing time. The objective is for all four people to be on the other side of the river in theshortest time possible.

    (a) Identify at least two feasible plans for crossing the river (remember, the canoe is the

    only mode of transportation and it cannot be shuttled empty).(b) Define the criterion for evaluating the alternatives.

    *(c) What is the smallest time for moving all four people to the other side of the river?

    *5. In a baseball game, Jim is the pitcher and Joe is the batter. Suppose that Jim can

    throweither a fast or a curve ball at random. If Joe correctly predicts a curve ball, he canmaintaina .500 batting average, else if Jim throws a curve ball and Joe prepares for a fast

    ball,his batting average is kept down to .200. On the other hand, if Joe correctly predicts a

    fastball, he gets a .300 batting average; else his batting average is only .100.(a) Define the alternatives for this situation.

    (b) Define the objective function for the problem and discuss how it differs fromthefamiliar optimization (maximization or minimization) of a criterion.

    PROBLEM SET 2.1A

    1. For the Reddy Mikks model, construct each of the following constraints and express it

    with a linear left-hand side and a constant right-hand side:*(a) The daily demand for interior paint exceeds that of exterior paint by at least 1 ton.

    (b) The daily usage of raw material M2 in tons is at most 6 and at least 3.*(c) The demand for interior paint cannot be less than the demand for exterior paint.

    (d) The minimum quantity that should be produced of both the interior and the exterior

    paint is 3 tons.*(e) The proportion of interior paint to the total production of both interior and exterior

    paints must not exceed .5.

    2. Determine the bestfeasible solution among the following (feasible and infeasible)

    solutions of the Reddy Mikks model:(a) XI = 1, X2 = 4. (b) Xl = 2, X2 = 2. (c) XI = 3, x2 = 1.5.

    (d) X I = 2, X2 = 1. (e) XI = 2, X2 = -l.

    *3. For the feasible solution XI = 2, x2 = 2 of the Reddy Mikks model, determine the un-

    used amounts of raw materials Ml and M2.

  • 5/21/2018 Home Work Questions

    2/23

    Problem Set 2.2A

    1. Determine the feasible space for each of the following independent constraints, given

    that x1, x2 O.*(a) 3x1+ x2 6. (b) x12x2 5. (c) 2x13x2 12. *(d) x1- x20. (e) x1+ x20.

    Problem Set 3.1A

    *1. In the Reddy Mikks model (Example 2.2-1), consider the feasible solution Xl = 3 tons

    and X2 = 1 ton. Determine the value of the associated slacks for raw materials M1 and M2.

    2. In the diet model (Example 2.2-2), determine the surplus amount of feed consisting of500 Ib of corn and 600 lb of soybean meal.

    3. Consider the following inequality10x1 3x2 -5

    Show that multiplying both sides of the inequality by -1 and then converting theresultinginequality into an equation is the same as converting it first to an equation andthenmultiplying both sides by -1.

    Problem Set 3.2A

    1. Consider the following LP:

    Maximize z = 2x1 + 3x2subject to

    x1 + 3x2 6

    3x1 + 2x2 6x1, x2 0

    (a) Express the problem in equation form.

    (b) Determine all the basic solutions of the problem, and classify them asfeasible and infeasible.

    *(c) Use direct substitution in the objective function to determine the optimum basicfeasible solution.

    (d) Verify graphically that the solution obtained in (c) is the optimum LP Solution-

    hence,conclude that the optimum solution can be determined algebraically byconsideringthe basic feasible solutions only.

    *(e) Show how the infeasible basic solutions are represented on thegraphical solutionspace.

    2. Determine the optimum solution for each of the following LPs by enumerating all

    thebasic solutions.

    (b) Minimize z= x1+ 2x2 3x3 2x4

    subject tox1+ 2x2 3x3 + x4 = 4

    x1+ 2x2 + x3 + 2x4 = 4

  • 5/21/2018 Home Work Questions

    3/23

    *3. Show algebraically that all the basic solutions of the following LP are infeasible.

    Maximize z = x1+ x2subject to

    x1+ 2x2 62x1+ x2 16

    Problem Set 3.3A

    1. In Figure 3.3, suppose that the objective function is changed to Maximizez = 8x1+ 4x2

    Identify the path of the simplex method and the basic and nonbasic variables thatdefinethis path.

    2. Consider the graphical solution of the Reddy Mikks model given in Figure

    2.2. Identifythe path of the simplex method and the basic and nonbasic

    variables that define this path.

    *3. Consider the three-dimensional LP solution space in Figure 3.4, whose feasibleextremepoints areA, B, ... , and 1.(a) Which of the following pairs of corner points cannot represent successive

    simplex iterations:(A, B), (B, D), (E, H), and (A, I)? Explain the reason.

    (b) Suppose that the simplex iterations start at A and that the optimum occurs at H.

    Indicatewhether any of the following paths are not legitimate for the simplex algorithm,andstate the reason.

    (i)A-B-G-H.(ii)A-E-I-H.

    (iii)A-C-E-B-A-D-G-H.

    5. Consider the solution space in Figure 3.4, where the simplex algorithm starts at point

    A.Determine the entering variable in the first iteration together with its value and the

    improvementinz for each of the following objective functions:*(a) Maximize z = x1 2x2 + 3x3

    (b) Maximize z = 5x1 + 2x2 + 4x3(c) Maximize z = -2x1 + 7x2 + 2x3

    (d) Maximize z = x1 + x2 + x3

    Problem Set 3.3B

    2. Consider the following set of constraints:x1+2x2 +2x3 + 4x4 40

    2x1 -x2 +X3 +2x4 84x1 2x2 + x3 - x410

    Solve the problem for each of the following objective functions.

    (a) Maximizez =2x1+x2 3x3 + 5x4(b) Maximizez = 8x1+ 6x2 + 3x3 2x4

    (c) Maximizez = 3x1 -x2 + 3x3 + 4x4

  • 5/21/2018 Home Work Questions

    4/23

    (d) Minimizez = 5x1 - 4x2 + 6x3 8x4

    *3. Consider the following system of equations:

    x1+2x2 3x3 + 5x4 + x5=45x1-2x2 +6x4 + x6 =8

    2x1+ 3x2 2x3 + 3x4 + x7 =3- x1+x3 -2x4 +X8= 0

    x1,x2,.x80

    Letx5, x6,.. , and x8be a given initial basic feasible solution. Suppose that x1 becomesbasic.

    Which of the given basic variables must become nonbasic at zero level to guaranteethat allthe variables remain nonnegative, and what is the value of x1 in the new solution?Repeat

    this procedure forx2, x3, andx4.

    4. Consider the following LP:

    Maximizez = x3subject to

    5x1 + x2 =46x1 + x3 =83x1 + x4 =3

    x1,x2,x3,x4 0(a) Solve the problem by inspection (do not use the Gauss-Jordan row operations),

    andjustify the answer in terms of the basic solutions of the simplex method.

    (b) Repeat (a) assuming that the objective function calls for minimizingz = x1.

    5. Solve the following problem by inspection, and justify the method of solution in terms

    ofthe basic solutions of the simplex method.

    Maximizez = 5x16x2 + 3x3 5x4 + 12x5

    subject to

    x1 + 3x2 + 5x3 + 6x4 + 3x5 90

    x1,x2,x3,x4,x5 0(Hint:A basic solution consists of one variable only.)

    6. The following tableau represents a specific simplex iteration. All variables arenonnegative.The tableau is not optimal for either a maximization or a minimization

    problem.Thus, when a nonbasic variable enters the solution it can either increase ordecrease z orleave it unchanged, depending on the parameters of the entering nonbasic

    variable.

    Basic xlx2x3 x4x5 x6x7x8 Solution

    z 0 -5 04-1 -10 0 0620

    x8 0 3 0 -2 -3 -1 5 1 12

    x30 1 1 31 0 3 06

  • 5/21/2018 Home Work Questions

    5/23

    x11 -1006-40 0 0

    (a) Categorize the variables as basic and nonbasic and provide the current values of allthe

    variables.*(b)Assuming that the problem is of the maximization type, identify the nonbasic

    variablesthat have the potential to improve the value ofz. If each such variable entersthebasic solution, determine the associated leaving variable, if any, and the associatedchangeinz. Do not use the Gauss-Jordan row operations.

    (c) Repeat part (b) assuming that the problem is of the minimization type.

    (d) Which nonbasic variable(s) will not cause a change in the value of Z when selected toenter the solution?

    AFTER MID

    PROBLEM SET #3.4(a)

    3. In Example 3.4-1, identify the starting tableau for each of the following (independent)

    cases, and develop the associated z-row after substituting out all the artificial variables:*(a) The third constraint is Xl +2X2 >= 4.*(b) The second constraint is 4XI + 3X2 = 10

    X1,x2,x3 >=0

    Solve the problem for each of the following objective functions:(a) Maximize z = 2Xl + 3X2 - 5X3

    (b) Minimize z = 2XI + 3X2 - 5x3

    6) Consider the problemMaximize z= 2x1 + 4x2 + 4x3 + -3x4

    Subject to :Xl +X2 +X3 = 4

    Xl + 4x2 +X4 = 8

    X1,x2,x3,x4>=0

    The problem shows thatX3 andX4 can play the role of slacks for the two equations. Theydiffer from slacks in that they have nonzero coefficients in the objective function. We can

    useX3 andX4 as starting variable, but, as in the case of artificial variables, they must be

    substituted out in the objective function before the simplex iterations are carried out.Solve the problem withX3 andX4 as the starting basic variables and without using any

    artificial variables.

  • 5/21/2018 Home Work Questions

    6/23

    7. Solve the following problem usingX3 andX4 as starting basic feasible variables. As inProblem 6, do not use any artificial variables.

    Minimizez = 3xI +2X2 + 3X3subject to

    XI + 4X2 +X3 >=72x1 +X2 +X4 >= 10

    Xl> x2, x3, X4 >= 0

    8. Consider the problem

    Maximizez =Xl + 5X2 + 3X3

    subject toXl +2X2 +X3 = 3

    2Xi -X2 = 4X1,x2,x3>=0The variableX3 plays the role of a slack. Thus, no artificial variable is needed in the first

    constraint. However, in the second constraint, an artificial variable is needed. Use thisstarting solution (i.e.,X3 in the first constraint and R2 in the second constraint) to solve

    this problem.

    9. Show how the M-method will indicate that the following problem has no feasible

    solution.Maximizez =2x1 + 5X2

    subject to

    3XI +2x2 >= 62x1 +x2 =0

    PROBLEM SET 3.4(B) pg#111

    *1. In Phase I, if the LP is of the maximization type, explain why we do not maximize the

    sum of the artificial variables in Phase I.

    2. For each case in Problem 4, Set 3.4a, write the corresponding Phase I objective function.

    3. Solve Problem 5, Set 3.4a, by the two-phase method.

    4. Write Phase I for the following problem, and then solve (withTORA for convenience)

    to show that the problem has no feasible solution.

    Maximizez = 2Xl + 5X2subject to

    3x1 + 2x2 >=6

  • 5/21/2018 Home Work Questions

    7/23

    2x1 + 1x2 =0

    5. Consider the following problem:Maximizez =2xl +2x2 + 4x3

    subject to2Xl +X2 +X3

  • 5/21/2018 Home Work Questions

    8/23

    solutions.

    Maximizez =: Xl +2X2 + 3X3subject to

    Xl +2x2 + 3X3

  • 5/21/2018 Home Work Questions

    9/23

    (a) By inspecting the constraints, determine the direction (XI. X2, orX3) in which the

    solutionspace is unbounded.

    (b) Without further computations, what can you conclude regarding the optimum objectivevalue?

    PROBLEM SET 3.5 ( D )

    Consider the LP

    Maximizez = 3XI + 2Xl + 3X3

    Subject to:2Xl +X2 +X3 = 8

    X1,x1,x3>=0Use TORA's Iterations => M~ Meth6d to show that the optimal solution includes an artificial

    basic variable, but at zero level. Does the problem have afeasible optimal solution?

    Note: manual of sets 3.5 a,b c and d are available at image shop

    ******Ch 04 . Duality excluded from syllabus********

    Ch 05.transportation model

    Note: solve these problems by given mrthods (i)nwcm (ii) lcm (iii) vam

  • 5/21/2018 Home Work Questions

    10/23

  • 5/21/2018 Home Work Questions

    11/23

  • 5/21/2018 Home Work Questions

    12/23

    ******The assignment problem****

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    19

    The Assignment Model

    Characteristics

  • 5/21/2018 Home Work Questions

    13/23

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    1

    Assignment Model Example 1

    (1)

  • 5/21/2018 Home Work Questions

    14/23

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    22

    Assignment Model Example 2

    (1)

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    23

    Assignment Model Example 3

    (1)

  • 5/21/2018 Home Work Questions

    15/23

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    24

    Assignment Model Example 4

    (1)

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    25

    Assignment Model Example 4

    (2)

  • 5/21/2018 Home Work Questions

    16/23

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    26

    Assignment Model Example

    (3)

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    27

    Assignment Model Example

    (4)

  • 5/21/2018 Home Work Questions

    17/23

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    28

    Assignment Model Example 5(1)

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    30

    Assignment Model Example6(1)(minimize)

  • 5/21/2018 Home Work Questions

    18/23

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    31

    Assignment Model Example6(2)(minimize)

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    32

    Assignment Model Example6(3)(minimize)

  • 5/21/2018 Home Work Questions

    19/23

    2007/08, Sami Fethi, EMU, All Right Reserved.Operations Research

    Ch 6: Transportation and Assignment

    33

    Assignment Model Example6(4)(minimize)

    Q.No. Solve the following assignment problem using Hungarian Algorithm in order to

    maximize the efficiency.J-1 J-2 J-3 J-4 J-5

    M-1 5 6 8 10 12

    M-2 4 8 14 16 11

    M-3 3 2 8 7 5

    M-4 4 6 9 7 11

    M-5 12 8 6 7 4

    PROBLEM SET 6.1(a)

    *1. For each network in Figure 6.5 determine (a) a path, (b) a cycle, (c) a tree, and (d) a

    spanning

    tree.

    2. Determine the sets N andA for the networks in Figure 6.5.

    3. Draw the network defined by

    N = {1,2,3,4,5,6}A = {{1,2),(1,5), (2,3), (2,4),(3,4), (3,5), (4,3),(4,6), (5,2),(5,6)}

  • 5/21/2018 Home Work Questions

    20/23

    *4. Consider eight equal squares arranged in three rows, with two squares in the first row,

    fOUT inthe second, and two in the third.The squares of each row are arranged symmetrically about

    the vertical axis. It is desired to fill the squares with distinct numbers in the range 1through 8 so that no two adjacent vertical, horizontal, or diagonal squares hold consecutive

    numbers.Use some form of a network representation to find the solution in a systematic way.

    5. Three inmates escorted by 3 guards must be transported by boat from the mainland to a

    penitentiary island to serve their sentences. The boat cannot transfer more than twopersons in either direction.The inmates are certain to overpower the guards if they

    outnumber them at any time. Develop a network model that designs the boat trips in amanner that ensures a smooth transfer of the inmates.

    PROBLEM SET 6.2(a)

    EXAMPLE 6.2-11) Solve Example 6.2-1 starting at node 5 (instead of node 1), and show that the

    algorithm

    produces the same solution.2)

    Determine the minimal spanning tree of the network of Example 6.2-1 under each of

    the

    following separate conditions:*(a) Nodes 5 and 6 are linked by a 2-mile cable.

    (b) Nodes 2 and 5 cannot be linked.(c) Nodes 2 and 6 are linked by a 4-mile cable

    (d) The cable between nodes 1 and 2 is 8 miles long.

    (e) Nodes 3 and 5 are linked by a 2-mile cable.(f) Node 2 cannot be linked directly to nodes 3 and 5.

    PROBLEM SET 6.3 pg # 243-246

    EXAMPLE # 6.3-1 , 6.3-2 , 6.3-3

    PROBLEM SET 6.5(A)

    EXAMPLE 6.5-1

    6. The activities in the following table describe the construction of a new house. Constructthe associated project network.

  • 5/21/2018 Home Work Questions

    21/23

    7. A company is in the process of preparing a budget for launching a new product. Thefollowing table provides the associated activities and their durations. Construct the project

    network.

  • 5/21/2018 Home Work Questions

    22/23

    8. The activities involved in a candlelight choir service are listed in the following table.

    Construct the project network.

    9. The widening of a road section requires relocating ("reconductoring") 1700 feet of 13.8-kV

    overhead primary line. The following table summarizes the activities of the project.

    Construct the associated project network.

  • 5/21/2018 Home Work Questions

    23/23

    1O. The following table gives the activities for buying a new car. Construct the project

    network.