Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

1.

Algorithm analysis is the study of: A) How algorithms work B) How to design algorithms C)
How to analyze the efficiency of algorithms D) None of the above
Answer: C) How to analyze the efficiency of algorithms
2. The motivation behind algorithm analysis is to: A) Improve the correctness of algorithms B)
Improve the readability of algorithms C) Improve the efficiency of algorithms D) None of the
above
Answer: C) Improve the efficiency of algorithms
3. The time complexity of an algorithm measures: A) The amount of time it takes to execute the
algorithm B) The number of steps the algorithm takes to execute C) The amount of memory
the algorithm uses D) None of the above
Answer: B) The number of steps the algorithm takes to execute
4. The space complexity of an algorithm measures: A) The amount of time it takes to execute
the algorithm B) The number of steps the algorithm takes to execute C) The amount of
memory the algorithm uses D) None of the above
Answer: C) The amount of memory the algorithm uses
5. The Big O notation is used to: A) Measure the best-case time complexity of an algorithm B)
Measure the average-case time complexity of an algorithm C) Measure the worst-case time
complexity of an algorithm D) None of the above
Answer: C) Measure the worst-case time complexity of an algorithm
6. The Omega notation is used to: A) Measure the best-case time complexity of an algorithm B)
Measure the average-case time complexity of an algorithm C) Measure the worst-case time
complexity of an algorithm D) None of the above
Answer: A) Measure the best-case time complexity of an algorithm
7. The Theta notation is used to: A) Measure the best-case time complexity of an algorithm B)
Measure the average-case time complexity of an algorithm C) Measure the worst-case time
complexity of an algorithm D) None of the above
Answer: B) Measure the average-case time complexity of an algorithm
8. The concept of algorithm analysis dates back to: A) Ancient times B) The Middle Ages C)
The Renaissance D) The 20th century
Answer: A) Ancient times
9. The first known algorithm analysis was done by: A) Euclid B) Isaac Newton C) Alan Turing
D) Donald Knuth
Answer: A) Euclid
10. The motivation behind algorithm analysis is to: A) Improve the correctness of algorithms B)
Improve the readability of algorithms C) Improve the efficiency of algorithms D) None of the
above
Answer: C) Improve the efficiency of algorithms
1. The concept of algorithm analysis gained significant attention in the field of computer science
during which decade? A) 1950s B) 1960s C) 1970s D) 1980s
Answer: C) 1970s
2. The motivation behind algorithm analysis is to: A) Improve the correctness of algorithms B)
Improve the readability of algorithms C) Improve the efficiency of algorithms D) None of the
above
Answer: C) Improve the efficiency of algorithms
3. The space complexity of an algorithm measures: A) The amount of time it takes to execute
the algorithm B) The number of steps the algorithm takes to execute C) The amount of
memory the algorithm uses D) None of the above
Answer: C) The amount of memory the algorithm uses
4. The concept of algorithm analysis was popularized by which influential computer scientist?
A) Alan Turing B) Donald Knuth C) Edsger Dijkstra D) Grace Hopper
Answer: B) Donald Knuth
5. The Big O notation is used to: A) Measure the best-case time complexity of an algorithm B)
Measure the average-case time complexity of an algorithm C) Measure the worst-case time
complexity of an algorithm D) None of the above
Answer: C) Measure the worst-case time complexity of an algorithm
1. Quicksort is an efficient sorting algorithm that falls under the category of: A) Divide and
conquer algorithms B) Greedy algorithms C) Dynamic programming algorithms D) None of
the above
Answer: A) Divide and conquer algorithms
2. The main idea behind Quicksort is to: A) Divide the array into two equal halves B) Sort the
array by repeatedly swapping adjacent elements C) Partition the array into two subarrays
based on a pivot element D) None of the above
Answer: C) Partition the array into two subarrays based on a pivot element
3. The pivot element in Quicksort is used to: A) Determine the position of the smallest element
in the array B) Divide the array into two subarrays during the partitioning process C) Sort the
array by comparing it with other elements D) None of the above
Answer: B) Divide the array into two subarrays during the partitioning process
4. The worst-case time complexity of Quicksort is: A) O(n) B) O(n log n) C) O(n^2) D) None of
the above
Answer: C) O(n^2)
5. Quicksort can be made more efficient by using: A) Merge sort as a preprocessing step B)
Insertion sort for small subarrays C) Bubble sort for large arrays D) None of the above
Answer: B) Insertion sort for small subarrays
1. Quicksort is an efficient sorting algorithm that falls under the category of: A) Divide and
conquer algorithms B) Greedy algorithms C) Dynamic programming algorithms D) None of
the above
Answer: A) Divide and conquer algorithms
2. The main idea behind Quicksort is to: A) Divide the array into two equal halves B) Sort the
array by repeatedly swapping adjacent elements C) Partition the array into two subarrays
based on a pivot element D) None of the above
Answer: C) Partition the array into two subarrays based on a pivot element
3. The pivot element in Quicksort is used to: A) Determine the position of the smallest element
in the array B) Divide the array into two subarrays during the partitioning process C) Sort the
array by comparing it with other elements D) None of the above
Answer: B) Divide the array into two subarrays during the partitioning process
4. The worst-case time complexity of Quicksort is: A) O(n) B) O(n log n) C) O(n^2) D) None of
the above
Answer: C) O(n^2)
5. Quicksort can be made more efficient by using: A) Merge sort as a preprocessing step B)
Insertion sort for small subarrays C) Bubble sort for large arrays D) None of the above
Answer: B) Insertion sort for small subarrays
6. Quicksort is an in-place sorting algorithm, which means: A) It requires additional memory to
store intermediate results B) It modifies the input array during the sorting process C) It
creates a copy of the input array before sorting D) None of the above
Answer: B) It modifies the input array during the sorting process
7. The average-case time complexity of Quicksort is: A) O(n) B) O(n log n) C) O(n^2) D) None
of the above
Answer: B) O(n log n)
8. Quicksort is not a stable sorting algorithm, which means: A) It may change the relative order
of equal elements B) It always maintains the relative order of equal elements C) It only works
on arrays with distinct elements D) None of the above
Answer: A) It may change the relative order of equal elements
9. The partitioning process in Quicksort involves: A) Rearranging the elements in the array
based on their values B) Swapping adjacent elements until the array is sorted C) Dividing the
array into two equal halves D) None of the above
Answer: A) Rearranging the elements in the array based on their values
10. Quicksort is a recursive algorithm, which means: A) It can only be implemented using loops
B) It calls itself to solve smaller subproblems C) It requires a stack to keep track of function
calls D) None of the above
Answer: B) It calls itself to solve smaller subproblems
11. The best-case time complexity of Quicksort is: A) O(n) B) O(n log n) C) O(n^2) D) None of
the above
Answer: B) O(n log n)
12. Quicksort is widely used in practice because: A) It has a simple implementation B) It is
efficient for most inputs C) It guarantees a stable sorting order D) None of the above
Answer: B) It is efficient for most inputs
13. The choice of pivot element in Quicksort can affect its performance. Which of the following is
a good strategy for choosing the pivot? A) Always selecting the first element of the array B)
Randomly selecting an element from the array C) Selecting the median of the first, middle,
and last elements D) None of the above
Answer: C) Selecting the median of the first, middle, and last elements
14. Quicksort is an example of an in-place sorting algorithm, which means: A) It requires
additional memory to store intermediate results B) It modifies the input array during the
sorting process C) It creates a copy of the input array before sorting D) None of the above
Answer: B) It modifies the input array during the sorting process
15. Quicksort has a space complexity of: A) O(1) B) O(n) C) O(log n) D) None of the above
Answer: C) O(log n)
1. "Big-Oh" notation is used to describe the: A) Best-case time complexity of an algorithm B)
Average-case time complexity of an algorithm C) Worst-case time complexity of an algorithm
D) None of the above
Answer: C) Worst-case time complexity of an algorithm
2. The "big-Oh" notation O(n) represents: A) Constant time complexity B) Linear time
complexity C) Quadratic time complexity D) None of the above
Answer: B) Linear time complexity
3. Asymptotic analysis is used to analyze the: A) Exact running time of an algorithm B) Best-
case running time of an algorithm C) Average-case running time of an algorithm D) Growth
rate of an algorithm's running time
Answer: D) Growth rate of an algorithm's running time
4. The "big-Oh" notation O(1) represents: A) Constant time complexity B) Linear time
complexity C) Quadratic time complexity D) None of the above
Answer: A) Constant time complexity
5. The "big-Oh" notation O(n^2) represents: A) Constant time complexity B) Linear time
complexity C) Quadratic time complexity D) None of the above
Answer: C) Quadratic time complexity
6. When analyzing the time complexity of an algorithm, we focus on the: A) Number of
operations performed by the algorithm B) Size of the input to the algorithm C) Memory usage
of the algorithm D) None of the above
Answer: B) Size of the input to the algorithm
7. The "big-Oh" notation O(log n) represents: A) Constant time complexity B) Linear time
complexity C) Logarithmic time complexity D) None of the above
Answer: C) Logarithmic time complexity
8. Asymptotic analysis allows us to: A) Determine the exact running time of an algorithm B)
Compare the efficiency of different algorithms C) Predict the best-case running time of an
algorithm D) None of the above
Answer: B) Compare the efficiency of different algorithms
9. The "big-Oh" notation O(n log n) represents: A) Constant time complexity B) Linear time
complexity C) Logarithmic time complexity D) None of the above
Answer: B) Linear time complexity
10. Asymptotic analysis focuses on the behavior of an algorithm: A) For small input sizes B) For
large input sizes C) For all input sizes D) None of the above
Answer: B) For large input sizes
1. Which of the following statements is true about "big-Oh" notation? A) It provides an exact
measurement of an algorithm's running time. B) It represents the best-case time complexity
of an algorithm. C) It describes the upper bound of an algorithm's running time. D) It is only
applicable to recursive algorithms.
Answer: C) It describes the upper bound of an algorithm's running time.
2. The "big-Oh" notation O(n!) represents: A) Constant time complexity B) Linear time
complexity C) Exponential time complexity D) None of the above
Answer: C) Exponential time complexity
3. Which of the following time complexities grows the fastest as the input size increases? A)
O(1) B) O(log n) C) O(n) D) O(n^2)
Answer: D) O(n^2)
4. Asymptotic analysis is concerned with the behavior of an algorithm: A) In the best-case
scenario B) In the average-case scenario C) In the worst-case scenario D) In all possible
scenarios
Answer: D) In all possible scenarios
5. The "big-Oh" notation O(2^n) represents: A) Constant time complexity B) Linear time
complexity C) Exponential time complexity D) None of the above
Answer: C) Exponential time complexity
1. What is a recurrence relation? A) A relation between two variables B) A relation between two
functions C) A relation that defines a sequence based on previous terms D) A relation that
defines a function based on previous values
Answer: C) A relation that defines a sequence based on previous terms
2. Which of the following is an example of a linear recurrence relation? A) Fibonacci sequence
B) Tower of Hanoi C) Merge sort D) Quick sort
Answer: A) Fibonacci sequence
3. What is the base case in a recurrence relation? A) The first term of the sequence B) The last
term of the sequence C) The term that defines the relation D) The term that terminates the
sequence
Answer: A) The first term of the sequence
4. What is the order of a recurrence relation? A) The number of terms in the sequence B) The
number of base cases C) The number of recursive calls in the relation D) The highest power
of the variable in the relation
Answer: D) The highest power of the variable in the relation
5. Which of the following is an example of a homogeneous recurrence relation? A) Fibonacci
sequence B) Tower of Hanoi C) Merge sort D) Quick sort
Answer: A) Fibonacci sequence
6. What is the characteristic equation of a linear homogeneous recurrence relation? A) An
equation that defines the base case B) An equation that defines the order of the relation C)
An equation that defines the coefficients of the relation D) An equation that defines the roots
of the relation
Answer: D) An equation that defines the roots of the relation
7. What is the closed-form solution of a recurrence relation? A) An explicit formula for the nth
term of the sequence B) A recursive formula for the nth term of the sequence C) An equation
that defines the base case D) An equation that defines the order of the relation
Answer: A) An explicit formula for the nth term of the sequence
8. Which of the following is an example of a non-homogeneous recurrence relation? A)
Fibonacci sequence B) Tower of Hanoi C) Merge sort D) Quick sort
Answer: B) Tower of Hanoi
9. What is the method of undetermined coefficients used for? A) Solving linear homogeneous
recurrence relations B) Solving linear non-homogeneous recurrence relations C) Finding the
order of a recurrence relation D) Finding the base case of a recurrence relation
Answer: B) Solving linear non-homogeneous recurrence relations
10. What is the time complexity of the Tower of Hanoi problem with n disks? A) O(1) B) O(log n)
C) O(n) D) O(2^n)
Answer: D) O(2^n)
11. What is the time complexity of the merge sort algorithm? A) O(1) B) O(log n) C) O(n) D) O(n
log n)
Answer: D) O(n log n)
12. What is the time complexity of the quick sort algorithm in the worst case? A) O(1) B) O(log n)
C) O(n) D) O(n^2)
Answer: D) O(n^2)
13. What is the time complexity of the Fibonacci sequence using a naive recursive approach? A)
O(1) B) O(log n) C) O(n) D) O(2^n)
Answer: D) O(2^n)
14. What is the time complexity of the Fibonacci sequence using dynamic programming? A) O(1)
B) O(log n) C) O(n) D) O(n^2)
Answer: C) O(n)
15. What is the time complexity of the Tower of Hanoi problem with n disks using a recursive
approach? A) O(1) B) O(log n) C) O(n) D) O(2^n)
Answer: D) O(2^n)
1. What is telescoping series? A) A series that involves the use of a telescope B) A series
where most terms cancel out, leaving only a few terms C) A series that involves the use of a
telescope to observe the terms D) A series where the terms increase or decrease
exponentially
Answer: B) A series where most terms cancel out, leaving only a few terms
2. Which of the following series is an example of a telescoping series? A) 1 + 2 + 3 + 4 + ... B)
1 - 1/2 + 1/3 - 1/4 + ... C) 1 + 1/2 + 1/4 + 1/8 + ... D) 1 + 1/2 + 1/3 + 1/4 + ...
Answer: B) 1 - 1/2 + 1/3 - 1/4 + ...
3. What is the general strategy for evaluating a telescoping series? A) Use the formula for the
sum of an arithmetic series B) Use the formula for the sum of a geometric series C) Simplify
the terms and look for cancellation D) Use the formula for the sum of a telescoping series
Answer: C) Simplify the terms and look for cancellation
4. What is the sum of the telescoping series 1 - 1/2 + 1/3 - 1/4 + ...? A) 1/2 B) 1/3 C) 1/4 D)
Diverges
Answer: D) Diverges
5. What is the sum of the telescoping series 1 + 1/2 + 1/4 + 1/8 + ...? A) 1 B) 2 C) 3/2 D)
Diverges
Answer: A) 1
6. What is the sum of the telescoping series 2 - 1 + 1/2 - 1/4 + ...? A) 1 B) 2 C) 3/2 D) Diverges
Answer: B) 2
7. What is the sum of the telescoping series 1/2 + 1/3 + 1/4 + 1/5 + ...? A) 1 B) 2 C) Diverges D)
Converges to a finite value
Answer: C) Diverges
8. What is the sum of the telescoping series 1 - 1/3 + 1/5 - 1/7 + ...? A) 1/2 B) 2/3 C) Diverges
D) Converges to a finite value
Answer: D) Converges to a finite value
9. What is the sum of the telescoping series 3 - 2 + 1 - 1/2 + ...? A) 1/2 B) 1 C) Diverges D)
Converges to a finite value
Answer: C) Diverges
10. What is the sum of the telescoping series 1 + 1/3 + 1/9 + 1/27 + ...? A) 1/2 B) 2/3 C)
Diverges D) Converges to a finite value
Answer: B) 2/3
1. What is mergesort? A) A sorting algorithm that uses a divide-and-conquer approach B) A
sorting algorithm that uses a bubble sort approach C) A sorting algorithm that uses a
selection sort approach D) A sorting algorithm that uses a quicksort approach
Answer: A) A sorting algorithm that uses a divide-and-conquer approach
2. What is the time complexity of mergesort in the worst case? A) O(n) B) O(n log n) C) O(n^2)
D) O(log n)
Answer: B) O(n log n)
3. What is the space complexity of mergesort? A) O(1) B) O(n) C) O(log n) D) O(n log n)
Answer: B) O(n)
4. Which step of mergesort combines the sorted subarrays? A) Merge B) Divide C) Conquer D)
Sort
Answer: A) Merge
5. Mergesort is a stable sorting algorithm. What does this mean? A) It always sorts the
elements in ascending order B) It always sorts the elements in descending order C) It
maintains the relative order of equal elements D) It randomly shuffles the elements
Answer: C) It maintains the relative order of equal elements
6. Which of the following is an advantage of mergesort? A) It has a small memory footprint B) It
is easy to implement C) It has a fast average-case time complexity D) It is an in-place sorting
algorithm
Answer: C) It has a fast average-case time complexity
7. Which of the following is a disadvantage of mergesort? A) It has a slow worst-case time
complexity B) It requires additional memory for merging C) It is difficult to implement D) It is
not a stable sorting algorithm
Answer: B) It requires additional memory for merging
8. Mergesort is an example of a: A) Comparison-based sorting algorithm B) Distribution-based
sorting algorithm C) Radix-based sorting algorithm D) Insertion-based sorting algorithm
Answer: A) Comparison-based sorting algorithm
9. Which of the following is the correct order of steps in the mergesort algorithm? A) Divide,
Merge, Sort B) Sort, Divide, Merge C) Merge, Sort, Divide D) Sort, Merge, Divide
Answer: B) Sort, Divide, Merge
10. In mergesort, the array is divided into subarrays until each subarray contains: A) One
element B) Two elements C) Three elements D) Four elements
Answer: A) One element
11. Which of the following is the correct implementation of the merge step in mergesort? A)
Merge sort(array, left, right) B) Merge(array, left, mid, right) C) MergeSort(array, left, mid,
right) D) MergeSort(array, left, right)
Answer: B) Merge(array, left, mid, right)
12. Mergesort is an example of a: A) Recursive algorithm B) Iterative algorithm C) Dynamic
programming algorithm D) Greedy algorithm
Answer: A) Recursive algorithm
13. Mergesort is a stable sorting algorithm because: A) It uses a stable partitioning technique B)
It uses a stable comparison operator C) It uses a stable merging technique D) It uses a
stable divide-and-conquer approach
Answer: C) It uses a stable merging technique
14. Which of the following is the correct time complexity of mergesort in the best case? A) O(n)
B) O(n log n) C) O(n^2) D) O(log n)
Answer: B) O(n log n)
15. Mergesort is an efficient sorting algorithm for: A) Small input sizes B) Large input sizes C)
Input sizes with a small range of values D) Input sizes with a large range of values
Answer: B) Large input sizes
1. The Master Theorem is used to analyze the time complexity of algorithms that follow a: A)
Divide-and-conquer approach B) Greedy approach C) Dynamic programming approach D)
Backtracking approach
Answer: A) Divide-and-conquer approach
2. The Master Theorem provides a formula to determine the time complexity of algorithms that
have the form: A) T(n) = aT(n/b) + f(n) B) T(n) = aT(n-1) + f(n) C) T(n) = aT(n/b) + n D) T(n) =
aT(n-1) + n
Answer: A) T(n) = aT(n/b) + f(n)
3. The Master Theorem has three cases: Case 1, Case 2, and Case: A) 3 B) 4 C) 5 D) 6
Answer: B) 4
4. Case 1 of the Master Theorem applies when the subproblems have: A) Equal size B)
Different sizes C) Constant size D) Linear size
Answer: A) Equal size
5. In Case 1 of the Master Theorem, the time complexity is determined by the: A) Number of
subproblems B) Size of the subproblems C) Combination of the number and size of the
subproblems D) Constant term in the recurrence relation
Answer: C) Combination of the number and size of the subproblems
6. Case 2 of the Master Theorem applies when the subproblems have: A) Equal size B)
Different sizes C) Constant size D) Linear size
Answer: B) Different sizes
7. In Case 2 of the Master Theorem, the time complexity is determined by the: A) Number of
subproblems B) Size of the subproblems C) Combination of the number and size of the
subproblems D) Constant term in the recurrence relation
Answer: B) Size of the subproblems
8. Case 3 of the Master Theorem applies when the subproblems have: A) Equal size B)
Different sizes C) Constant size D) Linear size
Answer: A) Equal size
9. In Case 3 of the Master Theorem, the time complexity is determined by the: A) Number of
subproblems B) Size of the subproblems C) Combination of the number and size of the
subproblems D) Constant term in the recurrence relation
Answer: A) Number of subproblems
10. In Case 1 of the Master Theorem, if f(n) is O(n^c) where c < log_b(a), then the time
complexity is: A) O(n) B) O(n log n) C) O(n^c) D) O(n^log_b(a))
Answer: B) O(n^log_b(a))
11. In Case 1 of the Master Theorem, if f(n) is Theta(n^c log^k n) where c = log_b(a), then the
time complexity is: A) O(n) B) O(n log n) C) O(n^c) D) O(n^c log^k n)
Answer: D) O(n^c log^k n)
12. In Case 1 of the Master Theorem, if f(n) is Omega(n^c), where c > log_b(a), and if af(n/b) <=
kf(n) for some constant k < 1 and sufficiently large n, then the time complexity is: A) O(n) B)
O(n log n) C) O(n^c) D) O(f(n))
Answer: C) O(n^c)
13. In Case 2 of the Master Theorem, if f(n) is O(n^c) where c > log_b(a), then the time
complexity is: A) O(n) B) O(n log n) C) O(n^c) D) O(f(n))
Answer: A) O(n^c)
14. In Case 3 of the Master Theorem, if f(n) is Theta(n^c log^k n) where c > log_b(a), then the
time complexity is: A) O(n) B) O(n log n) C) O(n^c) D) O(n^c log^k n)
Answer: D) O(n^c log^k n)
15. The Master Theorem provides a general framework for analyzing the time complexity of
divide-and-conquer algorithms, but it may not be applicable in all cases. True or False?
Answer: True
1. Ordinary Generating Functions (OGFs) are used to represent: A) Sequences of numbers B)
Functions of a single variable C) Power series D) All of the above
Answer: D) All of the above
2. The OGF of the sequence {1, 2, 3, 4, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: A) 1/(1-x)
3. The OGF of the sequence {1, 1, 1, 1, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: B) 1/(1+x)
4. The OGF of the sequence {1, 0, 1, 0, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: C) 1/(1-x)^2
5. The OGF of the sequence {1, 1/2, 1/4, 1/8, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D)
1/(1+x)^2
Answer: D) 1/(1+x)^2
6. The OGF of the sequence {1, 3, 5, 7, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: A) 1/(1-x)
7. The OGF of the sequence {1, -1, 1, -1, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: B) 1/(1+x)
8. The OGF of the sequence {1, 2, 4, 8, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: A) 1/(1-x)
9. The OGF of the sequence {0, 1, 2, 3, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: B) 1/(1+x)
10. The OGF of the sequence {0, 0, 1, 1, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: C) 1/(1-x)^2
11. The OGF of the sequence {0, 1/2, 1/4, 1/8, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D)
1/(1+x)^2
Answer: D) 1/(1+x)^2
12. The OGF of the sequence {0, 3, 5, 7, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: A) 1/(1-x)
13. The OGF of the sequence {0, -1, 1, -1, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: B) 1/(1+x)
14. The OGF of the sequence {0, 2, 4, 8, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: A) 1/(1-x)
15. The OGF of the sequence {0, 1, 2, 3, ...} is: A) 1/(1-x) B) 1/(1+x) C) 1/(1-x)^2 D) 1/(1+x)^2
Answer: B) 1/(1+x)
1. Counting with Generating Functions is a technique used to: A) Count the number of
elements in a set B) Count the number of subsets of a set C) Count the number of ways to
arrange objects D) All of the above
Answer: D) All of the above
2. The generating function for counting the number of ways to choose k objects from a set of n
objects is: A) (1+x)^n B) (1-x)^n C) (1+x)^k D) (1-x)^k
Answer: C) (1+x)^k
3. The generating function for counting the number of ways to arrange n distinct objects in a
line is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: A) (1+x)^n
4. The generating function for counting the number of ways to arrange n identical objects in a
line is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: C) (1+x)^n!
5. The generating function for counting the number of ways to arrange n distinct objects in a
circle is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: D) (1-x)^n!
6. The generating function for counting the number of ways to arrange n identical objects in a
circle is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: A) (1+x)^n
7. The generating function for counting the number of ways to choose k objects from a set of n
objects without repetition is: A) (1+x)^n B) (1-x)^n C) (1+x)^k D) (1-x)^k
Answer: B) (1-x)^n
8. The generating function for counting the number of ways to choose k objects from a set of n
objects with repetition is: A) (1+x)^n B) (1-x)^n C) (1+x)^k D) (1-x)^k
Answer: A) (1+x)^n
9. The generating function for counting the number of ways to arrange n distinct objects in a
line with restrictions is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: B) (1-x)^n
10. The generating function for counting the number of ways to arrange n identical objects in a
line with restrictions is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: D) (1-x)^n!
11. The generating function for counting the number of ways to arrange n distinct objects in a
circle with restrictions is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: A) (1+x)^n
12. The generating function for counting the number of ways to arrange n identical objects in a
circle with restrictions is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: C) (1+x)^n!
13. The generating function for counting the number of ways to choose k objects from a set of n
objects without repetition and with restrictions is: A) (1+x)^n B) (1-x)^n C) (1+x)^k D) (1-x)^k
Answer: B) (1-x)^n
14. The generating function for counting the number of ways to choose k objects from a set of n
objects with repetition and with restrictions is: A) (1+x)^n B) (1-x)^n C) (1+x)^k D) (1-x)^k
Answer: A) (1+x)^n
15. The generating function for counting the number of ways to arrange n distinct objects in a
line with restrictions and with repetition is: A) (1+x)^n B) (1-x)^n C) (1+x)^n! D) (1-x)^n!
Answer: B) (1-x)^n
1. Catalan numbers are a sequence of natural numbers that appear in various counting
problems. They are named after: A) Leonhard Euler B) Augustin-Louis Cauchy C) Eugène
Charles Catalan D) Pierre-Simon Laplace
Answer: C) Eugène Charles Catalan
2. The first few Catalan numbers are: A) 1, 2, 3, 4, 5 B) 1, 1, 2, 5, 14 C) 1, 3, 5, 7, 9 D) 1, 1, 2,
4, 8
Answer: B) 1, 1, 2, 5, 14
3. Catalan numbers can be defined recursively as: A) C(n) = C(n-1) + C(n-2) B) C(n) = C(n-1) *
C(n-2) C) C(n) = (2n)! / ((n+1)! * n!) D) C(n) = n!
Answer: C) C(n) = (2n)! / ((n+1)! * n!)
4. The Catalan number C(n) counts the number of: A) Binary trees with n+1 leaves B) Paths
from (0,0) to (n,n) that do not cross the main diagonal C) Balanced parentheses expressions
with n pairs of parentheses D) All of the above
Answer: D) All of the above
5. The formula for calculating the nth Catalan number is: A) C(n) = 2^n B) C(n) = n! C) C(n) =
(2n)! / ((n+1)! * n!) D) C(n) = C(n-1) + C(n-2)
Answer: C) C(n) = (2n)! / ((n+1)! * n!)
6. The Catalan number C(4) is equal to: A) 1 B) 2 C) 5 D) 14
Answer: D) 14
7. The Catalan number C(0) is equal to: A) 0 B) 1 C) 2 D) 3
Answer: B) 1
8. The Catalan number C(5) is equal to: A) 5 B) 10 C) 15 D) 42
Answer: D) 42
9. The Catalan number C(10) is equal to: A) 42 B) 89 C) 167 D) 4862
Answer: D) 4862
10. The Catalan number C(3) is equal to: A) 1 B) 2 C) 3 D) 4
Answer: C) 3
11. The Catalan number C(6) is equal to: A) 6 B) 15 C) 42 D) 132
Answer: D) 132
12. The Catalan number C(1) is equal to: A) 0 B) 1 C) 2 D) 3
Answer: B) 1
13. The Catalan number C(7) is equal to: A) 7 B) 21 C) 56 D) 429
Answer: D) 429
14. The Catalan number C(2) is equal to: A) 1 B) 2 C) 3 D) 4
Answer: B) 2
15. The Catalan number C(8) is equal to: A) 8 B) 28 C) 92 D) 256
Answer: C) 92

You might also like