Integer Solutions
-For lower values of c, all integer solutions have the property that either x or y or both are
negative. However for higher c, there are integer solutions where both x and y are nonn
Your Name:
Harvard University
Computer Science 20
Midterm 1
Monday, February 22, 2016
PROBLEM 1
Prove that if you pick 5 distinct integers from cfw_1, . . . , 100, some two differ by at most 24.
Solut
Computer Science 20, Midterm, 2/21/14
Four problems, all count equally.
1. Rewrite the following expressions using exactly one operation. For example,
the answer for (p q) would be p q. T and F repres
% Please fill in your name and collaboration statement here.
\newcommandcfw_\studentNamecfw_*FILL IN YOUR NAME HERE*
\newcommandcfw_\collaborationStatementcfw_*FILL IN YOUR COLLABORATION STATEMENT HER
Exercise Solutions
Chapter 1 Introduction to Sets and Functions: 1.3.1: Which of the following sets are equal to the set of all integers that are multiples of 5.
There may be more than one or none.
(1
Bezout
-Question: Do you see any integer solution for 10x + 15y = 1?
Question: How about 10x + 15y = 2? Whats the problem?
Answer: Seems like the only hope is if c is some multiple of 5.
Question: Wha
Diophantine Examples
-Find the non-negative integer solutions of 10x + 15y = 100.
We know that the full set of integer solutions is:
cfw_(x = 20 + 3k, y = 20 2k) | k Z
We need to restrict ourselves to
Greatest Common Divisor
-Imagine you have a floor of size 1053 inches by 481 inches. You would like to tile
your floor with square tiles. You can of course use 1 inch by 1 inch tiles, but you would
li
Bezout's Identity
-Let a, b, c Z, where d = gcd(a, b) and c
is a multiple of d. Suppose that (x = x0, y = y0) is one particular integer solution to
ax + by = c.
-Then the complete set of integer solut
Division Theorem
-If a, b Z, with a 6= 0, we say that a divides b, written a|b, if q Z, such
that b = aq. We say that a is a divisor or factor of b.
-Let a, b, c Z, where a 6= 0 and b 6= 0. Then:
-If
Diophantine Equations
-Imagine that your favorite restaurant is McDonalds, and your favorite food is chicken
nuggets.
It turns out that chicken nuggets come in two different sizes: the 4-box and the 9
Sylvester's Theorem
-Let a and b be positive, relatively prime
integers and c be a positive integer. Then there exist non-negative integers, x and y, that
satisfy
ax + by = c,
if
c > ab a b .
When c =
Euclidean Algorithm
-Suppose we want to find integers x and y such that 89x + 33y = 1.
To find x and y, we will need to first apply the Euclidean algorithm. This seems
extraneous,
since we already kno
Properties of Euclidean Algorithm
-To solve the Chicken McNugget problem, it will help to first realize that there are actually
an infinite number of different pairs, (x, y), of integer solutions to a
SHOULD I TAKE CS 20?
This quiz is meant to help you decide whether to take CS 20. If the terminology and questions are
unfamiliar to you, or if they are vaguely familiar but you cant actually do the p