Professional Documents
Culture Documents
for a; b 2 Z. Complete the following table for the property of R and provide a relevant reason for each
answer.
Part Property Yes/No (0.5 point)
a) Reflexive
b) Irreflexive
c) Symmetric
d) Asymmetric
e) Anti-symmetric
f) Transitive
Each justification is worth 1.5 points.
A NSWER :
page 2 of 10
Name: NIM: Class:
Problem 2 (12 points) Suppose R is a relation on A = f1; 2; 3; 4g represented by the following digraph:
Complete the following table for the property of R and provide a relevant reason for each answer.
Part Property Yes/No (0.5 point)
a) Reflexive
b) Irreflexive
c) Symmetric
d) Asymmetric
e) Anti-symmetric
f) Transitive
A NSWER :
page 3 of 10
Problem 3 (8 points) Suppose R and S are two relations over A = f1; 2; 3g represented by the following
digraphs:
(a). [2 points] Write the matrices that correspondingly represent the relations R and S (i.e., MR and
MS ).
(b). [2 points] Write the matrices that correspondingly represent the relations R [ S and R \ S (i.e.,
MR[S and MR\S ).
1
(c). [2 points] Write the matrices that correspondingly represent the relations R (or :R) and S (i.e.,
MR and MS 1 ).
(d). [2 points] Write the matrices that correspondingly represent the relations R S and S R (i.e., MR S
and MS R ).
A NSWER :
page 4 of 10
Name: NIM: Class:
Problem 4 (8 points) Suppose R and S are two relation on A = f1; 2; 3; 4g defined as follows:
(a). [2 points] Write the relations R and S in ordered pairs notation (set notation).
1 1
(b). [2 points] Write the relations R and S in ordered pairs notation (set notation).
1 1 1
(c). [2 points] Write the relations (S R) and R S in ordered pairs notation (set notation).
A NSWER :
page 5 of 10
Problem 5 (12 points) Suppose g = f(1; b) ; (2; c) ; (3; a) ; (4; b)g is a function from A = f1; 2; 3; 4g
to B = fa; b; c; dg and f = f(a; q) ; (b; r) ; (c; p) ; (d; s)g is a function from B = fa; b; c; dg to C =
fp; q; r; sg.
(a). [3 points] Determine whether g is: (1) injective, (2) surjective, and (3) bijective. Explain your
answer!
(b). [3 points] Determine whether f is: (1) injective, (2) surjective, and (3) bijective. Explain your
answer!
(c). [3 points] Write the function f g : A ! C in ordered pairs notation (i.e., f g = f: : :g).
(d). [3 points] Determine whether f g is: (1) injective, (2) surjective, and (3) bijective. Explain your
answer!
A NSWER :
page 6 of 10
Name: NIM: Class:
n 4
Problem 6 (10 points) Suppose f; g : Z ! Z where f (n) = 7 and g (n) = 7n + 4.
A NSWER :
page 7 of 10
Problem 7 (18 points) Suppose f; g; h : Z ! Z are functions defined as follows:
n 3
f (n) = 2n + 3, g (n) = , and h (n) = (f g) (n) .
2
(a). [6 points] Determine whether f is: (1) injective, (2) surjective, and (3) bijective. Explain your
answer!
(b). [6 points] Determine whether g is: (1) injective, (2) surjective, and (3) bijective. Explain your
answer!
(c). [6 points] Determine whether h is: (1) injective, (2) surjective, and (3) bijective. Explain your
answer!
A NSWER :
page 8 of 10
Name: NIM: Class:
(a). [3 points] Calculate b2 , b3 , and b4 . (Remark: be careful, the recurrence is bn = 2bn 2 bn 1 and
NOT bn = 2bn 1 bn 2 .)
(b). [3 points] Write the characteristic equation that corresponds to (1) and determine its roots.
(c). [3 points] Find the general solution of (1) with initial conditions b0 = 2 and b1 = 3.
(d). [1 point] Use the result in (c). to compute b10 . Express the result as an integer. (Hint: 210 = 1024,
3 339 = 1017.)
A NSWER :
page 9 of 10
Problem 9 (10 points) Observe the following excerpt of a Python program:
def s(n):
if n == 0: return 1
if n == 1: return 4
else: return 2*s(n-1) - s(n-2)
The above program computes the following recurrence
(b). [3 points] Write the characteristic equation that corresponds to (2) and determine its roots.
(c). [3 points] Find the general solution of (2) with initial conditions s0 = 1 and s1 = 4.
A NSWER :
page 10 of 10