Skip to content

Instantly share code, notes, and snippets.

@richardfat7
Last active December 13, 2017 10:49
Show Gist options
  • Save richardfat7/8c24eed22e123e1a063a95d5a288ca63 to your computer and use it in GitHub Desktop.
Save richardfat7/8c24eed22e123e1a063a95d5a288ca63 to your computer and use it in GitHub Desktop.
Decidable ? Not Decidable ?

✓Decidable

DFA NFA Regular Expression

  1. ADFA = {< D, w > | D is a DFA that accepts input w}
    By Simulatation
  2. ANFA = {< N, w > | N is an NFA that accepts input w}
    Convert to DFA
  3. AREX = {< R, w > | R is a regular expression that generates w}
    Convert to DFA
  4. MINDFA = {< D > | D is a minimal DFA}
    Use minimization alg
  5. EQDFA = {< D1, D2 > | D1, D2 are DFAs and L(D1) = L(D2)}
    Use minimization alg on both
  6. EDFA = {< D > | D is DFA and L(D) is empty}
    Check EQ with < D, ->O >

CFG CFL

  1. ACFG = {< G, w > | G is a CFG that generates w}
    Elimate ε- and unit productions from G
    Convert G into CNF G'
    Check if can CYK Alg prase < G', w >
  2. L accept w where L is a context-free language
    onvert to CFG

✗Not Decidable

CFG

  1. EQCFG = {< G1, G2 > | G1, G2 are CFGs and L(G1) = L(G2)}
  2. ALLCFG = {< G > | G is CFG that generates all strings}
    Construct a PDA P accepts all string except the computation histories of (M, w)
    Convert P to a CFG G
    Run R on input < G >
    S accepts if R accepts; S rejects if R rejects
    S accepts iff G reject the computation histories of (M, w), only when know M accept w
    S decides NOT ATM
  3. AMB = {< G > | G is an ambiguous CFG}
    If T can match, G is ambiguous
    If T cannot match, G is not ambiguous
    Construct G by
    S -> T | B
    T -> (Top of tile 1)T1 | (Top of tile 2)T2 | ... | (Top of tile n)Tn
    T -> (Top of tile 1)1 | (Top of tile 2)2 | ... | (Top of tile n)n
    B -> (Bottom of tile 1)B1 | (Bottom of tile 2)B2 | ... | (Bottom of tile n)Bn
    B -> (Bottom of tile 1)1 | (Bottom of tile 2)2 | ... | (Bottom of tile n)n
    T can match, Strings (TopTileA)(TopTileB)(TopTileC)CBA and (BotTileA)(BotTileB)(BotTileC)CBA will be in G and they are the same with two different way to parse
    G is ambiguous

PCP

  1. PCP = {< T > | T is a collection of tiles that contains a top-bottom match} Proof is outc

TM

  1. ATM = { < M, w > | M is a TM that accepts input w}
    Assume ATM is decidable, then some TM H decides ATM
    Construct a TM D, on input < M >
    1. Run H on input < M, < M > >
    2. Accept if H reject; Reject if H accept
    i.e. D accept if M loop or reject < M >, D reject if M accept < M >
    Run D with input < D >
    D accept if D reject < D >, D reject if D accept < D >
    Contradiction
  2. NOT ATM = { < M, w > | M is a TM that reject or loop on input w}
    If NOT ATM is decidable, then ATM is decidable as ATM is recognizable
  3. HALTTM = { < M, w > | M is a TM that halt on input w}
    Use HALTTM to reject the loop on case in ATM
  4. εTM = { < M > | M is a TM that accepts input ε}
    M' accepts z if M accepts w
    S know ε only when know if M' accept any z, when know if M accpet w
  5. SOMETM = { < M > | M is a TM that accepts some input strings}
    M' accepts z if M accepts w
    S know some input z is accepted or not only when know if M' accept some z, when know if M accpet w
  6. ETM = { < M > | M is a TM that accepts no input strings}
    M' accepts z if M accepts w
    S know all input z is rejcted or not only when know if M' accept any z, when know if M accpet w
    --OR--
    Run R on input < M >
    S accpets if R rejects; S rejects if R accepts
    S accpets iff M accept some input So S decides SOMETM
  7. EQTM = { < M1, M2 > | M1, M2 are a TMs such that L(M1) = L(M2)}
    Construct M2 reject all z
    Run R on input < M, M2 >
    S accepts if R acceptes; S rejects if R rejects
    S accepts iff M accept no input So S decides ETM

Format of proving a problem is undeciable

Let say A is the problem
Main idea is to reduce decider of problem A to decider of ATM
i.e. Solve A -> ATM is solved

  1. Suppose A is decidable
  2. Let R be a TM that decides A
  3. Consider the TM S: on input < M, w >, and try to claim S decide ATM
  4. Construct the following TM M':
    M' = a TM such that on input z,
    Simulate M on input w and accept/reject z according to M' (or use other undecidable problem to generate problem A)
  5. Run R on input < M' (, and / or something else) > and S accepts/rejects according H (or reverse)>
  6. Then S accept < M, w > if and only if M accept w
  7. So S decides ATM, which is impossible
  8. So R does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment