CS/MATH 1019 Discrete Math for Computer
Science
CS/MATH 1019 Exam
Course Title and Number: CS/MATH 1019 Discrete Math
for CS
Exam Date: Midterm and Final Exam 2024- 2025
Instructor: [Insert Instructor’s Name]
Student Name: [Insert Student’s Name]
Student ID: [Insert Student ID]
Examination
180 minutes
Instructions:
1. Read each question carefully.
2. Answer all questions.
3. Use the provided answer sheet to mark your responses.
4. Ensure all answers are final before submitting the exam.
5. Please answer each question below and click Submit when you have
completed the Exam.
6. This test has a time limit, The test will save and submit automatically
when the time expires
7. This is Exam which will assess your knowledge on the course
Learning Resources.
Good Luck!
Downloaded by Jack mah
()
, CS/MATH 1019 Discrete Math for Computer Science
CS/MATH 1019 Exam Test 2 Questions with Verified
Solutions | 100% Pass | Graded A+ |
YORK UNIVERSITY
SC/MATH 1019 3.0 D
TEST #2
SOLUTIONS
The total number of points for the Test is 90.
1. (10 points) Show that f (x) = (x + 2) log2(x2 + 1) + log2(x3 + 1) is O(x log2 x)
Solution. The function f is the sum of two functions f (x) = f1(x) + f2(x) where
f1(x) = (x+2) log2(x2+1) and f2(x) = log2(x3+1). Since we know that log 2(xm+1)
is O(log x), for all positive integers m, we have that both functions log2(x2 +
1) and log2(x3 + 1) are O(log2 x). Since f1 is a product of two functions g(x) = x
+ 2 which is obviously O(x), and log2(x2 + 1) which is O(log2 x), their product
f1(x)
is O(x log x). Therefore f (x) = f1(x) + f2(x) is O(max{|x log2 x|, | log2(x)|}) where
for x > 1, log2 x > 0, so
max{|x log2 x|, | log2(x)|} = max{x log2 x, log2(x)} = x log2 x.
Thus indeed, f (x) is O(x log2 x).
2. (5+5 points) (a) Prove by mathematical induction that for all positive integers
n
n
Σ
k · 2k = (n − 1)2n+1 + 2
k=1
Solution. Simple induction. Basis step. n = 1: 1 · 21 = (1 − 1)22 + 2 holds.
Inductive step. Suppose the equality
n
Σ
k · 2k = (n − 1) · 2n+1 + 2
k=1
holds for some n ≥ 1. Then for n + 1
n+1 n
Σ Σ
k·2k = k·2k+(n+1)2n+1 = (n−1)·2n+1+2+(n+1)2n+1 = (n−1+n+1)2n+1+2
k=1 k=1
= 2n2n+1 + 2 = [(n + 1) − 1]2(n+1)+1 + 2
the equality also holds.
(b) Prove by mathematical induction that 3n < n! for all n > 6.
Solution. Simple induction. Basis Step. For n = 7, 37 = 2178 < 5040 = 7! is
true. Inductive Step. Suppose 3n < n! for some n ≥ 7. Then n > 2, that is, 3 <
n + 1, so 3n+1 = 3n · 3 < (n!)3 < (n!)(n + 1) = (n + 1)!
Date: Dec 5, 2022.
1
Downloaded by Jack mah
()