Presentation is loading. Please wait.

Presentation is loading. Please wait.

RAJALAKSHMI ENGINEERING COLLEGE

Similar presentations


Presentation on theme: "RAJALAKSHMI ENGINEERING COLLEGE"— Presentation transcript:

1 RAJALAKSHMI ENGINEERING COLLEGE
THEORY OF COMPUTATION 11/19/2018

2 UNIT- I AUTOMATA 11/19/2018

3 11/19/2018

4 11/19/2018

5 11/19/2018

6 11/19/2018

7 11/19/2018

8 11/19/2018

9 11/19/2018

10 11/19/2018

11 11/19/2018

12 11/19/2018

13 11/19/2018

14 11/19/2018

15 Finite Automata 11/19/2018

16 11/19/2018

17 States Open Closed Sensors Front – Someone on the Front pad Rear – Someone on the Rear pad Both – Someone on both the pads Neither – No one on either pad 11/19/2018

18 11/19/2018

19 11/19/2018

20 11/19/2018

21 11/19/2018

22 11/19/2018

23 11/19/2018

24 11/19/2018

25 11/19/2018

26 11/19/2018

27 11/19/2018

28 11/19/2018

29 11/19/2018

30 11/19/2018

31 11/19/2018

32 11/19/2018

33 11/19/2018

34 11/19/2018

35 11/19/2018

36 11/19/2018

37 11/19/2018

38 11/19/2018

39 11/19/2018

40 11/19/2018

41 UNIT - II REGULAR EXPRESSIONS AND LANGUAGES 11/19/2018

42 11/19/2018

43 11/19/2018

44 11/19/2018

45 11/19/2018

46 11/19/2018

47 11/19/2018

48 11/19/2018

49 11/19/2018

50 11/19/2018

51 11/19/2018

52 11/19/2018

53 11/19/2018

54 11/19/2018

55 11/19/2018

56 11/19/2018

57 11/19/2018

58 11/19/2018

59 11/19/2018

60 11/19/2018

61 11/19/2018

62 11/19/2018

63 11/19/2018

64 11/19/2018

65 11/19/2018

66 11/19/2018

67 11/19/2018

68 11/19/2018

69 11/19/2018

70 11/19/2018

71 11/19/2018

72 11/19/2018

73 11/19/2018

74 11/19/2018

75 11/19/2018

76 11/19/2018

77 11/19/2018

78 11/19/2018

79 11/19/2018

80 Questions about Regular Languages
11/19/2018

81 Question contd… 11/19/2018

82 Singleton Languages are Regular
11/19/2018

83 Finite Languages are regular
11/19/2018

84 11/19/2018

85 11/19/2018

86 11/19/2018

87 11/19/2018

88 11/19/2018

89 Closure Properties for Regular Languages
11/19/2018

90 Myhill-Nerode Theorem
11/19/2018

91 11/19/2018

92 11/19/2018

93 11/19/2018

94 UNIT III CONTEXT-FREE GRAMMAR AND LANGUAGES 11/19/2018

95 Context Free Grammars 11/19/2018

96 Cont… 11/19/2018

97 Cont… 11/19/2018

98 Defining CFG 11/19/2018

99 Notational conventions For CFGs
11/19/2018

100 OTHER CFG EXAMPLES 11/19/2018

101 Languages of CFG 11/19/2018

102 Languages of CFG 11/19/2018

103 Regular Languages and CFL
11/19/2018

104 Translating FAs into CFG
11/19/2018

105 Formalizing the Translation
11/19/2018

106 Closure Properties of CFL
11/19/2018

107 Proving CFLs closed under Union
11/19/2018

108 IDEA 11/19/2018

109 Formal Construction of Gu
11/19/2018

110 Derivations 11/19/2018

111 Sentential Form 11/19/2018

112 Left Most and Right Most Derivation
11/19/2018

113 Right-Linear Grammars
11/19/2018

114 Ambiguous Grammars 11/19/2018

115 Ambiguous Grammars 11/19/2018

116 Pushdown Automata Recall our study of regular languages.
They were defined in terms of regular expressions (syntax). We then showed that FAs provide the computational power needed to process them. We would like to mimic this line of development for CFLs. We have a “syntactic” definition of CFLs in terms of CFGs. What kind of computing power is needed to “process” (i.e. recognize) CFLs? Do FAs suffice? 11/19/2018

117 Cont… 11/19/2018

118 Cont… 11/19/2018

119 Example PDA for{0n1n|n≥0}
11/19/2018

120 Formal Definition 11/19/2018

121 Instantaneous Description
11/19/2018

122 Language accepted by PDA
11/19/2018

123 Language accepted by PDA
11/19/2018

124 Language accepted by PDA
11/19/2018

125 Equivalence of CFGs and PDAs
11/19/2018

126 Cont… 11/19/2018

127 Deterministic PDA 11/19/2018

128 CONTEXT-FREE LANGUAGES
UNIT - IV PROPERTIES OF CONTEXT-FREE LANGUAGES 11/19/2018

129 Chomsky Normal Form 11/19/2018

130 Defining CNF 11/19/2018

131 What is the Big Deal about CNF?
11/19/2018

132 Cont… 11/19/2018

133 Converting CFGs into CNF
11/19/2018

134 Eliminating ε-Productions
11/19/2018

135 Cont… 11/19/2018

136 Cont… 11/19/2018

137 Nullability 11/19/2018

138 Generating an ε-Production-free CFGs
11/19/2018

139 Converting CFGs into CNF
11/19/2018

140 Eliminating Unit Productions
11/19/2018

141 Cont… 11/19/2018

142 U(G,A) and New Productions
11/19/2018

143 Example 11/19/2018

144 Cont… 11/19/2018

145 Formal Construction 11/19/2018

146 Eliminating Terminal Productions
11/19/2018

147 Example 11/19/2018

148 Formal Construction 11/19/2018

149 Pumping Lemma For CFLs 11/19/2018

150 Cont… 11/19/2018

151 Derivation Trees 11/19/2018

152 Defining Derivation Tree
11/19/2018

153 Example 11/19/2018

154 Derivation Trees and CNF
11/19/2018

155 11/19/2018

156 Pumping Lemma for CFL 11/19/2018

157 Proving Languages Non Context Free using Pumping Lemma
11/19/2018

158 Prove that L= {aNbNcN|N ≥0} is Not a CFL
11/19/2018

159 Proof Cont… 11/19/2018

160 Turing Machines 11/19/2018

161 A Finite Automaton 11/19/2018

162 A Pushdown Automaton 11/19/2018

163 A Turing Machine 11/19/2018

164 Cont.. 11/19/2018

165 Differences 11/19/2018

166 Example 11/19/2018

167 Cont… 11/19/2018

168 Cont… 11/19/2018

169 Cont… 11/19/2018

170 Formal Definition 11/19/2018

171 Cont.. 11/19/2018

172 Cont… 11/19/2018

173 Cont… 11/19/2018

174 Configurations 11/19/2018

175 Cont… 11/19/2018

176 More Configuration 11/19/2018

177 Accepting a Language 11/19/2018

178 Enumerable Languages 11/19/2018

179 UNIT – V UNDECIDABILITY 11/19/2018

180 Enumerable Languages 11/19/2018

181 Enumerable Languages 11/19/2018

182 Example 11/19/2018

183 Example 11/19/2018

184 Example 11/19/2018

185 Element Distinctness 11/19/2018

186 Element Distinctness 11/19/2018

187 Element Distinctness 11/19/2018

188 Element Distinctness 11/19/2018

189 Element Distinctness 11/19/2018

190 Variants 11/19/2018

191 Multitape Turing Machine
11/19/2018

192 Equivalence 11/19/2018

193 Simulation 11/19/2018

194 Simulation 11/19/2018

195 Non Deterministic Turing Machine
11/19/2018

196 Decidability 11/19/2018

197 Example 11/19/2018

198 Theorem 11/19/2018

199 Theorem 11/19/2018

200 Theorem 11/19/2018

201 Theorem 11/19/2018

202 Halting Problem 11/19/2018

203 Cont.. 11/19/2018

204 Cont.. 11/19/2018

205 Turing Machines are countable
11/19/2018

206 Cont.. 11/19/2018

207 Post Correspondence Problem
11/19/2018

208 Cont… 11/19/2018

209 Cont... 11/19/2018

210 Cont… 11/19/2018

211 Cont… 11/19/2018

212 Cont… 11/19/2018

213 11/19/2018

214 NP-complete Problem 11/19/2018

215 11/19/2018

216 11/19/2018

217 To keep things simple, we will mainly concern ourselves with
Decision Problems To keep things simple, we will mainly concern ourselves with decision problems. These problems only require a single bit output: ``yes'' and ``no''. How would you solve the following decision problems? Is this directed graph acyclic? Is there a spanning tree of this undirected graph with total weight less than w? Does this bipartite graph have a perfect (all nodes matched) matching? Does the pattern p appear as a substring in text t? 11/19/2018

218 11/19/2018

219 P is the set of decision problems that can be solved in worst-case
polynomial time: If the input is of size n, the running time must be O(nk). Note that k can depend on the problem class, but not the particular instance. All the decision problems mentioned above are in P. 11/19/2018

220 The class NP (meaning non-deterministic polynomial time) is the
Nice Puzzle The class NP (meaning non-deterministic polynomial time) is the set of problems that might appear in a puzzle magazine: ``Nice puzzle.'' What makes these problems special is that they might be hard to solve, but a short answer can always be printed in the back, and it is easy to see that the answer is correct once you see it. Example... Does matrix A have an LU decomposition? No guarantee if answer is ``no''. 11/19/2018

221 11/19/2018

222 Technically speaking:
NP Technically speaking: A problem is in NP if it has a short accepting certificate. An accepting certificate is something that we can use to quickly show that the answer is ``yes'' (if it is yes). Quickly means in polynomial time. Short means polynomial size. This means that all problems in P are in NP (since we don't even need a certificate to quickly show the answer is ``yes''). But other problems in NP may not be in P. Given an integer x, is it composite? How do we know this is in NP? 11/19/2018

223 Another way of thinking of NP is it is the set of problems that can
Good Guessing Another way of thinking of NP is it is the set of problems that can solved efficiently by a really good guesser. The guesser essentially picks the accepting certificate out of the air (Non-deterministic Polynomial time). It can then convince itself that it is correct using a polynomial time algorithm. (Like a right-brain, left-brain sort of thing.) Clearly this isn't a practically useful characterization: how could we build such a machine? 11/19/2018

224 Exponential Upperbound
Another useful property of the class NP is that all NP problems can be solved in exponential time (EXP). This is because we can always list out all short certificates in exponential time and check all O(2nk) of them. Thus, P is in NP, and NP is in EXP. Although we know that P is not equal to EXP, it is possible that NP = P, or EXP, or neither. Frustrating! 11/19/2018

225 As we will see, some problems are at least as hard to solve as any
NP-hardness As we will see, some problems are at least as hard to solve as any problem in NP. We call such problems NP-hard. How might we argue that problem X is at least as hard (to within a polynomial factor) as problem Y? If X is at least as hard as Y, how would we expect an algorithm that is able to solve X to behave? 11/19/2018

226 11/19/2018

227 11/19/2018

228 11/19/2018

229 11/19/2018

230 All evidence indicates that these conjectures are true.
co-NP NP P One of the central (and widely and intensively studied 30 years) problems of (theoretical) computer science is to prove that (a) PNP (b) NP  co-NP. All evidence indicates that these conjectures are true.  Disproving any of these two conjectures would not only be considered truly spectacular, but would also come as a tremendous surprise (with a variety of far-reaching counterintuitive consequences). NP-complete: Collection Z of problems is NP-complete if (a) it is NP and (b) if polynomial-time algorithm existed for solving problems in Z, then P=NP. 11/19/2018

231 11/19/2018

232 11/19/2018

233 11/19/2018

234 11/19/2018

235 11/19/2018

236 NP-Complete Problems 11/19/2018

237 11/19/2018

238 11/19/2018

239 11/19/2018

240 11/19/2018

241 11/19/2018

242 11/19/2018


Download ppt "RAJALAKSHMI ENGINEERING COLLEGE"

Similar presentations


Ads by Google