Download as pdf or txt
Download as pdf or txt
You are on page 1of 109

Informática Teórica

Andrés A. Aristizábal P.
aaaristizabal@icesi.edu.co

Departamento de Matemáticas y Estadística

2019-1

1 / 34
Agenda

1 Equivalence relations and countable and uncountable sets


Aims
Discussion and exercises

2 Finite-state machines
Presentation of next topic

2 / 34
Equivalence relations and countable and uncountable sets Aims

Agenda

1 Equivalence relations and countable and uncountable sets


Aims
Discussion and exercises

2 Finite-state machines
Presentation of next topic

3 / 34
Equivalence relations and countable and uncountable sets Aims

Aims

Understand the notion of equivalence class and its properties.


Understand what is a partition.
Know the existent relation between equivalence relations,
equivalence classes and partitions.
Understand the reason why for two sets to have the same
cardinality there is the need of the existence of a bijection
between both of them.
Understand the concept of countable and uncountable sets.

4 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Agenda

1 Equivalence relations and countable and uncountable sets


Aims
Discussion and exercises

2 Finite-state machines
Presentation of next topic

5 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Discussion of the previous reading material

Presentation of concept maps

6 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise
Which of these collections of subsets are partitions of the set of bit strings of length 8?
a) the set of bit strings that begin with 1, the set of bit strings that begin with 00, and the set of
bit strings that begin with 01
b) the set of bit strings that contain the string 00, the set of bit strings that contain the string 01,
the set of bit strings that contain the string 10, and the set of bit strings that contain the string
11
c) the set of bit strings that end with 00, the set of bit strings that end with 01, the set of bit
strings that end with 10, and the set of bit strings that end with 11
d) the set of bit strings that end with 111, the set of bit strings that end with 011, and the set of
bit strings that end with 00
e) the set of bit strings that contain 3k ones for some nonnegative integer k ; the set of bit strings
that contain 3k + 1 ones for some nonnegative integer k ; and the set of bit strings that
contain 3k + 2 ones for some nonnegative integer k .

7 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise

Which of these are partitions of the set Z × Z of ordered pairs of integers?


a) the set of pairs (x, y ), where x or y is odd; the set of pairs (x, y ), where x is even; and the set of pairs (x, y ), where y is
even
b) the set of pairs (x, y ), where both x and y are odd; the set of pairs (x, y ), where exactly one of x and y is odd; and the set of
pairs (x, y ), where both x and y are even
c) the set of pairs (x, y ), where x is positive; the set of pairs (x, y ), where y is positive; and the set of pairs (x, y ), where both
x and y are negative
d) the set of pairs (x, y ), where 3 divides x and 3 divides y ; the set of pairs (x, y ), where 3 divides x and 3 does not divide y;
the set of pairs (x, y ), where 3 does not divide x and 3 divides y ; and the set of pairs (x, y ), where 3 does not divide x and 3
does not divide y
e) the set of pairs (x, y ), where x > 0 and y > 0; the set of pairs (x, y ), where x > 0 and y ≤ 0; the set of pairs (x, y ),
where x ≤ 0 and y > 0; and the set of pairs (x, y ), where x ≤ 0 and y ≤ 0
f) the set of pairs (x, y ), where x 6= 0 and y 6= 0; the set of pairs (x, y ), where x = 0 and y 6= 0; and the set of pairs (x, y ),
where x 6= 0 and y = 0

8 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise
Which of these are partitions of the set of real numbers?
a) the negative real numbers, {0}, the positive real numbers
b) the set of irrational numbers, the set of rational numbers
c) the set of intervals [k , k + 1], k = ..., −2, −1, 0, 1, 2, ...
d) the set of intervals (k , k + 1), k = ..., −2, −1, 0, 1, 2, ...
e) the set of intervals (k , k + 1], k = ..., −2, −1, 0, 1, 2, ...
f) the sets {x + n | n ∈ Z} for all x ∈ [0, 1).

9 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise
List the ordered pairs in the equivalence relations produced by these
partitions of {a, b, c, d, e, f , g}.
a) {a, b}, {c, d}, {e, f , g}
b) {a}, {b}, {c, d}, {e, f }, {g}
c) {a, b, c, d}, {e, f , g}
d) {a, c, e, g}, {b, d}, {f }

10 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise
A partition P1 is called a refinement of the partition P2 if every set in P1
is a subset of one of the sets in P2 . Show that the partition formed from
congruence classes modulo 6 is a refinement of the partition formed
from congruence classes modulo 3.

11 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise
Determine whether each of these sets is finite, countably infinite, or
uncountable. For those that are countably infinite, exhibit a one-to-one
correspondence between the set of positive integers and that set.
a) the negative integers
b) the even integers
c) the real numbers between 0 and 1/2
d) the integers that are multiples of 7.

12 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise
Show that a subset of a countable set is also countable.

13 / 34
Equivalence relations and countable and uncountable sets Discussion and exercises

Exercises

Exercise
Show that if A and B are sets, A is uncountable, and A ⊆ B, then B is
uncountable.

14 / 34
Finite-state machines Presentation of next topic

Agenda

1 Equivalence relations and countable and uncountable sets


Aims
Discussion and exercises

2 Finite-state machines
Presentation of next topic

15 / 34
Finite-state machines Presentation of next topic

Finite-state machines

What is a finite-state machine?

16 / 34
Finite-state machines Presentation of next topic

Finite-state machines

What is a finite-state machine?


Intuitively a finite-state machine is a computational model which
consists of states, transitions between states, inputs and outputs. It is
also known as finite state automaton or a sequential machine.

16 / 34
Finite-state machines Presentation of next topic

Finite-state machines

What is a finite-state machine?


Intuitively a finite-state machine is a computational model which
consists of states, transitions between states, inputs and outputs. It is
also known as finite state automaton or a sequential machine.

Which properties are involved in this model?

16 / 34
Finite-state machines Presentation of next topic

Finite-state machines

What is a finite-state machine?


Intuitively a finite-state machine is a computational model which
consists of states, transitions between states, inputs and outputs. It is
also known as finite state automaton or a sequential machine.

Which properties are involved in this model?

Finiteness.

16 / 34
Finite-state machines Presentation of next topic

Finite-state machines

What is a finite-state machine?


Intuitively a finite-state machine is a computational model which
consists of states, transitions between states, inputs and outputs. It is
also known as finite state automaton or a sequential machine.

Which properties are involved in this model?

Finiteness.
Discreteness.

16 / 34
Finite-state machines Presentation of next topic

Finite-state machines

What is a finite-state machine?


Intuitively a finite-state machine is a computational model which
consists of states, transitions between states, inputs and outputs. It is
also known as finite state automaton or a sequential machine.

Which properties are involved in this model?

Finiteness.
Discreteness.
Sequential action.

16 / 34
Finite-state machines Presentation of next topic

Finite-state machines

What is a finite-state machine?


Intuitively a finite-state machine is a computational model which
consists of states, transitions between states, inputs and outputs. It is
also known as finite state automaton or a sequential machine.

Which properties are involved in this model?

Finiteness.
Discreteness.
Sequential action.
Determinism.

16 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?


Mechanical systems.

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?


Mechanical systems.
Digital electronic systems.

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?


Mechanical systems.
Digital electronic systems.
Pneumatic or hydraulic systems.

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?


Mechanical systems.
Digital electronic systems.
Pneumatic or hydraulic systems.
Chemical systems.

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?


Mechanical systems.
Digital electronic systems.
Pneumatic or hydraulic systems.
Chemical systems.
Physical systems.

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?


Mechanical systems.
Digital electronic systems.
Pneumatic or hydraulic systems.
Chemical systems.
Physical systems.
Information-processing procedures.

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

In which kind of scenarios these machines can be used?


Mechanical systems.
Digital electronic systems.
Pneumatic or hydraulic systems.
Chemical systems.
Physical systems.
Information-processing procedures.
Among others.

17 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which are the characteristics of this model?

18 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which are the characteristics of this model?

Its behavior is defined only at discrete moments t0 , t1 , t2 , ..., tn

18 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which are the characteristics of this model?

Its behavior is defined only at discrete moments t0 , t1 , t2 , ..., tn


At instant t = 0 all parts of the machine are initialized at a known condition.

18 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which are the characteristics of this model?

Its behavior is defined only at discrete moments t0 , t1 , t2 , ..., tn


At instant t = 0 all parts of the machine are initialized at a known condition.
At each moment t, it receives an input symbol s(t) and returns an output symbol
r (t).

18 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which are the characteristics of this model?

Its behavior is defined only at discrete moments t0 , t1 , t2 , ..., tn


At instant t = 0 all parts of the machine are initialized at a known condition.
At each moment t, it receives an input symbol s(t) and returns an output symbol
r (t).
Its input symbols belong to finite input alphabet.

18 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which are the characteristics of this model?

Its behavior is defined only at discrete moments t0 , t1 , t2 , ..., tn


At instant t = 0 all parts of the machine are initialized at a known condition.
At each moment t, it receives an input symbol s(t) and returns an output symbol
r (t).
Its input symbols belong to finite input alphabet.
Its output symbols belong to finite output alphabet.

18 / 34
Finite-state machines Presentation of next topic

Finite-state machines

The sequence of input symbols is known as the stimulus and the output
sequence of symbols as the response.

19 / 34
Finite-state machines Presentation of next topic

Finite-state machines

The sequence of input symbols is known as the stimulus and the output
sequence of symbols as the response.
Its behavior is determined only by the stimulus.

19 / 34
Finite-state machines Presentation of next topic

Finite-state machines

The sequence of input symbols is known as the stimulus and the output
sequence of symbols as the response.
Its behavior is determined only by the stimulus.
Its behavior takes it through a sequence of states, where each state belongs to a
set of states.

19 / 34
Finite-state machines Presentation of next topic

Finite-state machines

The sequence of input symbols is known as the stimulus and the output
sequence of symbols as the response.
Its behavior is determined only by the stimulus.
Its behavior takes it through a sequence of states, where each state belongs to a
set of states.
It has an initial state which describes the condition of its parts just before
receiving the stimulus.

19 / 34
Finite-state machines Presentation of next topic

Finite-state machines

The sequence of input symbols is known as the stimulus and the output
sequence of symbols as the response.
Its behavior is determined only by the stimulus.
Its behavior takes it through a sequence of states, where each state belongs to a
set of states.
It has an initial state which describes the condition of its parts just before
receiving the stimulus.
The total state of the machine at moment t is the n-tuple
q(t) = (q (1) (t), q (2) (t), ..., q (n) (t)) where n is the number of parts and q (n) (t) is
the state assumed by the ith−part at time t.

19 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which is the mathematical description of this model?

20 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which is the mathematical description of this model?

A finite state machine M consists of:


Finite sets S, R y Q, where S is a finite input alphabet, R is a finite output
alphabet and Q is a set of states.

20 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which is the mathematical description of this model?

A finite state machine M consists of:


Finite sets S, R y Q, where S is a finite input alphabet, R is a finite output
alphabet and Q is a set of states.
A state transition function f that gives the next state of M in terms of the current
state and the next input symbol.

20 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which is the mathematical description of this model?

A finite state machine M consists of:


Finite sets S, R y Q, where S is a finite input alphabet, R is a finite output
alphabet and Q is a set of states.
A state transition function f that gives the next state of M in terms of the current
state and the next input symbol.
An output function g that gives the next output symbol of M in terms of the
current state and the next input symbol.

20 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Which is the mathematical description of this model?

A finite state machine M consists of:


Finite sets S, R y Q, where S is a finite input alphabet, R is a finite output
alphabet and Q is a set of states.
A state transition function f that gives the next state of M in terms of the current
state and the next input symbol.
An output function g that gives the next output symbol of M in terms of the
current state and the next input symbol.
A predetermined initial state q(0) = q1 , where q1 ∈ Q, in which M is placed
prior to instant t = 0.

20 / 34
Finite-state machines Presentation of next topic

Finite-state machines

21 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Definition of a Mealy machine

22 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Definition of a Mealy machine


Definition
A transition assigned finite-state machine is 6−tuple where:

Q is a finite set of internal states


S is a finite input alphabet
R is a finite output alphabet
f is the state transition funcion f : Q × S −→ Q
g is the output function g : Q × S −→ R
q1 ∈ Q is the initial state

22 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Representations of Finite-state machines

23 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Representations of Finite-state machines

State table State diagram

23 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

24 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

Solution
S = {a}

24 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

Solution
S = {a}
Q = {A, B, C}

24 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

Solution
S = {a}
Q = {A, B, C}
R = {0, 1, 2}

24 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

Solution
S = {a}
Q = {A, B, C}
R = {0, 1, 2}
Let t be the moment at which the last symbol of a stimulus ω is
presented to M. Then the state q(t) will interpreted as follows:

24 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

Solution
S = {a}
Q = {A, B, C}
R = {0, 1, 2}
Let t be the moment at which the last symbol of a stimulus ω is
presented to M. Then the state q(t) will interpreted as follows:
q(t) = A means |ω| mod 3 = 0

24 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

Solution
S = {a}
Q = {A, B, C}
R = {0, 1, 2}
Let t be the moment at which the last symbol of a stimulus ω is
presented to M. Then the state q(t) will interpreted as follows:
q(t) = A means |ω| mod 3 = 0
B means |ω| mod 3 = 1

24 / 34
Finite-state machines Presentation of next topic

Example
Design a finite-state machine M whose output tells the number of input
symbols, modulo 3, that have been applied.

Solution
S = {a}
Q = {A, B, C}
R = {0, 1, 2}
Let t be the moment at which the last symbol of a stimulus ω is
presented to M. Then the state q(t) will interpreted as follows:
q(t) = A means |ω| mod 3 = 0
B means |ω| mod 3 = 1
C means |ω| mod 3 = 2

24 / 34
Finite-state machines Presentation of next topic

Solution
State table State diagram

25 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Definition of a Moore machine

26 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Definition of a Moore machine


Definition
A state assigned finite-state machine is 6−tuple donde:

Q is a finite set of internal states


S is a finite input alphabet
R is a finite output alphabet
f is a state transition function f : Q × S −→ Q
h is an output function h : Q −→ R
q1 ∈ Q is the initial state

26 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Representations of Finite-state machines

27 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Representations of Finite-state machines

State table State diagram

27 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Example
Design a finite-state machine M that accepts a bit string if and only if it begins with a 1
and contains exactly one 0

28 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Example
Design a finite-state machine M that accepts a bit string if and only if it begins with a 1
and contains exactly one 0

Solution
S = {s | s is a bit string }

28 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Example
Design a finite-state machine M that accepts a bit string if and only if it begins with a 1
and contains exactly one 0

Solution
S = {s | s is a bit string }
Q = {A, B, C, D}

28 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Example
Design a finite-state machine M that accepts a bit string if and only if it begins with a 1
and contains exactly one 0

Solution
S = {s | s is a bit string }
Q = {A, B, C, D}
R = {0, 1}

28 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Solution

29 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Machine complexity
It is interesting to understand the relationship between the number of
states of a machine M and its number of physical components.
Suppose that M is built of n parts, each of which can assume either of
two states.

30 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Machine complexity
It is interesting to understand the relationship between the number of
states of a machine M and its number of physical components.
Suppose that M is built of n parts, each of which can assume either of
two states. Then each total state of M is an n−tuple
q = (q (1) , q (2) , ..., q (n) ) in which q (i) represents the state of the ith-part.

30 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Machine complexity
It is interesting to understand the relationship between the number of
states of a machine M and its number of physical components.
Suppose that M is built of n parts, each of which can assume either of
two states. Then each total state of M is an n−tuple
q = (q (1) , q (2) , ..., q (n) ) in which q (i) represents the state of the ith-part.
The number of total states is 2n .

30 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Machine complexity
It is interesting to understand the relationship between the number of
states of a machine M and its number of physical components.
Suppose that M is built of n parts, each of which can assume either of
two states. Then each total state of M is an n−tuple
q = (q (1) , q (2) , ..., q (n) ) in which q (i) represents the state of the ith-part.
The number of total states is 2n . Therefore, (number of parts) ∼ log2
(number of states).

30 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

Let M be a finite-state machine f : Q × S −→ Q.

31 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

Let M be a finite-state machine f : Q × S −→ Q.

Definition
s
Si f (q, s) = q 0 , we say that q 0 is the s−successor of state q and write q −→ q 0 .

31 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

Let M be a finite-state machine f : Q × S −→ Q.

Definition
s
Si f (q, s) = q 0 , we say that q 0 is the s−successor of state q and write q −→ q 0 .

Definition
If a string of input symbols ω = s(1)s(2)...s(t) takes M from state q = q(0) to state
q 0 = q(t),

31 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

Let M be a finite-state machine f : Q × S −→ Q.

Definition
s
Si f (q, s) = q 0 , we say that q 0 is the s−successor of state q and write q −→ q 0 .

Definition
If a string of input symbols ω = s(1)s(2)...s(t) takes M from state q = q(0) to state
s(1) s(2) s(t)
q 0 = q(t), that is, if q(0) −→ q(1) −→ ... −→ q(t)

31 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

Let M be a finite-state machine f : Q × S −→ Q.

Definition
s
Si f (q, s) = q 0 , we say that q 0 is the s−successor of state q and write q −→ q 0 .

Definition
If a string of input symbols ω = s(1)s(2)...s(t) takes M from state q = q(0) to state
s(1) s(2) s(t)
q 0 = q(t), that is, if q(0) −→ q(1) −→ ... −→ q(t) we say that state q 0 is the
ω
ω−successor of state q and write q =⇒ q 0 .

31 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

Let M be a finite-state machine f : Q × S −→ Q.

Definition
s
Si f (q, s) = q 0 , we say that q 0 is the s−successor of state q and write q −→ q 0 .

Definition
If a string of input symbols ω = s(1)s(2)...s(t) takes M from state q = q(0) to state
s(1) s(2) s(t)
q 0 = q(t), that is, if q(0) −→ q(1) −→ ... −→ q(t) we say that state q 0 is the
ω
ω−successor of state q and write q =⇒ q 0 . Under these conditions q(0)q(1)...q(t) is
called an admissible state sequence for ω.

31 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

By these definitions we have effectively extended the domain of the


state transition function to include all input strings, rather than just
individual input symbols.

32 / 34
Finite-state machines Presentation of next topic

Finite-state machines
State sequences

By these definitions we have effectively extended the domain of the


state transition function to include all input strings, rather than just
individual input symbols. That is, we now have f : Q × S ∗ −→ Q where
ω
f (q, ω) = q 0 if and only if q =⇒ q 0 and f (q, λ) = q for all q ∈ Q.

32 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Automata equivalence

33 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Automata equivalence
Definition
Two automata M1 and M2 are equivalent if and only if

33 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Automata equivalence
Definition
Two automata M1 and M2 are equivalent if and only if
1 Their input and output alphabets are the same: S1 = S2 , R1 = R2

33 / 34
Finite-state machines Presentation of next topic

Finite-state machines

Automata equivalence
Definition
Two automata M1 and M2 are equivalent if and only if
1 Their input and output alphabets are the same: S1 = S2 , R1 = R2
2 For each stimulus, M1 y M2 produce identical responses. That is, if
s1 (t) = s2 (t), t ≥ 1, then r1 (t) = r2 (t), t ≥ 1.

33 / 34
Finite-state machines Presentation of next topic

Next class

Exercises and section


Reading material Finite-State Machines pages 89-107
Exercises: 4.1,4.6,4.10

34 / 34
Finite-state machines Presentation of next topic

Positive rational numbers

How do we prove that the set of rational numbers is countable?

34 / 34
Finite-state machines Presentation of next topic

Positive rational numbers

How do we prove that the set of rational numbers is countable?

We must find a bijection

34 / 34
Finite-state machines Presentation of next topic

Positive rational numbers

How do we prove that the set of rational numbers is countable?

We must find a bijection


We can find it by listing them as a sequence of the form r1 , r2 , ..., rn , ...

34 / 34
Finite-state machines Presentation of next topic

Positive rational numbers

How do we prove that the set of rational numbers is countable?

We must find a bijection


We can find it by listing them as a sequence of the form r1 , r2 , ..., rn , ...
We can see that every positive rational number is the quotient p/q of two
positive integers

34 / 34
Finite-state machines Presentation of next topic

Positive rational numbers

How do we prove that the set of rational numbers is countable?

We must find a bijection


We can find it by listing them as a sequence of the form r1 , r2 , ..., rn , ...
We can see that every positive rational number is the quotient p/q of two
positive integers
We have the positive rational numbers where the denominator is 1 in the first
row, those with the denominator being 2 in the second row and so on and so
forth.

34 / 34
Finite-state machines Presentation of next topic

Positive rational numbers

How do we prove that the set of rational numbers is countable?

We must find a bijection


We can find it by listing them as a sequence of the form r1 , r2 , ..., rn , ...
We can see that every positive rational number is the quotient p/q of two
positive integers
We have the positive rational numbers where the denominator is 1 in the first
row, those with the denominator being 2 in the second row and so on and so
forth.
The key to list the rational numbers in a sequence is to first list those positive
rational numbers p/q with p + q = 2, followed by those with p + q = 3,
continuing with those with p + q = 4, etc.

34 / 34
Finite-state machines Presentation of next topic

Positive rational numbers

How do we prove that the set of rational numbers is countable?

We must find a bijection


We can find it by listing them as a sequence of the form r1 , r2 , ..., rn , ...
We can see that every positive rational number is the quotient p/q of two
positive integers
We have the positive rational numbers where the denominator is 1 in the first
row, those with the denominator being 2 in the second row and so on and so
forth.
The key to list the rational numbers in a sequence is to first list those positive
rational numbers p/q with p + q = 2, followed by those with p + q = 3,
continuing with those with p + q = 4, etc.
When we found a number p/q which already exists, we do not include it.

34 / 34
Finite-state machines Presentation of next topic
11T MHIA017-Rosen-v5.cls May 13, 2011 10:24

Números racionales positivos

2.5 Cardinality of Se

1 2 3 4 5 ...
1 1 1 1 1
Terms not circled
are not listed 1 2 3 4 5 ...
2 2 2 2 2
because they
repeat previously
listed terms
1 2 3 4 5 ...
3 3 3 3 3

1 2 3 4 5 ...
4 4 4 4 4

1 2 3 4 5 ...
5 5 5 5 5
...

...

...

...

FIGURE 3 ...
The Positive Rational Numbers Are Countable.

arrange the positive rational numbers by listing those with denominator q = 1 in the fir
those with denominator q = 2 in the second row, and so on, as displayed in Figure 3.
The key to listing the rational numbers in a sequence is to first list the positive r
34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

How do we prove that the set of real numbers is uncountable?

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

How do we prove that the set of real numbers is uncountable?

We do this by means of a contradiction

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

How do we prove that the set of real numbers is uncountable?

We do this by means of a contradiction


We assume then, that the set of real numbers is countable.

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

How do we prove that the set of real numbers is uncountable?

We do this by means of a contradiction


We assume then, that the set of real numbers is countable.
Since the subset of a countable set is countable as well, then, the the subset of
real numbers from 0 to 1 would be countable too.

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

How do we prove that the set of real numbers is uncountable?

We do this by means of a contradiction


We assume then, that the set of real numbers is countable.
Since the subset of a countable set is countable as well, then, the the subset of
real numbers from 0 to 1 would be countable too.
Under this assumption, the real numbers between 0 and 1 can be listed in some
order.

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

How do we prove that the set of real numbers is uncountable?

We do this by means of a contradiction


We assume then, that the set of real numbers is countable.
Since the subset of a countable set is countable as well, then, the the subset of
real numbers from 0 to 1 would be countable too.
Under this assumption, the real numbers between 0 and 1 can be listed in some
order.
r1 , r2 , r3 , ...

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

We will represent the decimal parts of these numbers in the following way:

34 / 34
candidate for an uncountable set? The first place we might look is the
Finite-state machines
Presentation of next topic
Example 5 we use an important proof method, introduced in 1879 by G
as the Cantor diagonalization argument, to prove that the set of real n
Cantor diagonalization argument
This proof method is used extensively in mathematical logic and in the
EXAMPLE 5 Show that the set of real numbers is an uncountable set.

Solution: To show that the set of real numbers is uncountable, we sup


numbers is countable and arrive at a contradiction. Then, the subset
fall between 0 and 1 would also be countable (because any subset o
countable;
We will represent the decimal parts see Exercise
of these numbers 16).inUnder this assumption,
the following way: the real numbers
listed in some order, say, r1 , r2 , r3 , . . . . Let the decimal representation

r1 = 0.d11 d12 d13 d14 ...


r2 = 0.d21 d22 d23 d24 ...
r3 = 0.d31 d32 d33 d34 ...
r4 = 0.d41 d42 d43 d44 ...
..
.

where dij ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. (For example, if r1 = 0.23794


2, d12 = 3, d13 = 7, and so on.) Then, form a new real number w

34 / 34
candidate for an uncountable set? The first place we might look is the
Finite-state machines
Presentation of next topic
Example 5 we use an important proof method, introduced in 1879 by G
as the Cantor diagonalization argument, to prove that the set of real n
Cantor diagonalization argument
This proof method is used extensively in mathematical logic and in the
EXAMPLE 5 Show that the set of real numbers is an uncountable set.

Solution: To show that the set of real numbers is uncountable, we sup


numbers is countable and arrive at a contradiction. Then, the subset
fall between 0 and 1 would also be countable (because any subset o
countable;
We will represent the decimal parts see Exercise
of these numbers 16).inUnder this assumption,
the following way: the real numbers
listed in some order, say, r1 , r2 , r3 , . . . . Let the decimal representation

r1 = 0.d11 d12 d13 d14 ...


r2 = 0.d21 d22 d23 d24 ...
r3 = 0.d31 d32 d33 d34 ...
r4 = 0.d41 d42 d43 d44 ...
..
.

where dij ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. (For example, if r1 = 0.23794


where dij ∈ {0, 1, 2, 3, 4, 5, 6, 7,
2,8,d12
9}= 3, d13 = 7, and so on.) Then, form a new real number w

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

Now we form a new real number with a decimal expression 0, d1 d2 d3 d4 ... where the
decimals are determined by the following formula:

34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

174 2 / Basic Structures: Sets, Functions, Sequences, Sums, and Matrices


Now we form a new real number with a decimal expression 0, d1 d2 d3 d4 ... where the
decimals are determined by the following formula:
r = 0.d1 d2 d3 d4 . . . , where the decimal digits are dete
!
4 if dii ̸= 4
di =
5 if dii = 4.

(As an example, suppose that r1 = 0.23794


0.09118764 . . . , r4 = 0.80553900 . . . , and so on.
0.4544 . . . , where d1 = 4 because d11 ̸= 4, d2 = 5 be
d4 = 4 because d44 ̸= 4, and so on.)
Every real number has a unique decimal expansion
has a tail end that consists entirely of the digit 9 is excl
A number with a decimal
expansion that terminates equal to any of r1 , r2 , . . . because the decimal expansio
has a second decimal of ri in the ith place to the right of the decimal point,
expansion ending with an Because there is a real number r between 0 and 1 th
34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

174 2 / Basic Structures: Sets, Functions, Sequences, Sums, and Matrices


Now we form a new real number with a decimal expression 0, d1 d2 d3 d4 ... where the
decimals are determined by the following formula:
r = 0.d1 d2 d3 d4 . . . , where the decimal digits are dete
!
4 if dii ̸= 4
di =
5 if dii = 4.

(As an example, suppose that r1 = 0.23794


Every real number has 0.09118764
a unique decimal r4 = 0.80553900
. . . ,expression (that excludes , and so on.
. . . the
0.4544
possibility of the expression . . . ,a where
having tail enddthat=consists
4 because
1 d of̸=the
entirely
11 d =9).5 be
4, digit2
d4 = 4 because d44 ̸= 4, and so on.)
Every real number has a unique decimal expansion
has a tail end that consists entirely of the digit 9 is excl
A number with a decimal
expansion that terminates equal to any of r1 , r2 , . . . because the decimal expansio
has a second decimal of ri in the ith place to the right of the decimal point,
expansion ending with an Because there is a real number r between 0 and 1 th
34 / 34
Finite-state machines Presentation of next topic

Cantor diagonalization argument

174 2 / Basic Structures: Sets, Functions, Sequences, Sums, and Matrices


Now we form a new real number with a decimal expression 0, d1 d2 d3 d4 ... where the
decimals are determined by the following formula:
r = 0.d1 d2 d3 d4 . . . , where the decimal digits are dete
!
4 if dii ̸= 4
di =
5 if dii = 4.

(As an example, suppose that r1 = 0.23794


Every real number has 0.09118764
a unique decimal r4 = 0.80553900
. . . ,expression (that excludes , and so on.
. . . the
0.4544
possibility of the expression . . . ,a where
having tail enddthat=consists
4 because
1 d of̸=the
entirely
11 d =9).5 be
4, digit2
d4 =r is4 not
Therefore, the real number because
equal d ̸=of4,r1and
to44any so because
, r2 , ..., on.) the decimal
Every real number has a unique decimal
expansion of r differs from the decimal expansion of r i in the ith place expansion
to the right
of the decimal point, for each i.
has a tail end that consists entirely of the digit 9 is excl
A number with a decimal
expansion that terminates equal to any of r1 , r2 , . . . because the decimal expansio
has a second decimal of ri in the ith place to the right of the decimal point,
expansion ending with an Because there is a real number r between 0 and 1 th
34 / 34
Finite-state machines Presentation of next topic

Exercises

Exercise
Show that the union of a countable number of countable sets is
countable.

34 / 34
Finite-state machines Presentation of next topic

Exercises

Exercise
Show that the set of all finite bit strings is countable.

34 / 34

You might also like