Thursday, January 22, 2009

Chinese Remainder Theorem

Chinese Remainder Theorem 

The Chinese Remainder Theorem is mainly based on the algorithm of linear congruencies. Congruence is nothing more than a statement about divisibility [19]. The Chinese Remainder Theorem is mainly based on the system of linear congruencies a = b (mod n) which can be reduced to a set of a = b (mod ni), where n1, n2, Ö ni are prime factors of n.

Theorem
Let n1, n2, . . . ,nk denote k positive integers which are relatively prime, and let a1,a2, . . . , ak denote any k integers. Then the congruencies x = ai (mod ni), i = 1, 2. . . k have common solutions. Any two solutions are congruent modulo n1, n2. . . nk. 
  Y = X (mod P) where P = n1* n2*Ö.* nk.  
  X = (a1*N1*x1) + . . . .+ (ak*Nk*xk) (mod P) 
  i.e. X = ∑ ai*Ni*xi (Mod P)  
Where Nk = P / nk in which xk satisfies Ni*xi = 1 (mod ni). 
The remainder of the solved congruencies X is transmitted. At the receiving end, using X, ai are found using ai = X (mod ni) and then multiplying by16, the original pixel values are reconstructed.