Beruflich Dokumente
Kultur Dokumente
Chapter 1.4
Chapter 1.4
Nonregular Languages
To understand the power of regular languages, we must also understand what they cant do. The FA for a regular language requires a nite amount of memory and number of states. Example: B = {0n1n | n 0} Example: C = { | has an equal number of 0s and 1s } Example: D = { | has an equal number of occurrences of 01 and 10 as substrings} It is not always easy to tell!
Chapter 1.4
Chapter 1.4
We can divide s into three substrings: s = xyz where: x = s1 s2 , y = s3s4, and z = s5s6 I know that whenever I am in state q5 and I see symbol s3 I go to state q1, and I know that if I am in state q1 and I see symbol s4 I go back to q5. So I know that whenever I am in state q5 and I see symbol s3 followed by s4 that I will return to state q5.
q0 s1 q2 s2 s3 q1 q5 s5 s4 q3 s6 q4
Chapter 1.4
So, string s1s2s5s6 is accepted (that is, xz). String s1s2s3s4 s5s6 is accepted (that is, s = xyz) String s1s2s3s4 s3s4s5s6 is accepted (that is, xyyz). String s1s2s3s4 s3s4s3s4s5s6 is accepted (that is, xyyyz). In fact, I can pump y down (that is, take is out to get xz) or I can pump y up (that is, add a copies of y between x and z) as many times as I want. If s = xyz A where A is the language recognized by this machine, then each string xy nz A, n 0.
Chapter 1.4
0 0 a b 1 c 0 b 1 c
So x = 0, y = 10, and z = 1.
Chapter 1.4
Chapter 1.4
...
...
...
Chapter 1.4
x takes machine M from r0 to rj . y takes machine M from rj to rl . (where rl is the same state as rj ) z takes machine M from rl to rn. (rn is an accept state) Since rj = rl , l p + 1, j < p + 1, and j = l then |y| > 0 and M must accept xy iz for i 0.
Chapter 1.4 10
Chapter 1.4
12
Chapter 1.4
13
Chapter 1.4
14
Chapter 1.4
15
Chapter 1.4
16