Posts

Showing posts with the label regular expressions

ARDEN'S THEOREM FOR REGULAR EXPRESSIONS

Image
    Identities for Regular Expression:- Given R, P, L, Q as regular expressions, the following identities hold − ∅* = ε ε* = ε RR* = R*R R*R* = R* (R*)* = R* RR* = R*R (PQ)*P =P(QP)* (a+b)* = (a*b*)* = (a*+b*)* = (a+b*)* = a*(ba*)* R + ∅ = ∅ + R = R   (The identity for union) R ε = ε R = R   (The identity for concatenation) ∅ L = L ∅ = ∅   (The annihilator for concatenation) R + R = R   (Idempotent law) L (M + N) = LM + LN   (Left distributive law) (M + N) L = ML + NL   (Right distributive law) ε + RR* = ε + R*R = R* Arden's Theorem:- In order to find out a regular expression of a Finite Automaton, we use Arden’s Theorem along with the properties of regular expressions. Statement  − Let  P  and  Q  be two regular expressions. If  P  does not contain null string, then  R = Q + RP  has a unique solution that is  R = QP* Proof  − R = Q + (Q + RP)P  [After putting the value R = Q + RP] = Q + ...

ARDEN'S THEOREM FOR REGULAR EXPRESSIONS

Image
  Identities for Regular Expression:- Given R, P, L, Q as regular expressions, the following identities hold − ∅* = ε ε* = ε RR* = R*R R*R* = R* (R*)* = R* RR* = R*R (PQ)*P =P(QP)* (a+b)* = (a*b*)* = (a*+b*)* = (a+b*)* = a*(ba*)* R + ∅ = ∅ + R = R   (The identity for union) R ε = ε R = R   (The identity for concatenation) ∅ L = L ∅ = ∅   (The annihilator for concatenation) R + R = R   (Idempotent law) L (M + N) = LM + LN   (Left distributive law) (M + N) L = ML + NL   (Right distributive law) ε + RR* = ε + R*R = R* Arden's Theorem:- In order to find out a regular expression of a Finite Automaton, we use Arden’s Theorem along with the properties of regular expressions. Statement  − Let  P  and  Q  be two regular expressions. If  P  does not contain null string, then  R = Q + RP  has a unique solution that is  R = QP* Proof  − R = Q + (Q + RP)P  [After putting the value R = Q + RP] = Q + QP + RP...

PUMPING LEMMA AND CLOSURE PROPERTIES OF REGULAR LANGUAGES

Image
  PUMPING LEMMA:- In the theory of  formal languages , the   pumping lemma   may refer to: -> Pumping lemma for regular languages , the fact that all sufficiently long strings in such a language have a substring that can be repeated arbitrarily many times, usually used to prove that certain languages are not regular. -> Pumping lemma for context-free languages , the fact that all sufficiently long strings in such a language have a pair of substrings that can be repeated arbitrarily many times, usually used to prove that certain languages are not context-free. -> Pumping Lemma is used as a proof for irregularity of a language. Thus, if a language is regular, it always satisfies pumping lemma. If there exists at least one string made from pumping which is not in L, then L is surely not regular. The opposite of this may not always be true. That is, if Pumping Lemma holds, it does not mean that the language is regular. -> It states that if 'L' is an infinite ...

REGULAR EXPRESSIONS

       About R.E's. :- ->  The language accepted by finite automata can be easily described by simple expressions called Regular Expressions. It is the most effective way to represent any language. ->The languages accepted by some regular expression are referred to as Regular languages. ->A regular expression can also be described as a sequence of pattern that defines a string. ->Regular expressions are used to match character combinations in strings. String searching algorithm used this pattern to find the operations on a string. What are Regular Languages?   – An alphabet Σ = {a, b, c} is a finite set of letters, – The set of all strings (aka, words) Σ∗ over an alphabet Σ can be recursively defined as:-  :Base case: ε ∈ Σ ∗ (empty string),  :Induction: If w ∈ Σ ∗ then wa ∈ Σ ∗ for all a ∈ Σ.  – A language L over some alphabet Σ is a set of strings, i.e. L ⊆ Σ ∗ . Some examples: – Leven = {w ∈ Σ ∗ : w is of even length} – La∗b∗ =...