Sets of Strings
Context: FIT1058_MOC · the sets used to encode data symbolically · built from an alphabet · generated by powers and the Kleene star
Quick Revision
- 🎯 Objective: encode data as finite strings over an alphabet ➔ = length- strings, = all finite strings.
- 📦 Core Components: alphabet ➔ empty string ➔ .
- ⚡ Key Constraint: ; is infinite; a language is a subset of .
📝 Core
1. Strings over an Alphabet
- Alphabet ➔ a finite set of characters.
- String ➔ a finite sequence of characters from ; length = number of characters.
- Empty string ➔ , length .
2. Powers and Kleene Star
- Power ➔ = all length- strings, .
- Kleene star ➔ = all finite strings.
- ➔ the alphabet itself.
3. Languages
- Language ➔ any subset of (e.g. valid words).
- Universal set ➔ is the natural for string problems.
- Everything digital ➔ words, integers, files, DNA are subsets of some .
Key identities:
⚖️ Core Decision Matrix
| Object | Meaning | Size |
|---|---|---|
| 1 | ||
| length- strings | ||
| all finite strings | infinite (if ) | |
| language | subset of | varies |
When It Flips: strings are ordered (
ab≠ba), alphabets are not; a length- string is an element of (Cartesian Product), and is the infinite union .
📊 Exam Execution Trace
Manual Execution Trace
by length:
| Step / State | |||
|---|---|---|---|
| 0 (Init) | — | — | — |
| 1 | 0 | 1 | |
| 2 | 1 | 2 | |
| 3 | 2 | 4 |
⚠️ Common Mistakes
- 💡 ➔ has one element (the empty string), ; the empty set has none. A box containing one empty box is not empty.
🧠 Active Recall
Why is different from , and what are their cardinalities?
- Hint: One element vs none.
Answer
- Short answer: has ; has .
- Why: Contains something ➔ holds the empty string; holds nothing.
For list , give , and say why is infinite.
- Hint: No longest string.
Answer
- Short answer: = the 8 length-3 binary strings; .
- Why: Every length ➔ has no longest string when .