CSCI241 - Quizes

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

Select the circuit whose output is x y + z ¯ ¯ .

b.

f ( x ) = x 2 g ( x ) = ⌈ x / 2 ⌉ Select the correct value for f ∘ g ( − 3 / 2 ) .

b. 0

Select the set that is equivalent to C ∪ ( C ∩ B )

b. C

The propositional variables b, v, and s represent the propositions: b: Alice rode her bike today. v: Alice overslept today. s: It is sunny today. Select the logical expression that represents the statement: "Alice rode her bike today only if it was sunny today and she did not oversleep."

b. b → ( s ∧ ¬ v )

S and T are binary relations on the set {a, b, c, d} and are defined as follows: S = { (a, b), (a, c), (b, d), (d, c) } T = { (b, b), (c, a), (c, d), (a, d) }Select the set corresponding to T ∘ S . a. { (a, b), (a, d), (d, a) } b. { (a, a), (a, b), (a, d), (d, a), (d, d) } c. { (a, c), (b, d), (c, b), (c, c) } d. { (a, c), (b, d), (c, a), (c, b), (c, c) }

b. { (a, a), (a, b), (a, d), (d, a), (d, d) } NOt d. { (a, c), (b, d), (c, a), (c, b), (c, c) }

The domain for variable x is the set of all integers. Select the statement that is true.

b. ∃ x ( x 2 < 1 )

Define strings s = 101 and t = 10. Select the string that is equal to st. a. 101101 b. 10110 c. 101 d. 10

b. 10110

Use De Morgan's law to select the statement that is equivalent to: "It is not true that the patient has high blood pressure or influenza."

b. The patient does not have high blood pressure and does not have influenza.

The domain of discourse are the students in a class. Define the predicates: S(x): x studied for the test A(x): x received an A on the test Select the logical expression that is equivalent to: "Everyone who studied for the test received an A on the test."

b. ∀ x ( S ( x ) → A ( x ) )

Graph G is defined by the arrow diagram below. Select the pair of vertices such that there is no walk of length 4 in G from the first vertex to the second vertex. a. 1, 3 b. 1, 4 c. 2, 1 d. 4, 3

b. 1, 4 NOT c. 2, 1 NOT d. 4, 3

S and T are binary relations on the set {a, b, c, d} and are defined by the arrow diagrams below: Select the pair that is not in T ∘ S . a. (1, 3) b. (2, 3) c. (2, 4) d. (4, 3)

c. (2, 4)

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

c. Neither reflexive nor anti-reflexive NOT a. Reflexive NOT d. Transitive

The loop below computes the product of two integers: While (j < n) prod := prod + m j := j + 1 End-while The pre-condition and post-condition for the loop are: Pre-condition: m and n are non-negative integers. j = 0 and prod = 0. Post-condition: p r o d = m ⋅ n .What is the correct loop condition?

c. j is an integer such that j ≤ n and p r o d = m ⋅ j . NOT a. j is an integer such that j ≤ n and p r o d = n ⋅ j . NOT b. j is an integer such that j < n and p r o d = n ⋅ j . NOT d. j is an integer such that j < n and p r o d = m ⋅ j .

Select the collection of sets that forms a partition of 𝐑

c. { x ∈ 𝐑 : x < 2 } { x ∈ 𝐑 : 2 ≤ x < 4 } { x ∈ 𝐑 : 4 ≤ x }

p = T, q = F, and r = T. Select the expression that evaluates to false.

c. ¬ ( p ∧ ¬ q )

The domain for variable x is the set of all integers. Select the statement that is false.

c. ∀ x ( x 2 > x )

The domain of discourse are the students in a class. Define the predicates: S(x): x studied for the test A(x): x received an A on the test Select the logical expression that is equivalent to: "Someone who did not study for the test received an A on the test."

c. ∃ x ( ¬ S ( x ) ∧ A ( x ) )

Select the statement that is false.

c. 𝐙 ⊂ 𝐑 +

Below is a database showing the daily train schedule for a train station. What series of operations should be performed in order to get the departure times of all the Express trains to Amsterdam? a. SELECT[Destination = "Amsterdam"] PROJECT[Express/Local, Departure Time] b. SELECT[Express/Local = "Express"] PROJECT[Destination, Departure Time] c. SELECT[Destination = "Amsterdam" and Express/Local = "Express"] PROJECT[Departure Time] d. SELECT[Destination = "Amsterdam" and Express/Local = "Express"] PROJECT[Departure Time, Track]

c. SELECT[Destination = "Amsterdam" and Express/Local = "Express"] PROJECT[Departure Time] NOT a. SELECT[Destination = "Amsterdam"] PROJECT[Express/Local, Departure Time]

Select the truth assignment that shows that the argument below is not valid: p v q -q p<->q a. p = T q = T b. p = F q = T c. p = T q = F d. p = F q = F

c. p = T q = F

Select the set that corresponds to the relation given in the matrix below. Rows of the matrix are numbered 1 through 4 from top to bottom and columns are numbered 1 through 4 from left to right. a. { (2, 1), (2, 2), (3, 3), (4, 2) } b. { (1, 2), (2, 3), (2, 4), (3, 3) } c. { (1, 2), (2, 2), (2, 4), (3, 3) } d. { (2, 1), (2, 2), (3, 3), (3, 4) }

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

Select the set that corresponds to the relation given in the arrow diagram below: a. { (1, 3), (1, 4), (2, 3) } b. { (1, 3), (1, 4), (3, 2) } c. { (1, 3), (1, 4), (2, 3), (2, 2) } d. { (1, 3), (1, 4), (3, 2), (2, 2) }

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

Graph G is defined by the arrow diagram below. What is the out-degree of vertex 2? a. 1 b. 2 c. 3 d. 4

c. 3

Select the description that fits the sequence below: 8, 5, 2, 2, 1, -1

c. Non-increasing but not decreasing

Select the proposition that is a tautology.

d. ( p ∧ q ) → p

15 athletes are assigned to one of three teams. Each team will have five athletes. The teams are different, so it matters who gets assigned to which team. How many ways are there to assign the athletes to the teams? a. P ( 15 , 3 ) b. P ( 15 , 5 ) c. 15 ! ( 3 ! ) 5 d. 15 ! ( 5 ! ) 3

15 ! ( 5 ! ) 3

How many 10-bit strings begin with "101" or "00"? a. 2 7 + 2 8 b. 2 10 + 2 10 c. 2 7 ⋅ 2 8 d. 2 10 ⋅ 2 10

2 7 + 2 8

How many times does the while loop execute in the pseudocode fragment below? count = 12 While (count > 0) count = count - 3 End-while a. 0 b. 4 c. 5 d. 6

4

How many strings of length 10 over the alphabet {a, b, c, d} have at least one b somewhere in the string? a. 3 10 b. 4 10 − 3 10 c. 10 ⋅ 4 9 d. 10 ⋅ 3 9

4 10 − 3 10

A graph is encoded as a string by listing the number of vertices, followed by a semicolon, followed by a list of the edges in the graph. The graph encoding is used to define a language L. A string is in the language if and only if the string is a valid encoding of a graph and the graph contains a path in which every vertex appears exactly once. Select the string that is in the language. a. (3, 4), (4, 1), (4, 2), (2, 4), (1, 2) b. 4;(3, 4), (4, 2), (2, 1), (1, 3), (2, 2), (3, 1) c. 5;(3, 4), (4, 2), (2, 1), (1, 3), (2, 2), (3, 1) d. 4;(3, 3), (4, 3), (2, 1), (1, 3), (2, 2), (3, 1)

4;(3, 4), (4, 2), (2, 1), (1, 3), (2, 2), (3, 1) NOT 5;(3, 4), (4, 2), (2, 1), (1, 3), (2, 2), (3, 1)

A graph is encoded as a string by listing the number of vertices, followed by a semicolon, followed by a list of the edges in the graph. The graph encoding is used to define a language L. A string is in the language if and only if the string is a valid encoding of a graph and the graph contains a cycle of length three.Select the string that is in the language. a. 3;(4, 1), (4, 2), (2, 4), (3, 4), (1, 2) b. 4;(4, 1), (4, 2), (2, 4), (3, 4), (1, 4) c. 4;(4, 1), (4, 2), (2, 4), (3, 4), (1, 3) d. 4;(4, 1), (5, 2), (2, 4), (3, 4), (1, 3)

4;(4, 1), (4, 2), (2, 4), (3, 4), (1, 3)

Below is a database showing the daily train schedule for a train station. Select the correct output from the following two queries: SELECT[Departure Time ≤ 10:00AM] PROJECT[Destination] a. Brussels Helsinki Munich b. (8:00AM, Brussels) (9:15AM, Helsinki) (9:32AM, Helsinki) c. (8:00AM, Brussels, 1, Express) (9:15AM, Helsinki, 2, Local) (9:22AM, Munich, 1, Local) (9:32AM, Helsinki, 1, Express) d. (8:00AM, Brussels) (9:15AM, Helsinki) (9:22AM, Munich) (9:32AM, Helsinki)

a. Brussels Helsinki Munich

Select the set that corresponds to the relation given in the arrow diagram below: a. { (A, 3), (B, 1), (B, 4), (D, 3), (D, 4) } b. { (A, 3), (B, 1), (B, 2), (D, 3), (D, 4) } c. { (1, B), (3, A), (3, D), (4, B), (4, D) } d. { (1, B), (2, B), (3, A), (3, D), (4, D) }

a. { (A, 3), (B, 1), (B, 4), (D, 3), (D, 4) }

Below is a database showing the daily train schedule for a train station. Select the set of attributes that is a key for this database. a. { Departure Time, Destination } b. { Departure Time, Track } c. { Destination, Track } d. { Destination, Local/Express }

a. { Departure Time, Destination } NOT c. { Destination, Track }

The propositional variables f, h, and p represent the propositions: f: The student got an A on the final. h: The student turned in all the homework. p: The student is on academic probation Select the logical expression that represents the statement: "The student is not on academic probation and the student got an A on the final or turned in all the homework."

a. ¬ p ∧ ( f ∨ h )

Select the value of ⌈ − 5.8 ⌉

a. -5

p = F, q = T, and r = T. Select the expression that evaluates to false.

a. -q

Select the mathematical expression that is equivalent to the sum 2 + 6 + 18 + 54 + ⋯ + 2 ⋅ 3 15 .

a. 3 16 − 1 NOT c. 3 13 − 1

Select the expression that is equivalent to x + y .

a. y + x y ¯ NOT b. x y + y + x ¯ ⋅ y ¯

Select the proposition that is logically equivalent to ¬ p → q .

b. p v q

The propositional variables s and m represent the two propositions: s: it is sunny today m: I will bring my umbrella. Select the logical expression that represents the statement: "Despite the fact that it is sunny today, I will bring my umbrella."

b. s ^ m

Select the mathematical expression that is equivalent to the sum ∑ j = − 2 n − 4 j j + 7 .

b. ∑ j = − 2 n − 5 j j + 7 + ( n − 4 ) n + 3 NOT c. ∑ j = − 2 n − 3 j j + 7 + j n + 3 NOT d. ∑ j = − 2 n − 5 j j + 7 + j n + 3 NOT a. ∑ j = − 2 n − 3 j j + 7 + ( n − 4 ) n + 3

C = { 3 , 5 , 9 , 12 , 15 , 16 } D = { 5 , 7 , 8 , 12 , 13 , 15 } Select the set corresponding to C ⊕ D

c. { 3 , 7 , 8 , 9 , 13 , 16 }

The values for variables x, y, and z are: x = 1, y = 0, z = 1 Select the Boolean expression that evaluates to 0.

c. x + y + z ¯ NOT a. z ¯ y + x y ¯ NOT b. x y z ¯ NOT d. (y + z ¯¯)x

Select the Boolean expression that corresponds to the output of the Boolean circuit below:

c. x y ¯ + y ¯ z NOT: d. x y ¯ + y ¯ z

The function SuperPower given below receives two inputs, x and n, and should return x 4 n − 2 . x is a real number and n is positive integer. SuperPower(x, n) If n = 1, then Return(x^2) y := SuperPower(x, n-1) Return( ? ) What is the correct value for the algorithm to return?

c. y ⋅ x 4

Select the mathematical expression that is equivalent to the sum ∑ j = 0 n − 2 2 j + 1 .

c. ∑ k = 1 n − 1 2 k NOT a. ∑ k = 0 n − 2 2 k NOT b. ∑ k = 1 n − 1 2 k + 1 NOT d. ∑ k = 1 n − 2 2 k + 1

The domain of a relation R is the set of integers. x is related to y under relation R if x 2 = y . Select the description that accurately describes relation R . a. Reflexive b. Anti-reflexive c. Symmetric d. Anti-symmetric

d. Anti-symmetric

Select the set that is equivalent to ( B ∩ C ) ∪ ∅

d. B ∩ C

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

d. Neither symmetric nor anti-symmetric NOT a. Symmetric NOT b. Anti-symmetric NOT c. Anti-reflexive

A = {1, 2, 3, 4}. Select the statement that is false.

d. { 2 , 3 } ⊆ P ( A )

B = { x ∈ 𝐙 : x is a prime number } C = { 3 , 5 , 9 , 12 , 15 , 16 } The universal set U is the set of all integers. Select the set corresponding to B ¯ ∩ C

d. { 9 , 12 , 15 , 16 }

Select the asymptotic worst-case time complexity of the following algorithm: Algorithm Input: a1, a2, ..., an, a sequence of numbers n, the length of the sequence x, a number Output: ??For i = 1 to n-1 For j = i+1 to n For k = 1 to n If ((ai)^2 + (aj)^2 = (ak)^2) Return( "True" ) End-for End-for End-for Return( "False" ) a. Θ ( 1 ) b. Θ ( n ) c. Θ ( n 2 ) d. Θ ( n 3 )

d. Θ ( n 3 )

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 ? a. ∅ b. S c. T d. 𝐑 x 𝐑 (all pairs of real numbers)

d. 𝐑 x 𝐑 (all pairs of real numbers) NOT a. ∅ NOT b. S NOT c. T

Which statement is the contrapositive of: "If x = 4 , then 3 x = 12 ."

d. 3 x ≠ 12 , then x ≠ 4 .

Select the summation expression whose value is equivalent to the sum 4 3 + 6 3 + 8 3 + ⋯ + 28 3 .

d. ∑ j = 2 14 ( 2 j ) 3

Select the value of the sum ∑ k = − 2 3 k 2 .

d. 19 NOT c. 14 NOT a. 3 NOT b. 9

A sequence is defined by the recurrence relation f n = n ⋅ f n − 1 − f n − 3 . How many initial values are required so that the sequence is well defined for all n ≥ 0 ?

d. 3

A relation R is given in the matrix below. Rows of the matrix are numbered 1 through 4 from top to bottom and columns are numbered 1 through 4 from left to right. Select the expression that is false. a. 2R2 b. 3R4 c. 4R1 d. 4R3

d. 4R3

S is a set of strings over the alphabet {a, b} and is defined recursively as follows: Basis: λ ∈ S and b ∈ S Recursive rules: If x is in S, then b x a ∈ S and a x b ∈ S .Select the set that corresponds to all the strings in S of length 4.

d. {bbaa, aabb, baba, abab} NOT c. {baba, abab} NOT b. {bbaa, aabb}

A = {a, b, c, d} X = {1, 2, 3, 4} Select the definition for f that is a well-defined function.

f = {(a, 2), (b, 3), (c, 3), (d, 1)}

A = {a, b, c, d} X = {1, 2, 3, 4} The function f : A → X is defined by the arrow diagram below. Select the set of pairs that defines a function that is equal to f.

f = {(a, 2), (b, 3), (c, 4), (d, 2)}

A and B are finite sets. The function f : A → B is a bijection. Select the true statement.

f ∘ f − 1 = I B

Select the truth assignment that shows that the argument below is not valid: p -> q q p

b. p = F q = T

A = { x ∈ 𝐙 : x is a prime number } B = { 4 , 7 , 9 , 11 , 13 , 14 } Select the set corresponding to A ∩ B

b. {7, 11, 13}

How many strings of length 10 over the alphabet {a, b, c, d} have exactly 3 a's? a. ( 10 3 ) b. 4 7 c. ( 10 3 ) ⋅ 3 7 d. ( 10 3 ) ⋅ 4 7

( 10 3 ) ⋅ 3 7

A store sells 6 varieties of donuts. Chocolate is one of the varieties sold. How many ways are there to select 14 donuts if at most 4 Chocolate donuts are selected? a. ( 19 5 ) − ( 15 5 ) b. ( 19 5 ) − ( 15 4 ) c. ( 19 5 ) − ( 14 5 ) d. ( 19 5 )

( 19 5 ) − ( 14 5 )

How many solutions are there to the equation x 1 + x 2 + x 3 + x 4 + x 5 = 39 , where each x i is an integer that satisfies x i ≥ 3 ? a. ( 24 5 ) b. ( 28 4 ) c. ( 36 5 ) d. ( 40 4 )

( 28 4 )

A country has two political parties, the Reds and the Blues. The 100-member senate has 44 Reds and 56 Blues. How many ways are there to pick a 10 member committee of senators with the same number of Reds as Blues? a. ( 44 10 ) ⋅ ( 56 10 ) b. ( 100 10 ) c. ( 44 5 ) + ( 56 5 ) d. ( 44 5 ) ⋅ ( 56 5 )

( 44 5 ) ⋅ ( 56 5 )

A state's license plate has 7 characters. Each character can be a capital letter (A-Z), or a digit except for 0 (1-9). How many license plates are there in which exactly 3 of the 7 characters are digits? a. ( 7 3 ) ⋅ ( 35 ) 4 b. P ( 7 , 3 ) ⋅ ( 35 ) 4 c. ( 7 3 ) ⋅ ( 26 ) 4 d. ( 7 3 ) ⋅ 9 3 ⋅ ( 26 ) 4

( 7 3 ) ⋅ 9 3 ⋅ ( 26 ) 4

20 applicants from a pool of 90 applications will be hired. How many ways are there to select the applicants who will be hired? a. P ( 90 , 20 ) b. ( 90 20 ) c. 90 20 d. 20 90

( 90 20 )

Select the correct output of the below algorithm with the following input: 3, -1, 2, 9, 36, -7, 6, 4 Algorithm Input: a_1, a_2,..., a_n, a sequence of numbers n, the length of the sequence i, a number Output: ?? i := 1 While (i^2 ≠ a_i and i < n) i := i + 1 End-while If (i^2 = a_i) Return( i ) Return( -1 ) a. -1 b. 3 c. 5 d. 6

-1

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 )

0110

The value f j is defined to be the number of ways to select j pieces for fruit from a set of two apples and three bananas. What is the generating function for the sequence { f j } ? a. 1 + x 5 b. 1 + x + x 2 + x 3 + x 4 + x 5 c. 1 + 2 x + 2 x 2 + 2 x 3 + 2 x 4 + x 5 d. 1 + 2 x + 3 x 2 + 3 x 3 + 2 x 4 + x 5

1 + 2 x + 3 x 2 + 3 x 3 + 2 x 4 + x 5

The value f j is defined to be the number of ways to select j pieces of fruit from a set consisting of an infinite supply of 3-packs of oranges, 2 apples (sold individually), and one 4-pack of bananas. What is the generating function for the sequence { f j } ? a. 1 + x 4 1 − x b. 1 − x 3 ( 1 − x ) 4 ⋅ ( 1 + x 4 ) c. 1 1 − x 3 ⋅ 1 − x 2 ( 1 − x ) ⋅ ( 1 + x 4 ) d. 1 1 − x 3 ⋅ 1 − x 2 ( 1 − x ) ⋅ ( 1 + x 4 ) 1 − x

1 + x 4 1 − x

What is the common ratio of the following geometric sequence? 27, 9, 3, 1, ...

1/3

What is the final value of "count" after the pseudocode fragment shown below? count = 0 For i = 1 to 3 For j = i+1 to 4 count := count + (j - i) End-for End-for a. 0 b. 10 c. 20 d. 35

10

There is a set of 10 jobs in the printer queue. Two of the jobs in the queue are called job A and job B. How many ways are there for the jobs to be ordered in the queue so that job A completes some time before job B? a. 10 ! 2 b. 2 ⋅ 9 ! c. 9 ! d. 10 !

10 ! 2

A basket holds a set of balls. Each ball is red, green, or blue. How many balls must there be in the basket in order to guarantee that there are at least 5 balls of the same color? a. 12 balls b. 13 balls c. 14 balls d. 15 balls

13 balls

How large must a group of people be in order to guarantee that there are at least two people in the group whose birthdays fall in the same month? a. 1 person b. 2 people c. 12 people d. 13 people

13 people

How many strings of length 12 over the alphabet {a, b, c, d} start with "aa" or end with "aa" or both? a. 2 ⋅ 4 10 + 4 8 b. 2 ⋅ 4 10 − 4 8 c. 2 ⋅ ( 12 2 ) ⋅ 4 10 + ( 12 4 ) ⋅ 4 8 d. 2 ⋅ ( 12 2 ) ⋅ 4 10 − ( 12 4 ) ⋅ 4 8

2 ⋅ 4 10 − 4 8

A particular state's license plates have 7 characters. Each character can be a capital letter, or a digit except for 0. How many license plates are there in which no two adjacent characters are the same? a. 35 ⋅ ( 34 ) 6 b. ( 34 ) 7 c. 35 ⋅ 34 ⋅ 33 ⋅ 32 ⋅ 31 ⋅ 30 ⋅ 29 d. ( 35 ) 7

35 ⋅ ( 34 ) 6

Each person in a group weighs at least 100 pounds and at most 130 pounds. How large must the group be in order to guarantee that there are at least 2 people whose weights differ by at most 9 pounds? a. 5 people b. 6 people c. 30 people d. 31 people

5 people

A bank PIN is a string of four digits, each digit 0-9. How many choices are there for a PIN if the last digit must be odd? a. 10 4 b. 4 10 c. 5 ⋅ 3 10 d. 5 ⋅ 10 3

5 ⋅ 10 3

A license plate has 7 characters. Each character can be a capital letter or a digit except for 0. How many license plates are there in which no character appears more than once and the first character is a digit? a. 9 ⋅ P ( 35 , 6 ) b. 9 ⋅ P ( 34 , 6 ) c. 9 ⋅ ( 35 ) 6 d. 9 ⋅ ( 34 ) 6

9 ⋅ P ( 34 , 6 )

A complete graph with 6 vertices is traversed using depth first search. The vertices are labeled A through F. The search starts at vertex A and vertices are considered in alphabetical order. What is the resulting DFS tree? a b c d

A (LOOK AT SCREENSHOTS ON SNAPCHAT TO CONFIRM)

What is the height of the tree shown below? alt text not provided a. 4 b. 5 c. 6 d. 7

A. 4 NOT b. 5

What are the edges in the minimum spanning tree of the graph shown below?

A. {d, f}, {f, c}, {c, h}, {c, e}, {e, g}, {f, a}, {a, b} NOT c. {d, f}, {d, g}, {g, e}, {e, c}, {c, h}, {f, a}, {a, b}

An acyclic graph has 10 vertices and 8 edges. How many connected components does the graph have?

B. 2 NOT C. 3 NOT a. 1 NOT d. 4

A complete graph with 6 vertices is traversed using breadth first search. The vertices are labeled A through F. The search starts at vertex A and vertices are considered in alphabetical order. What is the resulting BFS tree?

C

Which of the following tic-tac-toe configurations has a child that is a leaf if X plays next?

C NOT A NOT b

Use the prefix tree below to encode the word "piece". a. 11101000011110 b. 11110100011110 c. 1110100011110 d. 1110100001110

C. 1110100011110 NOT a. 11101000011110

Select the current state after the FSM below has processed the string 11010. a. A b. B c. C d. D

D

Consider a weighted graph in which all the weights on the edges are distinct. Suppose that e is the edge with the largest weight. What is the property that the graph must have in order for e to be in the minimum spanning tree? a. The graph must be a tree. b. The edge e must be incident to a vertex of degree 1. c. The weight of e must be close to the next largest weight. d. The graph is no longer connected if e is removed.

D. The graph is no longer connected if e is removed. not b. The edge e must be incident to a vertex of degree 1. NOT a. The graph must be a tree. NOT c. The weight of e must be close to the next largest weight.

Select the problem that is a decision problem. a. Given a graph, determine the length of the longest cycle in the graph. b. Given a graph and a positive integer x, determine whether the graph has a cycle of length x. c. Given a graph, find the longest cycle in the graph. d. Given a graph, determine the number of distinct cycles of length 3 that the graph contains.

Given a graph and a positive integer x, determine whether the graph has a cycle of length x.

A class of 30 students with 14 boys and 16 girls must select 4 leaders. How many ways are there to select the 4 leaders so that at least one girl is selected? a. 16 ⋅ ( 29 3 ) b. 16 ⋅ ( 30 3 ) c. ( 30 4 ) − ( 16 4 ) d. ( 30 4 ) − ( 14 4 )

NOT b. 16 ⋅ ( 30 3 ) NOT c. ( 30 4 ) − ( 16 4 ) NOT a. 16 ⋅ ( 29 3 )

f : 𝐙 → 𝐙 . f ( x ) = ⌈ x 3 ⌉ Select the correct description of the function f. a. One-to-one and onto b. One-to-one but not onto c. Onto but not one-to-one d. Neither one-to-one nor onto

NOT b. One-to-one but not onto

f : { 0 , 1 } 4 → { 0 , 1 } 3 f(x) is obtained from x by removing the first bit. For example, f(1000) = 000. Select the correct description of the function f.

Onto but not one-to-one

f : 𝐙 → 𝐙 . f ( x ) = ⌈ x 3 ⌉

Onto but not one-to-one

Select the sentence that correctly describes the set of strings accepted by the FSM below: a. The FSM accepts a string x if and only if x contains at least one 0 and at least one 1. b. The FSM accepts a string x if and only if x starts with a 0 and ends with a 1. c. The FSM accepts a string x if and only if the number of 1's in x is odd and the number of 0's in x is odd. d. The FSM accepts a string x if and only if x contains the pattern 101 somewhere in the string.

The FSM accepts a string x if and only if the number of 1's in x is odd and the number of 0's in x is odd. NOT a. The FSM accepts a string x if and only if x contains at least one 0 and at least one 1.

The set of full binary trees is defined as follows: Basis: A single vertex with no edges is a full binary tree. The root is the only vertex in the tree. Recursive rule: If T1 and T2 are full binary trees, then a new tree T' can be constructed by first placing T1 to the left of T2, adding a new vertex v at the top and then adding an edge between v and the root of T1 and an edge between v and the root of T2. The new vertex v is the root of T'.Select the tree that is not a full binary tree.

a NOT b NOT d

Select the graph that does not have an Euler trail. a. b. c. d.

a NOT c.

A store sells 4 varieties of donuts. Chocolate and Jelly are two of the varieties sold. How many ways are there to select 14 donuts so that at least 5 Chocolate donuts and at most 4 Jelly donuts are selected? a. ( 12 3 ) − ( 7 3 ) b. ( 12 3 ) − ( 9 3 ) c. ( 12 3 ) + ( 15 3 ) − ( 9 3 ) d. ( 12 3 ) ⋅ [ ( 15 3 ) − ( 9 3 ) ]

a. ( 12 3 ) − ( 7 3 ) NOT c. ( 12 3 ) + ( 15 3 ) − ( 9 3 )

20 identical prizes are distributed to a group of 180 people. How many ways are there to distribute the prizes if each person can receive at most one prize? a. ( 180 20 ) b. P ( 180 , 20 ) c. ( 199 179 ) d. 180 20

a. ( 180 20 ) NOT d. 180 20

A class of 35 students with 17 boys and 18 girls must select 10 leaders. How many ways are there to select the 10 leaders if at least one girl and at least one boy must be selected? a. ( 35 10 ) − ( 18 10 ) − ( 17 10 ) b. ( 35 10 ) − ( 18 10 ) ⋅ ( 17 10 ) c. 18 ⋅ 17 ⋅ ( 33 8 ) d. 18 ⋅ 17 ⋅ P ( 33 , 8 )

a. ( 35 10 ) − ( 18 10 ) − ( 17 10 ) NOT c. 18 ⋅ 17 ⋅ ( 33 8 ) NOT b. ( 35 10 ) − ( 18 10 ) ⋅ ( 17 10 )

A = { a , b } B = { 1 , 2 , 3 } Select the the expression that is an element of A × B × B

a. ( b , 2 , 3 )

A sequence { a n } is defined as follows: a 0 = 2 , a 1 = 1 , and for n ≥ 2 , a n = 3 ⋅ a n − 1 − n ⋅ a n − 2 + 1 . What is a 3 ?

a. -2

The value f j is defined to be the number of ways to select j cans of soda from an infinite supply of identical 2-packs. What is the generating function for the sequence { f j } ? a. 1 1 − x 2 b. 1 ( 1 − x ) 2 c. x 2 ( 1 − x ) 2 d. 1 + x 2

a. 1 1 − x 2 NOT c. x 2 ( 1 − x ) 2

A bank PIN is a string of four digits, each digit 0-9. How many choices are there for a PIN if the last digit must be odd and all the digits must be different from each other? a. 9 ⋅ 8 ⋅ 7 ⋅ 5 b. 5 ⋅ 10 3 c. 10 ⋅ 9 ⋅ 8 ⋅ 5 d. 10 ⋅ 9 ⋅ 8 ⋅ 7

a. 9 ⋅ 8 ⋅ 7 ⋅ 5

Which set is a connected component of the graph below? a. {A, H} b. {B, D, F} c. {C, E, G, J} d. {A, B, D, F, H, J}

a. {A, H} NOT b. {B, D, F}

Select the proposition that is a contradiction.

a. ¬ ( p ∨ q ) ∧ p

Select the permutation that is the next one in lexicographic order after (4, 6, 2, 7, 3, 1, 5). a. (4, 6, 2, 7, 3, 5, 1) b. (4, 6, 2, 7, 5, 1, 3) c. (4, 6, 2, 7, 1, 3, 5) d. (4, 6, 3, 1, 2, 5, 7)

a. (4, 6, 2, 7, 3, 5, 1)

Select the graph that has an Euler trail. a. K 2 , 3 b. K 3 , 3 c. K 3 , 4 d. K 4 , 4

a. K 2 , 3

Select the words that correctly completes the following sentence: In the graph below vertices A and C _____ . alt text not provided a. are adjacent b. are incident c. are regular d. both have degree 3

a. are adjacent

Select the order in which the vertices are visited in a pre-order traversal of the tree shown below. alt text not provided a. e, i, b, h, f, a, c, d, g b. e, i, b, h, f, a, d, c, g c. b, i, f, h, a, d, g, c, e d. b, i, f, h, d, g, c, a, e

a. e, i, b, h, f, a, c, d, g

What is the chromatic number of the graph shown below? alt text not provided a. 3 b. 4 c. 5 d. 6

a. 3 NOT b. 4

A planar graph G has 7 vertices. One of the vertices has degree 4, two vertices have degree 3, and four vertices have degree 2. How many regions does G have? a. 4 b. 5 c. 6 d. 7

a. 4 NOT b. 5 NOT d. 7

Use the prefix tree below to decode 10110011110.

a. rice

The graph below is traversed using breadth first search. The search starts at vertex A and vertices are considered in alphabetical order. What are the edges in the breadth first search tree? alt text not provided a. {A, B}, {A, C}, {A, E}, {B, F}, {C, D} b. {A, B}, {A, C}, {A, E}, {B, F}, {F, D} c. {A, B}, {A, C}, {B, E}, {B, F}, {C, D} d. {A, B}, {A, C}, {B, E}, {B, F}, {F, D}

a. {A, B}, {A, C}, {A, E}, {B, F}, {C, D}

Which choice corresponds to the descendants of vertex d?

b. g, b, c, and h

In implementing Prim's algorithm, after vertices b, c, e, and f have been added to the MST, what are the set of eligible edges?

b. {e, d}, {f, d}, {c, d}, {b, a}, {b, g}, {f, g}, {a, c}, {c, h} NOT d. {e, d}, {f, d}, {c, d}, {c, f}, {b, g}, {f, g}, {a, c}, {c, h}, {a, h}

In the graph below, which pair of vertices have a path of length 6 between them? a. B and C b. B and G c. C and D d. D and G

b. B and G

20 different prizes are distributed to a group of 180 people. Since the prizes are different, it matters who gets which prize. How many ways are there to distribute the prizes if each person can receive at most one prize? a. ( 180 20 ) b. P ( 180 , 20 ) c. ( 199 179 ) d. 180 20

b. P ( 180 , 20 ) NOT a. ( 180 20 )

What is the vertex connectivity of the graph pictured below? a. 1 b. 2 c. 3 d. 4

b. 2

Select the statement that is false. a. If two graphs G and H are isomorphic, then they have the same total degree. b. If two graphs G and H have the same degree sequence, then G and H are isomorphic. c. If two graphs G and H have the same degree sequence, then G and H must have the same number of edges. d. If two graphs G and H have the same number of edges then G and H must have the same total degree.

b. If two graphs G and H have the same degree sequence, then G and H are isomorphic. NOT a. If two graphs G and H are isomorphic, then they have the same total degree. NOT c. If two graphs G and H have the same degree sequence, then G and H must have the same number of edges.

Select the sequence that is a cycle in the graph below: alt text not provided a. ⟨ B , D , G , F , E , B ⟩ b. ⟨ B , D , G , E , F , B ⟩ c. ⟨ B , D , G , F ⟩ d. ⟨ B , D , G , E , D , B ⟩

b. ⟨ B , D , G , E , F , B ⟩

Select the correct matrix representation for the undirected graph given below. The rows and columns of the matrix are numbered 1 through 5. V = {1, 2, 3, 4, 5} E = { {1, 3}, {2, 3}, {4, 5}, {5, 1}, {5, 2}, {3, 4} } a. b. c. d.

c NOT d

What is the coefficient of the c 4 d 7 term in ( − 3 c + 5 d ) 11 ? a. ( 11 7 ) b. ( − 3 ) 4 ⋅ 5 7 c. ( 11 7 ) ⋅ 3 4 ⋅ 5 7 d. − ( 11 7 ) ⋅ 3 4 ⋅ 5 7

c. ( 11 7 ) ⋅ 3 4 ⋅ 5 7 NOT a. ( 11 7 ) NOT d. − ( 11 7 ) ⋅ 3 4 ⋅ 5 7 NOT b. ( − 3 ) 4 ⋅ 5 7

The degree sequence of a graph is a list of the degrees of all of the vertices in non-increasing order. The degree sequence for four different graphs are given below. Each graph is guaranteed to be connected. Select the degree sequence corresponding to the graph that has an Euler trail. a. 1, 2, 3, 3, 4, 4, 4, 5 b. 2, 2, 2, 4, 4, 4, 4 c. 2, 2, 3, 4, 4, 4, 5 d. 2, 4, 4, 4, 4, 4, 6

c. 2, 2, 3, 4, 4, 4, 5 NOT d. 2, 4, 4, 4, 4, 4, 6 NOT b. 2, 2, 2, 4, 4, 4, 4 NOT a. 1, 2, 3, 3, 4, 4, 4, 5

f is a function that maps 6-bit binary strings to 4-bit binary strings. For x ∈ { 0 , 1 } 6 , f(x) is the string x with the last two bits removed. Which property best describes the function f? a. Bijection b. 2-to-1 correspondence c. 4-to-1 correspondence d. 16-to-1 correspondence

c. 4-to-1 correspondence NOT b. 2-to-1 correspondence NOT a. Bijection

Select the set of properties such that it is possible to have a graph that satisfies all the properties in the set. a. Connected, 7 vertices, 5 edges b. A free tree, 10 vertices, one leaf c. 8 vertices, 7 edges, not a tree d. Acyclic, 6 vertices, 7 edges

c. 8 vertices, 7 edges, not a tree NOT b. A free tree, 10 vertices, one leaf NOT a. Connected, 7 vertices, 5 edges

The vertex set of graph G 1 is V 1 = {A, B, C, D, E}. The vertex set of graph G 2 is V 2 = {1, 2, 3, 4, 5}. The function f is an isomorphism that maps G 1 to G 2 as follows: F(A) = 4, f(B) = 1, f(C) = 3, F(D) = 5, f(E) = 2 The graph G 1 is pictured in the drawing below. Which edge is not in G 2 ? a. {1, 4} b. {1, 3} c. {2, 4} d. {3, 4}

c. {2, 4}

Suppose that G is a graph with n vertices such that every vertex has degree n/2. If the graph is represented using the adjacency list representation, then what is the worst-case complexity to determine whether two particular vertices are adjacent? a. Θ ( 1 ) b. Θ ( log n ) c. Θ ( n ) d. Θ ( n 2 )

c. Θ ( n )

Suppose that G is a graph with n vertices such that every vertex has degree 4. If the graph is represented using the matrix representation, then what is the worst-case complexity to find all the neighbors of a particular vertex? a. Θ ( 1 ) b. Θ ( log n ) c. Θ ( n ) d. Θ ( n 2 )

c. Θ ( n ) NOT b Θ ( log n ) NOT d. Θ ( n 2 )

Select the permutation that is the next one in lexicographic order after (4, 6, 2, 5, 3, 1). a. (4, 6, 2, 1, 3, 5) b. (4, 6, 5, 1, 2, 3) c. (4, 6, 3, 1, 2, 5) d. (4, 6, 3, 5, 2, 1)

c. (4, 6, 3, 1, 2, 5)

The greedy algorithm is used to color the graph shown below. The vertices are colored in order: A through G. The colors are ordered as: 1 - Red 2 - Blue 3 - Green 4 - Yellow 5 - Purple What is the coloring assigned to each vertex? a. A - red, B - red, C - blue, D - green, E - yellow, F - yellow, G - purple b. A - red, B - blue, C - red, D - red, E - red, F - blue, G - blue c. A - red, B - red, C - blue, D - green, E - green, F - yellow, G - yellow d. A - red, B - blue, C - green, D - red, E - red, F - blue, G - blue

c. A - red, B - red, C - blue, D - green, E - green, F - yellow, G - yellow

Select the sequence that is a Hamiltonian cycle for the graph shown below: alt text not provided a. ⟨ d , e , f , b , a , c ⟩ b. ⟨ d , e , f , b , a , c , d ⟩ c. ⟨ d , f , e , c , a , b , d ⟩ d. ⟨ d , f , e , c , b , a , d ⟩

c. ⟨ d , f , e , c , a , b , d ⟩

The Binomial Theorem says that for any positive integer n and any real numbers x and y, ∑ k = 0 n ( n k ) x k y n − k = ( x + y ) n Use the Binomial Theorem to select the correct value for ∑ k = 0 n ( − 2 ) k ( n k ) . a. 0 b. 1 c. ( − 1 ) n d. ( − 2 ) n

c. ( − 1 ) n NOT a. 0 NOT b. 1 NOT d. ( − 2 ) n

Select the generating function for the sequence: 1, 1, 1, 1, 1, 1 a. 1 1 − x b. 1 − x 5 1 − x c. 1 − x 6 1 − x d. 1 + x 5

c. 1 − x 6 1 − x NOt a. 1 1 − x NOT d. 1 + x 5 NOT b. 1 − x 5 1 − x

How many ways are there to permute the letters in SOUPSPOONS? a. 10 ! 3 ! 2 ! b. 10 ! 3 ! 2 ! 2 ! c. 10 ! 3 ! 3 ! 2 ! d. 10 ! 3 ! 3 ! 2 ! 2 !

c. 10 ! 3 ! 3 ! 2 !

What is the length of the walk ⟨ B , D , G , E , D , B ⟩ in the graph below: a. 3 b. 4 c. 5 d. 6

c. 5

What is the height of a full game tree for tic-tac-toe in which the root is an empty tic-tac-toe board?

c. 9

Which graph does not have a Hamiltonian path? a b c d

d

Select the graph that has an Euler circuit. a b c d

d NOT c NOT b NOT a

How many strings of length 12 over the alphabet {a, b, c} have exactly three a's or have exactly three b's or have exactly three c's? a. 3 ⋅ ( 12 3 ) ⋅ 2 9 b. 3 ⋅ ( 12 3 ) − 3 ⋅ ( 12 6 ) c. 3 ⋅ ( 12 3 ) ⋅ 2 9 − 3 ⋅ ( 12 6 ) d. 3 ⋅ ( 12 3 ) ⋅ 2 9 − 3 ⋅ ( 12 3 ) ⋅ ( 9 3 )

d. 3 ⋅ ( 12 3 ) ⋅ 2 9 − 3 ⋅ ( 12 3 ) ⋅ ( 9 3 ) NOT c. 3 ⋅ ( 12 3 ) ⋅ 2 9 − 3 ⋅ ( 12 6 )

Select the set of properties such that it is impossible to have a graph that satisfies all the properties in the set. a. Connected, 7 vertices, 7 edges b. Tree, 10 vertices, 9 leaves c. 8 vertices, 10 edges, not a tree d. Acyclic, 7 vertices, 7 edges

d. Acyclic, 7 vertices, 7 edges NOT C. 8 vertices, 10 edges, not a tree NOT a. Connected, 7 vertices, 7 edges NOT b. Tree, 10 vertices, 9 leaves

Select the true statement. a. K 2 , 3 is not planar. b. Every embedding of a planar graph has no edge crossings. c. The graph K 5 has a planar embedding. d. C 20 is a planar graph

d. C 20 is a planar graph. NOT b. Every embedding of a planar graph has no edge crossings. NOT a. K 2 , 3 is not planar. NOT c. The graph K 5 has a planar embedding.

Select the correct statement. a. If an undirected graph G is connected, then G must have an Euler circuit. b. If an undirected graph G does not have any isolated vertices, then G must have an Euler circuit. c. If an undirected graph G is 3-regular, then G must have an Euler circuit. d. If an undirected graph G is 4-regular, then G must have an Euler circuit.

d. If an undirected graph G is 4-regular, then G must have an Euler circuit. NOT b. If an undirected graph G does not have any isolated vertices, then G must have an Euler circuit. NOT a If an undirected graph G is connected, then G must have an Euler circuit. NOT c. If an undirected graph G is 3-regular, then G must have an Euler circuit.

Select the graph that does not have a Hamiltonian cycle. a. K 5 b. K 6 c. K 3 , 3 d. K 3 , 4

d. K 3 , 4 NOT a. K 5 NOT b. K 6

Select the sentence that correctly describes the value returned by Post-order(r), where r is the root of a tree. Post-order(v) Count = 0 For every child w of v: Count = Count +1 End-for For every child w of v: x := Post-order(w) If (x > Count) Count := x End-for Return( Count ) a. The height of the tree. b. The number of leaves in the tree. c. The number of internal vertices in the tree. d. The largest number of children belonging to any vertex in the tree.

d. The largest number of children belonging to any vertex in the tree. NOT C. The number of internal vertices in the tree. NOT b. The number of leaves in the tree.

Select the order in which the vertices are visited in a post-order traversal of the tree shown below. a. e, i, b, h, f, a, c, d, g b. e, i, b, h, f, a, d, c, g c. b, i, f, h, a, d, g, c, e d. b, i, f, h, d, g, c, a, e

d. b, i, f, h, d, g, c, a, e NOT a. e, i, b, h, f, a, c, d, g

Which choice corresponds to the level 2 vertices? alt text not provided a. j, f, and i b. g, b, and c c. j, d, k, and i d. e, d, m, a, and l

d. e, d, m, a, and l

Suppose S and T are finite sets and there is a function f : S → T such that f is a k-to-1 correspondence. What can be inferred about the cardinality of S and T? a. | S | ≤ | T | b. | T | = | S | c. | S | = | T | k d. | T | = | S | k

d. | T | = | S | k NOT b. | T | = | S | NOT c. | S | = | T | k NOT a. | S | ≤ | T |

Which choice corresponds to the leaves of the tree? alt text not provided a. e, g, b, h, m, a, and l b. e, g, b, c, h, f, m, a, and l c. g, b, h, f, m, a, and l d. e, g, b, h, f, m, a, and l

d. e, g, b, h, f, m, a, and l

What is the total degree of the graph below? alt text not provided a. 3 b. 4 c. 6 d. 8

d. 8

Select the function f that is an isomorphism from G to G'. alt text not provided a. f(a) = 3, f(b) = 5, f(c) = 4, f(d) = 2, f(e) = 1 b. f(a) = 3, f(b) = 5, f(c) = 2, f(d) = 4, f(e) = 3 c. f(a) = 3, f(b) = 4, f(c) = 2, f(d) = 5, f(e) = 1 d. f(a) = 3, f(b) = 5, f(c) = 2, f(d) = 4, f(e) = 1

d. f(a) = 3, f(b) = 5, f(c) = 2, f(d) = 4, f(e) = 1

The loop below computes the sum ∑ k = 1 n k 2 : While (j ≤ n) sum := sum + j^2 j := j + 1 End-while Pre-condition: m and n are non-negative integers. j = 1 and sum = 0. Post-condition: s u m = ∑ k = 1 n k 2 . Loop- invariant: j is an integer, j ≤ n + 1 , and s u m = ∑ k = 1 j − 1 k 2 .What facts are assumed in proving the post-condition?

d. j is an integer j ≤ n and j > n s u m = ∑ k = 1 j − 1 k 2 NOT a. j is an integer j ≤ n and j ≥ n s u m = ∑ k = 1 j − 1 k 2

p = T, q = F, and r = F. Select the expression that evaluates to true.

d. p v r

Select the expression that is equivalent to x ¯ .

d. x ¯ ⋅ y ¯ + x ¯ NOT ( x + x ¯ ) ( y + x )

Select the function that has a well-defined inverse.

f : 𝐙 → 𝐙 f ( x ) = x + 4

Select the argument that is invalid.

p -> q p v q p

Select the Boolean expression that corresponds to the output of the Boolean circuit below:

x + y ¯ + y z

Select the Boolean expression that is equivalent to the function defined in the table blow:

x y ¯ z ¯ + x y z

Select the Boolean expression that is equivalent to the function defined in the table below:

x ¯ y z ¯ + x ¯ y z + x y ¯ z

Select the Boolean expression that is equivalent to the function defined in the table blow:

x ¯ y ¯ z ¯ + x ¯ y z ¯ + x y z

The function ComputeSum receives a positive integer n as the input and returns the value ComputeSum ( n ) = ∑ j = 1 n ( j + 2 ) j 2. ComputeSum(n) If n = 1, then Return(3) y := ComputeSum(n - 1) Return( ? ) What is the correct value for the algorithm to return?

y + ( n + 2 ) n 2

The values for variables x, y, and z are: x = 0, y = 1, z = 1 Select the Boolean expression that evaluates to 1.

z + x ¯ + y x ¯

Select the asymptotic worst-case time complexity of the following algorithm: Algorithm Input: a1, a2, ..., an, a sequence of numbers n, the length of the sequence x, a number Output: ?? For i = 1 to 3 If (ai < x) Return("True") End-for Return( "False" ) a. Θ ( 1 ) b. Θ ( n ) c. Θ ( n 2 ) d. Θ ( n 3 )

Θ ( 1 ) NOT Θ ( n )

The domain for variable x is the set {Ann, Ben, Cam, Dave}. The table below gives the values of predicates P and Q for every element in the domain.

∀ x ( Q ( x ) → P ( x ) )

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

⌊ x / 12 ⌋


Kaugnay na mga set ng pag-aaral

Chapter 2, Econ Chapter 3,4,6,7 Review 1, Econ Chapter 3, Econ Chapter 4, Managerial Economics Exam

View Set

Qualifying Exam 3rd Year Pointers (Final)

View Set

Vertical Asymptotes of Rational Functions Assignment

View Set

Unit 11 Vocabulary (allude-pretext)

View Set

Lesson 17: At-Risk & Vulnerable Populations & Effect on Health

View Set

Sustainable Construction (LEED) Exam 1

View Set

BUL 5810 Chapter 7 Homework Quizzes

View Set