Theory of Computation (CS C351) : BITS Pilani
Theory of Computation (CS C351) : BITS Pilani
Theory of Computation (CS C351) : BITS Pilani
Alphabet
A string may contain no symbols and is called as an empty string or null string.
An empty denoted by e
The set of all strings including the empty string, over an alphabet is denoted by
*
Length of tiger is 5
and |e|=0
The value w(j) is jth symbol in the string w where j is between 1 and |w|
Concatenation
Two strings over the same alphabet can be combined to form the third by the
operation of concatenation.
Further w o e = e o w = w
Concatenation is associative.
(X0y)0z = X0(y0z)
5 CSC 351 Theory of Computation Dr.R.Gururaj BITS Pilani, Hyderabad Campus
A string v is a substring of w if and only if there are strings x and y
such that w=xvy
For each string w and each natural number i, the string wi is defined as
w0=e, the empty string
wi+1=wi 0 w for i>= 0
Thus w1=w
come2 = comecome
The reversal of a string w is denoted by wR is the string spelled backwards.
6 CSC 351 Theory of Computation Dr.R.Gururaj BITS Pilani, Hyderabad Campus
Like how we represent infinite sets , the same format can be used to represent
infinite languages.
= {a, b, c}
Hence a language is any set of strings over an alphabet that is any subset of *
Ex: List all binary strings that are formed over {0, 1}
It is not possible.
L= {w : w * }
If n is the no. symbols, and k is the length of the string, we can have nk
strings.
Ex: = {0, 1}
What is a Palindrome?
10 CSC 351 Theory of Computation Dr.R.Gururaj BITS Pilani, Hyderabad Campus
Kleene star of a language L is denoted by L*.
L* is the set of all strings obtained by concatenating zero or more strings from L.