In depth study of fast squaring (and multiplication) of large integers
CISC 320 Algorithms and Advanced Programming
-- Spring, 2000
-
Goals.
We will move away from the encryption context in order to focus on
the algorithmic issues of squaring large integers. The goals are
to
- Create a correct squaring function, ksqr() that is faster than the
benchmark classical version in csqr().
- Calculate the asymptotic cost of your ksqr() by setting up and solving
(up to big O)
a recurrence relation or summation formula for the run time.
- By timing experiments, verify or refute that the actual times
experienced conform to the expectations from the a priori analysis.
-
Resources.
-
320/rsaproject/main3.cc is a draft of a main() for testing ksqr().
It also contains the benchmark csqr().
Copy this as a starting point for your main().
-
320/rsaproject/Makefile3 is a draft makefile useful for compiling
and testing your code.
Copy this as a starting point for your makefile.
-
320/rsaproject/Num.h is a header containing the Num class, which
now includes a random Num generator.
Read and use this header, but do not change it.
-
320/rsaproject/stopwatch.h is a header containing the timing stopwatch.
Read and use this header, but do not change it.
Note: it has been updated.
-
Deliverables.
-
Correct code: goal (1) is a team goal and the deliverable is the code for
your ksqr(), together with a script showing correct computation with
(a) a random number, (b) the number B^k - 1 (the number whose B-digits
are each 9999) (c) the number 1, (d) the number 0.
- There will be an optional "race". If you wish to compete, follow
instructions to come later for making your ksqr() code linkable to
the competition main().
- Asymptotic analysis and experimental timing study. These goals
are met with an individual deliverable, namely a short essay
(3 or more pages) dealing with goals 2 and 3.
A separate handout will follow itemizing points to be covered.