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
- If sets X and Y have 7 and 8 elements, respectively, how many relations exist between them?:
- 256
- 272
- 356
- 56
Answer: (a) 256
Explanation: There are 2mn possible relations between two sets with cardinalities m and n.
- 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)}?:
- 26
- 36
- 8
- 6
Answer: (d) 6
- 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}?:
- {(0,0), (4,4), (5,5), (1,1), (2,2), (3,3)}
- {(0,1), (1,2), (2,2), (3,4)}
- {(0,1), (0,2), (1,2), (2,2), (3,4), (5,3), (5,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)}
- If X and Y are relations on S, which statement is FALSE?:
- Their intersection is a relation on S.
- Their union is a relation on S.
- Their difference is a relation on S.
- Their symmetric closure is not a relation.
Answer: (d) Their symmetric closure is not a relation.
- Which is NOT a valid law of Boolean algebra?:
- (A + B)(A + C) = A + (B × C)
- A + A = A
- A × B = B × A
- All of the above are true
Answer: (a) (A + B)(A + C) = A + (B × C)
- The dual of the AND operation is:
- OR
- AND
- NOT
- XOR
- The set {1, 0} is primarily associated with:
- Logical algebra
- Boolean algebra
- Set Theory
- Matrices
- How many distinct ways are there to express a logical proposition using only AND and OR (considering order and parentheses)?:
- 16
- 32
- 24
- None of the above
Answer: (b) 32
- A symmetric matrix A satisfies:
- A = AT
- A = -AT
- Diagonal elements are all 1
- Diagonal elements are all 0
- A matrix with one row and multiple columns is a:
- Row Matrix
- Column Matrix
- Diagonal Matrix
- None of the mentioned
- A matrix with multiple rows and only one column is a:
- Row Matrix
- Column Matrix
- Diagonal Matrix
- None of the mentioned
- To add two matrices, they must have:
- The same number of rows and columns
- The same number of columns
- The same number of rows
- The number of rows in the first equals the number of columns in the second
- For matrix addition, A + B = B + A is:
- True
- False
- For matrix multiplication, AB = BA is:
- True
- False
- A universal logic gate is:
- NAND
- OR
- NOT
- AND
- Maurice Karnaugh published his map in:
- 1953
- 1952
- 1956
- 1958
- The number of main canonical forms for Boolean expressions is:
- Two
- Three
- Four
- Five
- Boolean algebra is mainly used in designing:
- Logic symbols
- Digital computers
- Circuit theory
- None of the above
- Boolean algebra operates on how many values?:
- Two
- Three
- Four
- Five
- A sequential search algorithm involves:
- Comparing each element sequentially
- Dividing the problem into subproblems
- Sorting the data first
- None of the above
- In insertion sort, sorting starts with the:
- First element
- Second element
- Middle element
- Last element
- The worst-case time complexity of a linear search is:
- O(log n)
- O(n)
- O(n log n)
- O(n²)
- The time complexity of bubble sort is:
- O(n)
- O(log n)
- O(n log n)
- O(n²)
- Dynamic programming is characterized by:
- Reusing solutions to subproblems
- Dividing problems into independent subproblems
- Trying all possible solutions
- None of the above
- Complexity theory does NOT typically consider the ______ case:
- Null case
- Average case
- Best case
- Worst case
- If the function f is both injective and surjective, then f is:
- Bijective
- Surjective
- Injective
- None of the above
- If f and g are onto functions, then g∘f is a(n):
- Onto function
- Into function
- One-to-one function
- One-to-many function
- Function composition is:
- Associative but not commutative
- Commutative but not associative
- Both associative and commutative
- Neither associative nor commutative
- The composition of functions f(x) = 2x+1 and g(x) = 3x+4 is:
- 6x+9
- 6x+8
- 6x+7
- 6x+3
- The number of bytes required to encode 2000 bits is approximately:
- 250
- 4
- 2
- 8
- What is the main drawback of the bubble sort algorithm?:
- High space complexity
- High time complexity in the worst case
- Inability to handle large datasets
- Difficult implementation
Answer: (b) High time complexity in the worst case
Explanation: Bubble sort has O(n²) time complexity in the worst case.
- In a binary tree, the maximum number of nodes at level 'l' is:
- 2l
- 2(l+1)
- l²
- l
- In a hash table, a hash function primarily:
- Sorts the data
- Finds the index for storing data
- Handles collisions
- Encrypts the data
- Which graph traversal algorithm uses a stack?:
- Depth First Search (DFS)
- Breadth First Search (BFS)
- Topological Sort
- Kruskal's Algorithm
Answer: (a) Depth First Search (DFS)
- In an AVL tree, the balance factor of a node can be:
- 0, 1, or 2
- -1, 0, or 1
- -2, -1, 0, 1, or 2
- Only 0
- What is the correct order of increasing complexity for these sorting algorithms: Bubble Sort, Quick Sort, Merge Sort?:
- Bubble Sort, Quick Sort, Merge Sort
- Merge Sort, Bubble Sort, Quick Sort
- Quick Sort, Merge Sort, Bubble Sort
- Bubble Sort, Merge Sort, Quick Sort
- Deleting the last node in a circular linked list results in:
- The list remaining unchanged
- The second-to-last node becoming the last node
- The entire list being deleted
- An error
- The minimum number of colors needed to color a graph is:
- One
- Two
- Three
- Depends on the graph
- The key difference between a tree and a graph is:
- Trees have cycles; graphs don't.
- Trees have no cycles; graphs may have cycles.
- Trees are not connected; graphs are connected.
- Both have the same structure.
- The time complexity of the binary search algorithm is:
- O(n)
- O(n log n)
- O(log n)
- O(1)
- In which type of tree are the heights of the left and right subtrees always balanced?:
- Red-Black Tree
- Binary Search Tree
- AVL Tree
- B-tree
- A significant disadvantage of a binary search tree is:
- High memory overhead
- Potential for imbalance
- Many comparisons needed
- Cannot store large datasets
- The worst-case time complexity of insertion sort is:
- O(n)
- O(n log n)
- O(n²)
- O(log n)
- The worst-case time complexity of quicksort is:
- O(n)
- O(n log n)
- O(log n)
- O(n²)
- Which is a type of balanced binary search tree?:
- AVL Tree
- Red-Black Tree
- Both AVL Tree and Red-Black Tree
- Binary Search Tree
- Dijkstra's algorithm finds:
- Shortest paths in a weighted graph
- Maximum flow in a network
- Minimum spanning tree
- Topological ordering
- Which sorting algorithm is NOT stable?:
- Merge Sort
- Bubble Sort
- Quick Sort
- Insertion Sort
Answer: (c) Quick Sort
- The best algorithm for searching in a sorted array is:
- Linear Search
- Binary Search
- Jump Search
- Interpolation Search
- In a directed graph, a node with no outgoing edges is a:
- Source
- Sink
- Leaf
- Root
- In a hash table, a collision occurs when:
- Two keys hash to the same value
- The table is full
- A key is not found
- None of the above
- Which is NOT a feature of a B-tree?:
- Nodes can have multiple children
- Self-balancing
- Each node contains at most one key
- Keys are in sorted order
- A stack uses the principle of:
- FIFO
- LIFO
- Both FIFO and LIFO
- None of the above
- In a graph, the degree of a vertex is:
- Number of incident edges
- Number of adjacent vertices
- Number of neighbors
- All of the above
- The time complexity of Depth-First Search (DFS) is:
- O(n)
- O(n log n)
- O(n²)
- O(V + E)
- Algorithms for finding minimum spanning trees include:
- Prim's Algorithm
- Kruskal's Algorithm
- Both Prim's and Kruskal's Algorithms
- Bellman-Ford Algorithm
- In a doubly linked list, each node points to:
- Only the previous node
- Only the next node
- Both previous and next nodes
- None of the above
- A circular linked list offers efficient:
- Memory management
- Access to the last node
- Bidirectional traversal
- All of the above
- Is the following statement true or false? "Vertices in a linear graph are arranged in a line.”
- True
- False
- What is the primary use of a priority queue?:
- Storing elements in sorted order
- Handling tasks with varying priorities
- Fast access to the largest element
- Storing elements of equal priority
Answer: (b) Handling tasks with varying levels of priority
- Which algorithm finds the longest common subsequence in two sequences?:
- Dynamic Programming
- Greedy Algorithm
- Divide and Conquer
- Brute Force
Answer: (a) Dynamic Programming
- In a computer system, a deadlock is:
- A process stuck in an infinite loop
- Two or more processes blocked, waiting for each other
- A process finishing and exiting
- A process requesting too many resources
- Which sorting algorithm uses divide and conquer?:
- Selection Sort
- Bubble Sort
- Quick Sort
- Insertion Sort
Answer: (c) Quick Sort
- A major disadvantage of hash tables is:
- High memory overhead
- Collisions
- Inefficient searching
- Not thread-safe
- Greedy algorithms make decisions that are:
- Globally optimal
- Locally optimal
- Always the best solution
- Resource-minimizing
- Which is NOT a non-linear data structure?:
- Binary Tree
- Graph
- Stack
- Heap
Answer: (c) Stack
- Which is NOT a standard tree traversal technique?:
- Preorder Traversal
- Inorder Traversal
- Postorder Traversal
- Level-order Traversal
Answer: (d) Level-order Traversal
Explanation: Level-order traversal is a BFS, not a standard depth-first traversal.
- The primary characteristic of a stack is:
- FIFO
- LIFO
- Circular
- None of the above
- Which sorting algorithm repeatedly swaps adjacent elements?:
- Quick Sort
- Merge Sort
- Bubble Sort
- Insertion Sort
Answer: (c) Bubble Sort
- Which data structure is best for implementing a priority queue?:
- Stack
- Queue
- Binary Heap
- Linked List
Answer: (c) Binary Heap
- In a directed graph, a node with no outgoing edges is a:
- Source
- Sink
- Leaf
- Root
- In a hash table, what occurs when two keys map to the same index?:
- Collision
- Overflow
- Underflow
- Rehashing
- Which is NOT a characteristic of a B-tree?:
- Multiple children per node
- Self-balancing
- At most one key per node
- Sorted keys
- What operations are performed on a stack?:
- Push
- Pop
- Peek
- All of the above
- In a graph, the degree of a vertex represents:
- The number of edges incident to it
- The number of adjacent vertices
- The number of its neighbors
- All of the above
- The time complexity of Depth-First Search (DFS) is generally:
- O(n)
- O(n log n)
- O(n²)
- O(V + E)
- Which algorithms find the minimum spanning tree of a graph?:
- Prim's Algorithm
- Kruskal's Algorithm
- Both Prim's and Kruskal's Algorithms
- Bellman-Ford Algorithm
- In a doubly linked list, each node has pointers to:
- The previous node only
- The next node only
- Both the previous and next nodes
- None of the above
- A circular linked list is advantageous for:
- Efficient memory management
- Direct access to the last node
- Bidirectional traversal
- All of the above
- A complete graph is characterized by:
- Every pair of vertices connected by an edge
- No cycles
- Exactly one cycle
- Multiple edges between pairs of vertices
- The best-case time complexity for quicksort is:
- O(n)
- O(n log n)
- O(log n)
- O(n²)
- Merge sort's time complexity is best described as:
- O(n)
- O(n log n)
- O(n²)
- Variable, depending on the data
Answer: (a) OR
Answer: (b) Boolean algebra
Answer: (a) A = AT
Answer: (a) Row Matrix
Answer: (b) Column Matrix
Answer: (a) The same number of rows and columns
Answer: (a) True
Answer: (b) False
Answer: (a) NAND
Answer: (a) 1953
Answer: (a) Two
Answer: (b) Digital computers
Answer: (a) Two
Answer: (a) Comparing each element sequentially
Answer: (b) Second element
Answer: (b) O(n)
Answer: (d) O(n²)
Answer: (a) Reusing solutions to subproblems
Answer: (a) Null case
Answer: (a) Bijective
Answer: (a) Onto function
Answer: (a) Associative but not commutative
Answer: (a) 6x + 9
Answer: (a) 250
Answer: (a) 2l
Answer: (b) Finds the index for storing data
Answer: (b) -1, 0, or 1
Answer: (a) Bubble Sort, Quick Sort, Merge Sort
Answer: (b) The second-to-last node becoming the last node
Answer: (d) Depends on the graph
Answer: (b) Trees have no cycles; graphs may have cycles.
Answer: (c) O(log n)
Answer: (c) AVL Tree
Answer: (b) Potential for imbalance
Answer: (c) O(n²)
Answer: (d) O(n²)
Answer: (c) Both AVL Tree and Red-Black Tree
Answer: (a) Shortest paths in a weighted graph
Answer: (b) Binary Search
Answer: (b) Sink
Answer: (a) Two keys hash to the same value
Answer: (c) Each node contains at most one key
Answer: (b) LIFO
Answer: (d) All of the above
Answer: (d) O(V + E)
Answer: (c) Both Prim's and Kruskal's Algorithms
Answer: (c) Both previous and next nodes
Answer: (b) Access to the last node
Answer: (b) False
Answer: (b) Two or more processes blocked, waiting for each other
Answer: (b) Collisions
Answer: (b) Locally optimal
Answer: (b) LIFO
Answer: (b) Sink
Answer: (a) Collision
Answer: (c) At most one key per node
Answer: (d) All of the above
Answer: (d) All of the above
Answer: (d) O(V + E)
Answer: (c) Both Prim's and Kruskal's Algorithms
Answer: (c) Both the previous and next nodes
Answer: (b) Direct access to the last node
Answer: (a) Every pair of vertices connected by an edge
Answer: (b) O(n log n)
Answer: (b) O(n log n)