Computation Theory Lec
Computation Theory Lec
Length: w =n
Examples: abba = 4
aa = 2
a =1
EMPTY STRING
A string with no letters:
Observations: =0
w = w = w
String Substring
abbab ab
abbab abba
abbab b
abbab bbab
Prefix and Suffix
abbab
Prefixes Suffixes
abbab w uv
a bbab
prefix
ab bab
suffix
abb ab
abba b
abbab
Another Operation
wn =
ww
w
n
Definition: w0 =
(abba)0 =
The * Operation
* : THE SET OF ALL POSSIBLE
STRINGS FROM ALPHABET
= a,b
* = ,a,b, aa,ab,ba,bb,aaa,aab,
The + Operation
+
: the set of all possible strings from alphabet
except
= a,b
* = ,a,b, aa,ab,ba,bb,aaa,aab,
+ = * −
+ = a,b,aa,ab,ba,bb,aaa,aab,
Languages
A language is any subset of *
Example: = a,b
* = ,a,b, aa,ab,ba,bb,aaa,
Languages:
a,aa,aab
{, abba,baba, aa, ab, aaaaaa}
Note that:
Set size {} = = 0
Set size {} = 1
String length
=0
Operations on Languages
In computation theory, operations on languages
refer to various transformations or combinations of
languages. These operations play a crucial role in
understanding the behavior of different classes of
languages, such as regular languages, context-free
languages, and recursively enumerable languages.
The operations typically modify or combine existing
languages to produce new ones.
Operations on Languages
1. Union (L₁ ∪ L₂)
The union of two languages L₁ and L₂ consists of all strings that are
in L₁ or L₂ or in both.
•Definition:
L1∪L2={w∣w∈L1 or w∈L2}
•Example:
If L₁ = {"ab", "ba"} and L₂ = {"aa", "bb"}, then
L1∪L2={"ab", "ba", "aa", "bb"}
Operations on Languages
2. Concatenation (L₁ · L₂)
The concatenation of two languages L₁ and L₂ consists of all strings
that can be formed by taking a string from L₁ followed by a string from
L₂.
•Definition:
L1⋅L2={xy∣x∈L1,y∈L2}
•Example:
If L₁ = {"ab", "cd"} and L₂ = {"xy", "yz"}, then
L1⋅L2={"abxy", "abyz", "cdxy", "cdyz"}
Operations on Languages
3. Kleene Star (L*)
The Kleene star of a language L consists of all possible
strings that can be formed by concatenating zero or more
strings from L, including the empty string.
•Definition:
L∗={x1x2…xn∣xi∈L,n≥0}
•Example:
If L = {"a", "b"}, then
L∗={ϵ,"a", "b", "aa", "bb", "ab", "ba", "aaa", …}
Operations on Languages