Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mathematics:languagesandgrammar [2024/10/09 14:40] – created tami | mathematics:languagesandgrammar [2024/10/09 15:12] (current) – [Closure of an alphabet] tami | ||
---|---|---|---|
Line 8: | Line 8: | ||
$$ | $$ | ||
\begin{aligned} | \begin{aligned} | ||
- | L^0 &= \{\Lambda\}\newline | + | L^0 &= \{\Lambda\} \\ |
L^n &= L \cdot L^{n-1}, \text{if} \ n > 0 | L^n &= L \cdot L^{n-1}, \text{if} \ n > 0 | ||
\end{aligned} | \end{aligned} | ||
$$ | $$ | ||
+ | |||
+ | **Example.** If $L = \{a,bb\}$ then the first few powers of $L$ are... | ||
+ | $$ | ||
+ | \begin{aligned} | ||
+ | L^0 &= \{\Lambda\} \\ | ||
+ | L^1 &= L = \{a,bb\} \\ | ||
+ | L^2 &= L \cdot L = \{aa, | ||
+ | L^3 &= L \cdot L^2 = \{aaa, | ||
+ | \end{aligned} | ||
+ | $$ | ||
+ | |||
+ | ==== Closures of a Language ==== | ||
+ | |||
+ | If L is a language over $\Sigma$ (i.e. $L \subset \Sigma^{\ast}$) then **the closure** of $L$ is denoted $L^{\ast}$, and the **positive closure** of $L$ is denoted $L^+$. | ||
+ | |||
+ | $$ | ||
+ | \begin{aligned} | ||
+ | L^{\ast} &= L^0 \cup L^1 \cup L^2 \cup ... \\ | ||
+ | L^+ &= L^1 \cup L^2 \cup L^3 \cup ... | ||
+ | \end{aligned} | ||
+ | $$ | ||
+ | |||
+ | ==== Closure of an alphabet ==== | ||
+ | |||
+ | The closure of $\Sigma$ coincides with out definition of $\Sigma^{\ast}$ as the set f all string over $\Sigma$. In other words, we have a nice representation of $\Sigma^{\ast}$ as follows: | ||
+ | |||
+ | $$ | ||
+ | \Sigma^{\ast} = \Sigma^0 \cup \Sigma^1 \cup \Sigma^1 \cup ... | ||
+ | $$ | ||
+ | |||
+ | Where $\Sigma^k$ denotes the set of strings of length $k$, each of whose symmbols in $\Sigma$. | ||
+ | ===== Grammar ===== | ||
+ | |||
+ | |||