Neha Patil (Editor)

Quotient of a formal language

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In mathematics and computer science, the right quotient (or simply quotient) of a formal language L 1 with a formal language L 2 is the language consisting of strings w such that wx is in L 1 for some string x in L 2 . In symbols, we write:

Contents

L 1 / L 2 = { w   |   x ( ( x L 2 ) ( w x L 1 ) ) }

In other words, each string in L 1 / L 2 is the prefix of a string w x in L 1 , with the remainder of the word being a string in L 2 .

Similarly, the left quotient of L 1 with L 2 is the language consisting of strings w such that xw is in L 2 for some string x in L 1 . In symbols, we write:

L 1 L 2 = { w   |   x ( ( x L 1 ) ( x w L 2 ) ) }

The left quotient can be regarded as the set of postfixes that complete words from L 2 , such that the resulting word is in L 1 .

Example

Consider

L 1 = { a n b n c n     |     n 0 }

and

L 2 = { b i c j     |     i , j 0 } .

Now, if we insert a divider into the middle of an element of L 1 , the part on the right is in L 2 only if the divider is placed adjacent to a b (in which case i ≤ n and j = n) or adjacent to a c (in which case i = 0 and j ≤ n). The part on the left, therefore, will be either a n b n i or a n b n c n j ; and L 1 / L 2 can be written as

{ a p b q c r     |     p = q r         p q r = 0 } .

Properties

Some common closure properties of the right quotient include:

  • The quotient of a regular language with any other language is regular.
  • The quotient of a context free language with a regular language is context free.
  • The quotient of two context free languages can be any recursively enumerable language.
  • The quotient of two recursively enumerable languages is recursively enumerable.
  • These closure properties hold for both left and right quotients.

    References

    Quotient of a formal language Wikipedia