1. How many exercises should you solve as homework? A] 10 for

advertisement
1. How many exercises should you solve as homework?
A] 10 for each section
B] At least 5 for each section
C] At least half of those in each section
D] At least one third from each section
2. Homework amounts to what percent of your final grade?
A] 50%
B] 33%
C] 25%
D] 0%
3. List all the integer divisors of n=30. Then list all its PRIME divisors.
4. How many positive divisors do the following integers have?
A] 2n, where n is a positive integer. Hint: Should 1 be counted in your answer?
B] 0
5. Give an example of two statements A, B, s.t. A implies B, but B does not imply A.
6. Which term is the odd one out?
LEMMA, CONJECTURE, COROLLARY, FACT, RESULT, THEOREM
1. a, b, and c are integers. Prove that if a | b, then a | (bc).
Hint: Make sure you have a clear chain of implications () from hypothesis to
conclusion.
2. Disprove the following statement by counterexample:
If a and b are non-negative integers with a | b, then a ≤ b.
3. A binary operation is one that combines 2 values, like addition, multiplication, logical
AND and OR. Any Boolean operation is defined by its truth table. Truth tables of binary
Boolean operations (AND, OR, XOR etc.) have 4 combinations of the truth values of the
operands.
Based on the facts above, answer the question:
How many distinct binary Boolean operations (i.e. how many distinct truth tables with
two operands) are there?
First quiz counting towards the grade
1.A computer allows files to be named using any combination of uppercase letters (26 of
them) and digits (10 of them). The number of characters in a file name has to be between
1 and 8. How many different file names are there?
2. Calculate the following products:
4
k =
k  3
n

k 1
k 1
=
k
2nd quiz counting towards the grade
1.Re-write the following statements using quantifier notation (no proofs!):
S1: There is an integer that is neither prime nor composite.
S2: No matter what integer you choose, there is always another integer that is
larger.
2. Write the negation of the following statements. Feel free to take several steps, use
boxes and negation marks liberally, and explain in words what you are doing.
S3: x  Z, x<0
S4: x  Z,  x  Z : x+y = 0
3. What is the cardinal of the following sets?
A = 2{,,,Δ} = the power set of {,,,Δ}
B = {{1,2}, {3,4,5}} = a set of sets
1. Let A be an arbitrary set. Prove the following result:
Hints: use double inclusion and vacuous truth.
2. Prove that A  B  A – B = Φ
Hint: Equivalance means double implication.
A-Φ=A
1. Let A = {-1, -2, -3, -4, -5} and B = {1, 2, 3, 4, 5}.
The relation  from A to B is the following subset of the Cartesian product:
= {(a,b) : aA, bB, a|b}
Draw the graph of .
2. The relation “near to” is defined thus: a is near b iff |a-b|  2, in other words a and b are
at most 2 units apart. Is this an equivalence relation?
Hint: Equivalence means reflexive, symmetric and transitive. If your answer is YES, you have to prove that
all these properties are true. If the answer is NO, you have to say which property is not true, and give a
counterexample.
3. Prove that “congruence modulo n” is an equivalence relation,  nZ.
Reminder: a  b (mod n)  n | (a-b).
Proof of reflexivity:
Proof of symmetry:
Proof of transitivity:
1. In how many ways can we partition an n-element set into 2 parts such that one part has
4 elements, and the other part has the remaining n-4 elements?
Hint: consider separately the cases n=8 and n8. Understand and explain why they are different.
100 
 to the simplest form (w/o performing any multiplications).
2. Bring the number 
 95 
3. Prove by contradiction that consecutive integers cannot be even.
Hint: consecutive integers are numbers of the form x, x+1. ‘Even’ means … Assume by contradiction that
… We reach the statement that … which is FALSE.
1. Prove by induction that
9 + 910 + 9102 + … 910n-1 = 10n – 1 , for any n1.
Hint: the base case is n=1. After checking this, continue with simple induction (no strong induction
needed!): if the equality holds for n=k, then it also holds for n=k+1.
2. Consider the following function: f:N→N, f(x) = 10+x.
Is it one-to-one (injective)? Is it onto (surjective)?
Hint: for each question, either prove the affirmative, or give a counterexample for the negative.
3. How many functions f:{1,2,3}→{4,5,6,7} are there? How many one-to-one
(injective)?
1. f and g are both functions from Z to Z.
f(x) = x2 – 1
g(x) = x2 + 1
 Are fg and gf defined?
 If not, why? If yes, give explicit formulas for each.
Yes, they are both defined, since the image of each function is
included (set inclusion!) in the domain of the other. In other
words, f is defined at the point g(x), x, and g is defined at
the point f(x), x.
fg (x) = f(g(x)) = x4 + 2x2
gf (x) = g(f(x)) = x4 – 2x2 + 2
2. Consider the following function: f:N→N, f(x) = 11 + x.
Is it one-to-one (injective)? Is it onto (surjective)?
Hint: for each question, either prove the affirmative, or give a counterexample for the negative.
One-to-one means that if f(x) = f(y), then x=y. Or, if you prefer
the contrapositive, if xy, then f(x)f(y). Either form is
trivially proved for our function, since x=y  x+11 = y+11 
f(x) = f(y). (The same chain of equivalencies holds for the ‘not
equal’ sign.) Answer: f is one-to-one.
Onto means that any element of the image is the image of some
element from the domain. This obviously is false for, say, 4,
since f(x) = 4 would imply x = -7  N. Answer: f is not onto.
3. and are two permutations from S6:



123456 
123456
 
   234561
246135


Compute o then(use array notation).
Compute -1 (array notation).
Write and in cycle notation (with or without singletons).
123456 
 (remember that operates first!), which in cycle
461352
   
notation is (1,4,3)(2,6)(5)
123456 
    

351246
123456 
 1  

415263
= (1,3)(2,5,4)(6)
1. Prove that the falling factorial (n)k = n(n-1)…(n-k+1) is O(nk), where k is a fixed,
positive integer.
Hint: Expand the product into a sum of terms with different powers. The result is a polynomial in n. What
is its highest power? What can you do about the lower powers?
2. Prove the transitivity of the “is Big-Oh of” relation:
If f(n) is O(G(n)) and g(n) is O(h(n)), then f(n) is O(h(n)).
Hint: the proof requires very little beyond unraveling the definition of Big-Oh.
3. For the pairs of integers given below, find a div b and a mod b (alternate
notations are div(a,b) and mod(a,b)):
 a=100, b=3

a = -100, b=3

a = 3, b=100
1. Calculate the following in the context of Z10. Express the final result as a standard
representative of its class, i.e. as a number between 0 and 9.

98=

5– 8=

66=

8 \ 7=
Hint: What is the inverse of 7 in Z10? There are only 9 candidates to try out.
2. Solve the following equation in Z11:
3. State Fermat’s little theorem (no proof!).
4  x – 8 = 9.
1] Take the following values in the RSA algorithm: p = 19, q = 31, n= 19*31 = 589. It is
known that Bob’s decryption key is d = 53. Calculate the encryption key e.
Hint: e is the inverse of d modulo (n).
The solution is presented in the Solutions file on this web-page.
2] In Zn, what is the necessary and sufficient condition for (the class) b to have an inverse
b-1? Just state the condition – don’t prove anything.
Hint: See the solution to the previous problem: e and d are inverses modulo (n).
Download