Theory of Computation
Mathematical Preliminaries
Vladimir Kulyukin
Department of Computer Science
Utah State University
ww...
Outline
●
What is Theory of Computation?
●
Alphabets, Strings, Languages
●
Numbers, Sets, Set Formers
●
Proofs
www.vkedco....
What is Theory of Computation?
www.vkedco.blogspot.com
What is Theory of Computation?
●
Theoretical Computer Science can be broadly
divided into algorithms and computability (ak...
Basic Methodology
●
Abstraction of hardware details
●
Focus on what can be solved, not on how it can
be solved
●
Problem a...
Basic Methodology
●
Abstraction of hardware details
●
Focus on what can be solved, not on how it can
be solved
●
Problem a...
Abstraction of Hardware Details
Junun Mark III Robot
Smartphone
Personal Computer
While these devices have very different ...
Focus on What, Not How
●
Problem: sorting a sequence of numbers from smallest
to highest
●
Algorithmic answer: merge sort,...
Automata & Languages
●
Finite State Automata/Regular Expressions – Regular
Languages
●
Push Down Automata/Stack Machines –...
Automata & Languages
www.vkedco.blogspot.com
Alphabets, Languages, Strings
www.vkedco.blogspot.com
Alphabets
●
An alphabet is a finite set of symbols
●
The Greek letter Σ is typically used to denote an
alphabet
● Examples...
Strings
●
A string is a finite sequence of symbols
●
ε is the empty string; ε is not a symbol in any
alphabet; it denotes ...
Strings
●
The length of a string is the number of
symbols/characters in it
●
The length of a string is denoted with a pair...
String Concatenation
●
The concatenation of two strings x and y is the
strings containing the symbols of x followed by
the...
Power Notation in String Concatenation
●
When a natural number n is used as an exponent
on a string, it denotes the concat...
Languages
●
A language is a set strings over a alphabet
●
Note that we can define multiple languages over
the same alphabe...
Kleene Closures of Alphabets
●
The Kleene closure of an alphabet is the set
of all strings over it
●
If Σ is an alphabet, ...
Numbers, Sets, Set Formers
www.vkedco.blogspot.com
Natural Numbers
●
N is a set of natural numbers.
●
N includes 0, 1, 2, 3, …
●
Some texts exclude 0 from the set of natural...
Sets
{ }
{ } { }ε≠
∅ sets.emptyareor
www.vkedco.blogspot.com
Set Former Notation
{ }{ } { }
{ } { }
{ } { }{ }
.orbyfollowedisor
wherestringsofsettheis,,,|
s.'ofnumberthe
toequaliss'o...
Subsets
.
:seteveryofsubsetaissetemptyThe
.andif)onlyand(ififf
R
RSSRSR
⊆∅
⊆⊆=
www.vkedco.blogspot.com
Proper Subsets
.andiff SRSRSR ≠⊆⊂
www.vkedco.blogspot.com
Set-Theoretic Equalities
s.complementtheofuniontheis
onintersectitheofcomplementthei.e.,
s.complementtheofonintersectithe
...
Sets and N-Tuples
( ) ( ) ( ).,,,,,,
:matterdoessequencesainelementsoforderThe
}.,,{},,{},,{
:matternotdoessetainelementso...
Sets and N-tuples
}.,...,,|),...,,{(
...
:followsasdefinedissettheseofproduct
CartesianThen thesets.are,...,,Let
221121
21...
Predicates
.0)(or1)(or)(or)(either
eachforsuch thatonfunction
valued-BooleantotalaispredicateA
====
∈
aPaPFaPTaP
SaS
P
www...
Predicates
R.offunctionsticcharacteriais)(
}1)(|{
Then
if0
if1
)(
set.abeLet
xP
xPxR
Rx
Rx
xP
R
==



∉
∈
=
www.vkedco....
Proofs
www.vkedco.blogspot.com
Proof Methods
●
In CS, there are, broadly speaking, two methods of
proving things: formal and empirical
●
Formal methods a...
Mathematical Proofs
●
The corner stone of the formal method is the
mathematical proof
●
Many online and printed CS materia...
Proof Techniques
●
Proof techniques are independent of their subject matter: valid
proofs in calculus use the same proof t...
Learning to Love the P-Word
●
General advice: Do not be afraid of proofs; one can be a
mediocre theorem prover but a very ...
Upcoming SlideShare
Loading in …5
×

Theory of Computation: Math Preliminaries: Alphabets, Strings, Languages, Automata, Numbers, Sets, Set Formers, Proofs

951 views
804 views

Published on

Math Preliminaries: Alphabets, Strings, Languages, Automata, Numbers, Sets, Set Formers, Proofs

Published in: Science
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
951
On SlideShare
0
From Embeds
0
Number of Embeds
205
Actions
Shares
0
Downloads
24
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Theory of Computation: Math Preliminaries: Alphabets, Strings, Languages, Automata, Numbers, Sets, Set Formers, Proofs

  1. 1. Theory of Computation Mathematical Preliminaries Vladimir Kulyukin Department of Computer Science Utah State University www.vkedco.blogspot.com
  2. 2. Outline ● What is Theory of Computation? ● Alphabets, Strings, Languages ● Numbers, Sets, Set Formers ● Proofs www.vkedco.blogspot.com
  3. 3. What is Theory of Computation? www.vkedco.blogspot.com
  4. 4. What is Theory of Computation? ● Theoretical Computer Science can be broadly divided into algorithms and computability (aka theory of computation) ● The field of algorithms answers the question – how something can be computed? ● The field of computability answers the question – can something be computed? www.vkedco.blogspot.com
  5. 5. Basic Methodology ● Abstraction of hardware details ● Focus on what can be solved, not on how it can be solved ● Problem analysis in terms of devices (aka automata) and inputs (aka strings, languages) www.vkedco.blogspot.com
  6. 6. Basic Methodology ● Abstraction of hardware details ● Focus on what can be solved, not on how it can be solved ● Problem analysis in terms of devices (aka automata) and inputs (aka strings, languages) www.vkedco.blogspot.com
  7. 7. Abstraction of Hardware Details Junun Mark III Robot Smartphone Personal Computer While these devices have very different hardware, they have the same computational model www.vkedco.blogspot.com
  8. 8. Focus on What, Not How ● Problem: sorting a sequence of numbers from smallest to highest ● Algorithmic answer: merge sort, heap sort, quick sort, etc ● Computability answer: sorting is primitive recursive www.vkedco.blogspot.com
  9. 9. Automata & Languages ● Finite State Automata/Regular Expressions – Regular Languages ● Push Down Automata/Stack Machines – Context-Free Languages ● Linear Bounded Automata – Context Sensitive Languages ● Turing Machines/Universal Programs – Recursively Enumerable Languages www.vkedco.blogspot.com
  10. 10. Automata & Languages www.vkedco.blogspot.com
  11. 11. Alphabets, Languages, Strings www.vkedco.blogspot.com
  12. 12. Alphabets ● An alphabet is a finite set of symbols ● The Greek letter Σ is typically used to denote an alphabet ● Examples: Σ1 = {a, b}, Σ2 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. ● The symbols in the alphabet do not have any meaning in and of themselves www.vkedco.blogspot.com
  13. 13. Strings ● A string is a finite sequence of symbols ● ε is the empty string; ε is not a symbol in any alphabet; it denotes the string with zero symbols ● In the book (Davis et al.), the empty string is denoted as 0 ● In formal language theory, strings are typically written without quotation marks: aab and 010001 instead of “aab” and “010001” www.vkedco.blogspot.com
  14. 14. Strings ● The length of a string is the number of symbols/characters in it ● The length of a string is denoted with a pair of matching vertical lines around it ● Examples: – if x = aab, then |x| = 3; – if x = ε, then |x| = 0 www.vkedco.blogspot.com
  15. 15. String Concatenation ● The concatenation of two strings x and y is the strings containing the symbols of x followed by the symbols of y ● Examples: if x = ab and y = 100, then xy = ab100; if x = ε and y = abc, then xy = abc ● For any string, xε = εx = x www.vkedco.blogspot.com
  16. 16. Power Notation in String Concatenation ● When a natural number n is used as an exponent on a string, it denotes the concatenation of that string with itself n times ● Examples: – x0 = ε – x1 = x – x2 = xx – (ab)3 = ababab www.vkedco.blogspot.com
  17. 17. Languages ● A language is a set strings over a alphabet ● Note that we can define multiple languages over the same alphabet ● Example: Σ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. L1 = the set of all strings over Σ that end in 0 (e.g., 0, 110, 213450, etc.); L2 = the set of all strings over Σ that end in 1 (e.g., 1, 01, 0001, 91, etc.) www.vkedco.blogspot.com
  18. 18. Kleene Closures of Alphabets ● The Kleene closure of an alphabet is the set of all strings over it ● If Σ is an alphabet, its Kleene closure is written as Σ* ● Example: Σ = {a, b}. Σ* = the set of all strings consisting of a's and b's, including the empty string www.vkedco.blogspot.com
  19. 19. Numbers, Sets, Set Formers www.vkedco.blogspot.com
  20. 20. Natural Numbers ● N is a set of natural numbers. ● N includes 0, 1, 2, 3, … ● Some texts exclude 0 from the set of natural numbers, but we will keep it in ● In the texts, the word number refers to natural number www.vkedco.blogspot.com
  21. 21. Sets { } { } { }ε≠ ∅ sets.emptyareor www.vkedco.blogspot.com
  22. 22. Set Former Notation { }{ } { } { } { } { } { }{ } .orbyfollowedisor wherestringsofsettheis,,,| s.'ofnumberthe toequaliss'ofnumbertheands'precedes'that such,overstringsempty-nonofsettheis1| 3.or2,1,0,islengthwhose ,overstringsallofsettheis3|, * ccaaba ccaaybaxxy b aba banba baxbax nn ∈∈ ≥ ≤∈ www.vkedco.blogspot.com
  23. 23. Subsets . :seteveryofsubsetaissetemptyThe .andif)onlyand(ififf R RSSRSR ⊆∅ ⊆⊆= www.vkedco.blogspot.com
  24. 24. Proper Subsets .andiff SRSRSR ≠⊆⊂ www.vkedco.blogspot.com
  25. 25. Set-Theoretic Equalities s.complementtheofuniontheis onintersectitheofcomplementthei.e., s.complementtheofonintersectithe isuniontheofcomplementthei.e., ).( .andofonintersecti- SRSR SRSR SRRSR SRSR ∪=∩ ∩=∪ ∩−=− ∩ www.vkedco.blogspot.com
  26. 26. Sets and N-Tuples ( ) ( ) ( ).,,,,,, :matterdoessequencesainelementsoforderThe }.,,{},,{},,{ :matternotdoessetainelementsoforderThe set.ais},...,,{ 21 bacacbcba cabbcacba aaa n ≠≠ == www.vkedco.blogspot.com
  27. 27. Sets and N-tuples }.,...,,|),...,,{( ... :followsasdefinedissettheseofproduct CartesianThen thesets.are,...,,Let 221121 21 21 nnn n n SaSaSaaaa SSS SSS ∈∈∈ =××× www.vkedco.blogspot.com
  28. 28. Predicates .0)(or1)(or)(or)(either eachforsuch thatonfunction valued-BooleantotalaispredicateA ==== ∈ aPaPFaPTaP SaS P www.vkedco.blogspot.com
  29. 29. Predicates R.offunctionsticcharacteriais)( }1)(|{ Then if0 if1 )( set.abeLet xP xPxR Rx Rx xP R ==    ∉ ∈ = www.vkedco.blogspot.com
  30. 30. Proofs www.vkedco.blogspot.com
  31. 31. Proof Methods ● In CS, there are, broadly speaking, two methods of proving things: formal and empirical ● Formal methods are used in theory of computation, algorithms, operations research, etc. ● Empirical methods are used in many applied branches of CS ● Many R&D projects combine formal and empirical methods www.vkedco.blogspot.com
  32. 32. Mathematical Proofs ● The corner stone of the formal method is the mathematical proof ● Many online and printed CS materials contain proofs ● It is of vital importance for a CS practitioner to read at least some proofs ● The good news is that reading proofs is significantly easier than doing them www.vkedco.blogspot.com
  33. 33. Proof Techniques ● Proof techniques are independent of their subject matter: valid proofs in calculus use the same proof techniques as valid proofs in algorithms or theory of computation ● Common proof techniques can be identified ● Learning to identify common proof techniques will enable you to study many areas of CS independently ● The ability to identify proof techniques is based on your ability to understand how the technique works and when it is likely to be applicable ● In CS, a prominent proof technique is induction www.vkedco.blogspot.com
  34. 34. Learning to Love the P-Word ● General advice: Do not be afraid of proofs; one can be a mediocre theorem prover but a very good proof reader ● The first step in mastering the art of mathematical proof is to read and do proofs of known facts; do not think of it as a waste of time ● When you read some CS material, do not shy away from it, if it contains proofs www.vkedco.blogspot.com

×