I am not sure some notations' usage in the formal language and context free grammar

47 Views Asked by At

$L = \{x\#w\mid w^R\text{ is a substring of }x\text{ for }x, w \in \{0,1\}^*\}$, where $w^R$ is denoted the reverse of string $w$

  1. I am not sure # means any valid string or just the number symbol itself ?

  2. What's the exact meaning of $w \in \{0,1\}^*$ ? it means $w$ can be any combination of $\{0,1\}$ including empty string?

  3. Can empty string be the substring of any string by definition?

By the way, this $L$ can be transformed to a context free grammar.

Thank you all sincerely.

1

There are 1 best solutions below

1
On BEST ANSWER

Actually it depends on the convention your textbook/course is following. In general, the following holds.

  1. The implicit notion is that your alphabet is $\Sigma = \{0, 1, \# \}$. $\#$ is the symbol itself

  2. For any alphabet $\Theta$, $\Theta^*$ denotes the set of all finite strings that can be constructed using alphabets in $\Theta$. Empty string $\epsilon$ belongs here.
    Thus, $\{0, 1\}^* = \{ \epsilon, 0, 1, 00, 01, 10, 11, 000, 001, 010, 100, ... \}$

  3. Yes