Awesome q2a theme
0 votes
14 views
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) | 14 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) \}$

where,

$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)
0
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. ummokkate

    8 Points

  2. nehaPal13

    7 Points

  3. Muktiyar

    6 Points

  4. Taraka

    6 Points

  5. pratyush12

    6 Points

  6. Radheram

    6 Points

  7. amare123

    6 Points

  8. vps123

    4 Points

  9. reboot

    2 Points

  10. Chinmay Agnihotri

    2 Points

7,415 questions
1,744 answers
10,719 comments
90,375 users