01.01.2015 Views

Modular Arithmetic and Primality

Modular Arithmetic and Primality

Modular Arithmetic and Primality

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Addition of two numbers of length n<br />

– Pad smaller number with leading 0’s if necessary<br />

– At each step 3 single digit numbers (including carry) are added to create a<br />

2 digit number (could have a leading 0)<br />

– Time needed: c 0 (overhead) + c 1· n (which is linear)<br />

– Complexity O(n), where n is the size (in bits) of the numbers<br />

– Base an issue -<br />

<br />

Any number N can represented by log b (N+1) symbols<br />

Difference between decimal <strong>and</strong> binary (3.32)<br />

<br />

Constant factor between any two bases - Thus we’ll usually just use binary<br />

examples<br />

– Can we go faster<br />

Why not<br />

<br />

Thus, addition is Θ(n)<br />

CS 312 - Complexity Examples - <strong>Arithmetic</strong> <strong>and</strong> RSA 6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!