<jupyter_start><jupyter_text>Excerpted from: <NAME> and <NAME>, Introduction to Linear Optimization, Athena Scientific, 1997, Exercise 5.8. We thank the authors for permitting us to use this problem.A pottery manufacturer can make four different types of dining room service sets: English, Currier, Primrose, and Bluetail. Furthermore, Primrose can be made by two different methods, labeled 1 and 2. Each set uses clay, enamel, dry room time, and kiln time, and results in a product shown in the table below. The rows correspond to different products abbreviated as below. [1]- E: Units English- C: Units Currier- P1: Units Primrose via Method 1- P2: Units Primrose via Method 2- B: Units BluetailThe resource constraints are on- Clay- Enamel- Dry room usage- Kiln- PrimroseHint: It must be the case that the Primrose created by method 1 and 2 must be equal, and should be reflected in one of the constraints.|                 	| E  	| C   	| P1 	| P2 	| B  	| Total 	||-----------------	|----	|-----	|----	|----	|----	|-------	|| Clay(lbs)       	| 10 	|  15 	| 10 	| 10 	| 20 	|   130 	|| Enamel(lbs)     	|  1 	|   2 	|  2 	|  1 	|  1 	|    13 	|| Dry room(hours) 	|  3 	|   1 	|  6 	|  6 	|  3 	|    45 	|| Kiln(hours)     	|  2 	|   4 	|  2 	|  5 	|  3 	|    23 	|| Profit          	| 51 	| 102 	| 66 	| 66 	| 89 	|       	|Assuming that the number of dining room service sets of each type can be fractional, formulate the product maximization problem of the manufacturer as an LP. Then click below to reveal the formulation. (This part counts for 0 points.)  Formulation $$\left.\begin{array}{rrcl} \max & z=51E + 102C + 66P_1 + 66P_2 +89B \\                \text {s.t.:} & & & \\                & 10E+15C+10P_1+10P_2+20B \leq 130 \\.& E+2C+2P_1+P_2+B \leq 13  \\& 3E+C+6P_1+6P_2+3B \leq 45 \\ &  2E+4C+2P_1+5P_2+3B \leq 23\\&  P_1-P_2 = 0 \\&  E,C,P_1,P_2, B  \geq 0 \\                \end{array}\right\}$$<jupyter_code>using JuMP
# Define model
m = Model()

@variables m begin
    E  >= 0
    C  >= 0
    P1 >= 0
    P2 >= 0
    B  >= 0
end

@constraints m begin
    10E + 15C + 10P1 + 10P2 + 20B <= 130
      E +  2C +  2P1 +   P2 +   B <= 13 
     3E +   C +  6P1 +  6P2 +  3B <= 45 
     2E +  4C +  2P1 +  5P2 +  3B <= 23
                  P1 -   P2       == 0
end

@objective(m, Max,  51E + 102C + 66P1 + 66P2 + 89B)

solve(m)

println("Optimal Profit: ", getobjectivevalue(m))
println("English dining service set produced: ", getvalue( E))
println("Currier dining service set produced: ",getvalue( C))
println("Primrose via method 1 dining service set produced: ",getvalue(P1))
println("Primrose via method 2 dining service set produced: ",getvalue(P2))
println("Bluetail dining service set produced: ",getvalue( B))<jupyter_output>Optimal Profit: 649.0
English dining service set produced: 0.0
Currier dining service set produced: 2.0
Primrose via method 1 dining service set produced: -0.0
Primrose via method 2 dining service set produced: 0.0
Bluetail dining service set produced: 5.0<jupyter_text>Writing the LP in "dining.lp" file<jupyter_code>writeLP(m, "dining.lp")
!less "dining.lp"
!glpsol --cpxlp dining.lp --ranges dining.sen
!less "dining.sen"<jupyter_output>GLPK 4.60 - SENSITIVITY ANALYSIS REPORT                                                                         Page   1

Problem:    
Objective:  obj = 649 (MAXimum)

   No. Row name     St      Activity         Slack   Lower bound       Activity      Obj coef  Obj value at Limiting
                                          Marginal   Upper bound          range         range   break point variable
------ ------------ -- ------------- ------------- -------------  ------------- ------------- ------------- ------------
     1 c1           NU     130.00000        .               -Inf       86.25000      -1.42857     586.50000 VAR5
                                           1.42857     130.00000      153.33333          +Inf     682.33333 VAR2

     2 c2           BS       9.00000       4.00000          -Inf        6.50000     -28.20000     395.20000 c4
                                            .           13.00000       11.50000      25.00000     874.00000 c1

     3 c3           BS     [...]
{'fraction_non_alphanumeric': 0.12980195657361013, 'fraction_numerical': 0.08088761632068718, 'mean_word_length': 1.7080103359173127, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '201647', 'license': 'MIT', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1367, 'n_words': 473, 'path': 'week05/Problem 2 - Dining Set Problem.ipynb', 'repo_name': 'infimath/optimization-method', 'size': '4215'}