retagged by
492 views

1 Answer

0 votes
0 votes
Yes there exist an algorithm i am going to show you an worst case approach for it.

1) let $\sum$ be set of finite input symbol

so we an enumerate all the possible string  length n-1

2) now we will generate set of all strings of length n-1 generated bu given grammar

3) We have two different set now and just have to apply string matching algorithm.

Eg let $\sum ={a,b}$ and n=3

so set 1={$\epsilon$,a,b,aa,ab,ba,bb}

CFG is S->aSb|$\epsilon$

Set 2={$\epsilon$,ab}

apply string matching and result will be ={$\epsilon$,ab}

Related questions

0 votes
0 votes
0 answers
1
RahulVerma3 asked Apr 2
66 views
Is this the correct Turing machine for the language $0^n 1^n0^n$?assuming $ at the end and begining of the input tape
0 votes
0 votes
0 answers
2
baofbuiafbi asked Nov 14, 2023
167 views
Prove the language L={(G,H)|G is a CFG, H is a DFA, and L(G)∩L(H)=∅} is undecidable.