edited by
15,252 views
42 42 votes

Which of the following are regular sets?

  1. $\left\{a^nb^{2m} \mid n \geq 0, m \geq 0 \right\}$

  2. $\left\{a^nb^m \mid n =2m  \right\}$

  3. $\left\{a^nb^m \mid n \neq m \right\}$

  4. $\left\{xcy \mid x, y, \in \left\{a, b\right\} ^* \right\}$

  1. I and IV only
  2. I and III only
  3. I only
  4. IV only

4 Answers

Best answer
38 38 votes

Answer is A.

Since in option $2$ and $3, n$ is dependent on $m$, therefore a comparison has to be done to evaluate those and hence are not regular.

I and IV are clearly regular sets.

edited by
8 8 votes

I)Set of all strings containing any number of ‘a’ s followed by an even number of ‘b’ s. R.E=(a)$^{*}$(bb)$^{*}$.

IV) Strings containing a ‘c’. R.E= (a+b)$^{*}$c(a+b)$^{*}$.

Both these languages are regular as regular expressions exist.

By default a language is infinite. Eg : {a$^{n}$} it’s a infinite language.So both the languages II and III are infinite and comparison has to be done to evaluate these and hence are not regular.

 Answer: A


NOTE:

Every finite language is regular.

Infinite language + Comparison = Non-Regular.

Infinite language + No Comparison = Regular.


Edit: As nothing is mentioned about ‘c’ in option IV and there is a comma after y, So I think It’s a typo ‘c’ should also belongs to {a,b}$^{*}$. IV will be a complete language. Which is regular. R.E=(a+b)$^{*}$.

edited by
0 0 votes

A.here we have to accept any number of a's and even number of b's  [a*(bb)* is our regular expression] hence it is regular


B.here number of b's are depending on number of a's  which can be infinite possibilities so dfa cannot count such infinite cases hence Non Regular language. But it is CFL since npda can easily with the help of non determinimism can accept it its not DCFL since non determinism is not allowed in DPDA .

C.it says a's and b's should not be equal hence infinite counting which cant be entertained by Our DFA hence non regular
now it is a cfl but not dcfl

D.its a language saying exaclty one c in hence its it regular,cfl,dcfl,recursive enumerable.

Answer:
Position:
Show:

Related questions

74 74 votes
4 answers 4 answers
35.0k
35.0k views
Kathleen asked Sep 12, 2014
34,962 views
Which of the following are NOT true in a pipelined processor?Bypassing can handle all RAW hazardsRegister renaming can eliminate all register carried WAR hazardsControl h...
69 69 votes
14 answers 14 answers
21.4k
21.4k views
Kathleen asked Sep 12, 2014
21,401 views
Match the following NFAs with the regular expressions they correspond to: P Q R S $\epsilon + 0\left(01^*1+00\right)^*01^*$$\epsilon + 0\left(10^*1+00\right)^*0$$\epsilon...
83 83 votes
4 answers 4 answers
21.1k
21.1k views
Kathleen asked Sep 12, 2014
21,108 views
Match the following:$$\small{\begin{array}{|ll|ll|}\hline \text{E.} & \text{Checking that identifiers are declared before their use} & \text{P.} & \text{$L \: = \: \lef...
93 93 votes
5 answers 5 answers
25.9k
25.9k views
Kathleen asked Sep 12, 2014
25,861 views
Given below are two finite state automata ( $\rightarrow$ indicates the start state and $F$ indicates a final state)$$\overset{Y}{\begin{array}{|l|l|l|}\hline \text{} & ...