0% found this document useful (0 votes)
66 views3 pages

EECS 203: Discrete Mathematics Fall 2019 Discussion 12 - Notes

The document contains notes from a discrete mathematics class, including definitions of big-O, big-Ω, and big-Θ notation, and examples of using these notations to analyze the complexity of algorithms. There are exercises analyzing recurrence relations, algorithmic complexity, and solving recurrence relations.

Uploaded by

sam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views3 pages

EECS 203: Discrete Mathematics Fall 2019 Discussion 12 - Notes

The document contains notes from a discrete mathematics class, including definitions of big-O, big-Ω, and big-Θ notation, and examples of using these notations to analyze the complexity of algorithms. There are exercises analyzing recurrence relations, algorithmic complexity, and solving recurrence relations.

Uploaded by

sam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

EECS 203: Discrete Mathematics

Fall 2019
Discussion 12 - Notes

1 Definitions
• Big-O:
• Big-Ω:
• Big-Θ:
• Master Theorem:

1. Section 3.2 Problem 6


Prove that (x3 + 2x)/(2x + 1) is O(x2 ).

2. Not in Book 1
Prove that 5n is not O(3n )

3. Section 3.2 Problem 18


Let k be a positive integer. Show that 1k + 2k + · · · + nk is O(nk+1 ).

4. Section 3.2 Problem 25 (a, c)


Give as good a big-O estimate as possible for each of these functions
a) (n2 + 8)(n + 1)
b) (n log n + n2 )(n3 + 2)
c) (n! + 2n )(n3 + log(n2 + 1))

1
5. Section 3.2 Problem 30 (a, e)
Show that each of these pairs of functions are of the same order.
(a) 3x + 7, x
(e) log10 x, log2 x

6. Section 3.3 Exercise 13


The conventional algorithm for evaluating a polynomial an xn +an−1 xn−1 +...+a1 x+a0
at x = c can be expressed in pseudocode by
procedure polynomial(c, a0 , a1 , a2 , ..., an : real numbers)
power := 1
y := a0
for i := 1 to n
power := power ∗ c
y := y + ai ∗ power
return y {y = an xn + an−1 xn−1 + ... + a1 x + a0 }

a.) Evaluate 3x2 + x + 1 at x = 2 by working through each step of the algorithm


showing the values assigned at each assignment step.
b.) Exactly how many multiplications and additions are used to evaluate a polynomial
of degree n at x = c? (Do not count additions used to increment the loop variable.)

7. Section 3.3 Exercise 34


How many comparisons does the selection sort use to sort n items? Use your answer
to give a big-O estimate of the complexity of the selection sort in terms of number of
comparisons for the selection sort.

8. Exercise 8.1.12
a) Find a recurrence relation for the number of ways to climb n stairs if the person
climbing the stairs can take one, two, or three stairs at a time.
b) What are the initial conditions?
c) In how many ways can this person climb 8 stairs?

9. Exercise 8.1.54 (b)


Use Algorithm 1 to determine the maximum number of total attendees in the talks
in Example 6 if wi , the number of attendees of talk i, i = 1, 2, ..., 7, is
(b) 100, 5, 10, 20, 25, 40, 30.

2
10. 8.1 Not in Book
(a) Derive a recurrence relation for the number of binary strings of length n that do
not have consecutive 0’s. You must explain how you derive the relation.
(b) Find the solution to the recurrence relation you found in part (a).

11. 8.2.4 (b)


Solve this recurrence relation together with the initial conditions given.
b) an = 7an−1 − 10an−2 for n ≥ 2, a0 = 2, a1 = 1

12. Exercise 8.2.14


Find the solution to an = 5an−2 − 4an−4 with a0 = 3, a1 = 2, a2 = 6, and a3 = 8.
(Hint: Find the characteristic equation first.)

13. 8.2.20
Find the general form of the solutions of the recurrence relation an = 8an−2 − 16an−4 .

You might also like