(将NFA的状态的集合变为DFA中的点)
  • closure 和 pumping theory
    • The class of languages accepted vy finite automata is closed under:
      1. union
      2. concatentenation
      3. Kleene star
      4. complementation
      5. intersection
    • A language is regular if and only if it is accepted by finite automaton
      正则表达式和DFA, NFA的相互转化按照步骤生成
    • Pumping Theory : Let L be a regular language. There is an integer n ≥ 1 such that any string w ∈ L | w | ≥ n can be rewritten as w = x y z such that y ≠ e , | x y | ≤ n , and x y i z ∈ L for each i ≥ 0

      Give DFA or NFA write Regular Expression
      Give regular expression, write DFA or NFA
      Show a given language is (construct) or is not regular (pumping)

    • context-free and pushdown自动机

      • context-free grammar
        = ( V , , S ) where
        is an alphabet
        Σ is the set of terminals , is a subset of R is the set of rules ( V − Σ ) × V ∗ is the start Symbol, is an element of V − Σ
      • all regular languages are context-free
      • parse tree, leftmost derivation, rightmost derivation
        Grammars with strings that have two or more distinct parse trees are called ambiguous
    • PDA

      = ( K , , F ) where
      is a finite set of states
      Σ is an alphabet (the input symbols)
      is an alphabet (the stack symbols)
      s ∈ K is initial state
      F ⊆ K is the set of final states
      is the transition relation ( K × ( Σ ⋃ { e } ) × Γ ∗ ) × ( K × Γ ∗ )

    • The class of languages accepted by PDA is exactly the class of context-free languages
      The transitions from CFL to PDA:

      ( ( p , e , e ) , ( q , S ) ) ( ( q , e , A ) , ( q , x ) ) for each rule A → x
    • ( ( q , a , a ) , ( q , e ) ) for each a ∈ Σ .
  • clousure, pumping theory
    • CFL are closed under union, concatenation, Kleene star, CFL在补和交上不封闭
    • CFL与正则的交集为CFL
    • pumping theory : Let = ( V , , S ). Then any string w ∈ L ( G ) of length greater than ϕ ( G ) | V − Σ | can be written as w = u v x y z in such a way that either or y is nonempty and u v n x y n z is in L ( G ) for every n ≥ 0

      Given context-free language, write context-free grammar and PDA
      Give context-free grammar, write PDA
      Show a given language is or is not Context-free

    • Turing Machine and Recursive Enumerable Language

      • Turing machine

        = ( K , , H ) where
        is a finite set of states
        Σ is an alphabet, containing the blank symbol and the left end symbol , but not containing the symbol s ∈ K is the initial state
        H ⊆ K is the set of halting states
        , the transition function ( K − H ) × Σ K × ( Σ ⋃ { → , ← } )
      • 一些图灵机的符号表达(左右平移机( S ← , S → ), 复制机)
        这里写图片描述

      • decide L : if w ∈ L accepts w , and if w ∉ L rejects w
        Call a language recursice if there is a TM decides it.

      • A function is called recursive if there is a TM computes f
      • semidecides L : w ∈ L halts on input w
        Call a language recursicely enumerable iif there is a TM semidecides it.
      • if a language is recursive, then it is recursively enumerable
      • the complement of recursive language is also recursive
      • 多带和复合
        Corollary : Any function that is computed or language that is decided or semidecided by a k-tape TM is also computed, decided or semidecided by a standard TM.
    • Grammar
      = ( V , , S ) where
      is an alphabet
      Σ is the set of terminals , is a subset of R is the set of rules ( V ∗ ( V − Σ ) V ∗ ) × V ∗ is the start Symbol, is an element of V − Σ
    • a language is generated by a grammar iif it is recursively enumerable
      递归可枚举只在补和差下不封闭
    • computes f , if: S w S ⇒ ∗ G v v = f ( w ) .
      A function is called grammatically computable iif there is a grammar G computes it.
    • A fucntion is recursive iif it is grammatically computable
    • the transition form TM to Grammar? (P230)
    • Numerical Function
      • Basic Function:
        1. zero, z e r o k ( n 1 , n 2 , . . . , n k ) = 0
        2. identity, i d k , j ( n 1 , n 2 , . . . , n k ) = n j
        3. successor, s u c c ( n ) = n + 1
        4. The primitive recursive functions are all basic functions, and all functions that can be obtained by them by any number of successive application of composition and recursive definition
        5. other primitive resursive funstion:
          p l u s ( m , n ) = m + n m + n m u l t ( m , n ) = m ∗ n m ∗ n e x p ( m , n ) = m n m ↑ n
        6. all constant functions of the form f ( n 1 , . . . , n k ) = 17 s g n ( n ) which is zero if n = 0 m ∼ n = m a x { m − n , 0 } (defined use a predecessor function p r e d ( 0 ) = 0 , p r e d ( n + 1 ) = n )
        7. primitive recursive predicate (primitive functions that only takes values 0 and 1):
          g r e a t e r − t h a n ( m , n ) g r e a t e r − t h a n − o r − e q u a l ( m , n ) e q u a l ( m , n ) i s z e r o ( n ) i s o n e ( n ) p o s i t i v e ( n )
        8. Those function’s negation, disjunction and conjunction are also primitive recursive predicates
        9. Funstion defined by cases:(can be written as)
          f ( n ) = p ( n ) ∗ g ( n ) + ( 1 ∼ p ( n ) ) ∗ h ( n ) r e m ( m , n ) d i v ( m , n )
    • not all computable functions are primitive recursive
    • denote minimalization of m [ g ( n 1 , n 2 , . . . , n k , m ) = 1 ] The obvious method:
      m : = 0 ;
      while g ( n 1 , n 2 , . . . n k , m ) ≠ 1 m : = m + 1
      output But it is not a algorithm becaues it may fail to terminate
      • call a function g minimalizable if the above method always terminates.
      • Call a function -recursive if it can be obtained form basic functions by operations of composition, recursive definition, and minimalization of minimalizable funtions.
      • l o g ( m , n ) = μ p [ g r e a t e r − t h a n − o r − e q u a l ( ( m + 2 ) ↑ p , n + 1 ) ]
      • A function is -recursive iif it is recursive(that is, computable by a TM)
  • Design Turing machine to compute a function or decide (semidecide) a language
    判断原始递归函数

    • Undecidablity

      • Church Turing Thesis
        • 在所有输入上停机 算法
      • Chomasky hierachy
        这里写图片描述
      • Universal Turing Machine
        { q } { 0 , 1 } ∗ { a } { 0 , 1 } ∗
        特殊符号: ⨆ , ⊳ , ← , → 四个字典序下最小的符号
        这里写图片描述
        这里写图片描述
      • 通用图灵机

    • Halting problem
      H = { " M " , " w " : halts on input string w } is recursively enumerable It is precisely the language semidecided by universal TM U.
    • The language is not Recursive; therefore, the class of recursive languages is a strict subset of the class of recursively enumerable languages.
    • The class of recursively enumerable languages is not closed under complement
  • Some Undecidable problem and Reduction
    • 若有 X ≤ Y (X规约到Y), X 不可判定,则 Y 不可判定;Y 可判定, 则 X 可判定。
  • Properites of recursive languages
    • A lanuage is recursive iif both it and its complement are recursively enumerable
    • Turing-enumerable and lexicographioally Turing enumerable
      这里写图片描述
      • A language is Turing-enumerable iif there is a TM enumerates it.
      • A language is recursively enumerable iif it is turing-enumerable.
        这里写图片描述
      • A language is recursive iif it is lexicographically Turing-enumerable
  • Rice
    这里写图片描述
  • Show a given language be recursive enumerable
    show a given language be not recursive last one

  • 来自总结的一些例子:

    a ∗ b ∗ c ∗ − { a n b n c n , n > = 0 } is context free but not regular
  • L = L 1 L 2 是context free, 则 L 1 一定是context free (x)
  • Regular - context free不一定是CFL (如 a ∗ b ∗ c ∗ − a n b n a n b n c n )
  • 2-way PDA(i.e. PDA whose input head can move both left and right are more powerful than 1-way PDA
  • Given a PDA and an FA , the problem L ( M 1 ) ⊆ L ( M 2 ) is deciable
  • 非正则语言的kleen star也可能是正则的。
  • 正则语言的子集也可能非正则。

  • 递归与 递归等价

  • PDA中,若每一个格局至多有一个格局接在它后面,则为确定型的。 确定型CFL在补下封闭
  • A countable union of regular languages is necessarily regular (x) 可数包含可数无穷

  • 这里写图片描述

  • 这里写图片描述
  • 有时构造context-free不太好想时,通过构造PDA证之。
    这里写图片描述
  • It is decidable whether or not a given string belongs to a context-free language.
    It is decidable whether or not a context-free language is empty.
    这里写图片描述
    这里写图片描述

  • 这里写图片描述
    这里写图片描述
  • pumping theory不能反过来证明是否正则或CFL
  • If is regular, is not regular, then L 1 ∘ L 2 must be non-regular (X)
    这里写图片描述
  • 判断
    这里写图片描述
    这里写图片描述
  • 对于非确定图灵机的n步,确定图灵机要用n的指数步来模拟
  • 判断下面问题是否可判定
    参考链接

    • 两个基本问题(前者为递归可枚举但不递归,后者不是递归可枚举)
      这里写图片描述
      1. 一个图灵机至少有481个状态 (YES)
      2. 给定图灵机在空串上走了481步还没有停机 (YES)
      3. 给定图灵机,判断它是否在一些输入上经过481步还没有停机 (YES)
      4. 给定图灵机,判断它是否在所有输入上经过481步还没有停机 (YES)
      5. 给定图灵机是否接受空串 (NO)
      6. 给定TM M, 是否存在在M上停机的串? (NO)
        给定TM M,M是否在所有串上停机? (NO)
      7. 给定TM M,is L(M) finite? (NO)(通过取非?)
      8. 给定TM M, 带上是否出现过a(a )? (NO)
      9. 给定 M 1 , M 2 ,他们是否在同一个字符串上停机? (NO)
      10. 给定M, 只要M接受w, M接受 { M | | L ( M ) | > 2 } . 递归可枚举但不递归
        这里写图片描述
      11. countable
        这里写图片描述
      12. RE
        这里写图片描述
        这里写图片描述
        这里写图片描述
  • 计算理论复习正则语言与有穷自动机可数无穷正则表达式(注意+不是正则,*是正则; L∅=∅L=∅L \emptyset = \emptyset L = \emptyset) Σ⋃{(,),∅,⋃,∗}\Sigma \bigcup \lbrace(,),\emptyset, \bigcup,* \rbraceDFA MM = (KK, Σ\Sigma, δ\delta, ss, FF 复杂性 理论 的核心问题:是什么使得某些问题很难 计算 ,又使得另一些问题容易 计算 ? 复杂性 理论 的一个重要成果:发现一个按照 计算 难度给问题分类的完美体系。 面对难题:1. 搞清问题困难的根源,改变问题条件变成简单问题,2.近似解,3.问题在最坏情况下困难,随机 计算 。 密码学需要复杂性 目标是把问题分...
    循环冗余校验(Cyclic Redundancy Check,CRC)是数据通讯中很常用的一种校验方式。尤其是在嵌入式软件开发中,经常要用到 CRC 算法对各种数据进行校验。生成的数字在传输或者储存之前 计算 出来并且附加到数据后面,然后接收方进行检验确定数据是否发生变化。   CRC 是数据流采用二进制除法(没有进位,使用 xor 来代替减法)相除所得到的余数。其中被除数是需要 计算 校验和的信息数...
    2022年是我身为大三学生的一个重要的一年。在这一年里,我不断努力学习和实践,在 计算 机科学领域有了很大的进步。 首先,我在课堂上学习了大量的知识,比如 计算 机网络、数据结构与算法、操作系统、 计算 机组成原理等。这些课程不仅增长了我的 理论 知识,而且让我更加了解 计算 机科学的广阔性。 其次,我参加了多项比赛和竞赛,比如ACM程序设计竞赛和蓝桥杯程序设计大赛等。这些竞赛不仅提高了我的编程能力,而且让我更加热爱编程。 最后,我在实习期间学习了大量的实际经验。在实习中,我参与了多项项目的开发,比如Web开发、移动应用开发等。这些项目不仅让我掌握了实际开发技能,而且让我更加自信。 总的来说,2022年是我 计算 机科学学习生涯中非常重要的一年。我将继续努力学习和实践,为未来的职业生涯做好准备。