Computer Science MCQs with Answers – CS MCQ Questions for IT students who are preparing for academic and competitive exams in 2023.
Computer Science MCQs with Answers
1. A set which contains a single element is called a ……..
A) Singleton
B) One set
C) Proper set
D) Improper set
Ans. A) Singleton
2. The set of all subsets of A is called
A) Improper set of A
B) Proper set of A
C) Power set of A
D) Subset of A
Ans. C) Power set of A
3. The sequence 1, 4, 16, 64, ……… can be explicitly be defined by the formula
A) f(n) = 4n
B) f(n) = 4n
C) f(n) = n4
D) f(n) = 4 + n
Ans. B) f(n) = 4n
4. The value of 5! recursively is ……..
A) 125
B) 130
C) 110
D) 120
Ans. D) 120
5. State true (T) or false (F)
In a transition graph
(i) The final state, q1 is represented by two concentric circles.
(ii) The directed edges from the initial state to the final state are labelled as input/output.
A) (i) T (ii) F
B) (i) F (ii) T
C) (i) T (ii) T
D) (i) F (ii) F
Ans. C) (i) T (ii) T
6. State true (T) or false (F)
(i) When the input to a Moore machine is Ú, the output is l(q0).
(ii) In a Moore machine D represents the output alphabet.
A) (i) F (ii) T
B) (i) T (ii) F
C) (i) T (ii) T
D) (i) F (ii) F
Ans. A) (i) F (ii) T
7. If there is more than one edge associated with a given pair of vertices, then these edges are called ………
A) loop
B) Combined edges
C) lines
D) Parallel edges
Ans. D) Parallel edges
8. Graphs containing either parallel edges or loops is referred as ……..
A) Pendant graph
B) General Graph
C) infinite graph
D) finite graph
Ans. B) General Graph
9. A …… consists of a finite set of rules or productions which specify the syntax of the language.
A) Tree
B) Automata
C) Roots
D) Grammar
Ans. D) Grammar
10. The ……. of a string is the number of symbols in the string.
A) Structure
B) Graph
C) length
D) finite graph
Ans. C) length
11. An automaton system in which the output depends only on the present input is called a ………
A) Mealy machine
B) Moore machine
C) Dot machine
D) DF machine
Ans. B) Moore machine
12. The machine which has a finite number of states is called a …….
A) Finite automata
B) Finite control
C) Deterministic finite machine
D) finite graph
Ans. C) Deterministic finite machine
13. A string is a sequence of symbols obtained from ……
A) £
B) ¥
C) å
D) d
Ans. C) å
14. Digital computers are ……
A) automata controlled
B) Finite controlled
C) Deterministic machines
D) finite graph-structured
Ans. C) Deterministic machines
15. A DFA is a —— tuple
A) 4
B) 5
C) 3
D) 2
Ans. B) 5
16. A DFA is ………
A) easy to construct
B) difficult to construct
C) not constructable
D) only being imagined
Ans. B) difficult to construct
17. ……. are used to represent a set of strings and include symbols that are arranged using certain syntax rules.
A) irregular expressions
B) normal expressions
C) regular expressions
D) abnormal expressions
Ans. C) regular expressions
18. The union of two regular expressions is a ………
A) irregular expression
B) regular expression
C) null set
D) matrix
Ans. B) regular expression
19. If L1 and L2 are regular, then the regular language is closed under ………
A) Multiplication
B) division
C) addition
D) complementation
Ans. D) complementation
20. Let å and G be the set of alphabets, then the function f: å®G* is called as ………
A) Isomorphism
B) endomorphism
C) homomorphism
D) epimorphism
Ans. C) homomorphism
21. The language for the grammar G = (VT {0,1}, VN = {S },F, S) where the set of productions F: S®11S, S®0 is
A) L(G) = {0, 000, 11000, 1111110,……..}
B) L(G) = {0, 110, 10000, 1111110,……..}
C) L(G) = {0, 110, 11110, 1110000,……..}
D) L(G) = {0, 110, 11110, 1111110,……..}
Ans. D) L(G) = {0, 110, 11110, 1111110,……..}
22. A …….. is an ordered tree in which each vertex is labelled with the left sides of a product and in which the children of a vertex represents its corresponding right sides.
A) complete tree
B) derivation tree
C) ordered tree
D) binary tree
Ans. B) derivation tree
23. …….. of a relation R is the smallest transitive relation containing R.
A) transitive closure
B) reflexive closure
C) symmetric closure
D) equivalence closure
Ans. A) transitive closure
24. The value of éeù =
A) 3
B) 2
C) 1
D) 0
Ans. A) 3
25. The …….. is the assumption that for some fixed but arbitrary n ³ 0, P holds for each natural number 0, 1, 2, …..,n
A) Hypothesis
B) Induction hypothesis
C) Alternate hypothesis
D) Principal hypothesis
Ans. B) Induction hypothesis
26. A connected graph with n vertices and n – 1 edge is a ………
A) Forest
B) Branch
C) Tree
D) Leaf
Ans. C) Tree
27. If S = {a, b} then x = abab is a ……… on S
A) Alphabet
B) String
C) Letter
D) Grammar
Ans. B) String
28. The lexical analysis phase of a computer is often based on the ……… of a finite automaton.
A) Simulation
B) Certification
C) Simplification
D) Addition
Ans. A) Simulation
29. At regular intervals the automaton reads one symbol from the ………
A) Output tape
B) Input tape
C) Monitor
D) Initial tape
Ans. B) Input tape
30. The ……… is called finite control.
A) White box
B) Black box
C) Yellow box
D) Red box
Ans. B) Black box
31. All the edges of the transition graph are labelled as ………
A) Input
B) Output
C) Input/Output
D) Input transition.
Ans. C) Input/Output
32. If Q is the set of states, then the number of the set of subsets of Q is ………
A) 3Q
B) 2Q
C) 4Q
D) 5Q
Ans. B) 2Q
33. The start state of MN is the start state of ……
A) NM
B) MP
C) MQ
D) MD
Ans. D) MD
34. In the output l(q(t), x(t)), here q(t) is the ……
A) present state
B) present input
C) Mealy state
D) Moore state
Ans. A) present state
35. A ……. can be accepted both by deterministic as well as non-deterministic automata.
A) Irregular expression
B) Regular expression
C) Transit expression
D) Intransit expression
Ans. B) Regular expression
36. …….. is a regular expression denoting empty language.
A) Î
B) x
C) f
D) q
Ans. C) f
37. Let x, y Î å, here x + y represents the set ………
A) {x, y}
B) {x, y, z}
C) {y, z}
D) {x, z}
Ans. A) {x, y}
38. A set which is represented using a regular expression is known as a ………
A) Irregular set
B) Regular set
C) Empty set
D) Finite set
Ans. B) Regular set
39. If L1 and L2 are regular then L1 * denotes
A) Language
B) Irregular language
C) Regular Language
D) Grammar
Ans. C) Regular Language
40. AÈf =
A) f
B) A
C) N
D) ¥
Ans. B) A
41. A grammar G=(VN, VT, S, F) is said to be a regular grammar Û the grammar is
A) right regular
B) left regular
C) A) and B)
D) A) or B)
Ans. D) A) or B)
42. State true (T) or false (F)
(i) A Èf = {x /x Î A or x Îf} = A
(ii) A Çf = {x /x Î A and x Îf} = f
A) (i) T (ii) T
B) (i) F (ii) F
C) (i) T (ii) F
D) (i) F (ii) T
Ans. A) (i) T (ii) T
43. The G.C.D of (81, 36) is ………
A) 5
B) 9
C) 6
D) 4
Ans. B) 9
44. State true (T) or false (F)
(i) A grammar in which there are no restrictions on its productions is called a type-0 grammar.
(ii) A grammar that contains only productions of the form a®b where a ³ b is called a type-1 grammar.
A) (i) F (ii) T
B) (i) T (ii) F
C) (i) T (ii) T
D) (i) F (ii) F
Ans. B) (i) T (ii) F
45. For any finite set A, the cardinality of the power set of A is
A) 2n
B) 2A
C) 2n(A)
D) 2
Ans. C) 2n(A)
46. A binary tree is a tree in which no parent can have more than ………. children.
A) 0
B) 1
C) 3
D) 2
Ans. D) 2
47. State true (T) or false (F)
(i) The number of edges incident on a vertex v is called the degree of v.
(ii) The sum of the degrees of the vertices of a graph G is twice the number of vertices.
A) (i) T (ii) F
B) (i) F (ii) T
C) (i) T (ii) T
D) (i) F (ii) F
Ans. C) (i) T (ii) T
48. State true (T) or false (F)
(i) A vertex having no incident edge is called a vertex.
(ii) A vertex having degree one is called a pendant vertex.
A) (i) T (ii) F
B) (i) F (ii) T
C) (i) T (ii) T
D) (i) F (ii) F
Ans. B) (i) F (ii) T
49. State true (T) or false (F)
(i) A sentential form is any derivative of the unique non-terminal symbol S.
(ii) Language is a superset of all terminal strings over VT.
A) (i) T (ii) F
B) (i) F (ii) T
C) (i) T (ii) T
D) (i) F (ii) F
Ans. A) (i) T (ii) F
50. State whether true (T) or false (F)
A regular expression is recursively defined as follows
(i) f is a regular expression denoting an empty language.
(ii) a is a regular expression that indicates the language containing only
A) (i) T (ii) T
B) (i) T (ii) F
C) (i) F (ii) T
D) (i) F (ii) F
Ans. A) (i) T (ii) T