租房买房买生意上iU91
12
返回列表
楼主: rose_1126
打印 上一主题 下一主题

谁能帮忙解答这道数学题

[复制链接]   [推荐给好友]
11#
发表于 2005-11-24 02:35 | 只看该作者
Post by sino000
No. There is a unique solution to this problem conditioned on the maximal revenue, which can only be achieved with the largest Y.

That means the larger Y, the larger the revenue. The maximal revenue corresponds to the largest value of Y, which is located at the top in the green shadow area.

It should be pointed out that each point in the green area, including the three edges of the triangle, satisfies all the conditions except for the maximal revenue condition, which can only be satisfied by the top point corresponding to the unique solution.

40*28+60*14=1960
40*40+60*6=1960
40*49+60*0=1960
计算机要从娃娃抓起
回复 支持 反对

使用道具 举报

12#
发表于 2005-11-24 08:44 | 只看该作者

All possible solutions

I tried to write C++ code to calculate all possible solutions. I find that there are exactly 7 solutions. The maximam value is 1960, and all possible maximum points are (X,Y)=(28,14), (31,12), (34,10), (37,8), (40,6), (43,4), (46,2).
I give two paragraphs of code. The first one is find the maximum value is 1960. The second one is find all possible solutions that have value 1960.

//Code 1
#include <iostream.h>
void main()
{
int X;
int Y;
int myMax;
int tempMax;

int Xup=197; // maximum integer number of X that satisfies X+3Y<=200 (or 2X+3Y<=98) with integer Y>0

int Yup=32;// maximum integer number of Y that satisfies 2X+3Y<=98 (or  X+3Y<=200) with integer X>0
for (int i=1; i<=Xup; i++)
{
  for(int j=1; j<=Yup;j++)
  {
   if(2*i+3*j<=98 && i+3*j<=200 && i>=2*j)
   {
      myMax=40*i+60*j;
         
      if(myMax>tempMax)   
        tempMax=myMax;
   
   }  
  }
}
cout<<"Max="<<tempMax<<endl;
}

/////////////////////////////
//Code 2
#include <iostream.h>
void main()
{
int myMax;
int Xup=197;
int Yup=32;
for (int i=1; i<=Xup; i++)
{
  for(int j=1; j<=Yup;j++)
  {
   if(2*i+3*j<=98 && i+3*j<=200 && i>=2*j)
   {
      myMax=40*i+60*j;
      if(myMax==1960)
      {
         cout<<"X="<<i<<endl;
                              cout<<"Y="<<j<<endl;
      }     
   }  
  }
}

}
回复 支持 反对

使用道具 举报

13#
发表于 2005-11-24 08:57 | 只看该作者

Corrections for the code

I find that my C++ code is not displayed correct even though my original code is correct. I modified the code again.

I tried to write a C++ code to calculate the solutions. I find that there are exactly 7 solutions. The maximam value is 1960, and all possible maximum points are (X,Y)=(28,14), (31,12), (34,10), (37,8), (40,6), (43,4), (46,2).
I give two paragraphs of code. The first one is to find the maximum value is 1960. The second one is to find all possible solutions that have value 1960.
//Code 1
#include <IOSTREAM.H>
void main()
{
int X;
int Y;
int myMax;
int tempMax;

int Xup=197; // maximum integer number of X that satisfies X+3Y<=200 (or 2X+3Y<=98) with integer Y>0
int Yup=32;// maximum integer number of Y that satisfies 2X+3Y<=98 (or X+3Y<=200) with integer X>0

for (int i=1; i<=Xup; i++)
{
for(int j=1; j<=Yup;j++)
{
if(2*i+3*j<=98 && i+3*j<=200 && i>=2*j)
{
myMax=40*i+60*j;

if(myMax>tempMax)
tempMax=myMax;

}
}
}
<TEMPMAX;< p>

// display Max as =tempMax here

}

/////////////////////////////
//Code 2
#include <IOSTREAM.H>
void main()
{
int myMax;

int Xup=197;
int Yup=32;

for (int i=1; i<=Xup; i++)
{
for(int j=1; j<=Yup;j++)
{
if(2*i+3*j<=98 && i+3*j<=200 && i>=2*j)
{
myMax=40*i+60*j;
if(myMax==1960)
{

// display i and j here

<J;<J<<ENDL;< p>}
}
}
}

}
回复 支持 反对

使用道具 举报

14#
 楼主| 发表于 2005-11-24 15:15 | 只看该作者

能联系一下吗?

你好sino000,Hawkx

能否发个邮件给我告诉我你您的联系方式,我想请教您坐标图的问题,谢谢  renbing_1126@yahoo.com.cn

Post by sino000
QUOTE=HawkX]

X为propeller个数,Y为gear个数。
1) 2X+3Y<=98
2) X+3Y<=200
3) X>=2Y
4) X>0
5) Y>0
求40X+60Y的最大值。
[/QUOTE]
回复 支持 反对

使用道具 举报

15#
发表于 2005-11-24 15:34 | 只看该作者
dxzhu一提醒,我才想到自己呆了,还有隐含就是x,y都是整数。
因此虽然不是唯一解,但还是有限个解。
计算机要从娃娃抓起
回复 支持 反对

使用道具 举报

16#
发表于 2005-11-24 16:53 | 只看该作者

8 solutions

According to the original problem, the constrained conditions should be:

2X+3Y<=98
Xi+3Y<=200
X>=2Y
X,Y>=0
X,Y are integers

Therefore, except the above 7 solutions I mentioned, (X,Y)=(49,0) should be also a solution just as HawkX said above.
Overall, there are 8 solutions for this problem.
回复 支持 反对

使用道具 举报

17#
发表于 2005-11-24 17:32 | 只看该作者
我的见解是,max revenue is 5600.
最大单周产值是1960,考虑到库存容量,最大的产值似乎应该在满足上述其他条件的情况下最大库容。这样产值才最大。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

Copyright © 1999 - 2024 by Sinoquebec Media Inc. All Rights Reserved 未经许可不得摘抄  |  GMT-4, 2024-6-3 17:51 , Processed in 0.046268 second(s), 32 queries .