DS Unitwise Old Questions
DS Unitwise Old Questions
DS Unitwise Old Questions
1. Define deterministic finite state automata. Construct a DFA whose language is the set of
strings that ends with 111 and contains odd number of 1's.[2066]
4. Let G be the grammar with vocabulary V = {S, 0, 1}, set of terminals T={0, 1}; starting
symbol S, and productions P= {S-->11s, S-->0}.
6. Determine the kleen closures of the sets A= {0}, B = {0, 1}, C = {11}.[2066]
9. Explain the state transition function of the finite state machine with a suitable table. [2074]
10. Define the terms a language over a vocabulary and the phrase - structure grammar.[ 2068]
12. Define the terms a language over a regular grammer and regular expression.[2074]
13. Let G be the grammar with vocabulary V= (S, A, a, b}, t = {a,b}, starting symbol S and
production P = {S--> aA, S--> b, A--> aa}. What is L(G), the language of this grammar?
[2066]
14. Let A = {0, 1}. Show that the following expressions are all regular expressions over A
[2069]
a) 0* (0v1)* b) 00* (0v1)* 1.
16. What are the strings in the regular sets specified by the regular expression (10)*.
[2071]
21. Let G be the grammar with vocabulary V = {S, 0, 1}, set of terminals T ={0, 1), starting
symbol S, and productions P ={S-->11S, S -->0}. What is L (G), the language of
this grammar?[ 2071]
22. What are the strings in the regular sets specified by the regular expression 10*. [2072]
23. Discuss the types of phrase structure grammars and their relations.[ 2067]
24. Define the terms a language over a regular grammar and a regular expression.[2069]
26. Consider a set U = { 1,2,3,4,5,6,7,8,9,10}. What will be the computer representation for
set containing the numbers which are multiple of 3 not exceeding 6? Describe
injective, surjective and bijective function with examples.[2075]
29. Explain the static transition function of the finite state machine with a suitable table.[2068]
30. Let A = (p, q, r} . Give the regular set corresponding to the regular expression give:[ 2074]
31. Let A = (p, q, r}. Give the regular set corresponding to the regular expression given:[ 2068]
a) (p v q )┌ q* p( q q )" r
32. Let G be the grammar with vocabulary V = {S, 0,1}, set of terminals T = {0,1} , starting
symbol S, and productions P= {S —>11S, S —> 0}. What is L(G), the language of
this grammar?[2065]
34. What do you mean by phase-structure grammar? Let C1 be the grammar with vocabulary V=
{S, 0, 1}; set of terminals T= {0, 1}; starting symbol S, and productions P= {S-->11s, S--
>0}. Determine the language L(G) of this grammar.[2067]
35. Let G be the grammar with vocabulary V= {S, A, a, b}, set of terminals T ={a,b}, starting
symbol S, and productions P=(S-->aA, S-->b,A-->aa}. What is L(G), the language of this
grammar? [ 2073]
OR
Explain the deterministic finite state automata. When are two finite state
automata equivalent? Give an example.
37. Let S = (0, 1}. Give the regular expression corresponding to the regular set given:[ 2069]
OR
Define deterministic finite state automata. When are two finite state automata equivalent?
Give an example.
41. Construct the state transition table of the finite state machine whose diagram
is shown:[2069]
42. Discuss finite state machine with output with suitable example. What are the strings in the
regular set specified by the regular expression 01*0?[2073]
43. Discuss finite state machine without output with suitable example. What are the strings in the
regular set specified by the regular expression 0* 1*?[2070]
44. Define ceiling and floor function. Why do we need Inclusion - Exclusion principle? Make it
clear with suitable example. [2076]
45. Construct a nondeterministic finite-state automaton that recognizes the regular set
1*⋃ 01.[2071]
46. Let G be the grammar with vocabulary V = {S, 0, 1}, set of terminals T ={0, 1}, starting
symbol S, and production P={ S-->11S,S-->0}.
48. Construct the transition table of the finite - state machine whose diagraph is shown?[2068]
49. Define deterministic finite state automata. When are two finite state automata equivalent?
Explain it.[2069]
1. Find the value od x such that x=1(mod 3), x=1(mod 4), x =1(mod5) and x=0(mod 7) using
Chinese Remainder theroem. [2076]
2. Find the value of x such that x=1(mod 5) and x=2(mod 7) suing Chinese remainder theorem.
[2075]
3. What does primality testing means? Describe how Fermat’s Little Theorem tests for a prime
number with suitable example.[2075]
Unit-3 Logic and Proof Methods
4. Show that the implication and its contrapositive are logically equivalent. [2073]
7. What do you mean by proposition? Give example to justify your answer. [2067]
8. Given propositions p and q, define conjunction and asked in disjunction of p and q. [2069]
10. What is negation? Discuss with suitable example and truth asked in table. [2071]
11. What is conjunction? Discuss with suitable example and truth table. [2072]
Ram is hard working. If Ram is fard working, then he is intelligent. Therefore Ram
is intelligent.
:.Socrates is mortal.
24. State which rule of inference is basis of the following argument: [2065]
“It is below freezing and raining now. Therefore, it is below freezing now.”
25. State which rule of inference is basis of the following argument: [2065]
26. Give examples of addition rule and simplification rule of inference. [2067]
27. State the rule for the strong form of mathematical induction with propositions.[2068]
30. Define the terms a language over a vocabulary and the phrase-structure grammar. [2065]
31. All over smart people are stupid. Children of stupid people are naughty. John is a children of
Jane. Jane is over smart. Represent these statements in FOPL and prove that John is naughty.
[2076]
32. Let A=”Aldo is Italian” and B=”Bob is English”. Formalize the following sentences in
proposition. [2075]
Either Aldo is Italian and Bob is English, or neither Aldo is Italian nor Bob is English.
33. Express the statement “Everyone has exactly one best friend” as a logical
expression involving predicates, quantifiers with a domain consisting of all people and
logical connectives. [2074]
35. Differentiate between existential and universal quantifiers with suitable example. [2066]
36. Explain the 2 rules of inference for quantified statements and give suitable examples. [2067]
37. OR
38. Show that the propositions propositions pV(p^r) and (rVq)^(pVr) are logically equivalent.
40. What is logical equivalence? Show that p-->q and ┌p-> ┌q are logically equivalent. [2072]
OR
42. Prove that the product xy is odd if and only if both x and y are odd integers. [2075]
43. Discuss direct, indirect and vauous proof with suitable example. [2073]
44. Construct truth tables to determine whether the given statement is tautology a contingency or
an absurdity. [2074]
a. p=>(q=>p)
b. q=>(q=>p)
c. p ^ ~p
OR
Explain the method of proving theorems by direct indirect, contradiction and by cases.
45. Explain Tautologies, contradiction and contingencies with suitable examples. [2065]
OR
Explain the method of proving theorems by direct, indirect, contradiction and by cases.
47. Discuss the techniques of direct proof, indirect proof and vacuous proof for proving
implications with suitable examples. [2067]
48. Discuss direct, proof, indirect proof and proof by contradiction with suitable example.
[2071]
49. Discuss the different rules of inference for quantified statements along with suitable example
of each. [2072]
50. Construct truth tables to determine whether the given statement is a tautology, a
contingency, or an absurdity. [2069]
a. p=>(q=>p)
b. q=>(q=>p)
c. p^~p
Unit –4 Induction and Recursion
1. Find an explicit formula for the Fibonacci numbers, with [recursion relation fn-1 + fn-2 and
f0= 0, f1= 1. [2065]
f2n+1-fn2=fn-1fn-2
fn=fn-1+fn-2,f1=f2=1
4. Define explicit formula for the sequence: {al, a2, a3…..}. Write an explicit formula for the
sequence 2,5,7, 12, 19,31. [ 2069]
5. What is mathematical induction? Use mathematical [induction to prove that 1.1! + 2.2! + ...
+ n.n!= (n+1)!-1, wherever n is a positive integer. [2070]
6. Find all the solutions of the recurrence relation an = 4an-1+n2. Also find the solution of the
relation with initial condition a1 =1. [2072]
8. State the rule for the strong form, of mathematical induction with prepositions. [2074]
a. 3mod4
b. 7mod5
c. -5mod3
d. 11mod5
e. -8 mod 6
10. Write down the recursive algorithm to find the value of bn and prove its correctness using
induction.
11. Prove that for every positive integer n ≥1, n2+n is even integer using mathematical
induction. [2076]
OR
an=-3an-1+4an-2 if an=2n?
2. How many different license plates is available if each plate contains sequence of three
letters followed by three digits? [2071]
3. In how many ways we can draw a heart or a diamond from an ordinary deck of playing
cards? [2072]
7. Let {an} be a sequence that satisfies the recursion relation an = an-1- - an-2 for n≥2 and
suppose that a0 = 3 and a1=5 Find the values a2 and a3. [2066]
8. How many ways are there to select a first, second and third — prize winners from 10
different people? [2067]
9. Develop a “general explicit formula” for a non homogeneous recurrence relation of the
form: an = rqn-1+s, where s and rare constants. [2069]
10. State pigeonhole principle. Solve the recurrence relation an= 3an-1-3an-2 + an-3 with initial
conditions a0=1 ,a1 = 3, a2=7.[ 2076]
12. What is the coefficient of x12 y13 in the expansion of (2x-3y)25? [2070]
13. Determine whether the sequence {an) is solution of the [recurrence relation an=2an-1-an-2
where an=3n. [2073]
15. State the Pigeonhole principle. How many students must be in class to guarantee that at
least two students receive the same score on the final exam is graded on a scale from 0 to
100? [2066]
17. How many bit strings of length eight either start with a 1 bit or end with two bits 00?
[2070]
18. Discuss the importance of recurrence relation in the analysis of divide — and — conquer
algorithms. [2073]
19. Find the solution of the recursion relation an=an-1+2an-2 with a0=2 and a1=7. [2066]
OR
20. How many 3 digits numbers can be formed from the digits 1,2,3,4 and 5 assuming that:
[2076]
23. Define linear homogeneous recurrence relation of degree k with constant coefficients.
[2070]
24. How many students must be in a class to guarantee that [at least two students receive the
same score on the final exam, if the exam is graded on a scale from 0 to 100 points?
[2071]
26. Solve the recurrence relation an = 2an-1+2an-2+2an-3 for n≥3, a0=3,a1=6 and a2=9. [2070]
OR
Find the explicit formula for the Fibonacci numbers. Use fn=fn-1+fn-2 as recursive
condition and
f0 = 0 and f1 = 1 as initial condition.
27. Find the recurrence relation to find the number of moves needed to solve the TOH
(Tower of Hanoi) problem with n disks. Discuss application of recurrence relation in
divide and-conquer algorithms. [2071]
29. Solve the recurrence relation an=5an-1-6an-2 with initial conditions a0= land a1=2. [2075]
30. State and prove pigeonhole principle. What is the minimum number of student required
in a discrete mathematics class to be sure that at least six receive the same grade, if there
are five possible grades A, B, C, D, and F? [2073]
a. Repetitions of digits are allowed
31. Define the binomial coefficient and give the general term of the binomial coefficient.
Show that the sum of the binomial coefficient is 2n. [2067]
33. Define linear homogenous recursion relation of degree k with constant coefficient with
suitable examples. What is the solution of recurrence relation an = 6an-1- 9an-2 with a0 = 1
and a1 = 6? [2074]
34. Define linear homogeneous recursion relation of degree [K with constant coefficient with
suitable examples. What is the solution of the recurrence relation an=an-1+2an-2 with a0=2
and a1=7? [2065]
35. Describe linear homogeneous and linear non- homogeneous recurrence relations with
suitable examples. [2066]
36. Find the solution to the recurrence relation an=6an-1-11an-2+6an-3 with the initial
conditions a0 = 2, a1 = 5, and a2 = 15. [2067]
OR
Suppose that a person deposits Rs.10,000/- in a fixed account at a bank yielding 11% per
year with interest compounded annually. How much will be in the account after 10 years?
Solve the problem with modeling it into recursion relations.
37. What is binomial theorem? Use this theorem to find the coefficient of x12 y13 in the
expansion of(2x — 3y)25. [2071]
38. Discuss the principles of inclusion exclusion. How many bit strings of Length eight
either start with a 1 bit or end with two bits 00? [2072]
39. List any two applications of conditional probability. You have 9 families you would
Like to invite to a wedding. Unfortunately, you can only invite 6 families. How many
different sets of invitations could you write? [2075]
40. Find the solution to the recurrence relation an=6an-1-11an-2+6an-3 with the initial
conditions a0 = 2, a1 = 5, and a2 = 15. [2073]
OR
Find the explicit formula for the Fibonacci numbers. Use fn=fn-1+fn-2 as recursive
condition and f0 0 and f1 = 1 as initial condition.
1. Consider Kn the complete graph on n vertices. What is the degree of each vertex? [2068]
2. Distinguish between multi graph and pseudo graph with suitable examples. [2069]
3. Suppose that a planar simple graph has 20 vertices, each of degree 3. Into how many
regions does a representation of this planar graph split the plane? [2071]
6. Define the complete graph Kn, on n vertices and the complete bipartite graph Km,nwith
suitable examples. [2065]
7. How many edges are there in graph with 10 vertices each of degree six? [2066]
12. What is S-D cut? For the following network flow find the maximal flow from S to D. [2075]
13. Distinguish between binary tree and spanning tree with suitable examples.[2068]
15. Show that an undirected graph has an even number of vertices of odd degree. [2072]
17. Distinguish between multigraph and pseudograph with suitable examples. [2074]
18. Which of the undirected graphs in the following figure have an Euler circuit? Explain. [2065]
19. Distinguish between undirected and directed graphs with illustrations. [2069]
21. Define Euler circuit with suitable example. Find the maximal flow s to t from the given
network flow. [2076]
22. Define saturated and unsaturated edge? [2073]
23. What is the chromatic number of the complete bipartite graph Km,n, where m and n are
positive integers? [2065]
25. What is the chromatic number of the complete bipartite graph, where m and n are positive
integers? [2068]
28. Define reflexive closure and symmetric closure. Find the remainder when 4x2-- x + 3 is
divided by x + 2 using remainder theorem. [2076]
29. Define Euler path and Hamilton path with examples. Draw the Hassel diagram for the
divisible relation on the set { 1,2,5, 8, 16, 32} and find the maximal, minimal, greatest and
least element if exist. [2075]
30. Define Euler path and Hamilton path. Give examples of both Euler and Hamilton path.
[2076]
32. Which of the undirected graphs in the following have an Euler path? [2066]
34. What is graph isomorphism? What are the different invariants of graph isomorphism? [2072]
14. What is planar graph? Show that K3,3 is non-planar. [2073]
35. When does the two simple graphs G1= m(V1, E1) and G2(V2, E2) are isomorphic. Show that
the graph G = (V, E) and H (W, F) displayed in the following figure are isomorphic. [2074]
36. Show that the graphs in the following figure are not isomorphic. [2065]
What can you say about the complexity of graph isomorphism algorithms in terms of
complexity?
37. Prove that an undirected graph is a tree if and only if there is a unique simple path between
any two of its vertices. [2066]
38. Define spanning tree and minimum spanning tree. Mention the conditions for two graphs for
being isomorphic with an example. [2075]
39. Show that a tree with n vertices has n-i edges. [2071]
41. Prove that “a tree with n vertices has n-i edges’. [2073]
42. Define rooted tree. Show that a full m-ary tree with i internal vertices contains n = mi + 1
vertices. [2074]
43. Prove that an undirected graph is a tree if there is a unique simple path between any two of
its vertices. [2065]
44. Find a spanning tree of the simple graph in the following graph, if it exists. [2066]
Can there be more possibilities?
45. Prove that a tree with n-vertices has n-i edges. [2067]
46. Show that the maximum number of vertices in a binary tree of height n is2n+1-1.
OR
Draw all possible unordered trees on the set {a, b, c}.
47. Define isomorphism. Given an example to show that the graphs are not isomorphic.[2069]
48. Prove that “a simple graph is connected if and only if it has a spanning tree”. [2070]
49. What is shortest path problem? Find the length of a shortest path between a and z in the given
weighted graph. [2071]
50. List any two applications of graph coloring theorem. Prove that “A tree with n vertices has n-
i edges” . [2076]
51. Determine whether the graphs shown in the following figure are isomorphic. [2067]
What can you say about the graph isomorphism algorithms in terms of efficiency?
52. Discuss adjacency matrix representation of a graph with suitable example. [2070]
53. Find the maximum flow in the network shown in the figure. [2074]
55. Explain the concept of network flows and max-flow mm-cut theorem with suitable examples.
[2065]
56. State and prove the Max-flow and Min-cut theorem. [2066]
OR
Find a maximum flow for the network in the figure below. [2066,2070]
57. Explain the concept of network flows and max-flow mm-cut theorem with suitable examples.
[2067]
OR
Define Euler circuit and Euler path with suitable examples. Give the multi-graph model of
the two of Koenigsberg state a necessary and sufficient condition for Euler circuit in
connection to your definitions and models.
58. Prove that a symmetric connected relation has an undirected spanning tree. [2068]
OR
Give a simple condition on the weigh )f a graph that will guarantee that there is a unique
maximal spanning tree for the graph.
59. A phrase structure grammar g is defined to be a 4-tuple (V, S, v0|→ ), where W(v0, w, a, b,
c}, S={a, b, c}, v0|→ aw, w|→bbw, w|→ c. Derive a sentence of L(G), the language of this
grammar. [2069]
OR
Prove that an undirected graph is a tree if and only if there is a unique simple path between
any two of its vertices.
60. Discuss the algorithm for constructing Euler circuit with suitable example. [2072]
61. Describe Dijkstra’s algorithm for finding the shortest path in a weighted graph between two
vertices with suitable example. [2073]
62. What do you mean by spanning tree? Find a spanning tree of the simple graph G shown in
figure. [2074]
OR
Prove that an undirected graph is a tree if and only if there is a unique simple path between any
two of its vertices.
63. Define an Euler circuit and Euler path in an undirected graph. How can it be determined
whether an undirected graph has an Euler circuit and an Euler path? Explain with suitable
example. [2070]
64. An undirected graph is a tree if and only if there is a unique simple path between any two of
its vertices. [2071]
65. Discuss Kruskal’s algorithm for constructing a minimum spanning tree. Use this algorithm to
find minimum spanning tree in the graph given below. [2072]
66. Define Euler and Hamiltonian circuits and paths with examples illustrating the existence and
non existence of them. [2065]
OR
Discuss the shortest path algorithm of Dijkstra for finding the shortest path between two
vertices. Use this algorithm to find the length of the shortest path between a and z in the
following weighted graph?[2065,2066]
Give the idea of travelling salesman problem and the difficulties of solving it.
67. Define Hamiltonian paths and circuits with suitable examples for the existence and non
existence. Show that has a Hamilton circuit whenever. [2066]
68. Use Fluery’s algorithm to construct an Euler circuit for the following graph.[2068]
OR
Explain the concept of network flows and max-flow-min-cut with suitable examples.
[2068,2069]
69. Find a maximum flow in the network shown in the figure. [2069]
70. Define maximal flow and minimal cut and state and prove min-cut-max-flow theorem.
[2070]
71. Find all S-D cuts in the following transport network. What is the value of a maximal flow?
[2073]
72. Explain the concept of network flows and max-flow-min-cut theorem with suitable examples.
[2074]
73. Find the maximal flow for the network shown in the figure below: [2071]