Basics
Basics
[email protected]
Definitions
• An Alphabet, Σ is a non-empty set of symbols.
• For example: Σ = {0, 1} is a binary alphabet. Σ = {a, b, .., z} is the
collection of lowercase letters.
• A string or word is a finite sequence of letters drawn from some
alphabet.
• For example: x= 01110101 is a binary string. “Life is good” is also a
string.
• Empty strings denoted by " is a string with zero occurrences of letters.
Empty strings can be from any alphabet.
Definitions
• An Alphabet, Σ is a non-empty set of symbols.
• For example: Σ = {0, 1} is a binary alphabet. Σ = {a, b, .., z} is the
collection of lowercase letters.
• A string or word is a finite sequence of letters drawn from some
alphabet.
• For example: x= 01110101 is a binary string. “Life is good” is also a
string.
• Empty strings denoted by " is a string with zero occurrences of letters.
Empty strings can be from any alphabet.
Definitions
• An Alphabet, Σ is a non-empty set of symbols.
• For example: Σ = {0, 1} is a binary alphabet. Σ = {a, b, .., z} is the
collection of lowercase letters.
• A string or word is a finite sequence of letters drawn from some
alphabet.
• For example: x= 01110101 is a binary string. “Life is good” is also a
string.
• Empty strings denoted by " is a string with zero occurrences of letters.
Empty strings can be from any alphabet.
Definitions
• An Alphabet, Σ is a non-empty set of symbols.
• For example: Σ = {0, 1} is a binary alphabet. Σ = {a, b, .., z} is the
collection of lowercase letters.
• A string or word is a finite sequence of letters drawn from some
alphabet.
• For example: x= 01110101 is a binary string. “Life is good” is also a
string.
• Empty strings denoted by " is a string with zero occurrences of letters.
Empty strings can be from any alphabet.
Definitions
• An Alphabet, Σ is a non-empty set of symbols.
• For example: Σ = {0, 1} is a binary alphabet. Σ = {a, b, .., z} is the
collection of lowercase letters.
• A string or word is a finite sequence of letters drawn from some
alphabet.
• For example: x= 01110101 is a binary string. “Life is good” is also a
string.
• Empty strings denoted by " is a string with zero occurrences of letters.
Empty strings can be from any alphabet.
Definitions
• Length of a string, x, is the sum of occurrences of its symbols,
denoted by |x|.
• For example: if x = 01110101 then |x|= 8, the length of “Life if good”
is 12.
• The set of all strings composed from letters in Σ is denoted by Σ*.
• For example: if Σ = { 0, 1} then Σ*= {", 0, 1, 00, 01, 10, 11, ...}
• The set of all non-empty strings composed from letters in Σ is
denoted by Σ ! .
Definitions
• Length of a string, x, is the sum of occurrences of its symbols,
denoted by |x|.
• For example: if x = 01110101 then |x|= 8, the length of “Life is good”
is 12.
• The set of all strings composed from letters in Σ is denoted by Σ*.
• For example: if Σ = { 0, 1} then Σ*= {", 0, 1, 00, 01, 10, 11, ...}
• The set of all non-empty strings composed from letters in Σ is
denoted by Σ ! .
Definitions
• Length of a string, x, is the sum of occurrences of its symbols,
denoted by |x|.
• For example: if x = 01110101 then |x|= 8, the length of “Life is good”
is 12.
• The set of all strings composed from letters in Σ is denoted by Σ*.
• For example: if Σ = { 0, 1} then Σ*= {", 0, 1, 00, 01, 10, 11, ...}
• The set of all non-empty strings composed from letters in Σ is
denoted by Σ ! .
Definitions
• Length of a string, x, is the sum of occurrences of its symbols,
denoted by |x|.
• For example: if x = 01110101 then |x|= 8, the length of “Life is good”
is 12.
• The set of all strings composed from letters in Σ is denoted by Σ*.
• For example: if Σ = { 0, 1} then Σ*= {", 0, 1, 00, 01, 10, 11, ...}
• The set of all non-empty strings composed from letters in Σ is
denoted by Σ ! .
Definitions
• Length of a string, x, is the sum of occurrences of its symbols,
denoted by |x|.
• For example: if x = 01110101 then |x|= 8, the length of “Life is good”
is 12.
• The set of all strings composed from letters in Σ is denoted by Σ*.
• For example: if Σ = { 0, 1} then Σ*= {", 0, 1, 00, 01, 10, 11, ...}
• The set of all non-empty strings composed from letters in Σ is
denoted by Σ ! .
Definitions
• The set of all strings of length k composed from letters in Σ is denoted
by Σ " .
• For example: Σ = {0, 1} then Σ # = {00, 01, 10, 11}.
• Σ $ = 000, 001, 010, 011, 100, 101, 110, 111 .
• Size of Σ " = |Σ|"
• A language is a collection of strings over an alphabet.
• For example: the language of palindromes over the binary alphabet is
{", 0, 1, 00, 11, 000, 010, 101, 111,…}
Definitions
• The set of all strings of length k composed from letters in Σ is denoted
by Σ " .
• For example: Σ = {0, 1} then Σ # = {00, 01, 10, 11}.
• Σ $ = 000, 001, 010, 011, 100, 101, 110, 111 .
• Size of Σ " = |Σ|"
• A language is a collection of strings over an alphabet.
• For example: the language of palindromes over the binary alphabet is
{", 0, 1, 00, 11, 000, 010, 101, 111,…}
Definitions
• The set of all strings of length k composed from letters in Σ is denoted
by Σ " .
• For example: Σ = {0, 1} then Σ # = {00, 01, 10, 11}.
• Σ $ = 000, 001, 010, 011, 100, 101, 110, 111 .
• Size of Σ " = |Σ|"
• A language is a collection of strings over an alphabet.
• For example: the language of palindromes over the binary alphabet is
{", 0, 1, 00, 11, 000, 010, 101, 111,…}
Definitions
• The set of all strings of length k composed from letters in Σ is denoted
by Σ " .
• For example: Σ = {0, 1} then Σ # = {00, 01, 10, 11}.
• Σ $ = 000, 001, 010, 011, 100, 101, 110, 111 .
• Size of Σ " = |Σ|"
• A language is a collection of strings over an alphabet.
• For example: the language of palindromes over the binary alphabet is
{", 0, 1, 00, 11, 000, 010, 101, 111,…}
Definitions
• The set of all strings of length k composed from letters in Σ is denoted
by Σ " .
• For example: Σ = {0, 1} then Σ # = {00, 01, 10, 11}.
• Σ $ = 000, 001, 010, 011, 100, 101, 110, 111 .
• Size of Σ " = |Σ|"
• A language is a collection of strings over an alphabet.
• For example: the language of palindromes over the binary alphabet is
{", 0, 1, 00, 11, 000, 010, 101, 111,…}
Definitions
• The set of all strings of length k composed from letters in Σ is denoted
by Σ " .
• For example: Σ = {0, 1} then Σ # = {00, 01, 10, 11}.
• Σ $ = 000, 001, 010, 011, 100, 101, 110, 111 .
• Size of Σ " = |Σ|"
• A language is a collection of strings over an alphabet.
• For example: the language of palindromes over the binary alphabet is
{", 0, 1, 00, 11, 000, 010, 101, 111,…}
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.
Examples
• If Σ = {$, &, '} then what is Σ ! ?
• There must be 3! = 9 strings in this set.
• Σ ! = aa, ab, ac, ba, bb, bc, ca, cb, 'c .
• What about Σ" ?
• Σ" has three strings. Σ" = $, &, '
• Is Σ" the same as Σ?
• The answer is no! Elements in Σ are called symbols and they are letters
whereas the elements in Σ" are strings they just happen to have length 1.
• Do not mix types in programming.