0% found this document useful (0 votes)
87 views4 pages

hwk11 Sol

This document contains the details of Homework #11 for the course CS173: Discrete Mathematical Structures. It involves proving parts of the Master Theorem and analyzing properties of relations such as reflexivity, symmetry, transitivity, and applying set operations to relations. The homework has multiple parts involving the Master Theorem, relations, and counting transitive relations on sets of different sizes.

Uploaded by

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

hwk11 Sol

This document contains the details of Homework #11 for the course CS173: Discrete Mathematical Structures. It involves proving parts of the Master Theorem and analyzing properties of relations such as reflexivity, symmetry, transitivity, and applying set operations to relations. The homework has multiple parts involving the Master Theorem, relations, and counting transitive relations on sets of different sizes.

Uploaded by

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

CS173: Discrete Mathematical Structures

Fall 2005
Homework #11
Due 12/04/05, 8a
43 Points
1. (10 Points) The Master Theorem (Rosen, p 430) states: Let f be an increasing
function that satisfies the recurrence relation
f (n) a f (n /b) cn d
whenever n b k , where k is a positive integer, a 1, b is an integer greater than
1, and c and d are real numbers with c positive and d nonnegative. Then
O(n d )
if a b d

f (n) O(n d log n) if a b d .

logb a
O(n
)
if a b d

We will prove the Master Theorem by solving the following parts (some of the
answers can be found in your book. See exercises 29-33 on p 435).
a. Show that if a b d and n is a power of b, then

f (n) f (1) n d cn d log b n.


b. Use part a. to show that if a b d , then f(n) is O(nd log n).
log a
c. Show that if a b d and n is a power of b, then f (n) C1n d C2 n b ,

where C1 b d c /(b d a ) and C2 f (1) b d c /(a b d ) .


d. Use part c. to show that if a < bd, then f(n)=O(nd).

e. Use part c. to show that if a > bd, then f (n) O(n log b a ) .

Solution:
a. Suppose n=bk. Then

f (n) f (b k ) a f (b k 1 ) cb kd a (a f (b k 2 ) cb ( k 1) d ) cb kd a 2 f (b k 2 ) acb( k 1) d cb kd
...
k 1

k 1

a k f (1) a k 1cb (1) d a k 2cb( 2 ) d ... cb kd a k f (1) a j cb( k j ) d a k f (1) c a j b d ( k j ) [a b


j 0

j 0

k 1

k 1

k 1

j 0

j 0

j 0

a k f (1) c b dj b d ( k j ) a k f (1) c b dk [n b k ] a k f (1) c n d a k f (1) c k n d a k f (1

b. If n is a power of b, we the result is immediate. Since f(n) is increasing, there exist


k, such that: bk<n<bk+1. Now, f(n)<=f(bk+1). But
f (n) f (b k 1 ) a k 1 f (1) c (log b n 1) n d a k 1 f (1) c n d cn d log b n O(n d log b n)

To prove that the expression above is indeed big-o of the dominant factor, note that
you can easily find N starting from which, the dominant factor is larger then both of
the other factors. Thus, the c-constant for big-o (not to confuse with the c-constant of
the master theorem) is 3*c, and the big-o inequality holds for all n larger then N.
c. This one will be by induction on n, or rather k, where n=bk.
Induction base: k=0; n=1.

f (1) C11d C21log b a C1 C2 b d c /(b d a) f (1) b d c /(a b d ) f (1) b d c /(b d a) b d c /(b d a)


Now assume that the statement is true for n=bk, and prove for n=bk+1.
f (b k 1 ) a f (n / b) cn d [assumption] a{C1 (n / b) d aC 2 (n / b) log b a } cn d
ab d c(n / b) d /(b d a) a[ f (1) b d c /( a b d )](n / b) log b a cn d
[c /(b d a)]n d a cn d a[ f (1) b d c /(a b d )](n / b) log b a
n d {[ac /(b d a )] c} a[ f (1) b d c /(a b d )](n / b) log b a
n d {[ac /(b d a )] c(b d a) /(b d a)} a[ f (1) b d c /( a b d )](n / b) log b a
n d [cb d /(b d a)] a[ f (1) b d c /(a b d )](n / b) log b a
n d [cb d /(b d a)] a[ f (1) b d c /(a b d )]n log b a / b log b a
n d [cb d /(b d a)] a[ f (1) b d c /(a b d )]n log b a / a
n d [cb d /(b d a)] [ f (1) b d c /(a b d )]n log b a C1n d C 2 n log b a

d, e: We have proved that f ( n) C1n d C2 n

log b a

. Note that if a > bd,

C1n d C2 nlog b a thus f (n) 2C2 nlog b a O(nlog b a ) . Likewise, if a < bd,
C1n d C2 nlog b a thus f (n) 2C2 n d O(n d ) .
Grading Rubric: each section is worth 2 points. One for incomplete answer, two for a
complete one.
2. (16 points) Determine whether the relation R on the set of all real numbers is
reflexive, symmetric, antisymmetric, and/or transitive, where (x,y) R if and
only if
a.
b.
c.
d.
e.
f.
g.
h.
Answers:

x + y = 0.
x = y.
x y is a rational number.
x = 2y.
xy 0.
xy = 0.
x = 1.
x = 1 or y = 1.

a. Not reflexive, for example, 2+2 is not equal to 0. Symmetric, because if x+y=0
then y+x=0. Not antisymmetic. Not transitive, for example, 1+-1=0 and 1+1=0
but 1+1=2.
b. Reflexive (x=x), symmetric (x = y entails y = x), not antisimetric, transitive: if
x = y and y = z then clearly x = z.
c. Reflexive (x-x=0 is rational), symmetric (if x-y=z is rational, then y-x=-z which is
also rational), not antisimmetric, not transitive, for example (1+,-), (-,).
d. Not reflexive, not symmetric, antisymmetric, not transitive.
e. Reflexive, symmetric, not antisymmetric, not transitive (2,0), (0,-6).
f. Not reflexive, symmetric, not transitive. For example, x=1, y=0, z=1.
g. Not reflexive, not symmetric, antisymmetric, transitive.
h. Not reflexive, symmetric, not antisymmetric, not transitive. For example,
x=10,y=1,z=10.
Grading Rubric: each section is worth 2 points. One for incomplete answer, two for a
complete one.
3. (10 points) Let R1 and R2 be the divides and is a multiple of relations on the
set of all positive integers, respectively. That is, R1 = {(a,b) | a divides b} and R2
= {(a,b) | a is a multiple of b}. Find:
a.
b.
c.
d.
e.

R1 R2,
R1 R2,
R1 R2,
R2 R1,
R1 R2.

Answers:
a. Either a divides b, or it is the multiple of b. That is either a divides b or b divides
a. We can formulate this relation as GCD(a,b)=min{a,b}.
b. Both a divides b and b divides a. Thus a=b.
c. a divides b and a<b (ab).
d. b divides a, a>b (ab).
e. GCD(a,b)=min{a,b} and ab
Grading rubric:
2 point for each correct answer.
4. (7 points) How many transitive relations are there on a set with n elements if
a. (2 points) n = 1?
b. (3 points) n = 2?
c. (2 points) n = 3?
Answers:

a. There can be only one reflexive relation that would be also symmetric and
transitive.
b. Suppose we have two elements: {1,2}. We can have the following 15 relations:
{(1,1)} ; {(2,2)} ; {(2,1)} ; {(1,2)} ; {(1,1), (1,2)}; {(1,1),(2,1)}; {(1,1),(2,2)};
{(1,2),(2,1)}; {(1,2),(2,2)}; {(2,1),(2,2)}; {(1,1),(2,2),(2,1)}; {(1,1),(2,2)(1,2)};
{(1,1),(2,1),(1,2)}; {(2,2),(1,2), (2,1)}; {(1,1),(1,2),(2,1),(2,2)}. There are three
non-transitive relations: {(1,2),(2,1)}; {(1,1),(2,1),(1,2)}; {(2,2),(1,2), (2,1)}.
Thus there are 12 transitive relations.
c. Unfortunately one cannot solve this problem without the help of a computer. You
were to write a program that gives a correct answer: 171

You might also like