MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A problem with Maximize/Minimize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119720] Re: A problem with Maximize/Minimize
  • From: Dana DeLouis <dana.del at gmail.com>
  • Date: Sat, 18 Jun 2011 19:56:47 -0400 (EDT)

Wow.  This is bad.  Here=92s your equation, and the wrong answer:

equ={30 x+20 y+15 z,7 x+7 y+3 z<=100,3 x+y+2 z<=50,x>=0,y>=0,z>=0};
Maximize[equ,{x,y,z},Integers]
{490,{x->10,y->0,z->10}}

Since everything is positive, I just dropped the y>=0 part.
I get same solution, but also a different wrong answer.

equ={30 x+20 y+15 z,7 x+7 y+3 z<=100,3 x+y+2 z<=50,x>=0,y>=0};

Maximize[equ,{x,y,z},Integers]
{510,{x->10,y->0,z->10}}

= = = = = = = = = =
Dana DeLouis
$Version
"8.0 for Mac OS X x86 (64-bit) (November 6, 2010)"




On Jun 17, 12:09 am, Gary Wardall <gward... at gmail.com> wrote:
> A problem with Maximize/Minimize:
>
> Clear[x, y, z]
>
> Maximize[{30 x + 20 y + 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}]
>
> {450, {x -> 10, y -> 0, z -> 10}}
>
> Maximize[{30 x + 20 y + 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}, =
Integers]
>
> {490, {x -> 10, y -> 0, z -> 10}}
>
> I think the problem is obvious or am I confused? I'm using Mathematica
> 8 on an Apple Power Book  10.5.6
>
> A similar problem exist with Minimize.
>
> Minimize[{-30 x - 20 y - 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}]
>
> {-450, {x -> 10, y -> 0, z -> 10}}
>
> Minimize[{-30 x - 20 y - 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}, =
Integers]
>
> {-490, {x -> 10, y -> 0, z -> 10}}
>
> Gary Wardall


  • Prev by Date: Re: Metastable expressions in Mathematica
  • Next by Date: Transformation Rules
  • Previous by thread: Re: A problem with Maximize/Minimize
  • Next by thread: Stumped on debugging what is causing Dynamic to re-evaluate.