Question

Let L be the language of binary strings of odd length such that the middle bit...

Let L be the language of binary strings of odd length such that the middle bit is 0.

Show that L is not regular, and show that L is context-free.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let L be the language pf binary strings odd length such that the middle bit it 0.

Let w = (0+1)n 0 (0+1)n

We note that |w| ≥ n.

Let x,y,z ∈ Σ*  w = xyz such that

x = (0+1)n-2

y = (0+1)

z = (0+1) 0 (0+1)n

Checking the conditions of Pumping Lemma for Regular expressions,

1. |xy| ≤ n

2. y ≠ ∈ (or y ≥ 1)

3. for all k ≥ 0, the string xykz ∈ L.

Let k =0

xy0z = (0+1)n-2 (0+1)0 (0+1) 0 (0+1)n

xy0z = (0+1)n-2 (0+1) 0 (0+1)

xy0z = (0+1)n-1 0 (0+1)n   ∉ L

Therefore, L is not regular.

We have 2 condition to be checked here ​​​​​​:

(a) The String is of odd length

(b) The middle element is 0

If we can find mid-point in the expression even in a non-deterministic way, then it is context free language

Therefore, L is a Context Free Language.

Add a comment
Know the answer?
Add Answer to:
Let L be the language of binary strings of odd length such that the middle bit...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT