1 / 7

CSE20 Lecture 6 4/19/11

CSE20 Lecture 6 4/19/11. CK Cheng UC San Diego. Residual Numbers (NT-1 and Shaum’s Chapter 11). Introduction Definition Operations Range of numbers Conversion. Conversion. Number x. Mod Operation. Residual number (x 1 , x 2 , …, x k ) +, -, x operations for each x i under m i.

leveille
Download Presentation

CSE20 Lecture 6 4/19/11

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE20 Lecture 64/19/11 CK Cheng UC San Diego

  2. Residual Numbers(NT-1 and Shaum’s Chapter 11) • Introduction • Definition • Operations • Range of numbers • Conversion

  3. Conversion Number x Mod Operation Residual number (x1, x2, …, xk) +, -, x operations for each xi under mi Moduli (m1, m2, …, mk) Results Chinese Remainder Theorem

  4. Chinese Remainder Theorem Given a residual number (r1, r2, …, rk) with moduli (m1, m2, …, mk), where all mi are mutually prime, set M= m1×m2× …×mk, and Mi=M/mi. Let Si be the solution that (Mi×Si)%mi = 1 Then we have the corresponding number x = (∑i=1,k(Mi Si ri))%M.

  5. Example Given (m1,m2,m3)=(2,3,7), M=2×3×7=42, we have M1=m2×m3=3×7=21 (M1S1)%m1=(21S1)%2=1 M2=m1×m3=2×7=14 (M2S2)%m2=(14S2)%3=1 M3=m1×m2=2×3=6 (M3S3)%m3=(6S3)%7=1 Thus, (S1, S2, S3) = (1,2,6) For a residual number (0,2,1): x=(M1S1r1 + M2S2r2 + M3S3r3)%M =(21×1×0 + 14×2×2 + 6×6×1 )%42 = ( 0 + 56 + 36 )%42 = 92%42 = 8

  6. Example For a residual number (1,2,5): • x=(M1S1r1 + M2S2r2 + M3S3r3)%M = (21×1×1 + 14×2×2 + 6×6×5)%42 = (21 + 56 + 180)%42 = 257%42 = 5

  7. Proof of Chinese Remainder Theorem Let A = ∑i=1,k(Mi Si ri), we show that 1. A%mv = rv and 2. x=A%M is unique. 1. A%mv= (∑i=1,k(Mi Si ri) )% mv = (Σ(MiSiri) % mv)%mv = (MvSvrv)%mv = [(MvSv)%mv × rv%mv ]%mv = rv%mv = rv 2. Proof was shown in lecture 5.

More Related