Disc2quest

Disc2quest - i and s j such that i!=j. By (2), it is...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
2 nd  Week Discussion Session Example Question QUESTION: Prove that there is no DFA that decides the language L={x | x is a string  which has an equal number of a's and b's} over an alphabet ∑   {a,b}. ANSWER: This question can be solved using proof by contradiction. Assume that there  is a DFA M which decides L. Consider a string of the form a n b m  such that  n,m   Z + . (1)It is obvious that a n b is in L if and only if n=m. Let s n  be the  state of the machine after it processes the prefix a n . (2) By (1), we can say if  the machine M is in state s n  it accepts the suffix b m  if and only if m=n. Now  consider two states s
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: i and s j such that i!=j. By (2), it is observable that s i cannot be the same state as s j because when M is in state s i , it accepts the suffix b i while when it is in state s j it rejects the suffix b i . Consequently each s n is a unique state. Since there are an infinite number of s n 's and each of them are unique states, the machine M must have an infinite number of states. However, this contradicts with our initial assumption that M is a DFA therefore our initial assumption cannot be true. Hence there is no DFA that decides the language L....
View Full Document

This note was uploaded on 12/27/2011 for the course CMPSC 225 taught by Professor Vandam during the Fall '09 term at UCSB.

Ask a homework question - tutors are online