Presentation is loading. Please wait.

Presentation is loading. Please wait.

Courtesy Costas Busch - RPI1 Non-regular languages.

Similar presentations


Presentation on theme: "Courtesy Costas Busch - RPI1 Non-regular languages."— Presentation transcript:

1 Courtesy Costas Busch - RPI1 Non-regular languages

2 Courtesy Costas Busch - RPI2 Regular languages Non-regular languages

3 Courtesy Costas Busch - RPI3 How can we prove that a language is not regular? Prove that there is no DFA that accepts Problem: this is not easy to prove Solution: the Pumping Lemma !!!

4 Courtesy Costas Busch - RPI4 The Pigeonhole Principle

5 Courtesy Costas Busch - RPI5 pigeons pigeonholes

6 Courtesy Costas Busch - RPI6 A pigeonhole must contain at least two pigeons

7 Courtesy Costas Busch - RPI7........... pigeons pigeonholes

8 Courtesy Costas Busch - RPI8 The Pigeonhole Principle........... pigeons pigeonholes There is a pigeonhole with at least 2 pigeons

9 Courtesy Costas Busch - RPI9 The Pigeonhole Principle and DFAs

10 Courtesy Costas Busch - RPI10 DFA with states

11 Courtesy Costas Busch - RPI11 In walks of strings:no state is repeated

12 Courtesy Costas Busch - RPI12 In walks of strings:a state is repeated

13 Courtesy Costas Busch - RPI13 If string has length : Thus, a state must be repeated Then the transitions of string are more than the states of the DFA

14 Courtesy Costas Busch - RPI14 In general, for any DFA: String has length number of states A state must be repeated in the walk of...... walk of Repeated state

15 Courtesy Costas Busch - RPI15 In other words for a string : transitions are pigeons states are pigeonholes...... walk of Repeated state

16 Courtesy Costas Busch - RPI16 The Pumping Lemma

17 Courtesy Costas Busch - RPI17 Take an infinite regular language There exists a DFA that accepts states

18 Courtesy Costas Busch - RPI18 Take string with There is a walk with label :......... walk

19 Courtesy Costas Busch - RPI19 If string has length (number of states of DFA) then, from the pigeonhole principle: a state is repeated in the walk...... walk

20 Courtesy Costas Busch - RPI20...... walk Let be the first state repeated in the walk of

21 Courtesy Costas Busch - RPI21 Write......

22 Courtesy Costas Busch - RPI22...... Observations:lengthnumber of states of DFA length

23 Courtesy Costas Busch - RPI23 The string is accepted Observation:......

24 Courtesy Costas Busch - RPI24 The string is accepted Observation:......

25 Courtesy Costas Busch - RPI25 The string is accepted Observation:......

26 Courtesy Costas Busch - RPI26 The string is accepted In General:......

27 Courtesy Costas Busch - RPI27 In General:...... Language accepted by the DFA

28 Courtesy Costas Busch - RPI28 In other words, we described: The Pumping Lemma !!!

29 Courtesy Costas Busch - RPI29 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we can write with and such that:

30 Courtesy Costas Busch - RPI30 Applications of the Pumping Lemma

31 Courtesy Costas Busch - RPI31 Theorem: The language is not regular Proof: Use the Pumping Lemma

32 Courtesy Costas Busch - RPI32 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma

33 Courtesy Costas Busch - RPI33 Let be the integer in the Pumping Lemma Pick a string such that: length We pick

34 Courtesy Costas Busch - RPI34 it must be that length From the Pumping Lemma Write: Thus:

35 Courtesy Costas Busch - RPI35 From the Pumping Lemma: Thus:

36 Courtesy Costas Busch - RPI36 From the Pumping Lemma: Thus:

37 Courtesy Costas Busch - RPI37 BUT: CONTRADICTION!!!

38 Courtesy Costas Busch - RPI38 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

39 Courtesy Costas Busch - RPI39 Regular languages Non-regular languages

40 Courtesy Costas Busch - RPI40 Regular languages Non-regular languages

41 Courtesy Costas Busch - RPI41 Theorem: The language is not regular Proof: Use the Pumping Lemma

42 Courtesy Costas Busch - RPI42 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma

43 Courtesy Costas Busch - RPI43 We pick Let be the integer in the Pumping Lemma Pick a string such that: length and

44 Courtesy Costas Busch - RPI44 Write it must be that length From the Pumping Lemma Thus:

45 Courtesy Costas Busch - RPI45 From the Pumping Lemma: Thus:

46 Courtesy Costas Busch - RPI46 From the Pumping Lemma: Thus:

47 Courtesy Costas Busch - RPI47 BUT: CONTRADICTION!!!

48 Courtesy Costas Busch - RPI48 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

49 Courtesy Costas Busch - RPI49 Regular languages Non-regular languages

50 Courtesy Costas Busch - RPI50 Theorem: The language is not regular Proof: Use the Pumping Lemma

51 Courtesy Costas Busch - RPI51 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma

52 Courtesy Costas Busch - RPI52 We pick Let be the integer in the Pumping Lemma Pick a string such that: length and

53 Courtesy Costas Busch - RPI53 Write it must be that length From the Pumping Lemma Thus:

54 Courtesy Costas Busch - RPI54 From the Pumping Lemma: Thus:

55 Courtesy Costas Busch - RPI55 From the Pumping Lemma: Thus:

56 Courtesy Costas Busch - RPI56 BUT: CONTRADICTION!!!

57 Courtesy Costas Busch - RPI57 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

58 Courtesy Costas Busch - RPI58 Regular languages Non-regular languages

59 Courtesy Costas Busch - RPI59 Theorem: The language is not regular Proof: Use the Pumping Lemma

60 Courtesy Costas Busch - RPI60 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma

61 Courtesy Costas Busch - RPI61 We pick Let be the integer in the Pumping Lemma Pick a string such that: length

62 Courtesy Costas Busch - RPI62 Write it must be that length From the Pumping Lemma Thus:

63 Courtesy Costas Busch - RPI63 From the Pumping Lemma: Thus:

64 Courtesy Costas Busch - RPI64 From the Pumping Lemma: Thus:

65 Courtesy Costas Busch - RPI65 Since: There must exist such that:

66 Courtesy Costas Busch - RPI66 However:for for any

67 Courtesy Costas Busch - RPI67 BUT: CONTRADICTION!!!

68 Courtesy Costas Busch - RPI68 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

69 69 Summary  Showing regular  construct DFA, NFA  construct regular expression  show L is the union, concatenation, intersection (regular operations) of regular languages.  Showing non-regular  pumping lemma  assume regular, apply closure properties of regular languages and obtain a known non-regular language.


Download ppt "Courtesy Costas Busch - RPI1 Non-regular languages."

Similar presentations


Ads by Google