0% found this document useful (0 votes)
16 views

Cse408 Unit 6

Uploaded by

Ritesh Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Cse408 Unit 6

Uploaded by

Ritesh Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Number-Theoretic Algorithms and

Complexity Classes
1. Which of the following complexity classes represents the set of decision problems that
can be solved by a deterministic Turing machine in polynomial time? a) P b) NP c) NP-
hard d) NP-complete Answer: a) P
2. The Euclidean algorithm is used to find the: a) Greatest Common Divisor (GCD) of two
numbers b) Least Common Multiple (LCM) of two numbers c) Prime factorization of a
number d) Modular inverse of a number Answer: a) Greatest Common Divisor (GCD) of
two numbers
3. Which of the following is NOT a property of prime numbers? a) Prime numbers are
divisible by 1 and themselves. b) Prime numbers have exactly two distinct positive
divisors. c) Prime numbers are always odd. d) Prime numbers cannot be expressed as a
product of two smaller numbers. Answer: c) Prime numbers are always odd.
4. The time complexity of the Sieve of Eratosthenes algorithm for finding prime numbers up
to a given limit is: a) O(n) b) O(n log n) c) O(n^2) d) O(sqrt(n)) Answer: d) O(sqrt(n))
5. Which of the following is an example of a number-theoretic algorithm? a) QuickSort b)
Dijkstra's algorithm c) Prim's algorithm d) Miller-Rabin primality test Answer: d) Miller-
Rabin primality test
6. The complexity class co-NP represents the set of decision problems for which: a) There
exists a non-deterministic Turing machine that can solve them in polynomial time. b)
There exists a deterministic Turing machine that can solve them in polynomial time. c)
There exists a non-deterministic Turing machine that can verify their solutions in
polynomial time. d) There exists a deterministic Turing machine that can verify their
solutions in polynomial time. Answer: c) There exists a non-deterministic Turing machine
that can verify their solutions in polynomial time.
7. The Chinese Remainder Theorem is used to solve: a) Linear programming problems b)
Quadratic programming problems c) Systems of linear equations d) Systems of
congruences Answer: d) Systems of congruences
8. Which of the following is an example of an NP-complete problem? a) Sorting a list of
numbers b) Finding the shortest path in a graph c) Solving a system of linear equations
d) Traveling Salesperson Problem (TSP) Answer: d) Traveling Salesperson Problem
(TSP)
9. The time complexity of the Euclidean algorithm for finding the GCD of two numbers is: a)
O(n) b) O(log n) c) O(n log n) d) O(n^2) Answer: b) O(log n)
10. The complexity class PSPACE represents the set of decision problems that can be
solved by a: a) Deterministic Turing machine in polynomial space b) Non-deterministic
Turing machine in polynomial space c) Deterministic Turing machine in exponential
space d) Non-deterministic Turing machine in exponential space Answer: a)
Deterministic Turing machine in polynomial space
11. Which of the following is NOT a data structure? a) Array b) Linked List c) Stack d)
Algorithm Answer: d) Algorithm
12. What is the time complexity of inserting an element at the end of an array? a) O(1) b)
O(log n) c) O(n) d) O(n^2) Answer: a) O(1)
13. Which sorting algorithm has the worst-case time complexity of O(n^2)? a) Merge Sort b)
Quick Sort c) Insertion Sort d) Heap Sort Answer: c) Insertion Sort
14. What is the purpose of dynamic programming? a) To solve optimization problems by
breaking them down into overlapping subproblems b) To design efficient algorithms for
sorting and searching c) To analyze the complexity of algorithms d) To implement data
structures like stacks and queues Answer: a) To solve optimization problems by breaking
them down into overlapping subproblems
15. Which data structure follows the Last-In-First-Out (LIFO) principle? a) Queue b) Stack c)
Linked List d) Tree Answer: b) Stack
16. Which of the following is NOT a searching algorithm? a) Binary Search b) Linear Search
c) Depth-First Search d) Bubble Sort Answer: d) Bubble Sort
17. What is the time complexity of a binary search algorithm? a) O(1) b) O(log n) c) O(n) d)
O(n^2) Answer: b) O(log n)
18. Which data structure is used to implement a priority queue? a) Array b) Linked List c)
Stack d) Heap Answer: d) Heap
19. Which algorithm is used to find the shortest path in a weighted graph? a) Breadth-First
Search (BFS) b) Depth-First Search (DFS) c) Dijkstra's Algorithm d) Prim's Algorithm
Answer: c) Dijkstra's Algorithm
20. What is the time complexity of a bubble sort algorithm? a) O(1) b) O(log n) c) O(n) d)
O(n^2) Answer: d) O(n^2)
21. Which of the following is an example of a number-theoretic algorithm? a) QuickSort b)
Dijkstra's algorithm c) Prim's algorithm d) Euclidean algorithm Answer: d) Euclidean
algorithm
22. The time complexity of the Euclidean algorithm for finding the GCD of two numbers is: a)
O(n) b) O(log n) c) O(n log n) d) O(n^2) Answer: b) O(log n)
23. The complexity class P represents the set of decision problems that can be solved by a:
a) Deterministic Turing machine in polynomial time b) Non-deterministic Turing machine
in polynomial time c) Deterministic Turing machine in exponential time d) Non-
deterministic Turing machine in exponential time Answer: a) Deterministic Turing
machine in polynomial time
24. Which of the following is an example of an NP-complete problem? a) Sorting a list of
numbers b) Finding the shortest path in a graph c) Solving a system of linear equations
d) Traveling Salesperson Problem (TSP) Answer: d) Traveling Salesperson Problem
(TSP)
25. The complexity class co-NP represents the set of decision problems for which: a) There
exists a non-deterministic Turing machine that can solve them in polynomial time. b)
There exists a deterministic Turing machine that can solve them in polynomial time. c)
There exists a non-deterministic Turing machine that can verify their solutions in
polynomial time. d) There exists a deterministic Turing machine that can verify their
solutions in polynomial time. Answer: c) There exists a non-deterministic Turing machine
that can verify their solutions in polynomial time.
26. The Chinese Remainder Theorem is used to solve: a) Linear programming problems b)
Quadratic programming problems c) Systems of linear equations d) Systems of
congruences Answer: d) Systems of congruences
27. The time complexity of the Sieve of Eratosthenes algorithm for finding prime numbers up
to a given limit is: a) O(n) b) O(n log n) c) O(n^2) d) O(sqrt(n)) Answer: d) O(sqrt(n))
28. The complexity class PSPACE represents the set of decision problems that can be
solved by a: a) Deterministic Turing machine in polynomial space b) Non-deterministic
Turing machine in polynomial space c) Deterministic Turing machine in exponential
space d) Non-deterministic Turing machine in exponential space Answer: a)
Deterministic Turing machine in polynomial space
29. The Euclidean algorithm is used to find the: a) Greatest Common Divisor (GCD) of two
numbers b) Least Common Multiple (LCM) of two numbers c) Prime factorization of a
number d) Modular inverse of a number Answer: a) Greatest Common Divisor (GCD) of
two numbers
30. The time complexity of the Miller-Rabin primality test algorithm is: a) O(1) b) O(log n) c)
O(n) d) O(k log n) Answer: d) O(k log n)
31. Which of the following algorithms is used to find the greatest common divisor (GCD) of
two numbers? a) QuickSort b) Dijkstra's algorithm c) Euclidean algorithm d) Prim's
algorithm Answer: c) Euclidean algorithm
32. The complexity class P represents the set of decision problems that can be solved by a:
a) Deterministic Turing machine in polynomial time b) Non-deterministic Turing machine
in polynomial time c) Deterministic Turing machine in exponential time d) Non-
deterministic Turing machine in exponential time Answer: a) Deterministic Turing
machine in polynomial time
33. The Chinese Remainder Theorem is used to solve: a) Linear programming problems b)
Quadratic programming problems c) Systems of linear equations d) Systems of
congruences Answer: d) Systems of congruences
34. The time complexity of the Sieve of Eratosthenes algorithm for finding prime numbers up
to a given limit is: a) O(n) b) O(n log n) c) O(n^2) d) O(sqrt(n)) Answer: d) O(sqrt(n))
35. The complexity class co-NP represents the set of decision problems for which: a) There
exists a non-deterministic Turing machine that can solve them in polynomial time. b)
There exists a deterministic Turing machine that can solve them in polynomial time. c)
There exists a non-deterministic Turing machine that can verify their solutions in
polynomial time. d) There exists a deterministic Turing machine that can verify their
solutions in polynomial time. Answer: c) There exists a non-deterministic Turing machine
that can verify their solutions in polynomial time.
36. The Euclidean algorithm is used to find the: a) Greatest Common Divisor (GCD) of two
numbers b) Least Common Multiple (LCM) of two numbers c) Prime factorization of a
number d) Modular inverse of a number Answer: a) Greatest Common Divisor (GCD) of
two numbers
37. The time complexity of the Miller-Rabin primality test algorithm is: a) O(1) b) O(log n) c)
O(n) d) O(k log n) Answer: d) O(k log n)
38. The complexity class PSPACE represents the set of decision problems that can be
solved by a: a) Deterministic Turing machine in polynomial space b) Non-deterministic
Turing machine in polynomial space c) Deterministic Turing machine in exponential
space d) Non-deterministic Turing machine in exponential space Answer: a)
Deterministic Turing machine in polynomial space
39. Which of the following algorithms is used to find the modular inverse of a number? a)
QuickSort b) Dijkstra's algorithm c) Euclidean algorithm d) Extended Euclidean algorithm
Answer: d) Extended Euclidean algorithm
40. The complexity class NP represents the set of decision problems that can be: a) Solved
in polynomial time b) Verified in polynomial time c) Solved in exponential time d) Verified
in exponential time Answer: b) Verified in polynomial time
41. Which of the following algorithms is used to find the greatest common divisor (GCD) of
two numbers? a) QuickSort b) Dijkstra's algorithm c) Euclidean algorithm d) Prim's
algorithm Answer: c) Euclidean algorithm
42. The complexity class P represents the set of decision problems that can be solved by a:
a) Deterministic Turing machine in polynomial time b) Non-deterministic Turing machine
in polynomial time c) Deterministic Turing machine in exponential time d) Non-
deterministic Turing machine in exponential time Answer: a) Deterministic Turing
machine in polynomial time
43. The Chinese Remainder Theorem is used to solve: a) Linear programming problems b)
Quadratic programming problems c) Systems of linear equations d) Systems of
congruences Answer: d) Systems of congruences
44. The time complexity of the Sieve of Eratosthenes algorithm for finding prime numbers up
to a given limit is: a) O(n) b) O(n log n) c) O(n^2) d) O(sqrt(n)) Answer: d) O(sqrt(n))
45. The complexity class co-NP represents the set of decision problems for which: a) There
exists a non-deterministic Turing machine that can solve them in polynomial time. b)
There exists a deterministic Turing machine that can solve them in polynomial time. c)
There exists a non-deterministic Turing machine that can verify their solutions in
polynomial time. d) There exists a deterministic Turing machine that can verify their
solutions in polynomial time. Answer: c) There exists a non-deterministic Turing machine
that can verify their solutions in polynomial time.
46. The Euclidean algorithm is used to find the: a) Greatest Common Divisor (GCD) of two
numbers b) Least Common Multiple (LCM) of two numbers c) Prime factorization of a
number d) Modular inverse of a number Answer: a) Greatest Common Divisor (GCD) of
two numbers
47. The time complexity of the Miller-Rabin primality test algorithm is: a) O(1) b) O(log n) c)
O(n) d) O(k log n) Answer: d) O(k log n)
48. The complexity class PSPACE represents the set of decision problems that can be
solved by a: a) Deterministic Turing machine in polynomial space b) Non-deterministic
Turing machine in polynomial space c) Deterministic Turing machine in exponential
space d) Non-deterministic Turing machine in exponential space Answer: a)
Deterministic Turing machine in polynomial space
49. Which of the following algorithms is used to find the modular inverse of a number? a)
QuickSort b) Dijkstra's algorithm c) Euclidean algorithm d) Extended Euclidean algorithm
Answer: d) Extended Euclidean algorithm
50. The complexity class NP represents the set of decision problems that can be: a) Solved
in polynomial time b) Verified in polynomial time c) Solved in exponential time d) Verified
in exponential time Answer: b) Verified in polynomial time
Modular Arithmetic in Number Theory:
51. What is the result of 7 modulo 3? a) 0 b) 1 c) 2 d) 3 Answer: c) 2
52. Which of the following is equivalent to 5 modulo 7? a) 2 b) 3 c) 5 d) 7 Answer: c) 5
53. What is the multiplicative inverse of 9 modulo 11? a) 1 b) 2 c) 9 d) 10 Answer: d) 10
54. Which of the following is true for any positive integers a, b, and n? a) (a + b) mod n = (a
mod n) + (b mod n) b) (a * b) mod n = (a mod n) * (b mod n) c) (a - b) mod n = (a mod n) -
(b mod n) d) All of the above Answer: d) All of the above
55. What is the result of 2^5 modulo 7? a) 1 b) 2 c) 3 d) 4 Answer: c) 3
56. Which of the following is true for any positive integers a and n? a) a^0 mod n = 1 b) a^1
mod n = a mod n c) a^2 mod n = (a mod n)^2 d) All of the above Answer: d) All of the
above
57. What is the result of 3^(-1) modulo 5? a) 0 b) 1 c) 2 d) 3 Answer: c) 2
58. Which of the following is true for any positive integers a, b, and n? a) If a ≡ b (mod n),
then a^2 ≡ b^2 (mod n) b) If a ≡ b (mod n), then a^3 ≡ b^3 (mod n) c) If a ≡ b (mod n),
then a^k ≡ b^k (mod n) for any positive integer k d) All of the above Answer: d) All of the
above
59. What is the result of 4^(-1) modulo 9? a) 0 b) 1 c) 2 d) 4 Answer: c) 2
60. Which of the following is true for any positive integers a, b, and n? a) If a ≡ b (mod n),
then a + n ≡ b (mod n) b) If a ≡ b (mod n), then a - n ≡ b (mod n) c) If a ≡ b (mod n), then
a + kn ≡ b (mod n) for any integer k d) All of the above Answer: d) All of the above
61. What is the result of 12 modulo 5? a) 0 b) 1 c) 2 d) 3 Answer: c) 2
62. Which of the following is equivalent to 8 modulo 4? a) 0 b) 1 c) 2 d) 4 Answer: a) 0
63. What is the multiplicative inverse of 5 modulo 9? a) 1 b) 2 c) 5 d) 9 Answer: b) 2
64. Which of the following is true for any positive integers a, b, and n? a) (a + b) mod n = (a
mod n) + (b mod n) b) (a * b) mod n = (a mod n) * (b mod n) c) (a - b) mod n = (a mod n) -
(b mod n) d) All of the above Answer: d) All of the above
65. What is the result of 3^4 modulo 7? a) 1 b) 2 c) 3 d) 4 Answer: b) 2
66. Which of the following is true for any positive integers a and n? a) a^0 mod n = 1 b) a^1
mod n = a mod n c) a^2 mod n = (a mod n)^2 d) All of the above Answer: d) All of the
above
67. What is the result of 6^(-1) modulo 11? a) 0 b) 1 c) 6 d) 11 Answer: c) 6
68. Which of the following is true for any positive integers a, b, and n? a) If a ≡ b (mod n),
then a^2 ≡ b^2 (mod n) b) If a ≡ b (mod n), then a^3 ≡ b^3 (mod n) c) If a ≡ b (mod n),
then a^k ≡ b^k (mod n) for any positive integer k d) All of the above Answer: d) All of the
above
69. What is the result of 7^(-1) modulo 10? a) 0 b) 1 c) 3 d) 7 Answer: c) 3
70. Which of the following is true for any positive integers a, b, and n? a) If a ≡ b (mod n),
then a + n ≡ b (mod n) b) If a ≡ b (mod n), then a - n ≡ b (mod n) c) If a ≡ b (mod n), then
a + kn ≡ b (mod n) for any integer k d) All of the above Answer: d) All of the above

71. Chinese Remainder Theorem,


72. The Chinese Remainder Theorem (CRT) is used to solve which type of mathematical
problems? a) Linear equations b) Quadratic equations c) Congruence equations d)
Differential equations Answer: c) Congruence equations
73. The Chinese Remainder Theorem states that if two positive integers a and b are
relatively prime, then there exists a solution to the system of congruences: a) ax ≡ 1 (mod
b) b) bx ≡ 1 (mod a) c) ax ≡ b (mod 1) d) bx ≡ a (mod 1) Answer: a) ax ≡ 1 (mod b)
74. In the Chinese Remainder Theorem, what is the condition for two moduli m1 and m2 to
be relatively prime? a) m1 + m2 = 1 b) m1 - m2 = 1 c) gcd(m1, m2) = 1 d) lcm(m1, m2) =
1 Answer: c) gcd(m1, m2) = 1
75. The Chinese Remainder Theorem can be extended to solve systems of congruences
with how many moduli? a) 2 b) 3 c) 4 d) Any number greater than or equal to 2 Answer:
d) Any number greater than or equal to 2
76. What is the Chinese Remainder Theorem used for in cryptography? a) Encrypting
messages b) Decrypting messages c) Generating prime numbers d) Breaking encryption
algorithms Answer: b) Decrypting messages
77. The Chinese Remainder Theorem guarantees a unique solution to the system of
congruences if: a) The moduli are prime numbers b) The moduli are relatively prime c)
The moduli are consecutive numbers d) The moduli are even numbers Answer: b) The
moduli are relatively prime
78. The Chinese Remainder Theorem can be used to find the smallest positive integer x that
satisfies a system of congruences. This integer is known as: a) The least common
multiple (LCM) b) The greatest common divisor (GCD) c) The modular inverse d) The
Chinese remainder Answer: d) The Chinese remainder
79. Which of the following is NOT a step in applying the Chinese Remainder Theorem? a)
Finding the modular inverses b) Solving a system of linear equations c) Applying the
Chinese Remainder Theorem formula d) Simplifying the congruences Answer: b) Solving
a system of linear equations
80. The Chinese Remainder Theorem can be used to solve problems related to: a) Number
theory b) Algebra c) Geometry d) Calculus Answer: a) Number theory
81. The Chinese Remainder Theorem is named after: a) Chinese mathematicians b) French
mathematicians c) Indian mathematicians d) Greek mathematicians Answer: a) Chinese
mathematicians
82. In the Chinese Remainder Theorem, what is the condition for a solution to exist for a
system of congruences? a) The moduli must be prime numbers b) The moduli must be
even numbers c) The moduli must be relatively prime d) The moduli must be consecutive
numbers Answer: c) The moduli must be relatively prime
83. The Chinese Remainder Theorem can be used to find a solution to a system of
congruences with how many moduli? a) 2 b) 3 c) 4 d) Any number greater than or equal
to 2 Answer: d) Any number greater than or equal to 2
84. What is the Chinese Remainder Theorem used for in number theory? a) Factoring large
numbers b) Solving linear equations c) Finding prime numbers d) Solving systems of
congruences Answer: d) Solving systems of congruences
85. The Chinese Remainder Theorem guarantees a unique solution to the system of
congruences if: a) The moduli are prime numbers b) The moduli are relatively prime c)
The moduli are consecutive numbers d) The moduli are even numbers Answer: b) The
moduli are relatively prime
86. What is the Chinese Remainder Theorem formula used to calculate? a) The least
common multiple (LCM) b) The greatest common divisor (GCD) c) The modular inverse
d) The Chinese remainder Answer: d) The Chinese remainder
87. Which of the following is NOT a step in applying the Chinese Remainder Theorem? a)
Finding the modular inverses b) Solving a system of linear equations c) Applying the
Chinese Remainder Theorem formula d) Simplifying the congruences Answer: b) Solving
a system of linear equations
88. The Chinese Remainder Theorem can be used to find the smallest positive integer x that
satisfies a system of congruences. This integer is known as: a) The least common
multiple (LCM) b) The greatest common divisor (GCD) c) The modular inverse d) The
Chinese remainder Answer: d) The Chinese remainder
89. Which of the following is a necessary condition for the Chinese Remainder Theorem to
be applicable? a) The moduli must be prime numbers b) The moduli must be even
numbers c) The moduli must be relatively prime d) The moduli must be consecutive
numbers Answer: c) The moduli must be relatively prime
90. The Chinese Remainder Theorem can be used to solve problems related to: a) Number
theory b) Algebra c) Geometry d) Calculus Answer: a) Number theory
91. The Chinese Remainder Theorem is named after: a) Chinese mathematicians b) French
mathematicians c) Indian mathematicians d) Greek mathematicians Answer: a) Chinese
mathematicians
92. The Chinese Remainder Theorem is a result in which branch of mathematics? a) Number
theory b) Algebra c) Geometry d) Calculus Answer: a) Number theory
93. The Chinese Remainder Theorem is used to solve systems of congruences with how
many moduli? a) 2 b) 3 c) 4 d) Any number greater than or equal to 2 Answer: d) Any
number greater than or equal to 2
94. In the Chinese Remainder Theorem, what is the condition for a solution to exist for a
system of congruences? a) The moduli must be prime numbers b) The moduli must be
even numbers c) The moduli must be relatively prime d) The moduli must be consecutive
numbers Answer: c) The moduli must be relatively prime
95. The Chinese Remainder Theorem guarantees a unique solution to the system of
congruences if: a) The moduli are prime numbers b) The moduli are relatively prime c)
The moduli are consecutive numbers d) The moduli are even numbers Answer: b) The
moduli are relatively prime
96. What is the Chinese Remainder Theorem used for in cryptography? a) Encrypting
messages b) Decrypting messages c) Generating prime numbers d) Breaking encryption
algorithms Answer: b) Decrypting messages
97. The Chinese Remainder Theorem can be used to find the smallest positive integer x that
satisfies a system of congruences. This integer is known as: a) The least common
multiple (LCM) b) The greatest common divisor (GCD) c) The modular inverse d) The
Chinese remainder Answer: d) The Chinese remainder
98. Which of the following is NOT a step in applying the Chinese Remainder Theorem? a)
Finding the modular inverses b) Solving a system of linear equations c) Applying the
Chinese Remainder Theorem formula d) Simplifying the congruences Answer: b) Solving
a system of linear equations
99. The Chinese Remainder Theorem can be used to solve problems related to: a) Number
theory b) Algebra c) Geometry d) Calculus Answer: a) Number theory
100. The Chinese Remainder Theorem is named after: a) Chinese mathematicians b)
French mathematicians c) Indian mathematicians d) Greek mathematicians Answer: a)
Chinese mathematicians
101. The Chinese Remainder Theorem can be extended to solve systems of
congruences with non-relatively prime moduli using: a) The Extended Euclidean
Algorithm b) The Chinese Remainder Theorem formula c) The Fermat's Little Theorem d)
The Euler's Totient Function Answer: a) The Extended Euclidean Algorithm

102. Greatest Common Divisor


103. What is the GCD of 12 and 18? a) 2 b) 3 c) 4 d) 6 Answer: b) 3
104. The GCD of two numbers is always: a) Smaller than both numbers b) Larger than
both numbers c) Equal to the sum of the two numbers d) Equal to the product of the two
numbers Answer: a) Smaller than both numbers
105. The GCD of two prime numbers is always: a) 1 b) 0 c) The smaller prime number
d) The larger prime number Answer: a) 1
106. The GCD of any number and 0 is: a) 0 b) 1 c) The number itself d) Undefined
Answer: c) The number itself
107. The GCD of two numbers can be calculated using which algorithm? a) Euclidean
Algorithm b) Newton's Method c) Gaussian Elimination d) Lagrange Interpolation Answer:
a) Euclidean Algorithm
108. The GCD of two numbers is 15. Which of the following statements is true? a)
Both numbers are divisible by 15 b) One number is divisible by 15, and the other is not c)
Both numbers are prime d) Both numbers are even Answer: a) Both numbers are
divisible by 15
109. The GCD of two numbers is 1. What can you conclude about the numbers? a)
They are both prime b) They are both even c) They are relatively prime d) They are both
odd Answer: c) They are relatively prime
110. The GCD of two numbers is 12. Which of the following statements is true? a)
Both numbers are divisible by 12 b) One number is divisible by 12, and the other is not c)
Both numbers are prime d) Both numbers are even Answer: a) Both numbers are
divisible by 12
111. The GCD of two numbers is 5. If one number is 25, what is the other number? a)
5 b) 10 c) 15 d) 20 Answer: c) 15
112. The GCD of two numbers is 1. What can you conclude about the numbers? a)
They are both prime b) They are both even c) They are relatively prime d) They are both
odd Answer: c) They are relatively prime
113. What is the GCD of 24 and 36? a) 2 b) 3 c) 4 d) 6 Answer: b) 3
114. The GCD of two numbers is always: a) Smaller than both numbers b) Larger than
both numbers c) Equal to the sum of the two numbers d) Equal to the product of the two
numbers Answer: a) Smaller than both numbers
115. The GCD of two prime numbers is always: a) 1 b) 0 c) The smaller prime number
d) The larger prime number Answer: a) 1
116. The GCD of any number and 0 is: a) 0 b) 1 c) The number itself d) Undefined
Answer: c) The number itself
117. The GCD of two numbers can be calculated using which algorithm? a) Euclidean
Algorithm b) Newton's Method c) Gaussian Elimination d) Lagrange Interpolation Answer:
a) Euclidean Algorithm
118. The GCD of two numbers is 15. Which of the following statements is true? a)
Both numbers are divisible by 15 b) One number is divisible by 15, and the other is not c)
Both numbers are prime d) Both numbers are even Answer: a) Both numbers are
divisible by 15
119. The GCD of two numbers is 1. What can you conclude about the numbers? a)
They are both prime b) They are both even c) They are relatively prime d) They are both
odd Answer: c) They are relatively prime
120. The GCD of two numbers is 12. Which of the following statements is true? a)
Both numbers are divisible by 12 b) One number is divisible by 12, and the other is not c)
Both numbers are prime d) Both numbers are even Answer: a) Both numbers are
divisible by 12
121. The GCD of two numbers is 5. If one number is 25, what is the other number? a)
5 b) 10 c) 15 d) 20 Answer: c) 15
122. The GCD of two numbers is 1. What can you conclude about the numbers? a)
They are both prime b) They are both even c) They are relatively prime d) They are both
odd Answer: c) They are relatively prime

123. Optimization Problems


124. What is the goal of an optimization problem? a) To find the maximum value b) To
find the minimum value c) To find the average value d) To find all possible values
Answer: b) To find the minimum value
125. Which algorithm is commonly used to solve optimization problems? a) Depth-first
search b) Breadth-first search c) Dijkstra's algorithm d) Gradient descent Answer: d)
Gradient descent
126. What is the difference between a local minimum and a global minimum in
optimization problems? a) There is no difference b) Local minimum is the lowest value in
a specific region, while global minimum is the lowest value in the entire problem space c)
Local minimum is the highest value in a specific region, while global minimum is the
highest value in the entire problem space d) Local minimum is the average value in a
specific region, while global minimum is the average value in the entire problem space
Answer: b) Local minimum is the lowest value in a specific region, while global minimum
is the lowest value in the entire problem space
127. Which technique is used to find the optimal solution in linear programming
problems? a) Dynamic programming b) Greedy algorithm c) Branch and bound d)
Simplex method Answer: d) Simplex method
128. In an optimization problem, what is the objective function? a) The function that
needs to be optimized b) The function that defines the constraints c) The function that
calculates the average value d) The function that calculates the maximum value Answer:
a) The function that needs to be optimized
129. Which of the following is an example of a discrete optimization problem? a)
Finding the shortest path in a graph b) Finding the maximum value of a continuous
function c) Finding the optimal solution to a linear equation d) Finding the average value
of a dataset Answer: a) Finding the shortest path in a graph
130. What is the difference between a feasible solution and an optimal solution in
optimization problems? a) There is no difference b) Feasible solution is the best solution,
while optimal solution is a solution that satisfies all constraints c) Feasible solution is a
solution that satisfies all constraints, while optimal solution is the best solution d) Feasible
solution is the average solution, while optimal solution is the worst solution Answer: c)
Feasible solution is a solution that satisfies all constraints, while optimal solution is the
best solution
131. Which technique is used to solve integer programming problems? a) Linear
programming b) Dynamic programming c) Branch and bound d) Greedy algorithm
Answer: c) Branch and bound
132. What is the difference between a local maximum and a global maximum in
optimization problems? a) There is no difference b) Local maximum is the highest value
in a specific region, while global maximum is the highest value in the entire problem
space c) Local maximum is the lowest value in a specific region, while global maximum is
the lowest value in the entire problem space d) Local maximum is the average value in a
specific region, while global maximum is the average value in the entire problem space
Answer: b) Local maximum is the highest value in a specific region, while global
maximum is the highest value in the entire problem space
133. Which algorithm is commonly used to solve optimization problems with discrete
variables? a) Genetic algorithm b) Simulated annealing c) Particle swarm optimization d)
All of the above Answer: d) All of the above
134. What is the difference between a local minimum and a global minimum in
optimization problems? a) There is no difference b) Local minimum is the lowest value in
a specific region, while global minimum is the lowest value in the entire problem space c)
Local minimum is the highest value in a specific region, while global minimum is the
highest value in the entire problem space d) Local minimum is the average value in a
specific region, while global minimum is the average value in the entire problem space
Answer: b) Local minimum is the lowest value in a specific region, while global minimum
is the lowest value in the entire problem space
135. Which technique is used to find the optimal solution in linear programming
problems? a) Dynamic programming b) Greedy algorithm c) Branch and bound d)
Simplex method Answer: d) Simplex method
136. In an optimization problem, what is the objective function? a) The function that
needs to be optimized b) The function that defines the constraints c) The function that
calculates the average value d) The function that calculates the maximum value Answer:
a) The function that needs to be optimized
137. Which of the following is an example of a continuous optimization problem? a)
Finding the shortest path in a graph b) Finding the maximum value of a continuous
function c) Finding the optimal solution to a linear equation d) Finding the average value
of a dataset Answer: b) Finding the maximum value of a continuous function
138. What is the difference between a feasible solution and an optimal solution in
optimization problems? a) There is no difference b) Feasible solution is the best solution,
while optimal solution is a solution that satisfies all constraints c) Feasible solution is a
solution that satisfies all constraints, while optimal solution is the best solution d) Feasible
solution is the average solution, while optimal solution is the worst solution Answer: c)
Feasible solution is a solution that satisfies all constraints, while optimal solution is the
best solution
139. Which technique is used to solve integer programming problems? a) Linear
programming b) Dynamic programming c) Branch and bound d) Greedy algorithm
Answer: c) Branch and bound
140. What is the difference between a local maximum and a global maximum in
optimization problems? a) There is no difference b) Local maximum is the highest value
in a specific region, while global maximum is the highest value in the entire problem
space c) Local maximum is the lowest value in a specific region, while global maximum is
the lowest value in the entire problem space d) Local maximum is the average value in a
specific region, while global maximum is the average value in the entire problem space
Answer: b) Local maximum is the highest value in a specific region, while global
maximum is the highest value in the entire problem space
141. Which algorithm is commonly used to solve optimization problems with discrete
variables? a) Genetic algorithm b) Simulated annealing c) Particle swarm optimization d)
All of the above Answer: d) All of the above
142. What is the difference between a local minimum and a global minimum in
optimization problems? a) There is no difference b) Local minimum is the lowest value in
a specific region, while global minimum is the lowest value in the entire problem space c)
Local minimum is the highest value in a specific region, while global minimum is the
highest value in the entire problem space d) Local minimum is the average value in a
specific region, while global minimum is the average value in the entire problem space
Answer: b) Local minimum is the lowest value in a specific region, while global minimum
is the lowest value in the entire problem space
143. Which technique is used to find the optimal solution in nonlinear programming
problems? a) Gradient descent b) Dijkstra's algorithm c) Bellman-Ford algorithm d)
Floyd-Warshall algorithm Answer: a) Gradient descent
144. Which of the following is NOT a common type of optimization problem? a) Linear
programming b) Integer programming c) Quadratic programming d) Dynamic
programming Answer: d) Dynamic programming
145. In linear programming, what is the objective function? a) The function that needs
to be minimized b) The function that defines the constraints c) The function that
calculates the average value d) The function that needs to be maximized or minimized
Answer: d) The function that needs to be maximized or minimized
146. Which technique is used to solve optimization problems with discrete variables?
a) Genetic algorithm b) Simulated annealing c) Particle swarm optimization d) All of the
above Answer: d) All of the above
147. What is the difference between a local minimum and a global minimum in
optimization problems? a) There is no difference b) Local minimum is the lowest value in
a specific region, while global minimum is the lowest value in the entire problem space c)
Local minimum is the highest value in a specific region, while global minimum is the
highest value in the entire problem space d) Local minimum is the average value in a
specific region, while global minimum is the average value in the entire problem space
Answer: b) Local minimum is the lowest value in a specific region, while global minimum
is the lowest value in the entire problem space
148. Which algorithm is commonly used to solve optimization problems with
continuous variables? a) Genetic algorithm b) Simulated annealing c) Gradient descent
d) All of the above Answer: c) Gradient descent
149. What is the difference between a feasible solution and an optimal solution in
optimization problems? a) There is no difference b) Feasible solution is the best solution,
while optimal solution is a solution that satisfies all constraints c) Feasible solution is a
solution that satisfies all constraints, while optimal solution is the best solution d) Feasible
solution is the average solution, while optimal solution is the worst solution Answer: c)
Feasible solution is a solution that satisfies all constraints, while optimal solution is the
best solution
150. Which technique is used to solve integer programming problems? a) Linear
programming b) Dynamic programming c) Branch and bound d) Greedy algorithm
Answer: c) Branch and bound
151. What is the difference between a local maximum and a global maximum in
optimization problems? a) There is no difference b) Local maximum is the highest value
in a specific region, while global maximum is the highest value in the entire problem
space c) Local maximum is the lowest value in a specific region, while global maximum is
the lowest value in the entire problem space d) Local maximum is the average value in a
specific region, while global maximum is the average value in the entire problem space
Answer: b) Local maximum is the highest value in a specific region, while global
maximum is the highest value in the entire problem space
152. Which technique is used to solve optimization problems with both discrete and
continuous variables? a) Genetic algorithm b) Simulated annealing c) Mixed-integer
programming d) All of the above Answer: c) Mixed-integer programming
153. What is the difference between a local minimum and a global minimum in
optimization problems? a) There is no difference b) Local minimum is the lowest value in
a specific region, while global minimum is the lowest value in the entire problem space c)
Local minimum is the highest value in a specific region, while global minimum is the
highest value in the entire problem space d) Local minimum is the average value in a
specific region, while global minimum is the average value in the entire problem space
Answer: b) Local minimum is the lowest value in a specific region, while global minimum
is the lowest value in the entire problem space

154. Basic Concepts of Complexity


Classes
155. Which complexity class represents the set of problems that can be solved in
polynomial time? a) P b) NP c) NP-hard d) NP-complete Answer: a) P
156. Which complexity class represents the set of decision problems that can be
verified in polynomial time? a) P b) NP c) NP-hard d) NP-complete Answer: b) NP
157. Which complexity class represents the set of problems that are at least as hard
as the hardest problems in NP? a) P b) NP c) NP-hard d) NP-complete Answer: c) NP-
hard
158. Which complexity class represents the set of problems that are both in NP and
NP-hard? a) P b) NP c) NP-hard d) NP-complete Answer: d) NP-complete
159. Which complexity class represents the set of problems that are solvable in
exponential time? a) P b) NP c) EXPTIME d) PSPACE Answer: c) EXPTIME
160. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine in polynomial time? a) P b) NP c) EXPTIME d)
PSPACE Answer: b) NP
161. Which complexity class represents the set of problems that can be solved using a
deterministic Turing machine with a polynomial amount of memory? a) P b) NP c)
EXPTIME d) PSPACE Answer: d) PSPACE
162. Which complexity class represents the set of problems that are solvable in
logarithmic space? a) P b) NP c) L d) NL Answer: c) L
163. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine with a logarithmic amount of memory? a) P b) NP c) L
d) NL Answer: d) NL
164. Which complexity class represents the set of problems that are solvable in
polynomial time on a quantum computer? a) P b) NP c) BQP d) QMA Answer: c) BQP
165. Which complexity class represents the set of decision problems that can be
solved in non-deterministic polynomial time? a) P b) NP c) NP-hard d) NP-complete
Answer: b) NP
166. Which complexity class represents the set of problems that are at least as hard
as the hardest problems in NP? a) P b) NP c) NP-hard d) NP-complete Answer: c) NP-
hard
167. Which complexity class represents the set of problems that are both in NP and
NP-hard? a) P b) NP c) NP-hard d) NP-complete Answer: d) NP-complete
168. Which complexity class represents the set of problems that can be solved in
exponential time? a) P b) NP c) EXPTIME d) PSPACE Answer: c) EXPTIME
169. Which complexity class represents the set of problems that can be solved using a
deterministic Turing machine in polynomial time? a) P b) NP c) EXPTIME d) PSPACE
Answer: a) P
170. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine in polynomial time? a) P b) NP c) EXPTIME d)
PSPACE Answer: b) NP
171. Which complexity class represents the set of problems that can be solved using a
deterministic Turing machine with a polynomial amount of memory? a) P b) NP c)
EXPTIME d) PSPACE Answer: d) PSPACE
172. Which complexity class represents the set of problems that are solvable in
logarithmic space? a) P b) NP c) L d) NL Answer: c) L
173. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine with a logarithmic amount of memory? a) P b) NP c) L
d) NL Answer: d) NL
174. Which complexity class represents the set of problems that are solvable in
polynomial time on a quantum computer? a) P b) NP c) BQP d) QMA Answer: c) BQP
175. NP-hard
176. Which complexity class represents the set of decision problems that are at least
as hard as the hardest problems in NP? a) P b) NP c) NP-hard d) NP-complete Answer:
c) NP-hard
177. Which complexity class represents the set of problems that are both in NP and
NP-hard? a) P b) NP c) NP-hard d) NP-complete Answer: d) NP-complete
178. Which complexity class represents the set of problems that can be solved in
polynomial time? a) P b) NP c) NP-hard d) NP-complete Answer: a) P
179. Which complexity class represents the set of problems that are solvable in
exponential time? a) P b) NP c) EXPTIME d) PSPACE Answer: c) EXPTIME
180. Which complexity class represents the set of problems that can be solved using a
deterministic Turing machine in polynomial time? a) P b) NP c) EXPTIME d) PSPACE
Answer: a) P
181. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine in polynomial time? a) P b) NP c) EXPTIME d)
PSPACE Answer: b) NP
182. Which complexity class represents the set of problems that can be solved using a
deterministic Turing machine with a polynomial amount of memory? a) P b) NP c)
EXPTIME d) PSPACE Answer: d) PSPACE
183. Which complexity class represents the set of problems that are solvable in
logarithmic space? a) P b) NP c) L d) NL Answer: c) L
184. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine with a logarithmic amount of memory? a) P b) NP c) L
d) NL Answer: d) NL
185. Which complexity class represents the set of problems that are solvable in
polynomial time on a quantum computer? a) P b) NP c) BQP d) QMA Answer: c) BQP
186. Which complexity class represents the set of problems that are at least as hard
as the hardest problems in NP and can be verified in polynomial time? a) P b) NP c) NP-
hard d) NP-complete Answer: d) NP-complete
187. Which complexity class represents the set of problems that are solvable in non-
deterministic polynomial time? a) P b) NP c) NP-hard d) NP-complete Answer: b) NP
188. Which complexity class represents the set of problems that are solvable in
exponential time on a quantum computer? a) P b) NP c) BQP d) QMA Answer: d) QMA
189. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P? a) P b) NP c) BQP d)
PSPACE Answer: b) NP
190. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or NP-complete? a) P
b) NP c) BQP d) PSPACE Answer: d) PSPACE
191. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or NP? a) P b) NP c)
BQP d) PSPACE Answer: d) PSPACE
192. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or NP-hard? a) P b) NP
c) NP-hard d) PSPACE Answer: d) PSPACE
193. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or EXPTIME? a) P b)
NP c) EXPTIME d) PSPACE Answer: d) PSPACE
194. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or BQP? a) P b) NP c)
BQP d) PSPACE Answer: d) PSPACE
195. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or QMA? a) P b) NP c)
QMA d) PSPACE Answer: d) PSPACE
196. Which complexity class represents the set of decision problems that are at least
as hard as the hardest problems in NP? a) P b) NP c) NP-hard d) NP-complete Answer:
c) NP-hard
197. Which complexity class represents the set of problems that are both in NP and
NP-hard? a) P b) NP c) NP-hard d) NP-complete Answer: d) NP-complete
198. Which complexity class represents the set of problems that can be solved in
polynomial time? a) P b) NP c) NP-hard d) NP-complete Answer: a) P
199. Which complexity class represents the set of problems that are solvable in
exponential time? a) P b) NP c) EXPTIME d) PSPACE Answer: c) EXPTIME
200. Which complexity class represents the set of problems that can be solved using a
deterministic Turing machine in polynomial time? a) P b) NP c) EXPTIME d) PSPACE
Answer: a) P
201. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine in polynomial time? a) P b) NP c) EXPTIME d)
PSPACE Answer: b) NP
202. Which complexity class represents the set of problems that can be solved using a
deterministic Turing machine with a polynomial amount of memory? a) P b) NP c)
EXPTIME d) PSPACE Answer: d) PSPACE
203. Which complexity class represents the set of problems that are solvable in
logarithmic space? a) P b) NP c) L d) NL Answer: c) L
204. Which complexity class represents the set of problems that can be solved using a
non-deterministic Turing machine with a logarithmic amount of memory? a) P b) NP c) L
d) NL Answer: d) NL
205. Which complexity class represents the set of problems that are solvable in
polynomial time on a quantum computer? a) P b) NP c) BQP d) QMA Answer: c) BQP
206. Which complexity class represents the set of problems that are at least as hard
as the hardest problems in NP and can be verified in polynomial time? a) P b) NP c) NP-
hard d) NP-complete Answer: d) NP-complete
207. Which complexity class represents the set of problems that are solvable in non-
deterministic polynomial time? a) P b) NP c) NP-hard d) NP-complete Answer: b) NP
208. Which complexity class represents the set of problems that are solvable in
exponential time on a quantum computer? a) P b) NP c) BQP d) QMA Answer: d) QMA
209. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P? a) P b) NP c) BQP d)
PSPACE Answer: b) NP
210. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or NP-complete? a) P
b) NP c) BQP d) PSPACE Answer: d) PSPACE
211. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or NP? a) P b) NP c)
BQP d) PSPACE Answer: d) PSPACE
212. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or NP-hard? a) P b) NP
c) NP-hard d) PSPACE Answer: d) PSPACE
213. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or EXPTIME? a) P b)
NP c) EXPTIME d) PSPACE Answer: d) PSPACE
214. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or BQP? a) P b) NP c)
BQP d) PSPACE Answer: d) PSPACE
215. Which complexity class represents the set of problems that are solvable in
polynomial time on a classical computer but not known to be in P or QMA? a) P b) NP c)
QMA d) PSPACE Answer: d) PSPACE
216.
217.
218.

You might also like