Theory of Computation · Unit 1 · 3 hrs
Basic Foundations
Exam-focused notes for Basic Foundations (Theory of Computation, CSC262): what the TU syllabus asks and how it has actually been tested, with 4 solved past questions from this unit.
Basic Foundations in short
This unit lays the mathematical groundwork for the theory of computation and then opens the subject proper: what an abstract machine is, the alphabets and strings it operates on, and the languages those strings form.
What this unit covers
- Review of Set Theory
- Logic
- Functions
- Proofs
- Automata, Computability and Complexity
- Complexity Theory
- Computability Theory
- Automata Theory
- Basic concepts of Automata Theory
- Alphabets
- Power of Alphabet
- Kleen Closure Alphabet
- Positive Closure of Alphabet
- Strings
- Empty String
- Substring of a string
- Concatenation of strings
- Languages
- Empty Language
Positive Closure of Alphabet
2081 · 5 marks
Does machine always refer to hardware? Justify. Define positive closure and Kleene closure. [5]
2080.1 · 5 marks
Differentiate Kleen closure from positive closure. Compute positive and Kleen closure of {ab}. [5]
Strings
2080 · 5 marks
Define string, substring, empty string, and empty language over alphabet {a,b}. [5]
Show solved answerHide answer
String, Substring, Empty String, and Empty Language over {a, b}
1. String
A string (also called a word) is a finite sequence of symbols taken from an alphabet.
Over the alphabet Σ = {a, b}, a string is any finite arrangement of the symbols a and b.
Examples over {a, b}:
ababaabbbaabab
Formally, if Σ = {a, b}, then Σ* (Kleene closure) gives the set of all possible strings over {a, b}, including the empty string:
Σ* = {ε, a, b, aa, ab, ba, bb, aaa, aab, ...}
2. Substring
A string v is called a substring of string w if v appears as a contiguous sequence of symbols within w (obtained by removing zero or more leading symbols and zero or more trailing symbols from w).
Example over {a, b}:
Let w = abab
Substrings of w include:
a,b,ab,ba,aba,bab,abab,ε
Note: Every string is a substring of itself, and the empty string ε is a substring of every string.
3. Empty String
The empty string (denoted ε or sometimes λ) is a string that contains no symbols at all. Its length is 0.
Key properties of ε over {a, b}:
| Property | Result |
|---|---|
| Length of ε | |ε| = 0 |
| Concatenation with any string x | ε x = x ε = x |
| ε belongs to | Σ* for any alphabet Σ |
Example:
If x =
ab, then ε · x =aband x · ε =ab
The empty string acts as the identity element for string concatenation.
4. Empty Language
A language over an alphabet Σ is a set of strings, i.e., a subset of Σ*.
The empty language (denoted ∅) is a language that contains no strings at all.
Over {a, b}:
∅ = { } (a set with no members)
Important distinction:
| Concept | Notation | Contains |
|---|---|---|
| Empty string | ε | A string of length 0 |
| Empty language | ∅ | No strings whatsoever |
| Language with only empty string | {ε} | Exactly one string (ε) |
Note: ∅ ≠{ε}. The empty language has no strings, whereas {ε} is a language containing one string (the empty string).
The empty language ∅ is a valid language over any alphabet, including {a, b}.
Summary Table
| Term | Definition | Example over {a,b} |
|---|---|---|
| String | Finite sequence of symbols from Σ | ab, bba, aab |
| Substring | Contiguous part of a string | ab is substring of aab |
| Empty String (ε) | String with no symbols, length = 0 | ε |
| Empty Language (∅) | Language containing no strings | ∅ = { } |
Alphabets
2078 · 5 marks
Define the term alphabet, prefix and suffix of string, concatenation and Kleen closure with example. [5]
Make Unit 1 stick
Practice CSC262 with flashcards & quizzes