MathGroup Archive 2014

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

Search the Archive

Re: Strange result of solve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132420] Re: Strange result of solve
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Tue, 11 Mar 2014 03:37:08 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20140310084113.E8ECC6A3B@smc.vnet.net>

Reduce is generally more powerful than Solve and indicates that the
expression is True, i.e., valid for all integers, x.

Reduce[5 x==0,x,Modulus->5]

True

In your second example, the result of {{}} does not mean that every x is OK
but rather that there is no solution for x.

Attributes[Solve]

{Protected}

Since Solve does NOT have either the attribute HoldFirst or HoldAll, your
second example is equivalent to

Solve[True,x,Modulus->5]

{{}}

That is, there is no solution for x since x does not appear in the
expression. You can verify this with

Solve[0 x==0,x,Modulus->5]//Trace

{{{0 x,0},0==0,True},{Modulus->5,Modulus->5},Solve[True,x,Modulus->5],{{}}}


Bob Hanlon



On Mon, Mar 10, 2014 at 4:41 AM, Wiel Aerts <wiel.aerts at xs4all.nl> wrote:

>
>
> I cannot really understand the different results of the following:
>
> Solve[ 5 x == 0, x, Modulus-> 5 ]
> result:  {{x-> 0}}
>
> and:
>
> Solve[ 0 x == 0, x, Modulus-> 5 ]
> result: {{}}
>
> The last means that every x is OK. Which I think is true. But I would
> expect the same result for the first case.
>
> What am I missing?
>
> Wiel
>
> I'm using MTM v9.
>
>
>




  • Prev by Date: Re: Do we need a When function?
  • Next by Date: Re: Do we need a When function?
  • Previous by thread: Strange result of solve
  • Next by thread: Re: Strange result of solve