Divisibility
Denition: When a and b are integers and a =
0 we say a divides b, and write a|b, if b/a is a
whole number.
THEOREM: Let a, b and c be integers. If a|b
and b|c, then a|c.
Proof: By hypothesis, the two quotients b/a
and c/b are whole numbers. T
Fermat and Eulers Theorems
Denition: A reduced set of residues (RSR)
modulo m is a set of integers R so that every
integer relatively prime to m is congruent to
exactly one integer in R.
Fact. a b (mod m) implies gcd(a, m) =
gcd(b, m).
Fact. All RSRs modu
Distribution of Primes
Denition. For positive real numbers x, let
(x) be the number of prime numbers less than
or equal to x.
For example, (1) = 0, (10) = 4 and (100) =
25. To use some ciphers, we will have to
choose some large primes, say, 100-digit prim
Introduction to probability
Suppose an experiment has a nite set X =
cfw_x1, x2, . . . , xn of n possible outcomes. Each
time the experiment is performed exactly one
on the n outcomes happens. Assign each outcome a real number between 0 and 1, called
the
Encryption 101
Beyond the Secret Decoder Ring
Sam Wagstaff
Computer Sciences and CERIAS
What is a secret decoder ring?
Popular 1930s to 1990s
Little Orphan Annie radio show
The image shown is from 1936
Also in breakfast cereal boxes
Another secret decoder
Caesar Cipher
Let n mod m denote the remainder when n is
divided by m, i.e., mod means % in C or Java.
Use the numbers 0 to 25 to code the English
alphabet: 0 = A, 1 = B, 2 = C, . . ., 25 = Z.
With this code, we can encipher a message by
computing with th
Congruences
A congruence is a statement about divisibility.
It is a notation that simplies reasoning about
divisibility. It suggests proofs by its analogy to
equations. Congruences are familiar to us as
clock arithmetic. Four hours after 10 AM
it will be
Congruences
A congruence is a statement about divisibility.
It is a notation that simplies reasoning about
divisibility. It suggests proofs by its analogy to
equations. Congruences are familiar to us as
clock arithmetic. Four hours after 10 AM
it will be
Your name:
The last four digits of your ID:
CS 355 SAMPLE MIDTERM EXAM
March 4, 2016
Print your name above. This exam is closed book and closed neighbors. You will have 50
minutes to do the exam. Work quickly and accurately. Please write neatly and legi
CS 355, Sample Midterm Exam Solution
TRY TO DO THE ENTIRE SAMPLE EXAM BEFORE YOU LOOK
AT THIS SOLUTION.
1. a. 9 or 16; b. 4; c. 11; d. 21 or 22; e. 7; f. 12; g. 6.
2. a. F; b. T; c. F; d. F; e. T.
3. a. 48; b. transposition; c. O(k).
4. a. A substitution
Remainders
We learned how to multiply and divide in elementary school.
As adults we perform division mostly by pressing the key on a calculator. This key supplies
the quotient. In numerical analysis and most
other parts of math, the quotient is what is
ne