Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: "Reduce" returns repeated solutions!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46348] Re: [mg46333] "Reduce" returns repeated solutions!
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Mon, 16 Feb 2004 08:59:49 -0500 (EST)
  • References: <200402150319.WAA06255@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 15 Feb 2004, at 04:19, Pedro L wrote:

> Hello mathgroup,
>
>
> I would like to know why when I write:
>
> Reduce[(x >= y \[Implies] 2x <= 3y) && Abs[x] < 5 && Abs[y] < 5, {x,
>     y}, Integers]
> I obtain repeated solutions.
>
>
>
> I obtain a lot of solutions like: x == -4 && y == -3 ...
>
> But many of them appear repeated.
> In this case I obtain   x == -4 && y == -1    two times.
>
> How do you "simplify" the list of solutions?
>
> Thanks in advance.
>
> Pedro L.  (Spain)
>
>
You can use Union


Length[l = Reduce[Implies[x >= y, 2*x <= 3*y] &&
      Abs[x] < 5 && Abs[y] < 5, {x, y}, Integers]]

78

Length[Union[l]]


43

or  Simplify:


Length[Simplify[l]]


43


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


  • Prev by Date: Bloomberg and Mathematica
  • Next by Date: Re: matrix operations
  • Previous by thread: "Reduce" returns repeated solutions!
  • Next by thread: Pattern Matching Exercises, Anyone?