168k views
5 votes
Let A={⟨r⟩∣r is a regular expression describing a language containing at least one string w that has 111 as a substring (w=x111y for some x and y). Show that A is decidable.

a) A is decidable.
b) A is not decidable.
c) Depends on the specific regular expression.

User Pandemic
by
7.8k points

1 Answer

3 votes

Final answer:

The set A of regular expressions describing languages that contain at least one string with '111' as a substring is decidable. This can be proven by constructing a Turing machine that accepts a regular expression, converts it to a finite automaton, and checks for acceptance of strings containing '111'.

Step-by-step explanation:

The question asks us to demonstrate that the set A, which includes all possible regular expressions that denote languages containing at least one string with '111' as a substring, is decidable. A language is said to be decidable if there is a Turing machine which accepts every string in the language and rejects every string not in the language within a finite amount of time.

To prove that A is decidable, we would design a Turing machine (TM) that decides A. This TM would take as input a regular expression r, and determine whether the language represented by r includes at least one string containing the substring '111'. The process for the TM would be as follows:

  1. Convert the regular expression r into its equivalent finite automaton M.
  2. Modify M to accept only if it processes a sequence including '111'.
  3. Run the modified automaton on all strings up to a certain length, as any string containing '111' must be of length at least 3.
  4. If the automaton accepts any string, accept; otherwise, if all strings are rejected, reject.

Since we know the set of all strings of a given length is finite and the process of a finite automaton on a string is finite, this process will halt. Therefore, the language A is decidable.

User Mark Vayngrib
by
8.3k points