Need attached mathematics work completed

User Generated

avpxavpxxl

Mathematics

Harvard school of Business

Description

Need attached mathematics questions completed. I can share study material if you need it.

Unformatted Attachment Preview

Assignment 7 COMP4141 2020 Term 1 Due: Sunday, 19th April, 17:00 Submission is through WebCMS/give and should be a single pdf file, maximum size 4Mb. Prose should be typed, not handwritten. Use of LATEX is encouraged, but not required. Discussion of assignment material with one other person is permitted, but the work submitted must be your own in line with the University’s plagiarism policy. Problem 1 (12 marks) Let M = ( Q, Σ, Γ, δ, q0 , qaccept , qreject ) be a Turing Machine, and x ∈ Σ∗ be a word of length n. We are interested in the problem of whether M will accept x using at most n tape cells. Let Σ0 = (Γ ∪ Q ∪ {#}). A finite run (of r steps) of M on input x can be represented as a word over (Σ0 )∗ : w = #C1 #C2 # · · · #Cr # where each Ci ∈ ( Q ∪ Γ)n+1 represents a configuration of M indicating the current state, the tape head position, and the contents of n tape cells. We are interested in the language: L = {w ∈ (Σ0 )∗ : w represents an accepting run of M on input x }. Note that L is either ∅ (if M does not accept x using at most n cells) or contains a single word representing the accepting run of x – so we have reduced our problem to determining if L contains 0 or 1 element. The aim of this question is to show that an NFA with O(n| M|) states can recognise L = (Σ0 )∗ \ L – regardless of whether L contains 0 or 1 element. Remark Compare this with the proof of Theorem 5.13 in Sipser. There are four reasons why a word w ∈ (Σ0 )∗ is not in L: (I) w is not in the correct format to represent a run (II) w does not begin with #q0 x# (III) w = #C1 #C2 # · · · #Cr # and there is an i such that Ci does not yield Ci+1 (IV) w does not end with #yqaccept z# where y, z ∈ Γ∗ ; |y| + |z| = n; and |z| > 0 If we can define NFAs with O(n| M|) states that can identify each of these conditions, then we can construct / L, simply make a non-deterministic an NFA with O(n| M|) states that can recognise L: for any word w ∈ e-transition to whichever NFA represents the condition that w meets. Here is an NFA that recognises condition (II) (assuming the string is properly formatted): 1 Σ0 q0 # Σ 0 \ { q0 } x1 x0 Σ 0 \ { x0 } x n −1 ··· Σ 0 \ { x1 } # Σ 0 \ {#} Σ 0 \ {#} Σ0 And here is an NFA that recognises condition (IV) (assuming the string is properly formatted): Σ0 Σ0 Σ00 Σ0 Σ00 # y0 qaccept z0 Σ0 \ Γ Γ y1 qaccept Γ Σ00 Σ00 Γ Γ y2 ··· Γ qaccept z1 Σ0 \ Γ Γ y n −1 Γ yn qaccept Γ z2 Σ0 \ Γ ··· Γ z n −1 Γ zn # Σ0 \ Γ Σ 0 \ {#} Σ0 Here Σ00 = Σ0 \ (Γ ∪ {qaccept }). Intuitively this NFA will non-deterministically guess the second-last # symbol. It will then keep track of the number of symbols before qaccept is seen and the number of symbols afterwards, and it will accept if any of the following hold: • qaccept is not seen exactly once; • There are not n + 1 symbols between two #, of which n are tape symbols (elements of Γ); or • There is not at least one tape symbol after qaccept (a) Give an NFA with O(n| M |) states that recognises condition (I). Justify your answer. (6 marks) (b) Give an NFA with O(n| M |) states that recognises condition (III). Justify your answer. (6 marks) 2 Problem 2 (8 marks) Show that the following problem is PSPACE-complete (Hint: Consider the complementary problem and use Problem 1): EQNFA Input: Two NFAs M and N Question: Is L( M ) = L( N )? (10 marks) Problem 3 Consider the following decision problem: 2-SAT Input: A boolean formula ϕ in CNF with at most 2 literals per clause Question: Is ϕ satisfiable? Show that PATH ≤ L 2-SAT. Hint 1: Find a reduction first then check if it is log-space. Hint 2: The 2-CNF clause (¬ x ∨ y) is logically equivalent to the expression ( x → y). 3
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!

Related Tags