Re: ChineseRemainder
- To: mathgroup at smc.vnet.net
- Subject: [mg56993] Re: [mg56971] ChineseRemainder
- From: Chris Chiasson <chris.chiasson at gmail.com>
- Date: Thu, 12 May 2005 02:32:32 -0400 (EDT)
- References: <200505110925.FAA24094@smc.vnet.net>
- Reply-to: Chris Chiasson <chris.chiasson at gmail.com>
- Sender: owner-wri-mathgroup at wolfram.com
Mod[4,4] is zero. I think the routine should return a null set. On 5/11/05, Dana DeLouis <delouis at bellsouth.net> wrote: > 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)" > > -- Chris Chiasson http://chrischiasson.com/ 1 (810) 265-3161
- References:
- ChineseRemainder
- From: "Dana DeLouis" <delouis@bellsouth.net>
- ChineseRemainder