Professional Documents
Culture Documents
Introduction to languages
There are two types of languages
▪ Formal Languages (Syntactic languages)
▪ concerned with form only and not meaning
Example
If Σ= {a, b} then
a, abab, aaabb, ababababababababab
◼ Note that and 1 are different. The first is the alphabet; its
members are 0,1,2. The second is the set of strings whose
members are the strings 0,1,2, each a string of length 1.
Languages
Length of Strings
The length of string s, denoted by |s|, is the number of letters/symbols
from alphabet in the string.
Example
Σ={a,b}
s = ababa
|s| = 5
Example
Σ= {a, B, b, d}
s = BaBbabBd
Tokenizing = (B)(a)(B)(b)(a)(b)(B)(d)
|s| = 8
Theory of Automata 22
How to prove a certain word is
in the closure language S*
◼ We must show how it can be written as a concatenation of
words from the base set Σ.
Theory of Automata 23
Examples
Example:
If Σ = {x}
Then Σ* = {Λ, x, xx, xxx, xxxx, ….}
Example:
If Σ = {0,1}
Then Σ* = {Λ, 0, 1, 00, 01, 10, 11, ….}
Example:
If Σ = {a, c}
Then Σ* = {Λ, a, c, aa, ac, ca, cc, aac, aca, caa, ….}
Note
Set size {} = = 0
String length =0
◼ Word that has no letters () and language that
has no words . ᶲ
◼ Is a part of ᶲ ?