Docsity

CS 173: Discrete Structures - Quiz 3 Solutions - Prof. Margaret M. Fleck, Quizzes of Discrete Structures and Graph Theory

Toggle sidebar
bg1
CS 173: Discrete Structures, Fall 2010
Quiz 3 (Wednesday 20 October)
NAME:
NETID:
DISCUSSION DAY/TIME:
This quiz has 2 pages containing 4 questions, totalling 20 points. You have 20 minutes
to finish. Showing your work may increase partial credit in case of mistakes.
1. (3 points) Check the appropriate box for each statement:
There is a set Asuch that
for every B⊆Z,A⊆B.
Correct Incorrect
For any function f:Z→Z,
if fis one-to-one then fis strictly
increasing.
Correct Incorrect
Two sets Aand Bare disjoint
if and only if
A=B A ∩B6=∅A∩B=∅
2. (8 points) Check all the boxes which correctly characterize each function, leaving the
other boxes blank.
f:R+→Rsuch that
f(n) = nlog2nO(n): Θ(nlog8n):
g:R+→R+such that
g(n) = 3n
O(n!): Ω(3n+ 17n4):
h:Z→Zsuch that
h(x) = ⌈x⌉One-to-one:Onto:
k:N→Nsuch that
k(n) = n+ 1 One-to-one:Onto:
1
pf3
pf4

Partial preview of the text

Download CS 173: Discrete Structures - Quiz 3 Solutions - Prof. Margaret M. Fleck and more Quizzes Discrete Structures and Graph Theory in PDF only on Docsity!

CS 173: Discrete Structures, Fall 2010

Quiz 3 (Wednesday 20 October)

NAME:

NETID:

DISCUSSION DAY/TIME:

This quiz has 2 pages containing 4 questions, totalling 20 points. You have 20 minutes to finish. Showing your work may increase partial credit in case of mistakes.

  1. (3 points) Check the appropriate box for each statement:

There is a set A such that for every B ⊆ Z, A ⊆ B.

Correct Incorrect

For any function f : Z → Z, if f is one-to-one then f is strictly increasing.

Correct Incorrect

Two sets A and B are disjoint if and only if

A = B A ∩ B 6 = ∅ A ∩ B = ∅

  1. (8 points) Check all the boxes which correctly characterize each function, leaving the other boxes blank. f : R+^ → R such that f (n) = n log 2 n (^) O(n): Θ(n log 8 n):

g : R+^ → R+^ such that g(n) = 3n O(n!): Ω(3n (^) + 17n (^4) ):

h : Z → Z such that h(x) = ⌈x⌉ One-to-one:^ Onto:

k : N → N such that k(n) = n + 1

One-to-one: Onto:

  1. (2 points) Give an example of a function f : { 2 , 13 , 21 } → {red, blue, green, white} which is not one-to-one.
  2. (3 points) Suppose that f and g are functions whose inputs and outputs are positive real numbers. Define precisely what it means for f to be O(g). Your definition must not use Θ, Ω, or slopes/derivatives.
  3. (4 points) Let’s define a function g : N → Z as follows: g(0) = 2, g(1) = 3, and f (n+1) = 3f (n)− 2 f (n−1), for every n ≥ 1. Suppose we are proving that f (n) = 2n+1, for every integer n ≥ 0, using strong induction. Give the hypothesis and conclusion for the inductive step. Do not use vague references such as “the claim” or “P(n)”: write out the specifics of both statements. Strong inductive hypothesis:

Goal of the inductive step, i.e. the conclusion you must reach at the end of the inductive step, not the conclusion of the whole proof:

  1. (2 points) Give an example of a function f : { 2 , 13 , 21 } → {red, blue, green, white} which is not one-to-one. Solution: For example, let f (2) = f (13) = red and f (21) = green. A bubble diagram is another good way to define a function that isn’t easily expressed by a formula.
  2. (3 points) Suppose that f and g are functions whose inputs and outputs are positive real numbers. Define precisely what it means for f to be O(g). Your definition must not use Θ, Ω, or slopes/derivatives. Solution: There are positive real numbers k and c such that f (x) ≤ cg(x), for all x ≥ k. It’s ok if your equation used the absolute values of f (x) and g(x). But it’s not necessary in this case because the problem said that the outputs were positive.
  3. (4 points) Let’s define a function g : N → Z as follows: g(0) = 2, g(1) = 3, and f (n+1) = 3f (n)− 2 f (n−1), for every n ≥ 1. Suppose we are proving that f (n) = 2n+1, for every integer n ≥ 0, using strong induction. Give the hypothesis and conclusion for the inductive step. Do not use vague references such as “the claim” or “P(n)”: write out the specifics of both statements. Correction: (given during quiz) the function name should be f, not g, everywhere in the above. Strong inductive hypothesis: Solution: Suppose that f (n) = 2n^ + 1 for n = 0,... , k, for some integer k ≥ 0.

Goal of the inductive step, i.e. the conclusion you must reach at the end of the inductive step, not the conclusion of the whole proof: Solution: f (k + 1) = 2k+1^ + 1