GATE CSE
First time here? Checkout the FAQ!
x
0 votes
39 views

L1 = {a^nb^n, n>=0}

L2 = {a^nb^m , n not equal to m)

So how L1 U L2 is regular?

 

I know, L1 U L2 will have RegEx a*b* which is regular but how this RegEx comes can someone please take strings generated by L1 and L2 and then UNION them, I need to know how to UNION them strings. Thanks

asked in Theory of Computation by Loyal (4.6k points) 4 39 112 | 39 views

1 Answer

+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 :)

answered by Loyal (3.6k points) 2 6 17
selected by

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



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23338 Points

  2. Bikram

    17048 Points

  3. Habibkhan

    7912 Points

  4. srestha

    6238 Points

  5. Debashish Deka

    5438 Points

  6. jothee

    4968 Points

  7. Sachin Mittal 1

    4772 Points

  8. joshi_nitish

    4286 Points

  9. sushmita

    3964 Points

  10. Rishi yadav

    3794 Points


Recent Badges

Popular Question user1234
Copy Editor Ayush Upadhyaya
Popular Question asu
Popular Question .
Popular Question makhdoom ghaya
Popular Question junaid ahmad
Notable Question learner_geek
Notable Question jothee
Popular Question jothee
Notable Question Jeffrey Jose
27,290 questions
35,142 answers
83,926 comments
33,231 users