Csci471 Intro Lecture 1
Csci471 Intro Lecture 1
LECTURE 1
Today:
• Turing Machines
1
Meiram Murzabulatov
Problem 2
• There are 𝑛 people in the room. Prove that there is a group of size at least !" log ! 𝑛
among these 𝑛 people such that everyone knows each other in the group, or
conversely everyone does not know each other in the group.
2
Models of Computation
First model of a program: DFA/Regexp
Solvable Problems: Regular Languages
Unsolvable Problem: {0n1n | n ≥ 0}
Next model of a program: PDA/CFG
Solvable Problems: Context-Free Languages
Unsolvable Problem: A={w#w | w ∈ {𝟎, 𝟏}∗ }
bool is_duplicate(s):
n = len(s)/2
if(s[n]!=‘#’): return False
return s[:n] == s[n+1:]
3
TURING MACHINE (TM)
FINITE
STATE
q10
CONTROL
AI N P U T
0 → 0, R ¨ → ¨, R
qaccept
0 → 0, R
¨ → ¨, R
qreject 0 → 0, R
¨ → ¨, L
11010q700110
q7
1 1 0 1 0 0 0 1 1 0
Starting configuration
q3
1 0 0 0 1 1 0
𝑞𝟑𝟎𝐰
𝑪𝟎 = 〈𝑞 〉𝐰= 𝑞𝟑 1000110
8/17/23 Meiram Murzabulatov; based on slides by Sofya Raskhodnikova 7
Accepting configuration
qacc
1 0 0 0 1 1 0
𝑪ℓ = 〈 … 𝑞𝑞𝒂𝒄𝒄 …
𝟎 〉𝐰
q7 q5
1 0 0 02 1 1 0
𝑪𝒊 = 1 0 0 𝐪𝟕 0 1 1 0
𝑪𝒊'𝟏 = 1 0 0 𝟐
〈 𝐪𝟓𝑞1𝟎1〉𝐰0
8/17/23 Meiram Murzabulatov; based on slides by Sofya Raskhodnikova 9
Formal Definition of a TM
A TM is a 7-tuple P = (Q, Σ, Γ, d, q0, qaccept , qreject)
Q is a finite set of states
Σ is the input alphabet,
where the blank symbol ¨ Ï Σ (¨ or ﹇ )
Γ is the tape alphabet, where ¨ Î Γ and Σ Í Γ
d : Q ´ Γ → Q ´ Γ ´ {L,R} is the transition function
q0 , qaccept , qreject Î Q are
the start, accept and reject states