Awesome q2a theme
0 votes
What will be the language generated by the following grammar ?

S → 0S1S / 1S0S/E

P.S. – E is Epsilon
in Theory of Computation by (22 points) | 13 views

1 Answer

+1 vote
Each production on right hand side generates either $2$ alphabets or an epsilon,

Further more, for each production there's always $1$ generated for every $0$ we generate, and vice versa.

So the language accepted by the grammar should be

$L(G)  = \{w | w \in \{0,1\}^*, n_0(w) = n_1(w) \}$


$n_0 = $ number of occurances of $0$ in $w$.  

$n_1 = $ number of occurances of $1$ in $w$.

So, in poor terms, it's a language of equal number of zeros and ones.
by (305 points)
Can you help me by drawing it's parse tree ? @toxicdesire
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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Jun 2020
  1. vps123

    4 Points

  2. ummokkate

    1 Points

  3. Kushagra गुप्ता

    1 Points

  4. faseela45

    1 Points

  5. srestha

    1 Points

7,385 questions
1,744 answers
90,357 users