Theory of Computation 11
Theory of Computation 11
"String: A finite sequence of symbols from an alphabet. E.g., if Σ = {a, b}, then
'aabb' is a string over Σ."
Length of a String
Content:
Define the length of a string, denoted by |w|.
Provide examples of strings and their lengths.
Text:
"The length of a string w, denoted as |w|, is the number of symbols in w."
"Examples: For w = 'abc', |w| = 3. For w = ε (empty string), |ε| = 0."
Types of Strings
Content:
Define common types of strings: empty string, prefix, suffix, and substring.
Text:
"Empty String (ε): A string with zero length."
"Prefix: A substring that occurs at the start. E.g., 'ab' is a prefix of 'abc'."
"Suffix: A substring that occurs at the end. E.g., 'bc' is a suffix of 'abc'."
"Substring: Any sequence of symbols within the string. E.g., 'b' is a
substring of abc'."
.
String Operations
Content:
Discuss common string operations: concatenation, reversal, and repetition.
Text:
Concatenation: Combining two strings. If w1 = 'abc' and w2 = 'de', then
w1 · w2 ='abcde'.
Reversal: Reversing the order of symbols in a string. If w = 'abc', then w^R
= 'cba'.
Repetition: Repeating a string n times. If w = 'a' and n = 3, then w^3 =
'aaa'.
Language and Strings
Content:
Define a language in terms of strings and an alphabet.
Text:
"A language (L) is a set of strings formed from an alphabet Σ."
"Example: If Σ = {0, 1}, a language could be L = {ε, 0, 1, 00, 01}."
Closure Properties of Strings
Languages are closed under union, concatenation, and Kleene star.
"Union: L1 ∪ L2 contains all strings from both L1 and L2."
"Concatenation: L1 · L2 contains strings formed by concatenating strings
from L1 and L2."
"Kleene Star (L*): The set of all possible concatenations of strings from L,
including ε."
.
SUBMITTED BY
MUHAMMAD YANEESH K
3RD BCA
9