- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain the technique for combining two languages in TOC?
There are three common ways of creating a new language from two languages −
Union
Intersection
Product
Languages are sets of strings, so they can be combined by the usual set operations of union and intersection.
Intersection
If L1 and L2 are languages over ∑, then L1 ∩ L2 is the language of strings in both L1 and L2 .
For example, If L = {aa, bb, ab} and M = {ab, aabb} then,
The intersection is as follows −
L ∩ M = {ab}
And
Union
If L1 and L2 are languages over the alphabet ∑, then the language L1 ∪ L2 is the language of all strings in at least one of the two languages.
For example, If L = {aa, bb, ab} and M = {ab, aabb} then,
The union is as follows −
L ∪ M = {aa, bb, ab, aabb}.
Where L is M are two languages over an alphabet ∑.
Concatenation − The operation of concatenation of strings places two strings in juxtaposition.
The concatenation of two languages L1 and L2 over the alphabet ∑ is the language L1L2 = { wx ∈ ∑* | w ∈ L1 ∧ x ∈ L2 }
The set of strings that can be split into two pieces − a piece from L1 and a piece from L2. It is similar to the Cartesian product of two sets, with strings.
Example
The concatenation of the two strings aab and ba is the string aabba.
We use the name cat to denote this operation − cat(aab, ba) = aabba.
We can combine two languages L and M by forming the set of all concatenations of strings in L with strings in M, which is called the product of the two languages.
Definition (Product of two languages)
If L and M are languages, then the new language called the product of L and M is defined as L · M (or only LM)
L · M = {cat(s,t) : s ∈ L and t ∈ M}
- Related Articles
- How to use Turing machines to recognize languages in TOC?
- Combining two arrays in JavaScript
- Combining two heatmaps in seaborn
- Explain Arden’s Theorem in TOC.
- Explain Chomsky hierarchy in TOC
- Explain the concept of derivation in TOC
- Explain the Post Correspondence Problem in TOC
- Explain the concept of grammar in TOC
- Explain the universal Turing machine in TOC
- Explain the concept of set in TOC?
- Explain the concept of strings in TOC?
- Combining two sorted lists in Python
- Explain the quick sort technique in C language.
- Explain the merge sort technique in C language
- Explain the power of an alphabet in TOC.
