MathGroup Archive 2012

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

Search the Archive

Re: modulo solving lacking domain?

  • To: mathgroup at
  • Subject: [mg126860] Re: modulo solving lacking domain?
  • From: Andrzej Kozlowski <akozlowski at>
  • Date: Thu, 14 Jun 2012 05:29:52 -0400 (EDT)
  • Delivered-to:
  • References: <> <> <> <> <>

On 13 Jun 2012, at 15:21, Richard Fateman wrote:

> The argument you are presenting is that  Modulus-> ...  in Solve changes
> not the method of computation but the domain for the answer.  Since the answer
> exists outside the Solve and is not marked as a "modular" solution only,
> it is a potential troublespot, though I understand the rationale.
> It is more like
> (context: Change semantics to assume all integers are to be treated mod N;
>    consider a*x=b,  solve for x.  restore context returning the integer x).
> and what I want is
> Solve (Mod(a*x-b,N)==0 ,x)    which Mathematica 8 refuses to do.

But Mathematica does not "refuse" to do it - you are just using the wrong approach.

Reduce[12*n - 8 == 20*k, {k, n}, Integers]

Element[C[1], Integers] && k == 3*C[1] + 2 && n == 5*C[1] + 4

The condition on k can be ignored: it only tells you additional information. The answer is the same as the one you wanted but now you do get the Element[=85.] thing.

Andrzej Kozlowski

  • Prev by Date: Re: ToString Awkwardness
  • Next by Date: Re: Splitting sums in mathematica
  • Previous by thread: Re: modulo solving lacking domain?
  • Next by thread: Re: modulo solving lacking domain?