Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MatLab Programming You need to use Linear Programming in MatLab to solve this. P

ID: 3833928 • Letter: M

Question

MatLab Programming

You need to use Linear Programming in MatLab to solve this. Please follow directions precisely

The Texas Poker Company assembles three different poker sets. Each Royal Flush (R) poker set contains 1000 poker chips, 4 decks of cards, 10 dice, and 2 dealer buttons. Each Deluxe Diamond (D) poker set contains 600 poker chips, 2 decks of cards, 5 dice, and one dealer button. The Full House poker (H) set contains 301 poker chips, 3 decks of cards, 3 dice, and one dealer button. The Texas Poker Company has 2, 800,000 poker chips, 10,000 decks of cards, 25,000 dice, and 6000 dealer buttons in stock. They earn a profit of $38 for each Royal Flush poker set, $22 for each Deluxe Diamond poker set, and $12 for each Full Mouse poker set. How many of each type of poker set (N_R, N_d, and N_F) should they assemble to maximize the profit? What is the maximum profit (p)? Setup the system of equations for this optimization problem: max p^T x under the constraints {Ax lessthanorequalto b A_eq x = b_eq L_b lessthanorequalto x lessthanorequalto U_b where x = [N_R, N_D, N_H]^T, p(N_R, N_D, N_H)=p^T x is the profit function, and p is a 3 times 1 column vector; A and A_eq are some matrices (may not be square); b, b_eq, and U_b are some column vectors. Arrange the equations such that the right hand sides (i.e. b and/or b_eq) are in the descending order. Among p, A, A_eq, b, b_eq, L_b, and U_b, not all of them will be used in the optimization (i.e. some of them are empty). (a) For those non-empty matrices/vectors, append column-wise (i.e. if a is an n times 1 column vector and B is an n times m matrix, append [a B] to become an n times (m+1) matrix), in the following order, A, A_eq, b, and b_eq into a matrix and save this matrix in A4.dat using the "save -ascii" command. (b) Similarly, append column-wise the non-empty members of p, L_b, and U_b into a matrix and save this matrix in A5.dat using the "save -ascii" command. (c) Solve the system using linprog. Round off N_R, N_D, N_F, and p to the nearest integers. Save [N_R, N_D, N_H, p]^T as a column vector in A6.dat using the "save -ascii" command.

Explanation / Answer

Linear programming (LP),involves minimizing or maximizing a linear objective function subject to bounds, linear equality, and inequality constraints.

Linear programming is the mathematical problem of finding a vector xx that minimizes the function:

minx{fTx}

Subject to the contraints:

                     Axb (inequality constraint)

                     Aeqx=beq (equality constraint)

                     lbxub (bound constraint)

The following algorithms are commonly used to solve linear optimization problems:

Active-set: Active-set algorithm is used to solve medium-scale linear programming problems. It minimizes the objective of the linear optimization problem at each iteration over the active set until it reaches a solution.

Simplex: This is also used to solve medium-scale linear programming problems. Simplex algorithm uses a systematic procedure for generating and testing candidate vertex solutions to a linear program. The simplex algorithm and the related dual-simplex algorithm are the most widely used algorithms for linear programming.

                           If any one of these algorithms fail to solve a linear programming problem, then the problem at hand is a large scale problem. Moreover, a linear programming problem with several thousands of variables along with sparse matrices is considered to be a large-scale problem. However, if coefficient matrices of your problem have a dense matrix structure, then linprog.m assumes that your problem is of medium-scale. By default, the parameter ’LargeScale’ is always ’on’. When ’LargeScale’ is ’on’, then linprog.m uses the primal-dual interior point algorithm.

Interior point: Uses a primal-dual predictor-corrector algorithm and is especially useful for large-scale linear programs that have structure or can be defined using sparse matrices.

Let the no. of sets of Royal Flush = X1

Deluxe Diamond = X2

Full House = X3

From the details given in the question, We have to maximixe profit, say Z,

which is given by Z = 38X1 + 22X2 + 12X3