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. $3$
D. $2$

2 Which property states that ?

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

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

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

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

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

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

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

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

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

7 What does the complexity class P stand for?

Basic Concepts of Complexity Classes- P Easy
A. Polynomial space
B. Polynomial time
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. Non-Polynomial time
C. Negative Polynomial time
D. Nondeterministic 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 requires exponential memory
B. It can be solved in polynomial time
C. Every problem in NP can be reduced to it in polynomial time
D. It has no known algorithm

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

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

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

13 What is ?

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

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

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

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

16 In a decision problem, the output is typically:

Optimization Problems Easy
A. A sorted array
B. An optimal value
C. Yes or No
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. Graph Coloring Problem
C. Knapsack 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.
C. is prime
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. Constant time
C. NP
D. P

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

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

21 What is the result of using modular exponentiation?

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

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. 17
B. 11
C. 8
D. 13

24 What is the modular inverse of ?

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

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 only be solved in exponential time.
C. A problem that can be solved in polynomial time by a deterministic Turing machine.
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 in NP and every problem in NP is polynomial-time reducible to it.
B. It is in P and every problem in NP is polynomial-time reducible to it.
C. It can be solved in polynomial time.
D. It is NP-hard but not in NP.

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

Greatest Common Divisor Medium
A. (2, -7)
B. (-4, 15)
C. (4, -15)
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 moduli must all be prime.
B. The moduli must be pairwise coprime.
C. The moduli must be even numbers.
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. 15
B. 7
C. 14
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 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 seeks to find the best solution from all feasible solutions.
B. It only requires verifying a given solution.
C. It asks for a simple 'yes' or 'no' answer.
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. P = PSPACE
B. NP = EXPTIME
C. NP-complete problems become unsolvable
D. P = NP

33 What is the ?

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

34 Which of the following is equivalent to ?

Modular Arithmetic Medium
A. 2
B. 4
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. Multiply and directly.
C. Find the modular inverse of and .
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. Problem is at least as hard as Problem .
C. Problem is at least as hard as Problem .
D. Both problems can be solved in polynomial time.

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

Modular Arithmetic Medium
A. 14
B. 12
C. 10
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 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. Symmetric key encryption like AES will run in exponential time.
D. Public-key cryptography can still be securely implemented based on worst-case hardness.

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

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

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. The input size and .
C. The input size and .
D. only.

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 , .
C. For all prime factors of , and .
D. is square-free and 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 that is both in NP and co-NP.
B. It is a problem in co-NP to which every other problem in co-NP can be reduced in polynomial time.
C. It is a problem that cannot be verified in polynomial time.
D. It is an NP-complete problem whose complement is also NP-complete.

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. 2
B.
C. 1.5
D.

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-hard but not NP
C. EXPTIME
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. Unless P = NP, general TSP cannot be approximated within any constant factor.
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. General TSP is in P if edge weights are restricted to be positive integers.

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