Describe an algorithm that shows that the following problem is decidable: given two regular expressionsR1andR2, is L(R1) =L(R2)? Hint: use Kleene’s theorem that relates regular expressions and finite automata
We use the 2 properties here:-
1. Given a regular expression R, then by Kleene's theorem, there always exist a DFA M corresponding to R such that L(R) =L(M).
2. Given 2 DFAs M1 and M2, the problem of finding L(M1) = L(M2) is decidable.
Following is the decidable algorithm:-
1. Create DFA M1 and M2 corresponding to R1 and R2 respectively.
2. If L(M1) = L(M2) then accept else reject.
Hence the problem L(R1) = L(R2) is decidable.
Describe an algorithm that shows that the following problem is decidable: given two regular expressionsR1andR2, is...
THEOREM 3.1 Let r be a regular expression. Then there exists some nondeteministic finite accepter that accepts L (r) Consequently, L () is a regular language. Proof: We begin with automata that accept the languages for the simple regular expressions ø, 2, and a E . These are shown in Figure 3.1(a), (b), and (c), respectively. Assume now that we have automata M (r) and M (r) that accept languages denoted by regular expressions ri and r respectively. We need...
a.) Exhibit an algorithm that, given any three regular languages, L,L1,L2, determines whether or not L = L1L2. b.) Describe an algorithm by which one can decide whether two regular expressions are equivalent.
Purpose: Gain experience converting from finite automata to regular expressions. Give regular expressions generating the following languages over {0,1}. Do these by hand by converting the finite automata. In your answers, you may use the shorthand Σ = (0+1) a. {w | w does not contain the substring 110} b. {w | w is any string except 11 and 111}
Consider the following decision problems. Indicate which of these problems are undecidable and which are decidable. For decidable problems, sketch an algorithm to decide/solve the problem; for undecidable problems, justify why they are undecidable. To decide whether a PDA accepts the empty string. To decide whether the languages accepted by two context-free grammars have strings in common.
Finite Automata and regular Expression Given the following Finite automata: 1. 0, 1 0, 1 0, 1 What regular expression does it accept?
For the following problems (except problem 8), state whether the problem is decidable or undecidable. If you claim the problem is decidable, then give a high-level, English description of an algorithm to solve the problem. If you claim the problem is undecidable, then describe a proof- by-reduction to verify your claim. If your proof involves some kind of transformation of M into M', as was done for the BlankTape problem, then provide a high -level, English description of your transformation....
You are given two Finite Automata (FA), FA1 and FA2, as shown below. a, b w2+ FA2 FAI You need to use the algorithm of Kleene's theorem to construct a FA3 for the union language: FA1 FA2. After constructing FA3, you need to answer the following question: How many states does FA3 have? Given the following machine: a,b 1- 2 4+ ab а a 3 Is this machine a FA or a TG? is a FA O None of the...
Question 5 Is the following problem decidable: Given two Turing machines Mi and M2 and an input a, does Mi stop on z and M2 does not stop on a (gets to an infinite loop)?
1) Design a greedy algorithm that solves the problem; describe your algorithm with clear pseudocode; and prove the time efficiency class of your algorithm: If x, y are two adjacent elements in a sequence, with x before y, we say that the pair x, y is in order when x <= y and the pair is out of order when x > y. For example, in the string “BEGGAR” the pair G, A are out of order, but all the...
(9 pts 3 pts each) For each of the following languages, name the least powerful type of machine that will accept it, and prove your answer. (Hint: a finite state automata is less powerful than a pushdown automata, which in turn is less powerful than a Turing Machine.) For example, to prove a language needs a PDA to accept it, you would use the Pumping Lemma to show it is not regular, and then build the PDA or CFG that...