Вы находитесь на странице: 1из 4

Basic Concepts of Theory of Computation

Alphabet or Vocabulary: - A finite, non-empty, ordered set of symbols or characters is called an alphabet. Alphabets are generally denoted by . Empty set or null set is not an alphabet. String or sentence or word: - A finite sequence of symbols from a given alphabet is called a string over that alphabet. String consisting of no symbols is called empty string and is denoted by . For example: - Let 1 ={ a, b, , z } and 2 ={ 0, 1, , 9 } are alphabets. 1. 2. 3. 4. 5. 6. abb is a string over alphabet 1. 123 is a string over alphabet 2. But ab12 is not a string over any of these alphabets. 3456 is also not a string over alphabet 2, because it is not finite. is a string over any alphabet. Set of natural numbers is not an alphabet because it is not finite.

Unary Alphabet: - Alphabet containing only one symbol is called a unary alphabet. Unary Strings: - Strings over unary alphabet are called unary strings. Binary Alphabet: - Alphabet containing two symbols only is called a binary alphabet. Binary Strings: - Strings over binary alphabet are known as binary strings. Length of a String: - Length of a string is denoted by | | For example: 1. 2. 3. 4. 5. 6. {0, 1} is a binary alphabet. 00111, 1000, 1101111 are the binary strings over the binary alphabet {0, 1}. {1} is a unary alphabet. 1111 is a binary string over the alphabet {0, 1} and a unary string over the alphabet {1}. Length of 111 is 3. | | and string is a string . is a string obtained is the number of symbols present in . Length of a string

Concatenation: - Concatenation of string concatenating I copies of . For example: -

1. If then , , 2. Concatenation of and or concatenation of for concatenation. 3. , where n is any non-negative integer. Substring: - A string

, and will give

. i.e. is the identity

is said to be the substring of another string

if

for some and .

Prefix: - A substring of string called proper prefix of . Suffix: - A substring of string called proper suffix of . For example: 1. 2. 3. 4. 5.

is called the prefix of

if

for some . If

then

is

is called the prefix of

if

for some . If

then

is

, 0, 1, 01, 11 and 011 are the substrings of 011. , 0, 1, 01, 011 are prefixes of 011. , 0, 1, 01 are proper prefixes of 011. , 1, 11, 011 are suffixes of 011. , 1, 11 are proper suffixes of 011. or if anan-1a2a1

Reverse of a string: - Reverse of a string =a1a2an is a string denoted by Permutation of a string: - String reordering the symbols of . For example: 1. 102 is a string. 2. 210, 120, 012 are the permutations of the above string. Powers of an alphabet: 1. The set of all strings over an alphabet is denoted by *. 2. + denotes the set *- . 3. k denotes the set of all strings of length k present in * Note: - 0 = For example: Let = {0, 1} be an alphabet 1. 2. 3. 4. 5. * = { , 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, } + = {0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, } 1 = {0, 1} 2 = {00, 01, 10, 11} 3 = {000, 001, 010, 011, 100, 101, 110, 111} is said to be the permutation of string

can be obtained by

Alphabetically Smaller String: - A string is said to be alphabetically smaller than another string or is said to be alphabetically bigger than , where and are in *, if any of the following conditions is true. 1. is proper prefix of . 2. For some which is a prefix of both and , a and b are prefixes of respectively where, a precedes b in . and

Alphabetically Ordered: - An ordered subset of * is said to be alphabetically ordered if alphabetically smaller than whenever precedes . For example: Let = {0, 1} be an alphabet.

is

1. 01 is alphabetically smaller than 0110. 2. 011011 is alphabetically smaller than 01110 because at 4th position 0 is preceded by 1 in . 3. {0, 00, 000, 001, 01, 010, 011, 1, 10, 100, 101, 11, 110, 111} is in alphabetical order. Canonically or Lexicographically Smaller String: - A string is said to be canonically smaller than another string or is said to be canonically bigger than , where and are in *, if any of the following conditions is true. 1. 2. is shorter in length than . and are identical in length then

is alphabetically smaller than . is canonically

Canonically Ordered: - An ordered subset of * is said to be canonically ordered if smaller than whenever precedes . For example: Let = {0, 1} be an alphabet.

1. 00 is canonically smaller than 0000. 2. 0110 is canonically smaller than 100. 3. 101 is canonically bigger than 100. 4. {0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, 110, 111} is in canonical order. Note: - Canonical order is same as the order in the truth table of a Boolean function. Language: - If is an alphabet which can be understood then any subset of * is said to be a language over or simply a language. For example: Let = {0, 1} be an alphabet, then 1. * is a language 2. is a language 3. {0, 00, 10, 111} is a language 4. Empty set is a language Note: Empty set and because are the languages over every alphabet. has no strings but latter has one string i.e. empty string .

Union and Intersection of two Languages: - Since we know that language is a set therefore union of two languages is same as union of two sets. Similarly intersection of two languages is same as intersection of two sets. Union of two languages L1 and L2 is denoted by L1 L2. Their intersection is denoted by L1 L2. Complementation of a Language: - Similarly complementation of a language is same as complementation o a set. Complementation of a language is denoted by . Difference of two Languages: - Similarly as above difference of two languages can be found out as we find the difference of two sets. Difference of two languages L1 and L2 is denoted by L1-L2. Composition of two languages: - Composition of two languages L1 and L2 is denoted by L1L2 and is defined as a language {xy : x is in L1 and y is in L2}. For example: Let L1 = {1, 0, 11, 001} and L2 = {1, 0, 110, 111, 000} be two languages then 1. 2. 3. 4. 5. 6. L1 L2 = {1, 0, 11, 001, 110, 111, 000} L1 L2 = {1, 0} L1 L2 = {11, 001} L2-L1 = {110, 111, 000} 1 = { , 00, 01, 10, 000, 010, 011, 100, 101, } L1L2 = {11, 10, 1110, 1111, 1000, 01, 00, 0110, 0111, 0000, 111, 110, 11110, 11111, 11000, 0011, 0010, 001110, 001111, 001000}

Li is used to denote the composition of L with itself i times, where i > 0. L0 = Kleene Closure of a Language L: - The set L0UL1UL2UL3 is called Kleene closure or just the closure of L. This set is denoted by L*. Positive Closure of a Language L: - The set L1L2L3 is called the positive closure of L. This set is denoted by L+. Li is the set of those strings that can be obtained by concatenating I strings from L and L* is the set of all those strings that can be obtained by concatenating any number of strings from L. For example: Let L1 = { , 0, 1} and L2 = {01, 11} be two languages. 1. L12 = { , 0, 1, 00, 01, 10, 11} 2. L23 = {010101, 010111, 011101, 011111, 110101, 110111, 111101, 111111} Formal Language: - A language that can be defined by a formal system (i.e. a system that has finite number of axioms and a finite number of rules) is said to be a formal language.

Оценить