1、数学建模实验四数学建模实验四(整数规划和对策论模型)基本实验1.遗嘱问题解答:设长子、次子、三子得到的骆驼数分别为:X1,X2,X3,则目标函数为:X1+X2+X3+1约束条件:X1=(X1+X2+X3+1)/2X2=(X1+X2+X3+1)/3X3=(X1+X2+X3+1)/9X1,X2,X3为整数,且(X1+X2+X3+1)为奇数。要想求出本题的可行解,则目标函数取得最小。使用Lingo建模:运行结果:Global optimal solution found. Objective value: 27.00000 Objective bound: 27.00000 Infeasibilit
2、ies: 0.000000 Extended solver steps: 0 Total solver iterations: 3 Model Class: PILP Total variables: 4 Nonlinear variables: 0 Integer variables: 4 Total constraints: 5 Nonlinear constraints: 0 Total nonzeros: 16 Nonlinear nonzeros: 0 Variable Value Reduced Cost X1 14.00000 1.000000 X2 9.000000 1.000
3、000 X3 3.000000 1.000000 Y 13.00000 0.000000 Row Slack or Surplus Dual Price 1 27.00000 -1.000000 2 1.000000 0.000000 3 0.000000 0.000000 4 0.000000 0.000000 5 0.000000 0.000000由运行结果可得:这个酋长的骆驼数量为27只,长子得到14只,次子得到9只,三子得到3只。2.固定费用解答:设Xi表示使用第i家公司的业务,i=1,2,3。则目标函数为:X1*(16+200*0.25)+X2*(25+200*0.21)+X3*(1
4、8+200*0.22)约束条件:X1+X2+X3=1X1,X2,X3为整数。最优解使得目标函数取得最小。使用Lingo建模:运行结果:Global optimal solution found. Objective value: 62.00000 Objective bound: 62.00000 Infeasibilities: 0.000000 Extended solver steps: 0 Total solver iterations: 0 Model Class: PILP Total variables: 3 Nonlinear variables: 0 Integer vari
5、ables: 3 Total constraints: 2 Nonlinear constraints: 0 Total nonzeros: 6 Nonlinear nonzeros: 0 Variable Value Reduced Cost X1 0.000000 66.00000 X2 0.000000 67.00000 X3 1.000000 62.00000 Row Slack or Surplus Dual Price 1 62.00000 -1.000000 2 0.000000 0.000000由运行结果可得:张先生应该选择C家电话公司,此时每月电话公司最少为62元。3.并联系
6、统的可靠性解答:设Xij表示使用第i个部件并联j个元件,i=1,2,3;j=1,2,3。则目标函数为:(X11*0.6+X12*0.8+X13*0.9)*(X21*0.7+X22*0.8+X23*0.9)*(X31*0.5+X32*0.7+X33*0.9)约束条件:X11+X12+X13=1X21+X22+X23=1X31+X32+X33=11*X11+2*X12+3*X13+3*X21+5*X22+6*X23+2*X31+4*X32+5*X33=10Xij为整数。最优解使得目标函数取得最大。使用Lingo建模:运行结果:Local optimal solution found. Object
7、ive value: 0.5040000 Objective bound: 0.5040000 Infeasibilities: 0.000000 Extended solver steps: 0 Total solver iterations: 16 Model Class: PINLP Total variables: 9 Nonlinear variables: 9 Integer variables: 9 Total constraints: 5 Nonlinear constraints: 1 Total nonzeros: 27 Nonlinear nonzeros: 9 Vari
8、able Value Reduced Cost X11 0.000000 0.3966667E-01 X12 1.000000 -0.1166667E-01 X13 0.000000 0.000000 X21 1.000000 -0.7733333E-01 X22 0.000000 0.000000 X23 0.000000 0.2666667E-02 X31 0.000000 0.000000 X32 0.000000 0.3733333E-01 X33 1.000000 0.000000 Row Slack or Surplus Dual Price 1 0.5040000 1.00000
9、0 2 0.000000 0.3430000 3 0.000000 0.2026667 4 0.000000 0.1306667 5 0.000000 0.7466667E-01由运行结果可得:部件1并联两个元件,部件2并联1个元件,部件3并联3个元件,最终的可靠性为0.504。4.选课策略解答:记i=1,2,9表示9门课程的编号。设表示第i门课程选修,表示第i门课程不选。问题的目标为选修的课程总数最少,即 约束条件:每个人最少要学习2门数学课,则 每个人最少要学习3门运筹学课 ,则 每个人最少要学习2门计算机课,则有: “最优化方法”的先修课是“数学分析”和“线性代数”,有:“数据结构”的先
10、修课程是“计算机编程”,有: “应用统计”的先修课是“数学分析”和“线性代数”,有: “计算机模拟”的先修课程是“计算机编程”,有: “预测理论”的先修课程是“应用统计”,有: “数学试验”是“数学分析”和“线性代数”,有: 使用Lingo建模:运行结果: Global optimal solution found. Objective value: 6.000000 Objective bound: 6.000000 Infeasibilities: 0.000000 Extended solver steps: 0 Total solver iterations: 0 Model Clas
11、s: PILP Total variables: 9 Nonlinear variables: 0 Integer variables: 9 Total constraints: 13 Nonlinear constraints: 0 Total nonzeros: 41 Nonlinear nonzeros: 0 Variable Value Reduced Cost C( 1) 5.000000 0.000000 C( 2) 4.000000 0.000000 C( 3) 4.000000 0.000000 C( 4) 3.000000 0.000000 C( 5) 4.000000 0.
12、000000 C( 6) 3.000000 0.000000 C( 7) 2.000000 0.000000 C( 8) 2.000000 0.000000 C( 9) 3.000000 0.000000 X( 1) 1.000000 1.000000 X( 2) 1.000000 1.000000 X( 3) 1.000000 1.000000 X( 4) 0.000000 1.000000 X( 5) 0.000000 1.000000 X( 6) 1.000000 1.000000 X( 7) 1.000000 1.000000 X( 8) 0.000000 1.000000 X( 9)
13、 1.000000 1.000000 Row Slack or Surplus Dual Price 1 6.000000 -1.000000 2 1.000000 0.000000 3 0.000000 0.000000 4 1.000000 0.000000 5 0.000000 0.000000 6 0.000000 0.000000 7 1.000000 0.000000 8 1.000000 0.000000 9 1.000000 0.000000 10 0.000000 0.000000 11 0.000000 0.000000 12 0.000000 0.000000 13 0.
14、000000 0.000000由运行结果可得:。即选修课程为:数学分析,线性代数.最优化方法,计算机模拟,计算机编程,数学试验。5.最小覆盖解答:设Xi表示社区i被覆盖,i=1,15;Yj表示建造发射台i,i=1,2,3,4,5,6,7。发射台与覆盖社区的关系如下表所示:1234567891011121314151是是2是是是3是是是是4是是是是5是是是是6是是是是是7是是是是目标函数为:4*X1+3*X2+10*X3+14*X4+6*X5+7*X6+9*X7+10*X8+13*X9+11*X10+6*X11+12*X12+7*X13+5*X14+16*X15约束条件:3.6*Y1+2.3*Y
15、2+4.1*Y3+3.15*Y4+2.8*Y5+2.65*Y6+3.1*Y7=X1;Y1+Y2=X2;Y2=X3;Y4=X4;Y2+Y6=X5;Y4+Y5=X6;Y3+Y5+Y6=X7;Y4=X8;Y3+Y4+Y5=X9;Y3+Y6=X10;Y5=X11;Y6+Y7=X12;Y7=X13;Y6+Y7=X14;Y7=X15;Xi,Yj为整数。最优解使得目标函数取得最大。使用Lingo建模:运行结果:Global optimal solution found. Objective value: 129.0000 Objective bound: 129.0000 Infeasibilities:
16、0.000000 Extended solver steps: 0 Total solver iterations: 0 Model Class: PILP Total variables: 22 Nonlinear variables: 0 Integer variables: 22 Total constraints: 17 Nonlinear constraints: 0 Total nonzeros: 63 Nonlinear nonzeros: 0 Variable Value Reduced Cost X1 0.000000 -4.000000 X2 1.000000 -3.000
17、000 X3 1.000000 -10.00000 X4 1.000000 -14.00000 X5 1.000000 -6.000000 X6 1.000000 -7.000000 X7 1.000000 -9.000000 X8 1.000000 -10.00000 X9 1.000000 -13.00000 X10 1.000000 -11.00000 X11 1.000000 -6.000000 X12 1.000000 -12.00000 X13 1.000000 -7.000000 X14 1.000000 -5.000000 X15 1.000000 -16.00000 Y1 0
18、.000000 0.000000 Y2 1.000000 0.000000 Y3 0.000000 0.000000 Y4 1.000000 0.000000 Y5 1.000000 0.000000 Y6 1.000000 0.000000 Y7 1.000000 0.000000 Row Slack or Surplus Dual Price 1 129.0000 1.000000 2 1.000000 0.000000 3 0.000000 0.000000 4 0.000000 0.000000 5 0.000000 0.000000 6 0.000000 0.000000 7 1.0
19、00000 0.000000 8 1.000000 0.000000 9 1.000000 0.000000 10 0.000000 0.000000 11 1.000000 0.000000 12 0.000000 0.000000 13 0.000000 0.000000 14 1.000000 0.000000 15 0.000000 0.000000 16 1.000000 0.000000 17 0.000000 0.000000由运行结果可得:需要建造的发射塔为2,4,5,6,7,只有1社区无法覆盖,覆盖最多人口为129千人。6.对策问题1解答:甲方赢的矩阵为:甲乙石头剪刀布石头0
20、3-1剪刀-302布1-20使用Lingo建模:运行结果:Global optimal solution found. Objective value: 0.000000 Infeasibilities: 0.000000 Total solver iterations: 4 Model Class: LP Total variables: 4 Nonlinear variables: 0 Integer variables: 0 Total constraints: 7 Nonlinear constraints: 0 Total nonzeros: 19 Nonlinear nonzero
21、s: 0 Variable Value Reduced Cost W 0.000000 0.000000 X( 1) 0.3333333 0.000000 X( 2) 0.1666667 0.000000 X( 3) 0.5000000 0.000000 A( 1, 1) 0.000000 0.000000 A( 1, 2) 3.000000 0.000000 A( 1, 3) -1.000000 0.000000 A( 2, 1) -3.000000 0.000000 A( 2, 2) 0.000000 0.000000 A( 2, 3) 2.000000 0.000000 A( 3, 1)
22、 1.000000 0.000000 A( 3, 2) -2.000000 0.000000 A( 3, 3) 0.000000 0.000000 Row Slack or Surplus Dual Price 1 0.000000 1.000000 2 0.000000 -0.3333333 3 0.000000 0.000000 4 0.000000 -0.1666667 5 0.000000 0.000000 6 0.000000 -0.5000000 7 0.000000 0.000000同理,列出乙方赢的矩阵为:乙甲石头剪刀布石头03-1剪刀-302布1-20使用Lingo建模:运行
23、结果: Global optimal solution found. Objective value: 0.000000 Infeasibilities: 0.000000 Total solver iterations: 4 Model Class: LP Total variables: 4 Nonlinear variables: 0 Integer variables: 0 Total constraints: 5 Nonlinear constraints: 0 Total nonzeros: 13 Nonlinear nonzeros: 0 Variable Value Reduc
24、ed Cost V 0.000000 0.000000 Y( 1) 0.3333333 0.000000 Y( 2) 0.1666667 0.000000 Y( 3) 0.5000000 0.000000 A( 1, 1) 0.000000 0.000000 A( 1, 2) 3.000000 0.000000 A( 1, 3) -1.000000 0.000000 A( 2, 1) -3.000000 0.000000 A( 2, 2) 0.000000 0.000000 A( 2, 3) 2.000000 0.000000 A( 3, 1) 1.000000 0.000000 A( 3,
25、2) -2.000000 0.000000 A( 3, 3) 0.000000 0.000000 Row Slack or Surplus Dual Price 1 0.000000 -1.000000 2 0.000000 0.3333333 3 0.000000 0.1666667 4 0.000000 0.5000000 5 0.000000 0.000000由计算结果可知,甲乙相同,均需要以1/3的概率出石头,1/6的概率出剪刀,1/2的概率出布,最后的结局是平局。7.对策问题2解答:由题意知,对于甲,有2种策略。用甲1表示甲的宣称与所抛掷硬币面相同,甲2表示甲的宣称与所抛掷硬币面不同
26、。对于乙,也有2种策略。用乙1表示猜同意,乙2表示猜不同意。则甲乙两人采用不同策略的输赢情况如下矩阵所示:乙1(猜同意) 乙2(猜不同意) 甲1(宣称与实际相符) (2,5) (5.2) 甲2(宣称与实际不符) (8,3) (3,8) 那么,甲的赢得矩阵为 乙的赢得矩阵为使用Lingo建模:运行结果:Feasible solution found. Infeasibilities: 0.000000 Total solver iterations: 21 Model Class: NLP Total variables: 6 Nonlinear variables: 4 Integer var
27、iables: 0 Total constraints: 9 Nonlinear constraints: 2 Total nonzeros: 26 Nonlinear nonzeros: 8 Variable Value V1 4.250000 V2 4.250000 X( 1) 0.6250000 X( 2) 0.3750000 Y( 1) 0.2500000 Y( 2) 0.7500000 A( 1, 1) 2.000000 A( 1, 2) 5.000000 A( 2, 1) 8.000000 A( 2, 2) 3.000000 B( 1, 1) 5.000000 B( 1, 2) 2
28、.000000 B( 2, 1) 3.000000 B( 2, 2) 8.000000 Row Slack or Surplus 1 0.000000 2 0.000000 3 0.000000 4 0.000000 5 0.000000 6 0.000000 7 0.000000 8 0.000000由计算结果可知,甲以0.625的概率出甲对策1(宣称与实际相符),以0.375的概率出甲对策2(宣称与实际不符),乙以0.25的概率出乙对策1(猜同意),以0.75的概率出乙对策2(猜不同意),甲乙的赢得值相同,v1=v2=4.25。加分实验(乒乓球团体赛上场队员排序)解:(该题不会,参考别人的答案,看懂了思路)(1)计算在三局两胜的比赛中甲队运动员获胜的概率表格两队比赛中,甲队运动员获胜的概率队员B1B2B3A10.500.570.65A20.430.500.57A30.350.430.50甲队与乙队各有六种对策:a1:A1 A2 A3 A1 A2 ; b1: B1 B 2 B 3 B 1 B 2a2:A1 A3 A2 A1 A3 ; b2: B1 B3 B2 B 1 B 3a3:A2 A1 A3 A2 A1
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1