[LAC]Introduction to languages

Introduction to languages


Overview

In this year, i enrolled a module called Language and Computation which will cover automata theory, languages and computation.
In the very first view, we need to define what are languages and the related terms.
Reference: Introduction to Automata Theory, Languages, and Computation.
A language is a (possibly infinite) set of words.
A word is a finite sequence (or string) of symbols.
ε denotes the empty word, the sequence of zero symbols.
A symbol is anything, but it has to come from an alphabet Σ which is a finite set
A common (and important) instance is Σ = {0, 1}.
ε, the empty word, is never a symbol of an alphabet.

alphabet

so what is the difference between “alphabet” and “symbol”?
On the reference book 1.5.1, it says, “an alphabet is a finite, non-empty set of symbols”
Conventionally, we use the symbol Σ for an alphabet. Common alphabets include:
1. Σ = {0, 1}, the binary alphabet
2. Σ = {a, b, …, z}, the set of all lower-case letters
3. The set of all ASCII characters, or the set of all printable ASCII characters

power of an alphabet

We define Σ^k to be the set of strings of length k, each of whose symbols is in Σ.
enter image description here
Note that there is a slight confusion between Σ and Σ1. The former is an alphabet, its members 0 and 1 are symbols. The latter is a set of strings; its members are the strings 0 and 1, each of which is of length 1.

All words over an alphabet

enter image description here
The set of all words(strings) over an alphabet Σ is conventionally denoted Σ. For instance, {0, 1} = {ε, 0, 1, 00, 01, 10, 11, 000, …}
Is Σ* always non-empty?
Yes because alphabet is nonempty set of symbols! and even empty word belongs to Σ*
note that if we say xw, it is the concatenation of strings which is x concatenated with w.
enter image description here

Exam questions

Is the following statement correct?
The empty word ε belongs to all languages
No, it is not correct
Let’s review the relationship between alphabet Σ, language and Σ*(a set of words)
A set of strings all of which are chosen from some Σ*, where Σ is a particular alphabet, is called language.
So empty word is in Σ*, and it can be language
But it doesn’t belongs to all languages, like the picture above, {a}, {b} both doesn’t have empty word.

评论

此博客中的热门博文

[MLE] W2 Multivariate linear regression

[MLE] W1 Introduction

[AIM] MetaHeuristics