course CPCS-222 (Data Structure)
1
King Abdul Aziz University
Faculty of Computing & Information Technology
Computer Science Department
CPCS-222 (Discrete Structure I)
Assignment 03
Announced Date: July 15, 2020
Due Date: June 18, 2020
Student ID:
Student Name:
***Section: XA
Note: Please use additional sheet if needed
Marks Obtained:
Maximum Marks: 30
2
Q.1: (pts 06)
Determine whether f is a function from Z to R
A. f(x) = 1 ⁄ (x 2 − 4)
B. f(x) = ±x
Answer:
3
Q.2: (pts 06)
Determine whether each of these functions from {a, b, c, d} to itself is one-to-one. And
which functions are onto?
A. f (a) = b, f (b) = a, f (c) = c, f (d) = d
B. f (a) = b, f (b) = b, f (c) = d, f (d) = c
Answer:
4
Q.3: (pts 06)
Determine whether each of these functions from R to R is invertible. If so, find its
inverse.
A. f (x) = -3x + 4
B. f (x) = -3x2 + 7
Answer:
5
Q.4: (pts 06)
Find f o g and g o f, where f (x) = x2 + 1 and g(x) = x + 2, are functions from R to R.
Answer:
6
Q.5: (pts 06)
Represent each of these relations on {1, 2, 3, 4} with a matrix (with the elements of this
set listed in increasing order).
A. {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}
B. {(1, 1), (1, 4), (2, 2), (3, 3), (4, 1)}
Answer: