338 views

1 Answer

0 votes
0 votes

S-> aSb| A | B

A-> aA | a

B-> bB | b

Question was written incorrect so i assumed question as {anbm|n,m$\geq$0 & n$\neq m$}

S-> $\varepsilon$ is not possible here.

what I did is break language in 3 parts

1) S-> aSb to give equal no of a's followed by equal number of b's

2) S->A so that string contain at least single a followed by 0 b's

3) S-> B so string contain at last single b followed by 0 a's

if string start with step 1 then it must follow either 2 or 3 to terminate

if it follow 2 then language will have a>b else if 3 is followed language will have a<b

edited by

Related questions

3 votes
3 votes
2 answers
1
0 votes
0 votes
1 answer
2
gateexplore asked Jun 11, 2023
441 views
Construct an NFA that will accept string of 0's, 1's and 2's beginning with a 0's followed by an odd number of 1's and ending with any number of 2's. Please give the answ...
0 votes
0 votes
0 answers
3
vishnu777 asked Nov 24, 2022
215 views
Can anyone explain what is the meaning of saying set of some languages is another language.Ex: L1,L2,L3.....Ln are some languages then i define L={L1,L2,L3.....Ln} which ...
1 votes
1 votes
1 answer
4