Chapter 1
Chapter 1
4
Computability Theory
Sets
A set is a group of elements represented as a unit.
For example : S ={a, b, c} a set of 3 elements
Functions
Let f be a function defined on a set A and taking values to a set B. Set A is called the
domain of f; set B is called the range of f.
Graphs
Is a visual representation of a set and a relation.
7
Mathematical notations and Terminology
(con’d)
Boolean Logic
Boolean logic, boolean values (True and False), boolean operations, negation (NOT),
conjunction (AND), disjunction (OR), operands of an operation, exclusive OR (XOR),
8
Strings and Languages
Empty String: The string with zero occurrences of symbols from and is
denoted e or .
▰ Length of String: Number of symbols in the string
▻ The length of a string w is usually written |w|
▻ |1010| = 4
▻ |e| = 0
▻ |uv| = |u| + |v|
▰ Reverse : wR
▻ If w = abc, wR = cba 10
Strings and Languages(con’d)
Example: = {0, 1}
1 = = {0, 1}
2 = {00, 01, 10, 11}
0 = {e} 11
Strings and Languages(con’d)
Exercise 1:The language L consists of strings over {a,b} in which each string begins with an a
should have an even length
aa, ab L
aaaa,aaab,aaba,aabb,abaa,abab,abba,abbb L
baa L
a
Exercise 2:The language L consists of strings over {a,b} in which each occurring of b is immediately
preceded by an a
eL
aL
abaab L
bb L
bab L
abb L 16
Strings and Languages(con’d)
Exercise 3:
The language L = {a,b}*{bb}{a,b}* = *{bb}*, consists of the strings over {a,b} that contain the
substring bb
bb L
abb L
bbb L
aabb L
bbaaa L
bbabba L
abab L
bab L
bL
Exercise 2:The language L consists of strings over {a,b} in which each occurring of b is immediately
preceded by an a
eL
aL 17
abaab L
Homework
18