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. $1$
B. $4$
C. $2$
D. $3$

2 Which property states that ?

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

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

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

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

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

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

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

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. Pairwise coprime
C. Even numbers
D. Prime numbers only

7 What does the complexity class P stand for?

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

8 What does the complexity class NP stand for?

Basic Concepts of Complexity Classes- NP Easy
A. Normal Polynomial time
B. Nondeterministic Polynomial time
C. Non-Polynomial time
D. Negative 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 requires exponential memory
C. It can be solved in polynomial time
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. Objective function
B. Output array
C. Input size
D. Iterative loop

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. The easiest problems in P
B. Finding a maximum element
C. Sorting an array
D. The hardest problems in NP

13 What is ?

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

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

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

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. NP-hard
B. NP-complete
C. Class P
D. None of the above

16 In a decision problem, the output is typically:

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

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. Knapsack Problem
B. Graph Coloring Problem
C. Traveling Salesperson Problem
D. Boolean Satisfiability Problem (SAT)

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

Modular Arithmetic Easy
A. is even
B. is prime
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. NP
D. Constant time

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

Optimization Problems Easy
A. An optimization problem
B. A sorting problem
C. A linear programming problem
D. A constant time 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. 13
B. 8
C. 11
D. 17

24 What is the modular inverse of ?

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

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 is NP-hard but not in NP.
B. It is in NP and every problem in NP is polynomial-time reducible to it.
C. It can be solved in polynomial time.
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, 11)
B. (2, -7)
C. (-4, 15)
D. (4, -15)

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 moduli must all be prime.
B. The moduli must be even numbers.
C. The moduli must be pairwise coprime.
D. The congruences must have the same remainder.

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

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

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 P
B. NP-complete = P
C. P = NP
D. P NP

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

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

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. P = NP
C. P = PSPACE
D. NP = EXPTIME

33 What is the ?

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

34 Which of the following is equivalent to ?

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

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. There is no difference; the terms are synonymous.
B. NP-complete problems must be in NP, while NP-hard problems do not have to be in NP.
C. NP-hard problems must be in NP, while NP-complete problems do not have to be.
D. NP-complete problems are solvable in polynomial time, NP-hard problems are not.

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. Find the modular inverse of and .
C. Multiply and directly.
D. Calculate .

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. Finding the shortest path in a graph using Dijkstra's algorithm.
C. The Traveling Salesperson Problem (Optimization version).
D. Sorting an array of integers.

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. 12
B. 20
C. 14
D. 10

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 Boolean Satisfiability Problem (SAT)
B. The Knapsack Problem
C. The Vertex Cover Problem
D. The Traveling Salesman 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 always NP-complete.
B. It could be outside NP.
C. It is in NP, but not necessarily NP-complete.
D. It is always in P.

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. One-way functions cannot exist.
B. Cryptographic hash functions can still be collision-resistant.
C. Public-key cryptography can still be securely implemented based on worst-case hardness.
D. Symmetric key encryption like AES will run in exponential time.

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. is NP-complete.
C. belongs to NP.
D. None of the above.

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. Linear Programming
B. Graph Isomorphism
C. Boolean Satisfiability (SAT)
D. Vertex Cover

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. only.
B. The input size 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. For all prime factors of , and .
B. is square-free and for all prime factors of , .
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 a problem that is both in NP and co-NP.
C. It is an NP-complete problem whose complement is also NP-complete.
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.
C. 2
D. 1.5

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. NL-complete and P
B. NP-complete
C. NP-hard but not NP
D. EXPTIME

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

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 Hamiltonian Cycle to Subset Sum.
B. Reduction from 3-SAT to Subset Sum.
C. Reduction from Vertex Cover to Subset Sum.
D. Reduction from Subset Sum to 3-SAT.

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.