ECS 120 Lecture Notes - Lecture 3: Parse Tree, Regular Language, Regular Expression

30 views6 pages
Week 4
Lecture 10
review:
1. Last Time: operations on regular languages
2. Given M & M’ is L(M) = L(M’)
a. Minimize both of the machines
b. Make a DFSM that does the following
i. A-B U B-A
ii. If there is a path?
iii. Is it empty?
c. This method guarantees that we can determine if L(M) & L(M’) are the same.
New information:
1. Regular expressions are often converted into NFA’s then DFA’s
a. We do not have to do this conversion by hand but this is a quiz question
New topic Context Free Grammars
Proof: there are some languages that are not regular?
Regular languages means that a DFSM or NDFSM can be used to accept the language.
There are regular languages. But not all languages are regular.
L= where n > 0
Find a FSM that accepts this language = this is impossible
1. Some strings in the language
a. 000111, 01, 001
b. Not in language
i. 10, 110, 0, 1, 101010101, 011, 001,
Proof that L= where n > 0 is not regular
1. Suppose that L is a regular language then some DFSM called M will be able to accept
the language L.
2. Let p be the number of states in M.
a. We are saying that M is a real FSM machine that can do this, therefore it has
some number of states inside of it, we do not know how many states but just
assume that there is some number p of them
3. Pick n to be greater than p
a. N is the number that 0 & 1 is raised to
b. Theres always a number greater than p.
4. Imagine the FSM working on a string where n>p.
5. n>p means that there has to be some loop going on somewhere. If there wasnt a loop
we could never accept where n>p.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

Already have an account? Log in
a. So weve established there is a loop, well if there is a loop how do we know that
the loop cant be taken multiple times? We dont know this
6. = xyz
a. Note in the example we are assuming p = 12
b. X = 0000
c. y= 0
d. z= 0111111
i. Note this stuff is subjective of where to divide, but proffesor and textbook
divide in the same way.
7. What would happen if n = P+1 so a total of 13.
a. Well if the NDFSM M that we said exsist does exist it must accept this language.
b. So y must be the loop. Meaning if we are a zero in y, we can keep taking zeros
and staying in y.
c. The issue with this is that if there are more zeros then ones’ are machine will still
accept.
8. So if NDFSM M exists it must accept 00011, but this is not apart of our language.
Therefore there is a contradiction. This contradiction leads us to believe that no such
machine can exists.
Definition:
Regular language: any language that a FSM can be built for.
Pigeon hole/ pumping up proof template.
Critical elements of the proof:
1. Suppose L is regular
2. Let p be the number of states in M
3. Pick n>p.
4. Longer strings will have to revisit some states
5. Pump up, meaning add more 0’s into the y
6. Pump down, take out zeros
a. Why pump down or up, it forces the FSM to accept when it shouldnt be accepting
and this contradiction is the reason we know that the language is not a regular
language.
Lecture 11
Review:
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Lecture 10 review: last time: operations on regular languages, given m & m" is l(m) = l(m", minimize both of the machines, make a dfsm that does the following. Is it empty: this method guarantees that we can determine if l(m) & l(m") are the same. New information: regular expressions are often converted into nfa"s then dfa"s, we do not have to do this conversion by hand but this is a quiz question. Regular languages means that a dfsm or ndfsm can be used to accept the language. Find a fsm that accepts this language = this is impossible. L= (cid:882)(cid:883) where n > 0: some strings in the language, 000111, 01, 001, not in language. This contradiction leads us to believe that no such machine can exists. Regular language: any language that a fsm can be built for. Lecture 11 style of proof a pumping lemma.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions