The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

0 votes

+3 votes

Best answer

A language is a **set**.

So, $L_{1} = \{a^{n}b^{n} : n \geq 0\}$

Which can be written like this: $\{\epsilon , ab, aabb, aaabbb, aaaabbbb, ... \}$.

And $L_{2} = \{a^{n}b^{m} : n \neq m\}$

Which is: $\{aab, abb, aaab, aaabb, abbb, aabbb, ... \}$.

When you union these two languages (or, sets), you get another set, which contains elements (or strings), which is in at least one of the two sets.

From this you can see, the union of these two languages will give:

$\{\epsilon , ab, aabb, aaabbb, aaaabbbb, ... , aab, abb, aaab, aaabb, abbb, aabbb, ... \}$

Which is nothing but the set of strings of the type $a^{*}b^{*}$.

Which is a regular language.

Hope it helps :)

@Rishabh Gupta 2 Yes, it very much does! Thanks a lot.

- All categories
- General Aptitude 1.2k
- Engineering Mathematics 4.7k
- Digital Logic 1.9k
- Programming & DS 3.5k
- Algorithms 3k
- Theory of Computation 3.7k
- Compiler Design 1.5k
- Databases 2.8k
- CO & Architecture 2.5k
- Computer Networks 2.9k
- Non GATE 837
- Others 1.2k
- Admissions 284
- Exam Queries 398
- Tier 1 Placement Questions 17
- Job Queries 51
- Projects 7

33,718 questions

40,263 answers

114,378 comments

38,900 users