(*PROBLEM 1*)
(*x=Machines A;  y=Machines B*)

cx=15;cy=20;
constraints1=30x+50y≥320&&x+2y≤12&&x≥0&&y≥0;
feasible1=RegionPlot[constraints1,{x,0,13},{y,0,4.5},PlotPoints->250]

Manipulate[Show[feasible1,Plot[c/cy-cx/cy x,{x,0,12},PlotRange->{0,5},PlotStyle->{Thick,Black}]],{{c,50},0,150}]

Minimize[{cx x+cy y,constraints1},{x,y}]

lines1=Plot[Table[c/cy-cx/cy x,{c,0,140,10}],{x,0,12},PlotStyle->Black];
opt1=Plot[c/cy-cx/cy x/.c->140,{x,0,12},PlotStyle->Red];
Show[feasible1,lines1,opt1]

sol=Solve[30 x+50 y==320&&x+2 y==12]
cx x+cy y/.sol

(*PROBLEM 2*)
(*x=Palium;  y=Timade*)

cx=0.4;cy=0.3;
constraints2=4x+2y≥10&&0.5x+0.5y≤2&&x≥0&&y≥0;
feasible2=RegionPlot[constraints2,{x,0,5},{y,0,5},PlotPoints->100]

Manipulate[Show[feasible2,Plot[c/cy-cx/cy x,{x,0,5},PlotRange->{0,5},PlotStyle->{Thick,Black}]],{{c,0.5},0,4}]

Minimize[{cx x+cy y,constraints2},{x,y}]

lines2=Plot[Table[c/cy-cx/cy x,{c,0,1,.2}],{x,0,5},PlotStyle->Black];
opt2=Plot[c/cy-cx/cy x/.c->1,{x,0,5},PlotStyle->Red];
Show[feasible2,lines2,opt2]

(*PROBLEM 3*)

constraints3=x+y+z≤12&&6x+6y+2z≤48&&36x+24y+18z≤360&&x≥0&&y≥0&&z≥0;
feasible3=RegionPlot3D[constraints3,{x,0,10},{y,0,10},{z,0,15},PlotPoints->100]

Manipulate[Show[feasible3,Plot3D[(1/20) (c-40 x-30 y),{x,0,10},{y,0,10},PlotRange->{0,15},PlotStyle->{Thick,Black,Opacity[0.5]},PlotPoints->100]],{{c,500},0,800}]

Maximize[{40 x+30 y+20z,constraints3},{x,y,z}]

Table[(1/20) (c-40 x-30 y),{c,760,360,-100}]

planes3=Plot3D[Table[(1/20) (c-40 x-30 y),{c,760,460,-100}],{x,0,10},{y,0,10},PlotRange->{0,15},PlotStyle->{Thick,Black,Opacity[0.4]},PlotPoints->100];
opt3=Plot3D[(1/20) (360-40 x-30 y),{x,0,10},{y,0,10},PlotRange->{0,15},PlotStyle->{Thick,Red,Opacity[0.8]},PlotPoints->100];
Show[feasible3,planes3,opt3]