0% found this document useful (0 votes)
24 views22 pages

converted_text

The document contains a series of 50 questions and answers related to logic, set theory, algorithms, and data structures. Each question presents multiple-choice options, with the correct answer provided for each. Topics covered include logical connectives, mathematical induction, properties of trees and graphs, and types of algorithms.

Uploaded by

draz474042
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views22 pages

converted_text

The document contains a series of 50 questions and answers related to logic, set theory, algorithms, and data structures. Each question presents multiple-choice options, with the correct answer provided for each. Topics covered include logical connectives, mathematical induction, properties of trees and graphs, and types of algorithms.

Uploaded by

draz474042
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Questions and Answers

1.
Which of the following is a logical connective?

a) Addition

b) Conjunction

c) Subtraction

d) Division
Answer: b) Conjunction

2.
What is the negation of the statement "All birds can fly"?

a) Some birds can fly

b) No birds can fly

c) Some birds cannot fly

d) All birds cannot fly


Answer: c) Some birds cannot fly

3.
In logic, what does the symbol " "represent?
a) Or

b) And

c) Not

d) Implies
Answer: b) And

4.
Which of the following is a tautology?

a) P ¬P

b) P ¬P

c) P ¬P

d) P ¬P
Answer: b) P ¬P

5.
What is the contrapositive of the statement "If it rains, then the ground is wet"?

a) If the ground is wet, then it rains

b) If the ground is not wet, then it does not rain


c) If it does not rain, then the ground is not wet

d) If it rains, then the ground is not wet


Answer: b) If the ground is not wet, then it does not rain

6.
What is the union of sets A = {1, 2, 3} and B = {3, 4, 5}?

a) {1, 2, 3, 4, 5}

b) {3}

c) {1, 2, 4, 5}

d) {1, 2, 3, 3, 4, 5}
Answer: a) {1, 2, 3, 4, 5}

7.
Which of the following is a subset of every set?

a) Universal set

b) Empty set

c) Power set

d) Singleton set
Answer: b) Empty set
8.
What is the cardinality of the set {a, b, c, d}?

a) 3

b) 4

c) 5

d) 2
Answer: b) 4

9.
If A = {1, 2, 3} and B = {2, 3, 4}, what is A B?

a) {1, 2, 3, 4}

b) {2, 3}

c) {1, 4}

d) {1, 2, 3}
Answer: b) {2, 3}

10.
What is the power set of the set {a, b}?

a) {{}, {a}, {b}, {a, b}}


b) {{a}, {b}, {a, b}}

c) {{}, {a}, {b}}

d) {{a}, {b}}
Answer: a) {{}, {a}, {b}, {a, b}}

11.
Which of the following is a function?

a) {(1, 2), (2, 3), (1, 4)}

b) {(1, 2), (2, 3), (3, 4)}

c) {(1, 2), (2, 3), (2, 4)}

d) {(1, 2), (2, 3), (3, 2)}


Answer: b) {(1, 2), (2, 3), (3, 4)}

12.
What is the domain of the function f(x) = √(x - 2)?

a) x ≥ 2

b) x ≤ 2

c) x > 2
d) x < 2
Answer: a) x ≥ 2

13.
Which of the following relations is reflexive?

a) {(1, 1), (2, 2), (3, 3)}

b) {(1, 2), (2, 3), (3, 1)}

c) {(1, 1), (2, 3), (3, 2)}

d) {(1, 2), (2, 1), (3, 3)}


Answer: a) {(1, 1), (2, 2), (3, 3)}

14.
What is the inverse of the function f(x) = 2x + 3?

a) f ¹(x)= (x - 3)/2

b) f ¹(x)= (x + 3)/2

c) f ¹(x)= 2x - 3

d) f ¹(x)= 3x + 2
Answer: a) f ¹(x)= (x - 3)/2

15.
Which of the following is an equivalence relation?

a) {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1)}

b) {(1, 1), (2, 2), (3, 3), (1, 2)}

c) {(1, 1), (2, 2), (3, 3), (1, 3), (3, 1)}

d) {(1, 1), (2, 2), (3, 3), (1, 2), (2, 3)}
Answer: a) {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1)}

16.
What is the next term in the sequence 2, 4, 8, 16, ...?

a) 24

b) 32

c) 64

d) 128
Answer: b) 32

17.
What is the sum of the first 10 natural numbers?

a) 45
b) 50

c) 55

d) 60
Answer: c) 55

18.
Which of the following is an arithmetic sequence?

a) 2, 4, 8, 16, ...

b) 3, 6, 12, 24, ...

c) 5, 10, 15, 20, ...

d) 1, 3, 9, 27, ...
Answer: c) 5, 10, 15, 20, ...

19.
What is the common ratio in the geometric sequence 3, 6, 12, 24, ...?

a) 2

b) 3

c) 4
d) 6
Answer: a) 2

20.
Which of the following is a recursive algorithm?

a) Bubble Sort

b) Quick Sort

c) Merge Sort

d) Insertion Sort
Answer: c) Merge Sort

21.
In a binary tree, what is the maximum number of nodes at level 'l'?

a) 2^l

b) 2^(l-1)

c) 2^(l+1)

d) l^2
Answer: a) 2^l

22.
What is the height of a tree with only one node?
a) 0

b) 1

c) 2

d) -1
Answer: a) 0

23.
Which of the following is a type of graph traversal?

a) Breadth-First Search

b) Depth-First Search

c) Both a and b

d) None of the above


Answer: c) Both a and b

24.
In a directed graph, what is the term for a node with no incoming edges?

a) Source

b) Sink
c) Leaf

d) Root
Answer: a) Source

25.
What is the minimum number of edges required to connect 'n' nodes in a graph?

a) n-1

b) n

c) n+1

d) n^2
Answer: a) n-1

26.
What is the base case in mathematical induction?

a) Proving the statement for n = 1

b) Proving the statement for n = k

c) Proving the statement for n = k + 1

d) Proving the statement for all n


Answer: a) Proving the statement for n = 1
27.
Which of the following is the inductive step in mathematical induction?

a) Proving the statement for n = 1

b) Assuming the statement is true for n = k

c) Proving the statement for n = k + 1

d) Both b and c
Answer: d) Both b and c

28.
What is the principle of mathematical induction used for?

a) Proving statements for all natural numbers

b) Proving statements for all integers

c) Proving statements for all real numbers

d) Proving statements for all complex numbers


Answer: a) Proving statements for all natural numbers

29.
Which of the following is an example of a statement that can be proved using mathematical
induction?
a) The sum of the first n natural numbers is n(n+1)/2

b) The square root of 2 is irrational

c) The Pythagorean theorem

d) The Fundamental Theorem of Calculus


Answer: a) The sum of the first n natural numbers is n(n+1)/2

30.
What is the first step in a proof by mathematical induction?

a) Assume the statement is true for n = k

b) Prove the statement for n = k + 1

c) Prove the statement for n = 1

d) State the statement to be proved


Answer: c) Prove the statement for n = 1

31.
What is the difference between a sequence and a series?

a) A sequence is a list of numbers, while a series is the sum of a sequence

b) A sequence is the sum of a series, while a series is a list of numbers


c) A sequence is a function, while a series is a relation

d) A sequence is a relation, while a series is a function


Answer: a) A sequence is a list of numbers, while a series is the sum of a sequence

32.
Which of the following is a property of a tree?

a) It has no cycles

b) It is a connected graph

c) It has n-1 edges for n nodes

d) All of the above


Answer: d) All of the above

33.
What is the time complexity of the Quick Sort algorithm in the worst case?

a) O(n log n)

b) O(n^2)

c) O(n)

d) O(log n)
Answer: b) O(n^2)
34.
Which of the following is a characteristic of a bipartite graph?

a) It can be divided into two disjoint sets

b) It contains no odd-length cycles

c) Both a and b

d) None of the above


Answer: c) Both a and b

35.
What is the main purpose of using mathematical induction?

a) To prove statements for all natural numbers

b) To find the sum of a series

c) To solve differential equations

d) To analyze algorithms
Answer: a) To prove statements for all natural numbers

36.
Which of the following is an example of a recursive function?

a) Factorial
b) Fibonacci

c) Both a and b

d) None of the above


Answer: c) Both a and b

37.
What is the main difference between a tree and a graph?

a) A tree is a type of graph with no cycles

b) A graph is a type of tree with cycles

c) A tree has more edges than a graph

d) A graph has more nodes than a tree


Answer: a) A tree is a type of graph with no cycles

38.
Which of the following is a property of a complete graph?

a) Every pair of distinct vertices is connected by a unique edge

b) It has no cycles

c) It is a tree
d) It has n-1 edges for n nodes
Answer: a) Every pair of distinct vertices is connected by a unique edge

39.
What is the main purpose of using set theory in mathematics?

a) To study collections of objects

b) To solve equations

c) To analyze functions

d) To prove theorems
Answer: a) To study collections of objects

40.
Which of the following is an example of a finite set?

a) The set of all natural numbers

b) The set of all real numbers

c) The set of all prime numbers less than 10

d) The set of all integers


Answer: c) The set of all prime numbers less than 10

41.
What is the main difference between a relation and a function?

a) A function is a special type of relation

b) A relation is a special type of function

c) A function can have multiple outputs for a single input

d) A relation can have only one output for each input


Answer: a) A function is a special type of relation

42.
Which of the following is an example of an infinite series?

a) The sum of the first n natural numbers

b) The sum of all natural numbers

c) The sum of the first n prime numbers

d) The sum of the first n even numbers


Answer: b) The sum of all natural numbers

43.
What is the main purpose of using algorithms in computer science?

a) To solve problems step-by-step


b) To analyze data

c) To design systems

d) To prove theorems
Answer: a) To solve problems step-by-step

44.
Which of the following is an example of a greedy algorithm?

a) Dijkstra's algorithm

b) Quick Sort

c) Merge Sort

d) Bubble Sort
Answer: a) Dijkstra's algorithm

45.
What is the main difference between a breadth-first search and a depth-first search?

a) Breadth-first search explores all neighbors before moving to the next level, while depth-
first search explores as far as possible along each branch before backtracking

b) Depth-first search explores all neighbors before moving to the next level, while breadth-
first search explores as far as possible along each branch before backtracking

c) Breadth-first search is used for trees, while depth-first search is used for graphs
d) Depth-first search is used for trees, while breadth-first search is used for graphs
Answer: a) Breadth-first search explores all neighbors before moving to the next level,
while depth-first search explores as far as possible along each branch before
backtracking

46.
Which of the following is an example of a non-linear data structure?

a) Array

b) Linked List

c) Tree

d) Stack
Answer: c) Tree

47.
What is the main purpose of using mathematical production in computer science?

a) To generate sequences and series

b) To analyze algorithms

c) To design data structures

d) To prove theorems
Answer: a) To generate sequences and series
48.
Which of the following is an example of a linear data structure?

a) Tree

b) Graph

c) Array

d) Binary Search Tree


Answer: c) Array

49.
What is the main difference between a stack and a queue?

a) A stack follows the Last-In-First-Out (LIFO) principle, while a queue follows the First-In-
First-Out (FIFO) principle

b) A stack follows the First-In-First-Out (FIFO) principle, while a queue follows the Last-In-
First-Out (LIFO) principle

c) A stack is a linear data structure, while a queue is a non-linear data structure

d) A stack is a non-linear data structure, while a queue is a linear data structure


Answer: a) A stack follows the Last-In-First-Out (LIFO) principle, while a queue follows
the First-In-First-Out (FIFO) principle

50.
Which of the following is an example of a dynamic programming algorithm?
a) Fibonacci sequence

b) Quick Sort

c) Merge Sort

d) Bubble Sort
Answer: a) Fibonacci sequence

You might also like