       Re: modulo solving lacking domain?

• To: mathgroup at smc.vnet.net
• Subject: [mg126846] Re: modulo solving lacking domain?
• From: Andrzej Kozlowski <akozlowski at gmail.com>
• Date: Wed, 13 Jun 2012 04:54:53 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201206120659.CAA25892@smc.vnet.net> <C49675CE-DFFB-4759-A1FC-F853D06D2456@mimuw.edu.pl> <4FD7DD77.6040101@eecs.berkeley.edu>

```On 13 Jun 2012, at 01:23, Richard Fateman wrote:

>
> Interestingly
>
> Solve[Mod[12 n, 20] == 8, n]
>
> "This system cannot be solved with the methods available to Solve"
>
> then
>
> Solve[12*n==8,n,Integers, Modulus->20]
>
> says
> "Solve::mdom: Warning: Mathematica is ignoring domain specification Integers; option setting Modulus -> 20 implies domain integers modulo 20. >>"
>
> but
>
> Solve[12*n==8,n,Modulus->20]
> returns  {{n -> 4 + 5 C}}
>
>
> should not say that n is an integer modulo 20, at all.
> e.g. n=04  is a solution.
>
> In actual practice, these kinds of things come up when using
> stuff like Hensel lifting / Chinese remainder based algorithms.
>
> (That is, you are doing modular arithmetic on Integers.)
>
> RJF
>
>
>

Actually it is all a matter of interpretation. It is perfectly valid to interpret both  the equation and answers in the ring (not field) of integers modulo 20 everything.

In other words, the answer is "n is an integer modulo 20 of the form 4+5 C where is is any integer modulo 20". Of course in this case all these solutions lift to integer solutions and one can also think of them as integer solution but only the first apps interpretation is consistent with what Solve does in this case:

Solve[n^2 == -1, n, Modulus -> 5]

{{n->2},{n->3}}

Now clearly Mathematica does not think that 7 is answer, which shows that you are completely wrong about this. Actually, I also was wrong in carelessly partially accepting your argument (and suggesting that the answer might be better given as ConditionalExpression). The Mathematica original answer is perfectly correct and your entire point was (as is so often the case) a red herring, not worth any further discussion.

Andrzej

```

• Prev by Date: Re: modulo solving lacking domain?
• Next by Date: Re: Simple display questions
• Previous by thread: Re: modulo solving lacking domain?
• Next by thread: Re: modulo solving lacking domain?