Discrete Mathematics: Questions and Answers on Key Concepts

Test your understanding of discrete mathematics with this comprehensive Q&A section. Covering topics such as sets, relations, functions, logic, and algorithms, this resource provides clear explanations and solutions to help solidify your knowledge.



Discrete Mathematics: Questions and Answers on Various Topics

This section presents a series of questions and answers covering various topics in discrete mathematics, including sets, relations, functions, algorithms, and logic.

Questions and Answers

  1. If sets X and Y have 7 and 8 elements, respectively, how many relations exist between them?:
    1. 256
    2. 272
    3. 356
    4. 56

    Answer: (a) 256

    Explanation: There are 2mn possible relations between two sets with cardinalities m and n.

  2. On the set {0, 1, 2, 3}, how many reflexive closures are there for the relation {(0, 1), (1, 1), (1, 3), (2, 1), (2, 2), (3, 0)}?:
    1. 26
    2. 36
    3. 8
    4. 6

    Answer: (d) 6

  3. What is the transitive closure of the relation {(0,1), (1,2), (2,2), (3,4), (5,3), (5,4)} on the set {0, 1, 2, 3, 4, 5}?:
    1. {(0,0), (4,4), (5,5), (1,1), (2,2), (3,3)}
    2. {(0,1), (1,2), (2,2), (3,4)}
    3. {(0,1), (0,2), (1,2), (2,2), (3,4), (5,3), (5,4)}
    4. {(0,1), (5,3), (5,4), (1,1), (2,2)}

    Answer: (c) {(0,1), (0,2), (1,2), (2,2), (3,4), (5,3), (5,4)}

  4. If X and Y are relations on S, which statement is FALSE?:
    1. Their intersection is a relation on S.
    2. Their union is a relation on S.
    3. Their difference is a relation on S.
    4. Their symmetric closure is not a relation.

    Answer: (d) Their symmetric closure is not a relation.

  5. Which is NOT a valid law of Boolean algebra?:
    1. (A + B)(A + C) = A + (B × C)
    2. A + A = A
    3. A × B = B × A
    4. All of the above are true

    Answer: (a) (A + B)(A + C) = A + (B × C)

  6. The dual of the AND operation is:
    1. OR
    2. AND
    3. NOT
    4. XOR

    Answer: (a) OR

  7. The set {1, 0} is primarily associated with:
    1. Logical algebra
    2. Boolean algebra
    3. Set Theory
    4. Matrices

    Answer: (b) Boolean algebra

  8. How many distinct ways are there to express a logical proposition using only AND and OR (considering order and parentheses)?:
    1. 16
    2. 32
    3. 24
    4. None of the above

    Answer: (b) 32

  9. A symmetric matrix A satisfies:
    1. A = AT
    2. A = -AT
    3. Diagonal elements are all 1
    4. Diagonal elements are all 0

    Answer: (a) A = AT

  10. A matrix with one row and multiple columns is a:
    1. Row Matrix
    2. Column Matrix
    3. Diagonal Matrix
    4. None of the mentioned

    Answer: (a) Row Matrix

  11. A matrix with multiple rows and only one column is a:
    1. Row Matrix
    2. Column Matrix
    3. Diagonal Matrix
    4. None of the mentioned

    Answer: (b) Column Matrix

  12. To add two matrices, they must have:
    1. The same number of rows and columns
    2. The same number of columns
    3. The same number of rows
    4. The number of rows in the first equals the number of columns in the second

    Answer: (a) The same number of rows and columns

  13. For matrix addition, A + B = B + A is:
    1. True
    2. False

    Answer: (a) True

  14. For matrix multiplication, AB = BA is:
    1. True
    2. False

    Answer: (b) False

  15. A universal logic gate is:
    1. NAND
    2. OR
    3. NOT
    4. AND

    Answer: (a) NAND

  16. Maurice Karnaugh published his map in:
    1. 1953
    2. 1952
    3. 1956
    4. 1958

    Answer: (a) 1953

  17. The number of main canonical forms for Boolean expressions is:
    1. Two
    2. Three
    3. Four
    4. Five

    Answer: (a) Two

  18. Boolean algebra is mainly used in designing:
    1. Logic symbols
    2. Digital computers
    3. Circuit theory
    4. None of the above

    Answer: (b) Digital computers

  19. Boolean algebra operates on how many values?:
    1. Two
    2. Three
    3. Four
    4. Five

    Answer: (a) Two

  20. A sequential search algorithm involves:
    1. Comparing each element sequentially
    2. Dividing the problem into subproblems
    3. Sorting the data first
    4. None of the above

    Answer: (a) Comparing each element sequentially

  21. In insertion sort, sorting starts with the:
    1. First element
    2. Second element
    3. Middle element
    4. Last element

    Answer: (b) Second element

  22. The worst-case time complexity of a linear search is:
    1. O(log n)
    2. O(n)
    3. O(n log n)
    4. O(n²)

    Answer: (b) O(n)

  23. The time complexity of bubble sort is:
    1. O(n)
    2. O(log n)
    3. O(n log n)
    4. O(n²)

    Answer: (d) O(n²)

  24. Dynamic programming is characterized by:
    1. Reusing solutions to subproblems
    2. Dividing problems into independent subproblems
    3. Trying all possible solutions
    4. None of the above

    Answer: (a) Reusing solutions to subproblems

  25. Complexity theory does NOT typically consider the ______ case:
    1. Null case
    2. Average case
    3. Best case
    4. Worst case

    Answer: (a) Null case

  26. If the function f is both injective and surjective, then f is:
    1. Bijective
    2. Surjective
    3. Injective
    4. None of the above

    Answer: (a) Bijective

  27. If f and g are onto functions, then g∘f is a(n):
    1. Onto function
    2. Into function
    3. One-to-one function
    4. One-to-many function

    Answer: (a) Onto function

  28. Function composition is:
    1. Associative but not commutative
    2. Commutative but not associative
    3. Both associative and commutative
    4. Neither associative nor commutative

    Answer: (a) Associative but not commutative

  29. The composition of functions f(x) = 2x+1 and g(x) = 3x+4 is:
    1. 6x+9
    2. 6x+8
    3. 6x+7
    4. 6x+3

    Answer: (a) 6x + 9

  30. The number of bytes required to encode 2000 bits is approximately:
    1. 250
    2. 4
    3. 2
    4. 8

    Answer: (a) 250

  31. What is the main drawback of the bubble sort algorithm?:
    1. High space complexity
    2. High time complexity in the worst case
    3. Inability to handle large datasets
    4. Difficult implementation

    Answer: (b) High time complexity in the worst case

    Explanation: Bubble sort has O(n²) time complexity in the worst case.

  32. In a binary tree, the maximum number of nodes at level 'l' is:
    1. 2l
    2. 2(l+1)
    3. l

    Answer: (a) 2l

  33. In a hash table, a hash function primarily:
    1. Sorts the data
    2. Finds the index for storing data
    3. Handles collisions
    4. Encrypts the data

    Answer: (b) Finds the index for storing data

  34. Which graph traversal algorithm uses a stack?:
    1. Depth First Search (DFS)
    2. Breadth First Search (BFS)
    3. Topological Sort
    4. Kruskal's Algorithm

    Answer: (a) Depth First Search (DFS)

  35. In an AVL tree, the balance factor of a node can be:
    1. 0, 1, or 2
    2. -1, 0, or 1
    3. -2, -1, 0, 1, or 2
    4. Only 0

    Answer: (b) -1, 0, or 1

  36. What is the correct order of increasing complexity for these sorting algorithms: Bubble Sort, Quick Sort, Merge Sort?:
    1. Bubble Sort, Quick Sort, Merge Sort
    2. Merge Sort, Bubble Sort, Quick Sort
    3. Quick Sort, Merge Sort, Bubble Sort
    4. Bubble Sort, Merge Sort, Quick Sort

    Answer: (a) Bubble Sort, Quick Sort, Merge Sort

  37. Deleting the last node in a circular linked list results in:
    1. The list remaining unchanged
    2. The second-to-last node becoming the last node
    3. The entire list being deleted
    4. An error

    Answer: (b) The second-to-last node becoming the last node

  38. The minimum number of colors needed to color a graph is:
    1. One
    2. Two
    3. Three
    4. Depends on the graph

    Answer: (d) Depends on the graph

  39. The key difference between a tree and a graph is:
    1. Trees have cycles; graphs don't.
    2. Trees have no cycles; graphs may have cycles.
    3. Trees are not connected; graphs are connected.
    4. Both have the same structure.

    Answer: (b) Trees have no cycles; graphs may have cycles.

  40. The time complexity of the binary search algorithm is:
    1. O(n)
    2. O(n log n)
    3. O(log n)
    4. O(1)

    Answer: (c) O(log n)

  41. In which type of tree are the heights of the left and right subtrees always balanced?:
    1. Red-Black Tree
    2. Binary Search Tree
    3. AVL Tree
    4. B-tree

    Answer: (c) AVL Tree

  42. A significant disadvantage of a binary search tree is:
    1. High memory overhead
    2. Potential for imbalance
    3. Many comparisons needed
    4. Cannot store large datasets

    Answer: (b) Potential for imbalance

  43. The worst-case time complexity of insertion sort is:
    1. O(n)
    2. O(n log n)
    3. O(n²)
    4. O(log n)

    Answer: (c) O(n²)

  44. The worst-case time complexity of quicksort is:
    1. O(n)
    2. O(n log n)
    3. O(log n)
    4. O(n²)

    Answer: (d) O(n²)

  45. Which is a type of balanced binary search tree?:
    1. AVL Tree
    2. Red-Black Tree
    3. Both AVL Tree and Red-Black Tree
    4. Binary Search Tree

    Answer: (c) Both AVL Tree and Red-Black Tree

  46. Dijkstra's algorithm finds:
    1. Shortest paths in a weighted graph
    2. Maximum flow in a network
    3. Minimum spanning tree
    4. Topological ordering

    Answer: (a) Shortest paths in a weighted graph

  47. Which sorting algorithm is NOT stable?:
    1. Merge Sort
    2. Bubble Sort
    3. Quick Sort
    4. Insertion Sort

    Answer: (c) Quick Sort

  48. The best algorithm for searching in a sorted array is:
    1. Linear Search
    2. Binary Search
    3. Jump Search
    4. Interpolation Search

    Answer: (b) Binary Search

  49. In a directed graph, a node with no outgoing edges is a:
    1. Source
    2. Sink
    3. Leaf
    4. Root

    Answer: (b) Sink

  50. In a hash table, a collision occurs when:
    1. Two keys hash to the same value
    2. The table is full
    3. A key is not found
    4. None of the above

    Answer: (a) Two keys hash to the same value

  51. Which is NOT a feature of a B-tree?:
    1. Nodes can have multiple children
    2. Self-balancing
    3. Each node contains at most one key
    4. Keys are in sorted order

    Answer: (c) Each node contains at most one key

  52. A stack uses the principle of:
    1. FIFO
    2. LIFO
    3. Both FIFO and LIFO
    4. None of the above

    Answer: (b) LIFO

  53. In a graph, the degree of a vertex is:
    1. Number of incident edges
    2. Number of adjacent vertices
    3. Number of neighbors
    4. All of the above

    Answer: (d) All of the above

  54. The time complexity of Depth-First Search (DFS) is:
    1. O(n)
    2. O(n log n)
    3. O(n²)
    4. O(V + E)

    Answer: (d) O(V + E)

  55. Algorithms for finding minimum spanning trees include:
    1. Prim's Algorithm
    2. Kruskal's Algorithm
    3. Both Prim's and Kruskal's Algorithms
    4. Bellman-Ford Algorithm

    Answer: (c) Both Prim's and Kruskal's Algorithms

  56. In a doubly linked list, each node points to:
    1. Only the previous node
    2. Only the next node
    3. Both previous and next nodes
    4. None of the above

    Answer: (c) Both previous and next nodes

  57. A circular linked list offers efficient:
    1. Memory management
    2. Access to the last node
    3. Bidirectional traversal
    4. All of the above

    Answer: (b) Access to the last node

  58. Is the following statement true or false? "Vertices in a linear graph are arranged in a line.”
    1. True
    2. False

    Answer: (b) False

  59. What is the primary use of a priority queue?:
    1. Storing elements in sorted order
    2. Handling tasks with varying priorities
    3. Fast access to the largest element
    4. Storing elements of equal priority

    Answer: (b) Handling tasks with varying levels of priority

  60. Which algorithm finds the longest common subsequence in two sequences?:
    1. Dynamic Programming
    2. Greedy Algorithm
    3. Divide and Conquer
    4. Brute Force

    Answer: (a) Dynamic Programming

  61. In a computer system, a deadlock is:
    1. A process stuck in an infinite loop
    2. Two or more processes blocked, waiting for each other
    3. A process finishing and exiting
    4. A process requesting too many resources

    Answer: (b) Two or more processes blocked, waiting for each other

  62. Which sorting algorithm uses divide and conquer?:
    1. Selection Sort
    2. Bubble Sort
    3. Quick Sort
    4. Insertion Sort

    Answer: (c) Quick Sort

  63. A major disadvantage of hash tables is:
    1. High memory overhead
    2. Collisions
    3. Inefficient searching
    4. Not thread-safe

    Answer: (b) Collisions

  64. Greedy algorithms make decisions that are:
    1. Globally optimal
    2. Locally optimal
    3. Always the best solution
    4. Resource-minimizing

    Answer: (b) Locally optimal

  65. Which is NOT a non-linear data structure?:
    1. Binary Tree
    2. Graph
    3. Stack
    4. Heap

    Answer: (c) Stack

  66. Which is NOT a standard tree traversal technique?:
    1. Preorder Traversal
    2. Inorder Traversal
    3. Postorder Traversal
    4. Level-order Traversal

    Answer: (d) Level-order Traversal

    Explanation: Level-order traversal is a BFS, not a standard depth-first traversal.

  67. The primary characteristic of a stack is:
    1. FIFO
    2. LIFO
    3. Circular
    4. None of the above

    Answer: (b) LIFO

  68. Which sorting algorithm repeatedly swaps adjacent elements?:
    1. Quick Sort
    2. Merge Sort
    3. Bubble Sort
    4. Insertion Sort

    Answer: (c) Bubble Sort

  69. Which data structure is best for implementing a priority queue?:
    1. Stack
    2. Queue
    3. Binary Heap
    4. Linked List

    Answer: (c) Binary Heap

  70. In a directed graph, a node with no outgoing edges is a:
    1. Source
    2. Sink
    3. Leaf
    4. Root

    Answer: (b) Sink

  71. In a hash table, what occurs when two keys map to the same index?:
    1. Collision
    2. Overflow
    3. Underflow
    4. Rehashing

    Answer: (a) Collision

  72. Which is NOT a characteristic of a B-tree?:
    1. Multiple children per node
    2. Self-balancing
    3. At most one key per node
    4. Sorted keys

    Answer: (c) At most one key per node

  73. What operations are performed on a stack?:
    1. Push
    2. Pop
    3. Peek
    4. All of the above

    Answer: (d) All of the above

  74. In a graph, the degree of a vertex represents:
    1. The number of edges incident to it
    2. The number of adjacent vertices
    3. The number of its neighbors
    4. All of the above

    Answer: (d) All of the above

  75. The time complexity of Depth-First Search (DFS) is generally:
    1. O(n)
    2. O(n log n)
    3. O(n²)
    4. O(V + E)

    Answer: (d) O(V + E)

  76. Which algorithms find the minimum spanning tree of a graph?:
    1. Prim's Algorithm
    2. Kruskal's Algorithm
    3. Both Prim's and Kruskal's Algorithms
    4. Bellman-Ford Algorithm

    Answer: (c) Both Prim's and Kruskal's Algorithms

  77. In a doubly linked list, each node has pointers to:
    1. The previous node only
    2. The next node only
    3. Both the previous and next nodes
    4. None of the above

    Answer: (c) Both the previous and next nodes

  78. A circular linked list is advantageous for:
    1. Efficient memory management
    2. Direct access to the last node
    3. Bidirectional traversal
    4. All of the above

    Answer: (b) Direct access to the last node

  79. A complete graph is characterized by:
    1. Every pair of vertices connected by an edge
    2. No cycles
    3. Exactly one cycle
    4. Multiple edges between pairs of vertices

    Answer: (a) Every pair of vertices connected by an edge

  80. The best-case time complexity for quicksort is:
    1. O(n)
    2. O(n log n)
    3. O(log n)
    4. O(n²)

    Answer: (b) O(n log n)

  81. Merge sort's time complexity is best described as:
    1. O(n)
    2. O(n log n)
    3. O(n²)
    4. Variable, depending on the data

    Answer: (b) O(n log n)