Module_0_1
Module_0_1
Text reading:
A language is a set of strings over alphabet which satisfy some property.
For example:
Consider alphabet Σ = {0,1}.
1. Set of strings over this alphabet of odd length:
L1 = {0, 1, 000, 001, 011, 100, …}
2. Set of strings with equal number of 0 and 1:
L2 = {01, 10, 0011, 0101, 1010, 1100, …}
3. Set of strings that are binary representation of a prime number:
L3 = {10, 11, 101, 111, 1011, 1101, 10001, …}
4. Set of all strings over this alphabet:
L4 = {e, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, …}
also written as Σ∗ .
Important task – membership testing: given a string s over alphabet Σ, and a
language 𝐿, is it true that 𝑠 ∈ L?
How is it related to the theory of computation?
Recall from CP312:
We restrict ourselves to decision problems only – those problems that have yes/no
answer. For example:
- given a binary string, does it have odd length?
- given a binary string, does it contain the same amount of 0 and 1?
- given a number in binary representation, is it prime?
Remark. We will later show that considering only decision problems is not very
restrictive.
Short proof that there are undecidable decision problems…
This is simple counting argument.
Consider the set of all decision problems (languages over fixed alphabet). Is it
countable?
We are talking the cardinality of a set of infinite sets over alphabet… which is the
same as the cardinality of the set of real numbers …
NO!
Consider the set of all decision algorithms (finite strings representing it – eq. Java
program). Is it countable?
YES! (Sort the algorithms descriptions as the strings, as every algorithm is JUST
FINITELY LONG STRING OF CHARACTERS). Count them …