Automata Theory and Formal Languages: Alphabets, Strings, and Languages
Alphabets
An alphabet is defined as any non-empty finite set of symbols.
The individual elements within an alphabet are referred to as symbols of that alphabet.
Notation: The symbol (sigma) is used to denote an alphabet. Alternatively, upper case letters may be used.
Example 1:
Strings
A string (denoted by ) over an alphabet is a finite sequence of symbols chosen from that specific alphabet.
Syntax: Symbols within a string are written sequentially without the use of commas to separate them.
Example 2:
Over alphabet , possible strings include . Specific examples include , , and .
Over alphabet , possible strings include . Specific examples include , , , and .
Core Symbols and Glossary
(sigma): Alphabet
: Set notation
: String
: Cardinality (the size or number of elements)
(lembda): Empty string
(phi): Prefix
(chi): Suffix
: copies of the string
: Language
: Kleene Closure of
Union: Combining sets
String Attributes and Operations
Length of a String: The length of string , denoted by , is the total count of symbols composing that string.
Example 3: If , then .
Empty String: A string with a length of 0 is called an empty or null string. It is denoted by the symbol (lembda). Therefore, .
Substring: A string is considered a substring of if the sequence of symbols in appears consecutively within .
Example 4: If and , is a substring of because the symbols in "ana" are found consecutively in the word "banana."
Concatenation: The concatenation of string (length ) and string (length ) is the sequence formed by appending string directly to the end of string .
Formal representation: If and , then the concatenation is the sequence .
Example 5: If and , the concatenation is .
Prefixes and Suffixes: In the context where string :
(phi) is the prefix of .
(chi) is the suffix of .
Proper Prefix: is a proper prefix if .
Proper Suffix: is a proper suffix if .
Contextual Example: In the word , () is a proper prefix and () is a proper suffix.
String Repetition (): This notation signifies the repetition of string for a total of copies.
Example 6: If :
Languages and Formal Notation
Language (L): A language is a set containing all possible strings derived from a given alphabet that satisfy a specific criterion or condition.
Example 7: A language defined as the set of strings of 's and 's where no two 's appear consecutively.
Defining Languages: There are multiple methodologies for defining a language:
: Notation for a language defined by a specific machine .
: Notation for a language defined by a grammar .
: Notation for a machine designed to accept a specific language .
: Notation for a grammar that recognizes a specific language .
Language Characteristics/Notation: Describes characteristics of a language using rules and symbols.
Example 8: Given
If , the notation is . This is read as " copies of such that is greater than or equal to 1."
If , the notation is . This is read as " copies of such that is greater than or equal to 0."
Operations on Languages
Given specific language sets and , the following operations apply:
Union (): This operation combines all elements from both sets.
.
Concatenation ( or ): This involves concatenating every individual element in the first set with every individual element in the second set.
.
Kleene Closure (): This set includes every possible string that can be formed from language , inclusive of the empty string ().
Positive Closure (): This includes the set of all strings consisting of one or more symbols, specifically excluding the empty string.
Formula: .