Files
uni_notes/00 Inbox/29593852 - Strings.md
2026-04-08 09:35:01 +02:00

2.3 KiB

created, course, topic, related, type, status, tags
created course topic related type status tags
2026-04-08 08:52 29593850 - Automationtheory #languages #string #character #kleene #regularExpressions 29593850 - Automationtheory lecture 🔴
university

📌 Summary

[!abstract] Overview of lecture 1 on Wednesday, 2026/Apr/08


📝 Content

Alphabets

Alphabets are formal, non-empty, sets of symbols (usually lowercase letters). They are denoted by Sigma.

Sigma = {a, b}

Alphabet Sigma contains the characters a and b.

Strings

A string is a set of letters. If there is an alphabet Sigma = {a,b} then abba is a string made from that alphabet. The empty string is denoted by epsilon, this is the neutral element.

Concatenation

String can be concatenated, where one string is appended to another. "apple" dot "pie" = "applepie"

&x = "apple" \ &y = "pie" \ &x dot y = "applepie"

Order of operations / Brackets do not matter. Any string concatenated with the empty string epsilon will result in itself.

Exponentiation

Reversing / Mirroring

For a string x = a_1 a_2 ... a_(n-1) a_n of length n, it's mirrored string is given by

x^("Rev") = a_n a_(n-1)...a_2 a_1

Kleene Star

Denoted by Sigma^*. The Kleene Star (or Kleene Closure) gives an infinite amount of strings made up of the characters of the alphabet.


Sigma^* {a, b} = {epsilon, a, b, "aa", "ab", "ba", "bb", "aaa", "aab", ...}

Example of the Kleene Star of the alphabet {a, b}

Formal Languages

A formal language of the alphabet Sigma is a subset L of Sigma^*

Finite representation of languages

Goal: Represent a language using finite information

Using set notation

S = {a^n b^m bar n, m >= 0} = {epsilon, a, b, "aa", "ab", ...}

This is very inefficient.

Using regular expressions

A regular expression r over an alphabet Sigma is defined recursively:

  • emptyset, epsilon and each a in Sigma are regular expression, which represent the Languages L(emptyset) = emptyset, L(epsilon) = {epsilon} and L(a) = {a}
  • If r and s are regular expressions then
    • (r+s) - !! Complete from leture notes

Regular languages

A language L that can be described by a regular expression r (i. e. L(r) = L) is called regular.