York University
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
(mungaidavid2000@gmail.com)
, 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
(mungaidavid2000@gmail.com)
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller YourAssignmentHandlers. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £12.21. You're not tied to anything after your purchase.