Lecture 2
Lecture 2
Lecture 2
Lec 02
Recursive Definitions
Previous Lecture
• Introduction to defining computer languages
• Alphabets
• Valid/In-valid alphabets
• Length of string
• Reverse of String
• Definition of different languages defined over
alphabets
Kleene Star Closure(*)
• Given Σ, then the Kleene Star Closure of the alphabet Σ, denoted by
Σ*, is the collection of all strings defined over Σ, including Λ.
• It is to be noted that Kleene Star Closure can be defined over any set
of strings.
• Examples
If Σ = {a}
• Then Σ* = {Λ, a, aa, aaa, aaaa, ….}
If Σ = {0,1}
• Then Σ* = {Λ, 0, 1, 00, 01, 10, 11, ….}
If Σ = {aaB, c}
• Then Σ* = {Λ, aaB, c, aaBaaB, aaBc, caaB, cc, ….}
• Note
• Languages generated by Kleene Star Closure of set of strings, are
infinite languages. (except for the two cases coming ahead) (By
infinite language, it is supposed that the language contains infinite
many words, each of finite length).
Kleene Star Closure(*)
If Σ = ¢
• Then Σ* = {Λ}
If S = {Λ}
• Then Σ* = {Λ}
• Because Λ. Λ = Λ
• The Kleene closure of two sets can end up being the
same language.
• Example:
S ={a b ab}, T={a b bb}
• S*= ………………. (language of all strings of a’s and b’s)
• T*= ………………. (language of all strings of a’s and b’s)
• Also (S*)* = S**
PLUS Operation (+)