diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index b2709eb..c305441 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -78,7 +78,7 @@ } ], "direction": "horizontal", - "width": 322.50418853759766 + "width": 349.50418853759766 }, "right": { "id": "8a65bc0c1d4d98f2", diff --git a/00 Inbox/29593852 - Strings.md b/00 Inbox/29593852 - Strings.md index 95171d6..2f39ef6 100644 --- a/00 Inbox/29593852 - Strings.md +++ b/00 Inbox/29593852 - Strings.md @@ -1,8 +1,8 @@ --- created: 2026-04-08 08:52 -course: -topic: -related: +course: "[[29593850 - Automationtheory]]" +topic: "#languages #string #character #kleene #regularExpressions" +related: "[[29593850 - Automationtheory]]" type: lecture status: 🔴 tags: @@ -11,7 +11,7 @@ tags: ## 📌 Summary > [!abstract] -> +> Overview of lecture 1 on `Wednesday, 2026/Apr/08` --- @@ -25,16 +25,45 @@ $Sigma = {a, 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$. +The empty string is denoted by $epsilon$, this is the neutral element. ### Concatenation -String can be concatenated, where one string is appended to another. This operation is +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_) +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^*$ \ No newline at end of file +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_. \ No newline at end of file