MathGroup Archive 2005

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

Search the Archive

ChineseRemainder


Hello.  I have a question on the function "ChineseRemainder."  Could anyone
offer an explanation on the following behavior?  Thanks.

Here's the package...

Needs["NumberTheory`NumberTheoryFunctions`"]

The following small example has no solution, and returns the null set, which
is ok...

list1={2,3,4};list2={9,4,8};

r=ChineseRemainder[list1,list2]

{}


The following returns a solution of 94.

list1={2,3,4};list2={4,7,9};

r=ChineseRemainder[list1,list2]

94

According to Help on this function, we can test the solution with the
following, and it correctly returns list1.

Mod[r,list2]

{2,3,4}


These similar numbers return a different solution.

list1={2,3,4};list2={9,7,4};

r=ChineseRemainder[list1,list2]

164


However, it does not correctly return list1.  (According to help)

Mod[r,list2]

{2,3,0}

This happens often in my program, and I'm having a tough time trusting the
solution.  Does anyone familiar with this have any insight?  Thanks.

I note that Mathematica's built-in ChineseRemainder function returns the
same answer, so I'm sure Mathematica is doing it correctly.  I guess I don't
understand why Mod[r,list2] will often not return list1 (According to help).

Reduce`RChineseRemainder[list1, list2]

164

Thank you for any insight.
Dana

$Version
 "5.1 for Microsoft Windows (January 27, 2005)"


  • Prev by Date: Numerical Eigenvalues for a 11x11 matrix
  • Next by Date: Re: Debugging
  • Previous by thread: Numerical Eigenvalues for a 11x11 matrix
  • Next by thread: Re: ChineseRemainder