Number Theory
Number Theory is the study of integers and their resulting structures. Why study it?
1 History: the first true algortihms were number-theoretic. 2 Analysis: We’ll learn about new kinds of running times and analyses. 3 Cryptography! Modern cryptosystems rely heavily on this stuff. 4 Computers are always dealing with integers anyway! CS 355 (USNA) Unit 3 Spring 2012 1 / 30
How big is an integer?
The measure of difficulty for array-based problems was always the size of the array. What should it be for an algorithm that takes an ineger n?
CS 355 (USNA) Unit 3 Spring 2012 2 / 30
Factorization
Classic number theory question: What is the prime factorization of an integer n? Recall: A prime number is divisible only by 1 and itself. Every integer > 1 is either prime or composite. Every integer has a unique prime factorization. It suffices to compute a single prime factor of n.
CS 355 (USNA) Unit 3 Spring 2012 3 / 30