Chinese Remainder Algorithm - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Group Theory : Numbers : Integer Functions : chrem

chrem - Chinese Remainder Algorithm

Calling Sequence

chrem(u, m)

Parameters

u

-

list [u1,..., un] of evaluations

m

-

list of moduli [m1,..., mn]

Description

• 

The list of moduli m must be pairwise relatively prime positive integers. Both lists u and m must be the same length n. The list of images u need not be reduced modulo m on input. In the following, M denotes the product of the moduli.

• 

If u is a list of integers, chrem(u, m) computes the unique positive integer a such that amodm1=u1,amodm2=u2,...,amodmn=un , and 0a<M.

• 

If the global variable mod has been assigned to mods then the result a is returned in the symmetric range for the integers modulo M. For example, the symmetric range for the integers modulo M&equals;35 is -17a+17.

• 

If u is a list of polynomials, chrem is applied across the polynomials so that the output f is a polynomial satisfying fmodm1&equals;u1 , ..., fmodmn&equals;un.

• 

If u is a list of lists, chrem is applied across the lists so that the output will be a list L satisfying Lmodm1&equals;u1, ..., Lmodmn&equals;un .

• 

For a definition, see Chinese remainder theorem .

Examples

chrem1&comma;2&comma;5&comma;7

16

(1)

chrem3x&plus;1&comma;x&plus;2y&plus;2&comma;5&comma;7

8x&plus;16&plus;30y

(2)

chrem3&comma;0&comma;1&comma;1&comma;2&comma;2&comma;5&comma;7

8&comma;30&comma;16

(3)

`mod`:=mods

mod:=mods

(4)

chrem3x&plus;1&comma;x&plus;2y&plus;2&comma;5&comma;7

8x&plus;165y

(5)

See Also

GaussInt, GIchrem


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam