Formal Logical System·
Formal system·
- tautology 恒真的 statement
- contradiction 恒假的 statement
Normal forms·
Disjunctive normal form (or of and)·
- Every statement form (not a contradiction) is logically equivalent to a restricted statement form of the form where each is either a variable or the negation of a variable.
Conjunctive normal form (and of or)·
- Every statement form (not a tautology) is logically equivalent to a restricted statement form of the form where each is either a variable or the negation of a variable.
Adequate set·
- 加上 中的任何一个
- 一元的只有 NOR, NAND
必须引入 not( )
Formal statement calculus(L)·
-
an alphabet of symbols:
-
A set of finite string of these symbols, called well-formed formula:
- is a wf
一个变量是一个式子( ) - If and are wfs, then and are wfs.
- is a wf
-
Axioms:
-
rules of deduction
MP: From and , we can derive
HS:
Deduction Theorem·
- Proof: 归纳推导过程的长度
枚举最后一步推导的方式, substitution or MP:
Unfinished! some examples·
Extension·
-
An extension Lof L is consistent if and only if there is a wf. which is not a theorem of L.
-
Otherwise
-
-
complete: we can decide every statement true or false
Turing Machines·
Standard Turing Machine·
- input is written on the first cells, other cells are empty
- when want to move to the left of the leftmost cell, stay put
- At each time
- read the symbol
- write a symbol
- move left or right

- A language is recursively enumerable (recognizable) if some TM recognizes it.
- the TM can enumerate all the strings
- A language is recursive (decidable) if some TM decides it.
- recursive language recursively enumerable language
Multiple Tapes·
2-Tape Turing Machine·
- The input is on Tape 1.
- Tape 2 is initially blank.
- Read a symbol from each tape, each head moves. 两个一起动
Simulation on one TM·
-
each has a mirror state
if one state has it means 当前 head 位于这个位置
-
Beginning
- input#
- replace the first symbol with
- 表示 一开始 第一个纸带 输入是input 位置在第一位
- 第二个纸带 输入是空 位置在第一位
- 中间用 # 隔开
- 每一次在一个上面做完了 就找到另一个 state 然后再做
- special case: 如果第一个纸带做到了 # 上
先整体右移,
Nondeterministic Turing Machine·
- 下一个状态是一个可行集合
- 只要有可行的方式到达 accept 那就是 accept
- simulate 的方式
- 3-tape TM
- tape 1: input
- tape 2: simulate
- tape 3: 按从短到长的顺序 存储 guess (bfs)
- 每次把 1 里面的 input load 到 2 上去
当前 3 的 guess 在 2 上跑一遍,
- 3-tape TM
- a NTM is a decider if all branches halt on all inputs
TM with outputs·
- TM with a write only tape
- enumerator
- a machine that can enumerate strings one by one, maybe with repetitions
- 为什么 Turing recognizable 的 language 称作 recursively enumerable
- 因为可以用一个enumerator E 去 generate

- 为啥得枚举 步数
- 一个 TM 输入的串的长度是否确定了在TM 上运行时间的上界
- 如何recognize
- 每次枚举出来一个 就跟输入 w 比较
- accept的总能判断出来 但 reject 的可能会不停机
Universal Turing Machine (UTM)·
- the set of TM is countable
- 可以编号
用 <M> 代表第 M 这个 的编号,
- 可以编号
- UTM
- input: M, w
- output: 与 M 上跑 w 的结果一样
Halting Problem·
·
- want to prove is not decidable
- Proof:
- If is decidable
- that decides
- consider
- accept if accepts
- reject if rejects or loops on
- always halt
- 令 如下定义
也是一个 TM( ) - always halt
- 考虑
- accept -> reject -> reject or loop on
- reject -> accept -> accept
- 总是矛盾
- Thus, is not decidable
- If is decidable
- 显然 is recognizable 因为我们可以直接模拟
- 所以 is not co-recognizable
·
-
-
not decidable
-
recognizable
-
not co-recognizable
Turing reducibility·
Oracle Turing Machine (OTM)·
- 相当于你有一个 oracle language A 就是有一个 tool A
- 你可以询问 A 让他自己告诉你 询问的串 在不在 中
Definition·
-
Language A is Turing reducible to B, if an oracle TM
decides A, write
-
就是说 有了
就是 turing decidable, -
Ex:
Examples·
-
Undecidable
-
Undecidable
-
和 都是图灵机, 且
Undecidable
If is decidable,
令 是一个拒绝所有输入的图灵机
对于
输入 即判定 是否为空, 解决了
Properties of CFG·
Reduction via Computation History·
Definition of computation history·
-
Let be a TM and be an input string.
An accepting computation history for on is a sequence of configurations, , where is the start configuration of on , is an accepting configuration of , and each legally follows from according to the rules of .
A rejecting computation history for on is defined similarly, except that is a rejecting configuration.
一个 configuration 是指 形如 的组合 包含了带子的内容 头的位置和状态信息
-
计算历史 是有限序列
如果不停机 那么不存在计算历史
Example: Linear bounded automaton (LBA)·
-
LBA 是一种图灵机 不允许 head 离开 input 在带子上的区域
-
相当于 纸带的存储大小被 input bound 住
-
-
Lemma: Let be an with states and symbols in the tape alphabet. There are exactly distinct configurations of for a tape of length .
configuration数有限 显然
-
is decidable
- 因为 configuration 的上限 is 我们可以在 w 上 模拟这么多步 或者直到它停机
- 如果接受就接受 如果拒绝或者还没跑完就拒绝
-
is not decidable
- 想要从 规约到
- 对于 和 我们构造一个检查器 检查器的输入是 以及一段 accepting computation history
- 检查器就是检查 computation history 是否合法 显然不需要额外的空间 因此是 LBA
- 我们只要判断是否属于 也就是判断了 是否存在 accepting computation history
Example: ·
-
is not decidable
-
想要从 规约到
-
构造一个非确定的 PDA 对于 M 和 w
- 如果 M 接受 w 则 PDA 不能接受所有的串
- 不接受 M 中 w 的 accepting history
! ! !
- 不接受 M 中 w 的 accepting history
- 如果 M 不接受 w 则 PDA 能够接受所有的串
- 如果 M 接受 w 则 PDA 不能接受所有的串
-
所以只要构造这样的PDA 不接受 w 的 accepting history 其他均接受
-
接受以下所有
-
- 不以 开始
- 不以一个 accepting configuration 结束
- 某个 不能派生
-
PDA 也有三个分支分别对应三种情况
-
-
不以 开始就接受
-
不以 accepting 结束 就接受
-
一个个判断
在判断 到 时
首先走到 然后将其压入栈, 然后与 一点点比较
除了读写头之外应该相同, 读写头部分用 去判断是否合理
一个小问题 是 压入栈之后顺序会颠倒
前一个倒着后一个正着 不能一个个比较, 解决方案
把奇数位置的串正着写 偶数位置的倒着写: -
-
-
Post correspondence problem (PCP)·
- 七种block
- 开始的block [# | ##]
- 如果
加入 [ | ], - 如果
加入 [ | ], - 加入
- [# | #], [# | #]
- [ | ], [ | ] 用来蚕食最后的剩余的骨牌们
- [## | #] 最后位置上的匹配
- 如何强制让第一种排在第一位
最后一种排在最后一位, ? - 这样 只有第一个是开头都是星星
- 只有最后一个结尾都是方块
Mapping reducibility·
Definition·
- A function is computable / recursive if some TM , on every input , halts with .
- Language is mapping reducible to language if there is a recursive function s.t. .
Properties·
- If and is decidable, then is decidable.
- If and is recognizable, then is recognizable.
- If and is co-recognizable, then is co-recognizable.
Example·
- Prove is not decidable, recognizable, co-recognizable.
- not decidable:
- proved by Turing reduction
- 规约到 是否与一个 空的TM 相同
- not recognizable:
- is not co-recognizable, so is not recognizable.
- not co-recognizable:
- 类似
Difference with Turing reducibility·
-
更强
-
需要是同向的
-
性质一样 因为能够用一个 去 map
-
Turing-reduction only for proving undecidability, and mapping-reduction can be used for prove unrecognizability.
Recursion Theorem·
- Let be a recursive function. There is a TM for which is the code of a Turing machine equivalent to .
Proof·
- define such a TM :
D(<M>):
output the code of the TM:
G(y):
d = M(<M>)
simulate the machine with code d on y
-
is recursive because 只是输出一个编号
不用运行, -
define a TM :
V(<M>):
output t(D(<M>))
-
Let
-
Then when running :
d = V(<V>) = t(D(<V>)) = t(<F>)simulate the machine with code d on y
-
So
F(y) = simulating the TM with code t(<F>) on y
Diagonalized Proof·
- Unfinished
Generalization: Kleene’s recursion theorem·
- Let be a recursive function . There is a Turing machine , where
Proof·
- Define a recursive function by s-m-n thm:
s(x):
output the code of TM on input y computing t(x,y)
-
By recursion theorem on , we have a TM s.t. the TM with code is equivalent to .
-
The TM with code is the TM that computes on input .
Unfinished·
Kolmogorov complexity·
Definition·
- Let be a binary string.
- The minimum description of is the shortest string where TM on input halts with on the tape.
- The Kolmogorov complexity
- 串 的信息量
Properties·
- , , for some constant .
- , , for some constant .
- , , for some constant .
- 存储
这个bound是, - 任何的图灵机 都是固定长度的 除了输入的部分
- 存储
c-compressible·
-
A string is c-compressible if .
-
If is not 1-compressible, then is incompressible.
-
Thm: Incompressible strings of every length exist.
- Proof: 为什么只用 二进制串的 description
-
Thm: ,
- Proof: 一样考虑二进制的 description 的个数
Compressibility·
-
-
Thm: COMPRESS is undecidable.
Proof:
-
Construct a Machine M:
M(n): For all y in 字典序 if (y, n) \notin COMPRESS print y halt: -
Then we get , the first string of
-
但是 prints y,
-
当 充分大时矛盾
-
Chaitin’s incompleteness theorem·
-
-
Proof:
-
Suppose we can prove for some .
-
选择 proof 的长度最小的 which proves .
-
考虑这样一个图灵机
: R(L): 枚举所有的argument Q check whether Q is valid check whether Q proves K(y) > L If yes, outputs y: 这样一个玩意儿的长度是
与 矛盾, 不需要输入 y 嘛( 虽然不影响证明, )
-
“Were-you-last” Game·
- m players, unlimited bits
- each player can read/write bits
Solution·
Trivial solution·
- Counter
If Counter = 0, Counter = m
Else Counter -= 1
real solution·
- use several blocks to represent the counter
- type of last block 0 / 1
- number of blocks
- size of each block
- How to set the initial counter to m?
- work on
- Lower bound of :
- Cannot be solved when
- 无论玩家什么策略
定义 表示 这个玩家可能修改的 bits 的集合, 均有, 由于决策树最多 层, 至多可以看 t 个 bit( ) 每层最多两个选择, 当前看的 bit 是 0/1( ) - 如果玩家的策略均相同
不足以表示,
- 如果玩家策略不同
- Sunflower Lemma
- A sunflower: 一堆集合
有共同的交集, 其他部分两两不交, - Let be a collection of sets each of size . If , then 存在一个包含p个集合的 sunflower
- A sunflower: 一堆集合
- 取 ,
- 存在一个 的 sunflower
记为, - 首先搞定其他所有的人
然后这 p 个人放到最后操作, 只有 center of sunflower 会有影响, center 的 size, - center 的状态
如果, 我们有 至少两个人 面对相同的 center 状态, 设为 和, - 假设 出现在 之前
把 删掉, 那么对于 之后的人没有影响, 原先的最后一个人仍旧会判断自己为最后一个人, 错误, - 合理
- Sunflower Lemma
- 无论玩家什么策略
Bounds of Complexity·
- 上界 下界
- 基于比较的排序的复杂度
- 决策树
Dynamic Partial Sum·
Description·
- 单点修改
- 求前缀和
Bound of complexity·
-
线段树 复杂度 查询修改均为
-
Interleave info(IL)·
-
表示 向 传递信息的次数
只考虑( ) -
is the number of transitions between a value with , and a consecutive value with
-
- is in
- is in j is in
-
Unfinished bound·
Information transfer (IT)·
- 表示 在 写 在 读 且 在 不再写 的 memory locations 的集合