100 views
0 votes
0 votes

Give a context-free grammar for each of the following languages. Consider, Σ={0,1}.

A. The language of strings that start with 1

B. The language of strings of the form WWR 

C. The language of strings that contain the substring 001

D. The language {0n10n where n ≥ 0}

E. The language {0i1j where i ≤ j}

F. The language {1i01j01i+j}

G. The language {03nw12n where n ≥ 0 and w is a string that contains at least two 0’s}

H. The language {0i10j | i is a multiple of three where i, j ≥ 0}

I. The language {0i10 j | j = 2 + 3i where i, j ≥ 0}

J. The language {1i01j | j is a multiple of four or i = 3 + 2j where i, j ≥ 0}

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
2
atulcse asked Jan 21, 2022
912 views
Given a CFG and a string, what is the relation between the number of leftmost derivations, the number of rightmost derivations and the number of parse trees?
1 votes
1 votes
1 answer
3
practicalmetal asked Mar 20, 2023
382 views
The complement of the languages:i) {ww | w in (0+1)*}ii) {$a^n b^nc^n$ | n>1} area) Context Free b) Not Context Free c)are DCFL’s d)None
0 votes
0 votes
1 answer
4
swami_9 asked Jul 16, 2022
563 views
Why the complement of a CFL is CSL?