MathGroup Archive 2004

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

Search the Archive

Re: Diophantic Equations with Constraints

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49457] Re: [mg49444] Diophantic Equations with Constraints
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Wed, 21 Jul 2004 06:39:17 -0400 (EDT)
  • References: <200407201153.HAA23713@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 20 Jul 2004, at 20:53, Michael S. wrote:

> *This message was transferred with a trial version of CommuniGate(tm) 
> Pro*
> The equation should read
>
> 	3x + 2y - z == 14  (not 148)
>
> Anyway, it's the principle of the thing I'd be interested in.
>
> Thanks,
>
> Michael
>


With the new equation we get:


Reduce[{3*x + 2*y - z == 14, 3 <= x <= 8, 0 <= y <= 12,
    1 <= z <= 9}, {x, y, z}, Integers]


y == 0 && z == 1 && x == 5 || y == 0 && z == 4 &&
    x == 6 || y == 0 && z == 7 && x == 7 ||
   y == 1 && z == 3 && x == 5 || y == 1 && z == 6 &&
    x == 6 || y == 1 && z == 9 && x == 7 ||
   y == 2 && z == 2 && x == 4 || y == 2 && z == 5 &&
    x == 5 || y == 2 && z == 8 && x == 6 ||
   y == 3 && z == 1 && x == 3 || y == 3 && z == 4 &&
    x == 4 || y == 3 && z == 7 && x == 5 ||
   y == 4 && z == 3 && x == 3 || y == 4 && z == 6 &&
    x == 4 || y == 4 && z == 9 && x == 5 ||
   y == 5 && z == 5 && x == 3 || y == 5 && z == 8 &&
    x == 4 || y == 6 && z == 7 && x == 3 ||
   y == 7 && z == 9 && x == 3

and

NMinimize[{Abs[3*x + 2*y - z - 14],
    3 <= x <= 8 && 0 <= y <= 12 && 1 <= z <= 9 &&
     (x | y | z) $B":(B Integers}, {x, y, z}]


{0., {x -> 5, y -> 0, z -> 1}}

NMinimize normally just finds one solution and it turns out to be the 
first one returned by Reduce.



Andrzej Kozlowski
Chiba, Japan
http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: AW: Assigning names to columns of a matrix
  • Next by Date: RE: 7 equations and 7 unknowns (non-linear equations)
  • Previous by thread: Diophantic Equations with Constraints
  • Next by thread: Diophantic Equations with Constraints