Computer Science Midterm 2

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

f∘f−1=IB

A and B are finite sets. The function f:A→B is a bijection. Select the true statement. f may not have a well-defined inverse f∘f−1=IAf∘f-1=IA f∘f−1=ff∘f-1=f f∘f−1=IB

⌊x/12⌋

A donut store sells packages of 12 donuts. The store has made x donuts. How many complete packages does the store have for sale?

A strict order and a total order

A person's birth date consists of the month, day, and year in which that person was born. The domain for a relation R is a group of people. No two people in the group have the same birth date. A person x is related to person y under the relation if x's birth date is earlier than y's birth date. Which description correctly characterizes the relation? A strict order and a total order. A partial order and a total order. A partial order but not a total order. A strict order but not a total order.

0110

For f:{0,1}4→{0,1}4 f(x) is obtained by removing the second bit from x and placing the bit at the end of the string. For example, f(1011) = 1110. Select the correct value for f-1(0101).

Injection

Let A = {a, b, c, d} and B = {1, 2, 3, 4, 5}{(d, 3), (b, 1), (a, 2), (c, 4)} ⊆ A X B

Not a function

Let A = {a, b, c, d} and B = {1, 2, 3, 4}{(a, 2), (b, 3), (b, 4), (d, 1)} ⊆ A x B

Well-defined function

Let A = {a, b, c, d} and B = {1, 2, 3, 4}{(a, 2), (b, 3), (c, 3), (d, 1)} ⊆ A X B

Bijection

Let A = {a, b, c, d} and B = {1, 2, 3, 4}{(d, 3), (b, 1), (a, 2), (c, 4)} ⊆ A X B

Surjection

Let A = {a, b, c, d} and B = {1, 2, 3}{(a, 2), (b, 3), (c, 3), (d, 1)} ⊆ A X B

- If f,g are also onto, then f∘g is invertible. - f∘g is one-to-one

Let f:B→C and g:A→B be one-to-one functions. Which of the following statements are true? (Check all that apply.) f∘g is onto f∘g is invertible g∘f is one-to-one If f,g are also onto, then f∘g is invertible. f∘g is one-to-one

(1,4),(2,4),(2,2)

Note that some arrows have heads at both ends. That means that both elements are related to each other. Note also that the self-loops do not have arrow heads. Enter H ο G as a sequence of ordered pairs [e.g. (2,3),(3,4),(4,5) ] Hint: There are 3 ordered pairs.

RXR (all pairs of real numbers)

S and T are relations on the real numbers and are defined as follows: S={(x,y) ∣ x < y} T={(x,y) ∣ x > y} What is T∘S? ∅ S R x R (all pairs of real numbers) T

C, F, B, G, H, A, E, D

Select the ordering of the vertices that is NOT a topological sort of the vertices. C, B, G, F, E, A, H, D B, C, F, A, G, E, H, D C, F, B, G, H, A, E, D C, F, E, B, A, G, H, D

A walk but not a path

Select the properties that accurately describe the following sequence with respect to graph G: ⟨2, 3, 1, 3, 4⟩ A walk and a path Neither a walk nor a path A walk but not a path A path but not a walk

G has a cycle of length 4

Select the statement about G that is false. G has a circuit of length 4 G has a cycle of length 4 G has a cycle of length 3 G has a circuit of length 3

Anti-symmetric

The domain of a relation R is the set of integers. xRy if x^2=y. Select the description that accurately describes relation R. Reflexive Anti-symmetric Symmetric Anti-reflexive

Neither reflexive nor anti-reflexive

The domain of a relation R is the set of real numbers. xRy if |x+y|≥2. Select the description that accurately describes relation R Anti-reflexive Transitive Reflexive Neither reflexive nor anti-reflexive

Neither symmetric nor anti-symmetric

The domain of a relation R is the set of real numbers. xRy if ⌈x⌉ ≤ ⌈y⌉. Select the description that accurately describes relation R. Neither symmetric nor anti-symmetric Anti-symmetric Symmetric Anti-reflexive

Neither a partial order nor a strict order

The domain of a relation is the set of all positive integers. x is related to y if ⌊x/2⌋ ≤ ⌊y/2⌋. Select the description that correctly characterizes the relation. Neither a partial order nor a strict order A partial order but not a total order A strict order but not a total order A partial order and a total order A strict order and a total order

A strict order but not a total order

The domain of a relation is the set of all positive integers. x is related to y if ⌊x/2⌋<⌊y/2⌋. Select the description that correctly characterizes the relation. Neither a partial order nor a strict order A partial order but not a total order A strict order but not a total order A partial order and a total order A strict order and a total order

R is an equivalence relation.

The domain of relation R is Z x Z. (a, b) is related to (c, d) if a-b = c-d. Which statement correctly characterizes the relation R? R is an equivalence relation. R is not an equivalence relation because R is not reflexive. R is not an equivalence relation because R is not symmetric. R is not an equivalence relation because R is not transitive.

R is not an equivalence relation because R is not symmetric.

The domain of relation R is Z x Z. (a, b) is related to (c, d) if a≤c and b≤d. Which statement correctly characterizes the relation R? R is an equivalence relation. R is not an equivalence relation because R is not reflexive. R is not an equivalence relation because R is not symmetric. R is not an equivalence relation because R is not transitive.

R is not an equivalence relation because R is not transitive.

The domain of relation R is the set of all integers. x is related to y if |x-y| ≤ 1. Which statement correctly characterizes the relation R? R is an equivalence relation. R is not an equivalence relation because R is not reflexive. R is not an equivalence relation because R is not symmetric. R is not an equivalence relation because R is not transitive.

3

The domain of relation R is the set of all non-negative integers. x is related to y if ⌊x/3⌋ = ⌊y/3⌋. The equivalence class R defines a partition over the set of all non-negative integers. How many elements are in each set in the partition? 0 1 2 3 4 Each set in the partition is infinite.

(F,F)

Which edge occurs in G4 (F,F) (A,D) (C,C) (F,D)

(E,B)

Which edge occurs in G5 (B,B) (C,E) (A,A) (E,B)

{ (1, 2), (2, 3), (1, 3), (4, 3), (1, 1), (2, 2), (3, 3), (4, 4) }

Which relation on the set {1, 2, 3, 4} is a partial order? { (1, 2), (2, 3), (1, 3), (4, 3), (1, 1), (2, 2), (3, 3), (4, 4) } { (1, 2), (2, 3), (1, 3), (4, 3) } { (1, 2), (2, 3), (1, 3), (3, 4), (1, 1), (2, 2), (3, 3), (4, 4) } { (1, 2), (2, 3), (1, 3), (3, 4) }

Injection

f: Z+→Z+. f(x)=x+3

Bijection

f: Z→Z. f(x)=x+3

0

⌈-0.9⌉

3

⌊3.7⌋


Kaugnay na mga set ng pag-aaral

Ab Psych Test #4: Disorders of Aging & Cognition

View Set

CISSP - Security Architecture and Engineering

View Set

Chapter 8 Drugs Used in Gastrointestinal System Disorders

View Set

PROBLEMS WITH LABOR AND DELIVERY

View Set