(a) Regular Languages:
(b) Context-free languages
Concatenation : If L1 and If L2 are two context
free languages, their concatenation L1.L2 will also be context
free. For example,
L1 = { anbn | n >= 0 } and L2 = {
cmdm | m >= 0 }
L3 = L1.L2 = { anbncmdm
| m >= 0 and n >= 0} is also context free.
L1 says number of a’s should be equal to number of b’s and L2 says
number of c’s should be equal to number of d’s. Their concatenation
says first number of a’s should be equal to number of b’s, then
number of c’s should be equal to number of d’s. So, we can create a
PDA which will first push for a’s, pop for b’s, push for c’s then
pop for d’s. So it can be accepted by pushdown automata, hence
context free.
Note: So CFL are closed under Concatenation.
Kleene Closure : If L1 is context free, its
Kleene closure L1* will also be context free. For example,
L1 = { anbn | n >= 0 }
L1* = { anbn | n >= 0 }* is also context
free.
Note :So CFL are closed under Kleen Closure.
Intersection and complementation : If L1 and If
L2 are two context free languages, their intersection L1 ∩ L2 need
not be context free. For example,
L1 = { anbncm | n >= 0 and m
>= 0 } and L2 = (ambncn | n
>= 0 and m >= 0 }
L3 = L1 ∩ L2 = { anbncn | n >=
0 } need not be context free.
L1 says number of a’s should be equal to number of b’s and L2 says
number of b’s should be equal to number of c’s. Their intersection
says both conditions need to be true, but push down automata can
compare only two. So it cannot be accepted by pushdown automata,
hence not context free.
Similarly, complementation of context free language L1 which is ∑*
– L1, need not be context free.
Note : So CFL are not closed under Intersection and Complementation.
Deterministic Context-free Languages
Deterministic CFL are subset of CFL which can be recognized by
Deterministic PDA. Deterministic PDA has only one move from a given
state and input symbol, i.e., it do not have choice. For a language
to be DCFL it should be clear when to PUSh or POP.
For example, L1= { anbncm | m
>= 0 and n >= 0} is a DCFL because for a’s, we can push on
stack and for b’s we can pop. It can be recognized by Deterministic
PDA. On the other hand, L3 = {
anbncm ∪
anbmcm | n >= 0, m >= 0 }
cannot be recognized by DPDA because either number of a’s and b’s
can be equal or either number of b’s and c’s can be equal. So, it
can only be implemented by NPDA. Thus, it is CFL but not
DCFL.
Note : DCFL are closed only under complementation
and Inverse Homomorphism.
(c) Regular Expressions
L(R1|R2) = L(R1) U L(R2).
L(R1R2) = L(R1) concatenated with L(R2).
L(R1*) = epsilon U L(R1) U L(R1R1) U L(R1R1R1) U ...
(d) Non-deterministic finite automaton
The set of all strings accepted by an NFA is the language the NFA accepts. This language is a regular language. For every NFA a deterministic finite automaton (DFA) can be found that accepts the same language. Therefore, it is possible to convert an existing NFA into a DFA for the purpose of implementing a (perhaps) simpler machine. This can be performed using the powerset construction, which may lead to an exponential rise in the number of necessary states. For a formal proof of the powerset construction.
2. Properties of the following: (a) Regular languages (b) Context-free languages (c) Regular expressions (d) Non-deterministic...
determine if the language is regular, context-free, Turing-decidable, or undecidable. For languages that are regular, give a DFA that accepts the language, a regular expression that generates the language, and a maximal list of strings that are pairwise distinguishable with respect to the language. For languages that are context-free but not regular, prove that the language is not regular and either give a context- free grammar that generates the language or a pushdown automaton that accepts the language. You need...
1. If L is the complement of a language recognized by a non-deterministic finite automaton, then L is _______ a) finite b) regular but not necessarily finite c) deterministic context-free but not necessarily regular d) context-free but not necessarily deterministic context-free e) recursive (that is, decidable) but not necessarily context-free f) recursively enumerable (that is, partially decidable) but not necessarily recursive g) not recursively enumerable
determine if the language is regular, context-free, Turing-decidable, or undecidable. For languages that are regular, give a DFA that accepts the language, a regular expression that generates the language, and a maximal list of strings that arc pairwise distinguishable with respect to the language. For languages that are context-free but not regular, prove that the language is not regular and either give a context- free grammar that generates the language or a pushdown automaton that accepts the language. You need...
Determining whether languages are finite, regular, context free, or recursive 1. (Each part is worth 2 points) Fill in the blanks with one of the following (some choices might not be used): a) finite b) regular but not finite d) context-free but not deterministic context-free e) recursive (that is, decidable) but not context-free f) recursively enumerable (that is, partially decidable) but not recursive g) not recursively enumerable Recall that if M is a Turing machine then "M" (also written as...
2. This question is about regular languages. Consider the following finite automaton: 2 3 4 (d) Translate the above automaton into a deterministic finite automaton. Explain your steps, or your design. [7 marks] 2. This question is about regular languages. Consider the following finite automaton: 2 3 4 (d) Translate the above automaton into a deterministic finite automaton. Explain your steps, or your design. [7 marks]
Can someone use pumping Lemma to show if these are regular languages or not c) Is L regular? give a finite automaton or prove using pumping lemma. (d) Is L context-free? give a context-free grammar or pushdown automaton, otherwise pr using pumping lemma. (16 pts)Given the set PRIMES (aP | p is prime (a) Prove that PRIMES is not regular. (b) Prove that PRIMES is not context-free. (c) Show if complement of PRIMES (PRIMES ) is regular or not. d)...
Let Azfa"b"c" I n 0 }. Answer each of the following question: 1. 2. 3. 4. Is A a regular language? Is A a context free language? Is A Turing recognizable? Is A Turing decidable?
If L1 and L2 are Regular Languages, then L1 ∪ L2 is a CFL. Group of answer choices True False Flag this Question Question 61 pts If L1 and L2 are CFLs, then L1 ∩ L2 and L1 ∪ L2 are CFLs. Group of answer choices True False Flag this Question Question 71 pts The regular expression ((ac*)a*)* = ((aa*)c*)*. Group of answer choices True False Flag this Question Question 81 pts Some context free languages are regular. Group of answer choices True...
Show that L = {anbm : m ≥ n +3} is deterministic. This is for formal languages and automata... Can you please try to explain what you are doing and why (if necessary, if not ill try my best to figure it out.) The definitions i'm working based off of are posted as a image below. Thanks! DEFINITION 7.3 A pushdown automaton M-О. Е, Г, 0, qo, z, Fİs said to be deterministic ifit is an automaton as defined in...