Unit 6 - Practice Quiz

CSE408 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the value of ?

Modular Arithmetic Easy
A. $4$
B. $1$
C. $2$
D. $3$

2 Which property states that ?

Modular Arithmetic Easy
A. Distributive property of division
B. Associative property of integers
C. Multiplication property of modular arithmetic
D. Addition property of modular arithmetic

3 What is the Greatest Common Divisor (GCD) of 12 and 18?

Greatest Common Divisor Easy
A. $3$
B. $6$
C. $2$
D. $4$

4 Which algorithm is traditionally used to find the GCD of two integers?

Greatest Common Divisor Easy
A. Kruskal's Algorithm
B. Dijkstra's Algorithm
C. Euclidean Algorithm
D. Prim's Algorithm

5 The Chinese Remainder Theorem is primarily used to solve a system of what?

Chinese Remainder Theorem Easy
A. Differential equations
B. Quadratic equations
C. Linear inequalities
D. Linear congruences

6 For the Chinese Remainder Theorem to be applicable, the moduli in the system of congruences must be:

Chinese Remainder Theorem Easy
A. Multiples of 10
B. Even numbers
C. Prime numbers only
D. Pairwise coprime

7 What does the complexity class P stand for?

Basic Concepts of Complexity Classes- P Easy
A. Programmable time
B. Probabilistic time
C. Polynomial time
D. Polynomial space

8 What does the complexity class NP stand for?

Basic Concepts of Complexity Classes- NP Easy
A. Negative Polynomial time
B. Nondeterministic Polynomial time
C. Non-Polynomial time
D. Normal Polynomial time

9 Which of the following statements is a major unsolved question in computer science?

Basic Concepts of Complexity Classes- P, NP Easy
A. ?
B. ?
C. ?
D. ?

10 A problem is in the class NP-complete if it is in NP and:

Basic Concepts of Complexity Classes- NP-complete Problems Easy
A. It has no known algorithm
B. It can be solved in polynomial time
C. It requires exponential memory
D. Every problem in NP can be reduced to it in polynomial time

11 An optimization problem seeks to find the best solution from all feasible solutions by maximizing or minimizing an:

Optimization Problems Easy
A. Input size
B. Objective function
C. Iterative loop
D. Output array

12 If a problem is NP-hard, it means it is at least as hard as:

Basic Concepts of Complexity Classes- NP-hard Easy
A. Finding a maximum element
B. Sorting an array
C. The easiest problems in P
D. The hardest problems in NP

13 What is ?

Modular Arithmetic Easy
A. $0$
B. $2$
C. $3$
D. $1$

14 If two numbers and are coprime (relatively prime), what is their GCD?

Greatest Common Divisor Easy
A. $0$
B.
C.
D. $1$

15 Is the problem of sorting a list of numbers in class P or NP-hard?

Basic Concepts of Complexity Classes- P, NP Easy
A. Class P
B. NP-hard
C. None of the above
D. NP-complete

16 In a decision problem, the output is typically:

Optimization Problems Easy
A. A sorted array
B. Yes or No
C. An optimal value
D. A floating point number

17 Which of the following is famously known as the first problem proven to be NP-complete?

Basic Concepts of Complexity Classes- NP-complete Problems Easy
A. Traveling Salesperson Problem
B. Knapsack Problem
C. Graph Coloring Problem
D. Boolean Satisfiability Problem (SAT)

18 The modular inverse of an integer modulo exists if and only if:

Modular Arithmetic Easy
A. is prime
B. is even
C.
D.

19 Which complexity class contains problems where a 'Yes' answer can be verified efficiently, but finding the answer might take exponential time?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Easy
A. Polynomial space
B. P
C. Constant time
D. NP

20 The Traveling Salesperson Problem (TSP) is an example of what kind of problem?

Optimization Problems Easy
A. A sorting problem
B. A linear programming problem
C. A constant time problem
D. An optimization problem

21 What is the result of using modular exponentiation?

Modular Arithmetic Medium
A. 4
B. 2
C. 3
D. 1

22 What is the time complexity of the Extended Euclidean Algorithm for two integers and ?

Greatest Common Divisor Medium
A.
B.
C.
D.

23 Suppose and . According to the Chinese Remainder Theorem, what is the smallest positive integer that satisfies these congruences?

Chinese Remainder Theorem Medium
A. 8
B. 13
C. 11
D. 17

24 What is the modular inverse of ?

Modular Arithmetic Medium
A. 7
B. 4
C. 5
D. 2

25 Which of the following best describes a problem in the NP class?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Medium
A. A problem whose solution can be verified in polynomial time by a deterministic Turing machine.
B. A problem that can be solved in polynomial time by a deterministic Turing machine.
C. A problem that can only be solved in exponential time.
D. A problem that cannot be solved by any Turing machine.

26 If a problem is NP-complete, which of the following statements must be true?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Medium
A. It can be solved in polynomial time.
B. It is NP-hard but not in NP.
C. It is in NP and every problem in NP is polynomial-time reducible to it.
D. It is in P and every problem in NP is polynomial-time reducible to it.

27 Given and , what are the coefficients such that using the Extended Euclidean Algorithm?

Greatest Common Divisor Medium
A. (4, -15)
B. (-4, 15)
C. (2, -7)
D. (-4, 11)

28 What is the primary condition for a system of linear congruences to have a unique solution modulo using the Chinese Remainder Theorem?

Chinese Remainder Theorem Medium
A. The congruences must have the same remainder.
B. The moduli must be pairwise coprime.
C. The moduli must all be prime.
D. The moduli must be even numbers.

29 How many elements are in the multiplicative group of integers modulo 15, ?

Modular Arithmetic Medium
A. 15
B. 14
C. 7
D. 8

30 Which of the following complexity class relationships is generally believed to be true, although unproven?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Medium
A. NP-complete = P
B. NP P
C. P = NP
D. P NP

31 In the context of algorithm design, what characterizes an optimization problem?

Optimization Problems Medium
A. It only requires verifying a given solution.
B. It asks for a simple 'yes' or 'no' answer.
C. It seeks to find the best solution from all feasible solutions.
D. It is always solvable in polynomial time.

32 If an NP-hard problem is solved in polynomial time, what is the consequence?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Medium
A. NP-complete problems become unsolvable
B. NP = EXPTIME
C. P = PSPACE
D. P = NP

33 What is the ?

Greatest Common Divisor Medium
A. 21
B. 14
C. 7
D. 35

34 Which of the following is equivalent to ?

Modular Arithmetic Medium
A. 4
B. -2
C. 2
D. 3

35 What is the primary difference between NP-complete and NP-hard problems?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Medium
A. NP-complete problems must be in NP, while NP-hard problems do not have to be in NP.
B. NP-complete problems are solvable in polynomial time, NP-hard problems are not.
C. There is no difference; the terms are synonymous.
D. NP-hard problems must be in NP, while NP-complete problems do not have to be.

36 To solve and using the Chinese Remainder Theorem, one computes and where . What is the next step?

Chinese Remainder Theorem Medium
A. Find the modular inverse of and .
B. Calculate .
C. Find the modular inverse of and .
D. Multiply and directly.

37 Which of the following problems is a classic example of an NP-hard optimization problem?

Optimization Problems Medium
A. Finding the minimum spanning tree using Kruskal's algorithm.
B. Sorting an array of integers.
C. Finding the shortest path in a graph using Dijkstra's algorithm.
D. The Traveling Salesperson Problem (Optimization version).

38 The concept of polynomial-time reduction () is used to show that:

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Medium
A. Neither problem is in NP.
B. Both problems can be solved in polynomial time.
C. Problem is at least as hard as Problem .
D. Problem is at least as hard as Problem .

39 What is the value of , where is Euler's totient function?

Modular Arithmetic Medium
A. 10
B. 14
C. 12
D. 20

40 Which of the following is the first problem proven to be NP-complete by Cook's Theorem?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Medium
A. The Vertex Cover Problem
B. The Traveling Salesman Problem
C. The Boolean Satisfiability Problem (SAT)
D. The Knapsack Problem

41 Suppose we want to compute using the repeated squaring method. If is a -bit integer, what is the exact number of multiplications required in the worst-case scenario (excluding modulo operations)?

Modular Arithmetic Hard
A.
B.
C.
D.

42 Let be pairwise coprime integers and . According to the Chinese Remainder Theorem, the system of congruences for has a unique solution modulo . If , what is the exact formula for the solution ?

Chinese Remainder Theorem Hard
A.
B.
C.
D.

43 In the Extended Euclidean Algorithm for computing , we find integers and such that . If and (successive Fibonacci numbers with ), what is the magnitude of the coefficients and generated by the standard algorithm?

Greatest Common Divisor Hard
A.
B.
C.
D.

44 Which of the following conditions is both necessary and sufficient for the linear congruence to have exactly distinct solutions modulo ?

Modular Arithmetic Hard
A. and
B. and
C. and
D. and

45 Let be an NP-complete problem and be a problem in P. Which of the following is true about ?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Hard
A. It is in NP, but not necessarily NP-complete.
B. It could be outside NP.
C. It is always in P.
D. It is always NP-complete.

46 If P = NP, which of the following statements about cryptographic hash functions and one-way functions is strictly correct?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Hard
A. Cryptographic hash functions can still be collision-resistant.
B. Symmetric key encryption like AES will run in exponential time.
C. Public-key cryptography can still be securely implemented based on worst-case hardness.
D. One-way functions cannot exist.

47 Consider a decision problem that is NP-hard. We know that problem can be reduced to in polynomial time (). What can be definitively inferred about ?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Hard
A. is NP-hard.
B. None of the above.
C. is NP-complete.
D. belongs to NP.

48 Ladner's Theorem states that if P NP, there exist problems in NP that are neither in P nor NP-complete (NP-intermediate). Which of the following problems is widely conjectured to be NP-intermediate?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Hard
A. Vertex Cover
B. Linear Programming
C. Boolean Satisfiability (SAT)
D. Graph Isomorphism

49 In the context of polynomial-time approximation schemes (PTAS) for NP-hard optimization problems, an FPTAS (Fully Polynomial-Time Approximation Scheme) requires the algorithm's running time to be polynomial in:

Optimization Problems Hard
A. The input size only.
B. only.
C. The input size and .
D. The input size and .

50 If you are using the Chinese Remainder Theorem to compute the sum of two large numbers and by working modulo a set of primes , what is the necessary condition on to ensure the result is strictly correct for general integer addition?

Chinese Remainder Theorem Hard
A.
B.
C.
D.

51 Fermat's Little Theorem states that for prime and . Carmichael numbers are composite numbers that satisfy this congruence for all coprime to the number. What is Korselt's criterion for a composite integer to be a Carmichael number?

Modular Arithmetic Hard
A. is square-free and for all prime factors of , .
B. For all prime factors of , and .
C. is square-free and for all prime factors of , .
D. For all prime factors of , .

52 What is the worst-case time complexity of the Euclidean algorithm to compute where , expressed in terms of the number of decimal digits of the smaller number ?

Greatest Common Divisor Hard
A.
B.
C.
D.

53 Which of the following accurately describes a co-NP-complete problem?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Hard
A. It is a problem in co-NP to which every other problem in co-NP can be reduced in polynomial time.
B. It is an NP-complete problem whose complement is also NP-complete.
C. It is a problem that is both in NP and co-NP.
D. It is a problem that cannot be verified in polynomial time.

54 The Minimum Vertex Cover problem is NP-hard. However, its optimization version can be approximated in polynomial time using a simple maximal matching algorithm. What is the tightest guaranteed approximation ratio for this specific algorithm?

Optimization Problems Hard
A.
B. 1.5
C.
D. 2

55 Consider a boolean formula in 2-CNF. The problem of determining whether this formula is satisfiable (2-SAT) belongs to which of the following complexity classes?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Hard
A. EXPTIME
B. NP-hard but not NP
C. NL-complete and P
D. NP-complete

56 The Miller-Rabin primality test is a probabilistic algorithm. For a composite number , what is the maximum probability that the test declares as prime for a single randomly chosen base ?

Number Theory Problems Hard
A.
B.
C.
D.

57 To compute the modular inverse of modulo (where is prime), we can use Fermat's Little Theorem. Which expression computes ?

Modular Arithmetic Hard
A.
B.
C.
D.

58 The Traveling Salesperson Problem (TSP) is a classic NP-hard optimization problem. Which of the following statements is true regarding approximating the general TSP?

Optimization Problems Hard
A. General TSP is in P if edge weights are restricted to be positive integers.
B. General TSP has a 1.5-approximation algorithm known as Christofides algorithm.
C. General TSP admits a Fully Polynomial Time Approximation Scheme (FPTAS).
D. Unless P = NP, general TSP cannot be approximated within any constant factor.

59 Which polynomial-time reduction demonstrates that the Subset Sum problem is NP-hard?

Basic Concepts of Complexity Classes- P, NP, NP-hard, NP-complete Problems Hard
A. Reduction from Subset Sum to 3-SAT.
B. Reduction from Hamiltonian Cycle to Subset Sum.
C. Reduction from 3-SAT to Subset Sum.
D. Reduction from Vertex Cover to Subset Sum.

60 Let and be two large integers represented by -bit arrays. What is the time complexity of the Binary GCD algorithm (Stein's algorithm) in terms of bit operations?

Greatest Common Divisor Hard
A.
B.
C.
D.