Question Bank
To prove a goal when a disjunction is known:
assume and prove then assume and prove ,
assume and prove ,
assume and prove and .
Let be propositional variables. Which of the following propositional formulas correspond to the boolean function with 3 arguments that returns when its inputs represent the binary encoding of a prime number:
.
Consider the clause set . The first step in running the Davis Putnam method is:
applying the splitting rule (using the literal ¬P)
applying the pure literal rule (where the pure literal is ¬Q)
applying the resolution rule
applying the one literal rule (using the last clause).
Let , , and be the grammar equivalent with G but without ϵ-productions. Which of the following assertions are correct?
has 8 productions
has 5 productions
has 3 erasing nonterminals
has one erasing nonterminal
Assume you have to build push-down automaton simulating a natural language processor recognizing numerical palindromes of even length. Which of the following grammars G = (VN, VT , S, P) help you building the solution:
Consider the set of all strings of balanced parentheses of two types: round and square. An example of where these strings come from is as follows. If we take expressions in C, which use round parentheses for grouping and for arguments of function calls, and use square brackets for array indexes, and drop out everything but the parentheses, we get all strings of balanced parentheses of these two types. For example, becomes the balanced parentheses string . A grammar for generating the strings of round and squared parentheses that are balanced is:
(this should be correct)
(this answer is marked correct in the book and in here)
(and this should be correct)
Which of the following sets of strings are not regular languages?
The set of bitstrings with equal number of 0s and 1s.
The set of decimal strings that represent prime numbers.
The set of bitstrings with more 1s than 0s.
Let and the grammar with . What is the language generated by G?
.
.
.
.
Which of the following strings are accepted by the DFA with the transition diagram:
Bitstrings that end in 1.
Bitstrings with an equal number of occurrences of 01 and 10.
Bitstrings with more 1s than 0s.
Bitstrings with an equal number of occurrences of 0 and 1.
Bitstrings with at least one 1.
None.
Let and L be the complement of the language . Is L a regular language?
No
Yes
Let Σ = {a, b, c}. Which of the following languages is regular?
.
| ##
# is even, and # is odd.
Let , and the NPDA with transition diagram:
.
.
.
Which of the following strings match the regular expression
Let L be the language generated by the grammar where
,
, and
.
Is L a regular language?
Yes
No
Let L be the language generated by the grammar where
,
, and
. How many strings of length 4 does L contain?
16
24
32
81
243
Let L be the language generated by the grammar
where
, and
.
Which of the following statements is true?
(This question is also wrong)
| does not contain consecutive identical letters (this should be the correct answer)
| contains identical consecutive letters}. (this is the correct answer in the book and also marked here as correct)
| contains the substring .
.
Let L be the language generated by the grammar where
,
, and
.
Let be the number of strings from with length . For every n > 1, the following recursive relation holds:
Which is the rank of the permutation ⟨4, 1, 6, 2, 3, 5⟩ in lexicographic order?
376
378
380
720
A message is a sequence of two types of signals: of type A which last for 1 second and of type B which last for 2 seconds. E.g., the message lasts 7 seconds. How many different messages last 10 seconds?
68
32
89
144
In how many ways can be colored the following configuration by using 2 colors: red and black?
64
48
128
36
In how many ways can we split a group of 50 persons in 49 nonempty groups?
50
1225
49
2450
19600
In how many ways can we choose 5 fruits from a market stall if on the stall there are: 5 apples, 5 pears and 5 apricots?
21
56
120
6
30
Which of the following recurrence relations hold for any ?
Which is the minimum weight spanning tree of the following connected graph? (hint: apply the
Kruskal algorithm)
43
40
36
41
Which is the Prüfer sequence of the following tree?
8, 3, 4, 5, 7, 6, 1, 9, 10, 11, 2
3, 4, 5, 7, 6, 1, 8, 2, 10, 11
8, 11, 9, 6, 1, 8, 8, 2, 2
8, 11, 9, 6, 1, 8, 2, 2, 8