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.1k
- Engineering Mathematics 4k
- Digital Logic 1.7k
- Programming & DS 3k
- Algorithms 2.6k
- Theory of Computation 3.2k
- Compiler Design 1.2k
- Databases 2.4k
- CO & Architecture 2.1k
- Computer Networks 2.4k
- Non GATE 819
- Others 1.1k
- Admissions 244
- Exam Queries 420
- Tier 1 Placement Questions 16
- Job Queries 39
- Projects 4

29,157 questions

36,985 answers

92,166 comments

34,824 users