ITCS

本文最后更新于 2026年2月11日 凌晨

快到期末周了,为自己的Cheat Sheet做点准备

Naive Set Theory

感觉唯一要看的是两个集合的power和一个证明过程。

CaO,一翻Slide发现还有几个定义要说。

几个定义

$\binom{A}{k}={X $ A:X=k}\subseteq A: |X|=k\}

BA={f:AB}B^A=\{f: A\to B\}

aRba\quad R \quad b infixnotation for (a,b)R(a,b)\in R

一个证明

Theorem: For every set AA it is not the case that 2AA|2^A|\le |A|

Proof: hh::\to2A2^A, we need to show that hh is not a surjection.

i.e. given hh we need to find some Δh2A\Delta_h\in 2^A so that

aA:h(a)Δh \forall a\in A:h(a)\ne \Delta_h

Use Δh={aAa∉h(a)}\Delta_h=\{a\in A|a\not \in h(a)\}

For every aAa\in A the sets h(a)h(a) and Δh\Delta_h differ in element aa.

经典方法

康托对角化

Words, Strings, Language

一些定义

Σ\Sigma\dots finitset “Alphabet”

Σk\Sigma^k\dots ordered k-tuples over Σ\Sigma w=(a1,a2,,ak)\quad w=(a_1,a_2,\dots,a_k)

\quad\quad\quadwords of length kk\quad w=a1a2akw=kw=a_1a_2\dots a_k \qquad |w|=k

ϵ\epsilon \qquad empty word

ΣΣ+\Sigma^*\quad \Sigma^+ all finite string and all finite non-empty string

#a(w):\#_a(w): a在w中的出现次数

LΣL\subset \Sigma^*\dots “language” over Σ\Sigma

图灵机入门

三类: FA,PDA,TM

分别对应Chomsky的 Regular grammar,Context free grammar和Unrestricted Grammar

FA

记号

ΣQsQFQΔ((Q×Σ)×Q)\Sigma\quad Q\quad s\in Q\quad F\subset Q\quad \Delta \subset ((Q\times\Sigma)\times Q)

分别代表: 字符集 状态集 起始状态 终止状态集 Configuration(状态转移路径集?):(当前状态,转移字符,转移后状态)

Computing step relation M\vdash_M on KMK_M

qQ,aΣ,uΣ:(q,au)M(q,u) iff (q,a,q)Δ\forall q\in Q, a\in\Sigma, u\in\Sigma^*: (q,au)\vdash_M(q',u) \text{ iff } (q,a,q')\in\Delta

M\vdash_M^* on KMK_M

当有一个计算路径时,直接前面起始state,后面终止state.

分为Deterministic 和 Non deterministic.

Continuous Language

是这门课教授为了教学创造的概念,但给的Lemma是通用的

定义为 FL(w)={aaΣ,waL}F_L(w)=\{a|a\in\Sigma,wa\in L\}

Theorem(Myhill-Nerode)

L DFA language     FL\iff \mathcal{F}_L is finite

一般反着用:

FL\mathcal{F}_L not finite     \implies L not DFA-language.

证非REG可以找一组 {w(i)Σ}\{w^{(i)}\in\Sigma^*\} s.t

FL(w(i))FL(w(j))for ij F_L(w^{(i)})\ne F_L(w^{(j)}) \text{for } i\ne j

之后有Pumping Lemma了其实就没那么常用了。
后面也知道DFA-language就是Regular Language

DFS Minimization

暴力算法:先按终态和末态分,然后每次检查每个划分中是否每个元素在每个可能输入下都会保持在同一分区,如果不是,将输入后的转移结果相同的状态再划分到一起

NFA转DFA

因为我一直和最小化搞混,就一起写了。
子集构造好难。

定义:子集构造就是先对Q做一个powerset,然后将里面的元素作为新的Q’.再按这些子集之间的转移关系建立新的DFA。

哎,期中考试这题一分不得。麻了。

Pumping Lemma

正着的形式:
L REG     \implies
NN:uvwLpartition v=xyz:iN:uxyizwL\exists N\in \mathbb{N}: \forall uvw\in L\qquad\exists \text{partition } v=xyz\quad :\forall i\in \mathbb{N}:uxy^izw\in L

vNwith0<yN\qquad\qquad\quad\quad|v|\ge N \qquad\quad\qquad\text{with}0<|y|\le N

因为它是必要不充分的,一般反着用判断非REG:
Remark: 对于 over 一个字母的language,fulfilling the pumping lemma is 充要的 (我在写什么,蚌)

NN:uvwL:partition v=xyz:iN:uxyiz∉L\forall N\in\mathbb{N}:\exists uvw\in L\quad:\forall \text{partition } v=xyz\quad:\exists i\in\mathbb{N}:uxy^iz\not\in L

vNwith0<yN\qquad\qquad\quad\quad|v|\ge N \qquad\quad\qquad\text{with}0<|y|\le N

可以用一种“玩游戏”的说法解释一下全称量词:

\forall对手选,自己无法控制
\exists自己选

  1. 对手选NN,你母鸡
  2. 自己从L中选一个词,并自己确定uvw的划分,vN|v|\ge N
  3. 对手选择v=xyz的划分方法,保证 0<yN0<|y|\le N
  4. 自己选择ii使uxyizwuxy^izw不在L中

这样就可以证L非REG了。

PDA

Notations

比FA多了:

  1. $:栈的起始符号
  2. Γ\Gamma:栈的字符集
  3. Δ\Delta 多一个对栈的操作,变为((Q×Σ×Γ)×(Q×Γ))((Q\times \Sigma\times\Gamma)\times (Q'\times \Gamma'))

以及有两种接收状态,final-state 或者 empty stack。

Pumping Lemma for CFL

相似地,对于Context Free Language, 我们也有相似的Pumping Lemma。

基本思想可以近似地理解为因为生成规则是finite的,因此想要生成长字符串必定能有某种重复规律。

Formally:

zL,ZN\exists z\in L, |Z|\ge N
\forall partition z=uvwyz with vwxN,vx>0|vwx|\le N, |vx| >0
i s.t. uviwyiz∉L\exists i \text{ s.t. } uv^iwy^iz\not\in L

主要是第二步要分类讨论,覆盖所有可能情况。

以及one letter alphabet满足pumping lemma后还regular。

Closure Property

Give that L,LL,L' to be context-free language and RR to be regular language, we have the following are also context-free:

  1. LLL\cup L'
  2. LL={xyxL and yL}L\cdot L'=\{xy|x\in L \text{ and }y\in L'\} (Concatenation)
  3. LRev={xRevxL}L^{Rev}=\{x^{Rev}|x\in L\} (Reversion)
  4. Li=LLi1 for i>0,L0={ϵ}L^i=L\cdot L^{i-1} \text{ for } i>0, L^0=\{\epsilon\}
  5. LL^*
  6. LRL\cap R

然后以下两个not necessarily context-free:

  1. LLL\cap L'
  2. L\overline{L}

Proof 1)

L={aibjcki,j,kN,i=j}L=\{a^ib^jc^k|i,j,k\in\mathbb{N},i=j\}
L={aibjcki,j,kN,i=j}L'=\{a^ib^jc^k|i,j,k\in\mathbb{N},i=j\}
LL={aibjcki,j,kN,i=j=k}={anbncnnN}L\cap L'=\{a^ib^jc^k|i,j,k\in\mathbb{N},i=j=k\}=\{a^nb^nc^n|n\in\mathbb{N}\}
which is not context-free by the pumping lemma for CFL.

Proof 2)

Assume it’s true, we have LL=LLL\cup L'=\overline{L\cap L'}.

But we have proofed the right hand side to be not necessarily context free. Thus the statement is also not necessarily true.

注意CFL是NPDA language,后面讨论DPDA和NPDA时候要区分清楚。

DPDA和NPDA的能力区别

  • Theorem: DPDA are closed under complement.

证明大体思路是对LL构造一个DPDA MM, 然后吧所有的Final state和non-final state flip一下。

然后几个构造的点要注意:

  1. 对所有的Dead end建一个超级死点(, 这样保证取反后能到,而且是final sate
  2. 提前计算ϵ\epsilon闭包,保证最后ϵ\epsilon-move 的结果是确定的,避免ϵ\epsilon-move随便带到final或者non-final state。

有了这个结论,我们就能对这两种machine的能力做个总结了:

  • DPDA language\subseteqNPDA language

因为NPDA language不能取补集,而DPDA可以,因此NPDA包含的语言更多。

更进一步还有什么结论呢?

  • 如果LLaccepted by some PDA MM, then it is also accepted via empty stack by some NPDA MM' with only one state.

这时候,栈顶元素就代表着现在的state。

Grammar

符号定义

G=(Σ,V,S,P)G=(\Sigma,V,S,P)

  • Σ\Sigma: terminal alphabet
  • VV: variable alphabet
  • SVS\in V: start variable
  • PFVF×FP\subset FVF\times F, (F=(ΣV)F=(\Sigma\cup V)^*)

这些集合都是finite的。

G\Rightarrow_G^*是reflexive, transitive closure of G\Rightarrow_G: derivation relation on F.

The language generated by GG is:

L(G)={wΣSGw} L(G)=\{w\in\Sigma^*|S\Rightarrow_G^*w\}

🌰

生成L(G)={anbncnnN}L(G)=\{a^nb^nc^n|n\in\mathbb{N}\}的Grammar:

  • V={C,D,S}V=\{C,D,S\}
  • Σ={a,b,c}\Sigma=\{a,b,c\}
  • P={SaDbc,Sϵ,DaDbc,Dϵ,CbbC,Cccc}\begin{aligned} P=\{S&\rightarrow aDbc,S\rightarrow\epsilon,\\ D&\rightarrow aDbc,D\rightarrow\epsilon,\\ C&b\rightarrow bC,\\ C&c\rightarrow cc\} \end{aligned}

Chomsky之你第一次听说他是在哪里(

  • Type 0 (unrestricted)
  • Type 1 (context sensitive) only productions αβ\alpha\rightarrow\beta where αβ|\alpha|\leq|\beta|
    也就是说语法不能缩短字符串
  • Type 2 (context free) only production of the form AaA\rightarrow a where AVA\in V
    意思是生成只需要非终结符,无关上下文
  • Type 3 (right linear=regular language)
    只能以下form
    AuB,Au,AϵA\rightarrow uB,A\rightarrow u,A\rightarrow \epsilon where A,BVA,B\in V and uΣu\in\Sigma

唯一需要注意图灵机对应的是type1对应TM with linearly bounded work space.

Context free grammar的条件

  1. 存在derivation
  2. 存在leftmost derivation
  3. 存在derivation tree with α\alpha as leaf labelling

Normal Form (for context-free grammar)

CNF

Have the form AaA\rightarrow a or ABCA\rightarrow BC (A,B,CVA,B,C\in V and aΣa\in\Sigma)

GNF

Have the form AaUA\rightarrow aU, (UV,aΣU\in V^*,a\in\Sigma)

TM

STM的formal specification

有几个新记号:

  • #ΓΣ\#\in\Gamma\setminus\Sigma
  • Δ(Q×Γ)×(Q×Γ×{,0,+})\Delta\subset (Q\times\Gamma)\times(Q\times\Gamma\times\{-,0,+\}) computation

然后Linearly Bounded Automata就是只用input tape的STM。

更Generalized的TM

主要是computing step rules, Δ(Q×Σ×Γk)×(Q×{,0,+}×(Γ×{,0,+}))\Delta\subset (Q\times\Sigma\times\Gamma^k)\times(Q\times\{-,0,+\}\times(\Gamma\times\{-,0,+\})^*)

DTM与NTM等价。

Church-Turing Thesis

Everything that is computable at all can be computed by a Turing machine.

从Computable到Decidable

partial function f computable

给定TM M\mathcal{M}, xΣ\forall x\in\Sigma^*,upon input xx

  • stops with tape content f(x)Γf(x)\in\Gamma^* in case f(x)f(x) is defined.
  • and does not stop in case f(x)f(x) is not defined.

然后everywhere computable就是f(x)f(x)xΣ\forall x\in \Sigma^*有定义。

Recursively Enumerable

AΣA\subset \Sigma^* r.e.     \implies there is an everywhere computable 的 function F:NΣF:\mathbb{N}\to \Sigma^* so that

A={F(1),F(2),}={F(n)nN} A=\{F(1),F(2),\cdots\}=\{F(n)|n\in\mathbb{N}\}

Decidable

首先给一个characteristic function的定义:

AΣA\subset\Sigma^*, 那么

χA(x)={1,if x A0,if x∉ A \chi_A(x)=\begin{cases} 1, \text{if x$\in$ A}\\ 0, \text{if x$\not \in$ A} \end{cases}

就是characteristic function.

我们定义Semi-decidble为只用对xAx\in A的情况有定义就可以。

然后如果 AA decidable, 那么我们有 AA semi-decidable 和 A\overline{A} semi-decidable。然后这里语言decidable也包含对应的Turing Machine acceptable。

TM’s encoding

M=(Σ,Γ,#,Q,s,F,Δ)Σ={a2,,at}Γ={a1,,at,,ag}#=a1Q={q1,,qm}s=q1F={q2}Δ(Q×Γ)×(Q×Γ×{,0,+})Δ={δ1,,δD}-=μ1,0=μ2,+=μ3cod(M)=cod(δ1)cod(δ2)cod(δD)cod((qh,ai,qj,ak,μp))=01h01i01j01k01p0\begin{aligned} M =& (\Sigma, \Gamma, \#, Q, s, F, \Delta)\\ \Sigma =& \{ a_2, \ldots, a_t \}\\ \Gamma =& \{ a_1, \ldots, a_t, \ldots, a_g \}\\\# =& a_1\\ Q =& \{ q_1, \ldots, q_m \}\\s =& q_1\\F =& \{ q_2 \}\\ \Delta \subseteq& (Q \times \Gamma) \times (Q \times \Gamma \times \{ -, 0, + \})\\\Delta =& \{ \delta_1, \ldots, \delta_D \}\\\text{-} =& \mu_1,\quad \text{0} = \mu_2,\quad \text{+} = \mu_3\\cod(M)=&cod(\delta_1)cod(\delta_2)\cdots cod(\delta_D)\\ cod((q_h,a_i,q_j,a_k,\mu _p))=&01^h01^i01^j01^k01^p0 \end{aligned}

这样我们就能引入UNIV和SAM的问题,因而探索NP,P之类的问题。

SAM: Self Accepting Machine, 能否accpet自己的编码。
UNIV:给定任意一个图灵机MM的编码,能否模拟它。

SAM相关

这里,UNIV是Turing acceptable但不是decidable的。

然后SAM是undecidable的,简单的证明如下:

先证SAM\overline{\textrm{SAM}}undecided:

要证 no TM M\mathcal{M} where L(M)=SAML(M)=\overline{\textrm{SAM}}.
For every TM M\mathcal{M} we have L(M)SAML(M)\not=\overline{\textrm{SAM}}
For every w{0,1}w\in\{0,1\}^* we have L(Mw)SAML(M_w)\not=\overline{\textrm{SAM}}

L(Mw)L(M_w) and SAM\overline{\textrm{SAM}} differ at least in ww thus w∉L(Mw)wSAMw\not\in L(M_w)\Leftrightarrow w\in\overline{\textrm{SAM}}

然后再证SAM\textrm{SAM}undecidable。
假设SAM\textrm{SAM}decidable, 那么

  • SAM TM acceptable and
  • SAM\overline{\textrm{SAM}} TN acceptable, which is not。

从这个证明过程中可以学到我们可以先证一半not TM acceptable,再用定义推出整个undecidable.

UNIV相关

UNIV是undecidable的,因为我们可以使用SAM\textrm{SAM}构造一个UNIV, 然后 SAM\textrm{SAM}已经被证明undecidable了,说明UNIV至少和它一样难,因此它也undecidable.这就引出了我们接下来Reducibility的概念。

Reducibility

基本定义

不formal的定义:A\preceqB,说明:

  • B decidable,因为A不会更难,因此A decidable。
  • A undecidable, 因为B至少和A一样难,因此B undecidable.

经典停机问题解法:
SAM\preceqHALT

1
2
3
4
5
6
7
8
SAM(M):
if not HALT(M,cod(M)):
reject
else
if M(cod(M)):
accept;
else:
reject.

这样就构造出了SAM。而SAM undecidable。所以HALT也undecidable.

这样我们就证明了HALT undecidable.

Formal的定义:

A,BΣ, everywhere computable f:AB,xA,f(x)B\forall A,B \subseteq \Sigma^*, \exists \text{ everywhere computable } f:A\to B, \forall x\in A, f(x)\in B

虽然不知道怎么用,但还是记一下。

Rice’s theorem

RE\mathcal{RE} 为所有r.e.语言构成的集合,取一个子集 SS, SRE\forall S\subset \mathcal{RE}, 这里SS non-trivial, 有

C(S)={wL(Mw)S} C(S)=\{w|L(M_w)\in S\}

undecidable。

和证伪很简单,因为只要举反例。证实很困难,因为要覆盖到(enumerate)所有情况是一个思路。

PCP problem & MPCP

MPCPΣPCPΣ{$,#}MPCP_\Sigma \preceq PCP_{\Sigma\cup \{ \$,\# \} }

对于每个下面的元素,我们在每个字母开头加上#.
对于上面的元素,我们对于第一个元素,在它的每个字母前后都加上#,对于其他元素,只在后面加#.
最后再加一个($,#$)的骨牌。
这样就能把一个kk张牌的MPCP归化为一个k+1k+1张牌的PCP了。
因为这样保证了:

  • 之前问题的第一张牌一定在第一位
  • 只有在原问题有解时构造出的问题才有解。

Reduction链

UNIV1WORD2MPCP3PCP \textrm{UNIV} \mathop{\preceq}\limits^1\textrm{WORD} \mathop{\preceq}\limits^2 \textrm{MPCP} \mathop{\preceq}\limits^3 \textrm{PCP}

证明如下:

  1. 在证明TM和Grammar能力等价的时候证了
  2. 把生成过程写出,把$Sw\$S\Rightarrow w€两行Reverse一下,并排放。头是(w,)(€w,€),尾是($,S$)(\$,S\$),中间直接对应。这样就完成了构造。
  3. 上面证过了。

因此我们可以说PCP undecidable.
有了这个,我们还可以证一些语言之间的关系的问题undecidable.因为这些都能归化到PCP problem。

核心思路是对一个PCP instance (k,((x1,y1)),(xk,yk))(k,((x_1,y_1))\cdots,(x_k,y_k))

Consider

LX={IR$X[I]I{1,2,,k}+}LX={IR$X[I]I{1,2,,k}+} L_X=\{I^R\$X[I]|I\in\{1,2,\cdots,k\}^+\} \\ L_X=\{I^R\$X[I]|I\in\{1,2,\cdots,k\}^+\}

这里I,JI,J为index set,然后IRI^R为reverse一下指标集II.
LXL_X是Context free的,因为他可以这么生成:

SiSxi,1ikSi$xi,1ik S\to i Sx_i, 1\leq i\leq k\\ S\to i \$x_i, 1\leq i\leq k

这样也能更好理解为什么要对指标集取反,因为确实是和$对称的。

这样我们就能用这两个Grammar去证一些东西了,比如要证:

L(G1)L(G2)=L(G_1)\cap L(G_2)=\emptyset

我们考虑 L(G1)L(G2)L(G_1)\cap L(G_2)\not=\emptyset, 那么就存在一个指标集II能满足 X[I]=Y[I]X[I]=Y[I].是一个PCP的解。

为了一个一个证伪,我们得从对所有 k>0k>0 做PCP,而这个是not finite的,因此这个问题undecidable.

复杂度类

这是前两周的主要内容。记录一下。

基本符号表示

NSAPACE,DSAPCE,NTIME,DTIME:分别代表non-det和det的State graph中从sSfFs\in S \to f\in F的路径上thickness的最大值...走过边数的最大值

几个经典的复杂度类

P=k>1DTIME(nk) P=\bigcup _{k>1}\textrm{DTIME}(n^k)

NP=k>1NTIME(nk) NP=\bigcup _{k>1}\textrm{NTIME}(n^k)

同理可得 PSAPCE和NPSPACE。
还有两个特殊的:

L=DSPACE(logn)NL=NSAPCE(logn) L=\mathrm{DSPACE}(\log n), NL=\mathrm{NSAPCE}(\log n)

他们之间的关系是

LNLPNPDSPACE=NSPACE L\subseteq NL\subseteq P\subseteq NP\subseteq DSPACE = NSPACE

补一个Tutorial提到的点。为什么区分NP和co-NP但不管co-P?因为其实co-P通过对输出取反就能做到,所以不用管。

以及有一种东西叫semi-polynomial的算法。
意思是它在以输入大小作为衡量尺度的时候有多项式时间解法,但如果以输入长度来看,它就是NP的。

P-reducible

Definition

首先引入一个polynomial reduction。
其实就是把everywhere computable的function f加了个“能在polynomial时间内算出”。符号长p\preceq_p这样。

NP-hard & NP-completeness

NP-hard的定义:

For language S\textrm{S}, LNP,s.t.LpS\forall L\in \mathrm{NP}, s.t. L\preceq_p S, then S is NP-hard\textrm{NP-hard}

NP-complete的定义:

…, SNP\in \mathrm{NP}

解题格式

Tutorial上讲的,也不能说格式吧,就是证NP-completeness的过程。

  1. 使用certificate的定义,证明这个东西是in NP的
  2. 使用P-reduction,证明它是NP-hard的。

然后就能证好了。

常用的感觉就是:

  1. SUBSETSUM\mathrm{SUBSETSUM}
  2. SAT/3SAT\mathrm{SAT/3-SAT}

几个具体🌰

MERF\textrm{MERF}:multi-valued satisfiability.

P-UNIVpMERFpSMERFpSATp3-SATpCLIQUE \textrm{P-UNIV}\preceq_p\textrm{MERF}\preceq_p\textrm{SMERF}\preceq_p\textrm{SAT}\preceq_p\textrm{3-SAT}\preceq_p\textrm{CLIQUE}

同时还有:

3-SATp3COLORABILITY \textrm{3-SAT}\preceq_p\textrm{3COLORABILITY}

这个Reduction的Idea是我们把
对于SATp3-SAT\textrm{SAT}\preceq_p\textrm{3-SAT}这一块,记录一下教材上的证法:

对于一个柿子,比如 p=abcdp=a\land \overline{b}\land \overline{c}\land d
我们可以引入一个新变量zz,构造另外两个柿子p1=abz,p2=cdzp_1=a\land \overline{b}\land z,p_2=\overline{c}\land d\land \overline{z}
保证只有pp成立时,两个柿子才成立,vice versa。
这个构造可以成立的原因有两个:
1.这个构造把柿子拆成了两部分,分别和原柿子相符。
2.因为一个z取反了,另一个没有,所以整个柿子是否satisfiable与zz无关。
因此这个构造可行。

Formal一点的写法

给出那个everywhere computable的function ff 的实现。

课上例子

问题描述是给定一个多边形,求最少需要几个“Guard”能看到所有的顶点。这个问题是NP-complete的。

几个Claim:

  1. 这个东西的下界是n3\lfloor\frac{n}{3}\rfloor,可以用基本所有的polygon都能triangulation然后能3-COLOR以及triangulation总存在来证。
  2. 对任意整数kk,总存在一个有3k2+23k^2+2的多边形使得所需的守卫数至少为kk

贴一个我看起来比较好的证明.

Schönhardt’s polyhedron

以上的问题还有对应的三维版本,好像所需的证明技巧类似,也是构造三角形和“niche”。最后完成证明。

贴一下论文来源.

Space Complexity

先复习一下Simple TM的定义:

几个notation:ΣΓQsQFQΔ((Q×Σ×Γ)×(Q×Γ×MW×MI))\Sigma \quad \Gamma\quad Q\quad s\in Q\quad F\subset Q\quad \Delta\subset((Q\times\Sigma\times\Gamma)\times(Q\times\Gamma\times M_W\times M_I))
其中 MW,MI{1,0,1}M_W,M_I\in\{-1,0,1\},为work tape和input tape上的移动状况。
Δ\Delta又能拆成3个:

  • Δ1(Q×Σ×Γ)×(Q×Γ)\Delta_1 (Q\times\Sigma\times\Gamma)\times(Q\times\Gamma) 对work tape的修改
  • Δ2 (Q)×(Q×MW)\Delta_2\ (Q)\times(Q\times M_W) move on work tape
  • Δ2(Q)×(Q×MI)\Delta_2 (Q)\times(Q\times M_I) move on input tape

几个PSAPCE-Complete的🌰

  • Context Sensitive Grammars
  • 华容道
  • graph coloring game

Randomness(不考)

几个复杂度类

RP & co-RP

LRPL\in\mathrm{RP}, \exists TM M\mathcal{M} that for any input xx, we can determine the following thing in p(x)p(|x|) time where pp is a polynomial:

  • xLMx\in L \to \mathcal{M} accept YES with Prob \ge 1/2.
  • x∉Lx\not\in L\to NO.

🌰:Miller-Rabin素性检验

BPP & ZPP

ZPP=RP \capc o-RP

BPP: 错误概率小于 1/3

🌰:SAT的多项式版本

课上老师给的Big Picture

Computing

首先,给定几个基本要素:

  1. Input tap, Work tape
  2. FA, FDA, TM
  3. (non-)deterministic

然后是几个概念:

  1. grammars
  2. language accepted by TM -> Recursively Enumerable
  3. SAM: Self Accepting Machine
  4. Reduction, 几乎是最重要的内容。

然后是Rice Theorem 和 PCP

Recursion Theory

Complexity Theory

首先复习了复杂度类的定义

Configuration Graph很重要,NP-complete的时候会argue这个东西

Poly-time reduction

默写一下定义:

F:ΣΓComputable in poly-time \exists F: \Sigma^* \to \Gamma^* \text{Computable in poly-time}

xΣ,xLF(x)L \forall x\in\Sigma^*, x\in L \Leftrightarrow F(x)\in L'

NP-complete 定义

SNP,LNP,LpSS\in \mathrm{NP}, \forall L\in\mathrm{NP},L\preceq_p S

还有

S NP-hard,SpL    L NP-hard S\textrm{ NP-hard}, S\preceq_p L'\implies L' \textrm{ NP-hard}


ITCS
https://chenxizhou233.github.io/posts/85db524f.html
作者
Xizhou Chen
发布于
2026年1月7日
许可协议