






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
CS 172: Computability and Complexity - Homework 2 - Prof. S. A. Seshia, Assignments of Computer Science
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!







Can a machine with memory in state be rewritten to a standard machine - correct answerYes, both have the same computational power Can non-det turing machines exist - correct answerThey cannot physically exist, they are simply a mathematical model of computation used to determine the computability of problems Can we prove that Pspace and Ptime aren't equal - correct answerNo, a machine that solves a problem that is in Pspace but not in Ptime has never been found Can you represent all decision problems as a language - correct answeryes Compare a Turing machine to a Deterministic finite state automata - correct answerA turing machine is capable of moving forwards and backwards along the string. Unlike a deterministic finite state automate which can only move forwards A Turing Machine has memory in the form of its tape. Which a DFA does not Define the diagonalisation language using standard notation - correct answerThe language that doesn't accept its own encoding as an input string. Given its own encoding can't be accepted by any TM Draw a diagram showing the relation between NP, PSpace/NPSpace, Ptime, ogspace and R - correct answer Explain how you would build the TM for the universal language - correct answerTape1: The machine and input pairs, distinguish between them by placing 3 1s between themTape2: The input encoded as a series of 1s and 0sTape3: The current state of the machine, in state qi there are i 0s after the first 1Tape4: Temporary tape used for copying and other operations If the head on tape 3 is pointing to an accepting state then the input is accepted Explain the function of /s and arrows in Turing machines transition graphs - correct answera slash represents a replacement, an arrow represents the head of the machine moving in a direction along a tape Give a Pspace complete problem that can be throught of as an instance of QBF - correct answerGeneralised versions of games such as checkers where the board can be any size. Given that my opponent does any move, does an exist a move that allows me to win, this could be represented as a QBF instance Give the formal definition of reduction - correct answer· Given Two languages L1 and L2, we say that there is a reduction from L1 to L2 or equivalently we say that L1 reduces to L2, if there exists a computable function f such that: where computable means we could design a turing machine to compute it
Given Rice's Theorem what properties are non trivial - correct answerwhere {0} is the empty language How can a multi-tape machine be represented by a multi-track machine - correct answer- You can do this by having a multi-track machine that has double the amount of tracks as you had tapes on your multi-tape machine
How does the definition of a non-det turing machine differ from a det turing machine - correct answerNon-det machines have a transition relation rather than a transition function. The different definitions are shown below How many steps can a Pspace machine support - correct answeran exponential amount of steps How would we represent all possible strings and TMs and compare them. - correct answerplot them on a table, with machines on one axis and strings on another. put 1 in a cell if a machine accepts a string and a 0 if it doesn't How would you define the halting problem as a language - correct answerLH : {<P,I>} P is a program where I is an input that causes the program to halt How would you encode a transition function of a TM in a binary string - correct answer- Start encoding with 1- Use a 1 to separate each step of the encoding- You need to encode the current state and input, then the new state, output and direction- Each rule is separate by two ones How would you prove that a language cannot be decided by a TM - correct answerEnumerate every possible TM and show that none of them accept the given language How would you represent a Turing machine with multiple tracks with a Turing machine with memory in a state - correct answer- Putting characters that are on multiple tracks next to each other on a single track. You then move between all those characters, storing them in memory. Then you can make a decision and move one.
Is the halting problem computable - correct answerIt is not. We're unable to write an algorithm capable of checking whether a program will halt when given a specific input Prove that the halting problem is not computable - correct answer Prove the existence of undecidable problems - correct answer- We can write a number of algorithms equal to the set of natural numbers- Because machines are enumerable that means that 1 number can be associated with 1 natural number - so they are the same size- Languages/Problems can be represented as a characteristic vector. There are 2^(set of natural numbers) possible characteristic vectors - as there are 2 choices for each character in the vector and the size of the string can be up to the size of the set of natural numbers. Therefore there are 2^(set of natural numbers) problems. Which can be proved to be the size of the set of real numbers- Therefore there are more problems that algorithms so there will always be decidable problems Show that NP is a subset of Pspace, do we know if there are equal - correct answerAn ND TM takes a maximum of polynomial time. We can simulate one attempt on the non- det machine in polynomial space, if it doesn't work we can try again using the same space. Therefore NP is in Pspace. We don't know if these classes are equal Show the hierarchy of complexities - correct answer What 3 elements make up each instantaneous description and how are they written - correct answer- Current state
What features defines Co-NP Problems - correct answerThey have concise certificates where we can answer no in polynomial time. Rather than NP problems where we can answer yes What is a binary relation - correct answerIt is a set of pairs of strings What is a Co-NP problem - correct answerA language L is in Co-NP if L is the complement of a language in NP What is a complexity class - correct answerIt is a set of languages What is a polynomial reduction - correct answerGiven 2 languages L1,L2 there is a polynomial reduction from L1 to L2 denoted by L1 ≤ L2, if there exists a function f() computable in polynomial time such that What is a property - correct answera set of languages e.g. languages that can be defined by turing machines with 8 states What is a Turing Machine with multiple tracks - correct answerA Turing machine where the tape has multiple columns in it What is an instantaneous description - correct answerIt is a way of representing the steps that a Turing machine would take when processing a specific input. What is Big Θ Notation - correct answer What is Complexity - correct answerAmong solvable problems, which problems are easy and which are hard to solve. How much time and space is needed to solve them What is Computability - correct answerWhether a problem can be solved by an algorithm in feasible time. This allows us to distinguish between solvable and unsolvable problems What is important about logspace problems - correct answerThe problems that can be solved efficiently by parallel machines are contained within Logspace. A very small subset of problems. What is Logspace - correct answerAll problems solvable in logarithmic space What is NP-Hardness - correct answerA language L is NP-Hard if for all languages L1 in NP there exists a polynomial reduction from L1 to L What is NPSpace, how does it relate to Pspace - correct answerNon-deterministic polynomial space. Problems decided by ND TMs using polynomial space. Pspace is a subset of NPSpace as ND TMs can always be simulated by deterministic TMs
What is Rice's Theorem, what is the language of a generic property of RE - correct answer What is Savitch's Theroem and what is the intuition behind it - correct answerPSpace = NPSpace. We can keep trying different branches of the ND TM reusing the same space each time. It can be shown that the simulation of an ND TM can be done in O(P(n)^2) space where the ND TM takes up O(p(N)) space What is the Antivirus problem - correct answerThe Antivirus (A) problem is defined as follows: give a Java function C, decide whether C is a virus or not. In order to decide whether a piece of code is a virus or not, we need to define what a virus is. For simplicity, we assume that a virus is a piece of code doing something "nasty". In this case, the nasty behaviour will be formatting the system hard-drive C:. What is the benefit of encoding TM's as binary strings - correct answerIt means that we're able to enumerate every possible machine be enumerating binary numbers What is the characterisation vector of a language - correct answerit is a binary vector which states which strings (from the enumerated list of all possible strings) are contained within a language, a character is 0 if the string is contained and 1 if it isn't. e.g. string 1 in the example is not contained What is the Church-Turing thesis and has it been proved - correct answerEverything that can be computed can be computed by a Turing machine. It hasn't been proven What is the class PSpace - correct answerAll problems that can be solved using a deterministic TM with a worktape of polynomial size. What is the complexity class of the simulation of a non det TM on a det TM - correct answerIt is exponential, whereas the non det TM itself carries out the computation in polynomial time What is the compliment of a language - correct answerIt is the inverse of a language, every sting accepted be the original language will be rejected by the compliment and vice versa What is the consensus on P=NP - correct answerIt is generally believed that problems exist only in NP and not in P, however we cannot prove this What is the decision problem of an independent - correct answerGiven a graph and a number k, is it true that a graph has an independent set of size at least k What is the decision version of the vertex cover problem - correct answeris it true that there is a vertex cover smaller than size for graph g
What is the property about the hardness of the problems in a reduction - correct answerThe problem that the initial one is reduced to must be at least as hard as the initial problem. Note that this is not a reversable property. ONLY THE FINAL PROPERTY IS AT LEAST AS HARD AS THE INITIAL. The problems are not as hard as each otherq What is the property of transitivity of polynomial reductions - correct answerTaking 3 languages, if there is a reduction from 1 to 2, and 2 to 3 then there exists a reduction from 1 to 3. What is the reachability problem - correct answerGiven a source s and a destination vector t, determine whether a path between the 2 vectors exist What is the relation between Logspace and Pspace. What is important about this relation - correct answerWe can say that logspace is a strict subset of Pspace, meaning that they are not equal to each other. Every other relation to reach this conclusion is not strict, or can't be proved to be strict. at some point in the image this relation becomes strict, but that point is unknown. What is the relation between P, NP and Pspace - correct answerP is a subset of NP which is a subset of Pspace What is the relation between vertex cover and independent set - correct answerVertices not in a vertex cover form an independent set, as in order for a vertex cover to be valid, 2 vertices outside of the cover cannot be connected, otherwise an edge would exist that isn't within the vertex cover. What is the relationship between Pspace and Ptime - correct answerPtime is a subset of Pspace. Because in Ptime it would be impossible if only a polynomial operations are carried out to use up more than polynomial amount of space What is the running time of a machine M over an input string W - correct answerThe number of steps that M performs while processing w before m stops. If M doesn't stop on W, then the running time of M over W is infinite What is the running time of a non det TM - correct answerThe maximum number of steps that could be carried out while processing an input - the deepest branch of the computational tree What is the space complexity of the reachability problem - correct answerNon deterministic log space problem What is the time complexity lower bound - correct answerΩ(f(n)) if given any algorithm to solve P, TA(n) is Ω(f(n))
What is the time complexity of a machine M - correct answerThe time complexity of a machine M is a function Tm(n) that is the maximum running time of M over any input string of length n What is the time complexity of the simulation of a multi-tape machine on a multi-track machine and how is it calculated - correct answerBy showing that the complexity calculated be each successive function is greater than the previous, we can state that the time complexity is at maximum the complexity of the final function, O(N^2) - polynomial What is the time complexity upper bound - correct answerO(f(n)) if there exists an algorithm A solving P such that TA(n) is O(f(n)) What is the universal language - correct answerEach pair is M, a string encoding of a TM and a string w which a machine accepts. A machine for this language would be able to say whether or not a machine would accept a given string. What is the vertex cover problem - correct answerC is a vertex cover of a graph g if for all edges of the graph, one end of each edge is in the set C What is the worst case performance scenario for when a multi-track machine performs 1 step. - correct answerA multi-track machine may have to perform 4m+2k steps. M is the maximum distance from the middle of the tape to the end. k is the total number of marks found on the tapes (the X marks used to mark the position of simulated heads). This is because if the machine has to move all the way from one end of the tape to the other and back again this takes 4m steps. Then if the mark has to be moved in the opposite direction to where it is travelling next it will move backwards then forwards, taking 2 moves. This may have to occur for each mark, so 2k. What the QBF, quantified boolean formula problem - correct answerIt is the Sat problem but with parameters placed onto finding satisfying assignments. e.g. the second instance in the example asks, regardless of what variable x is, y and z can be assigned in such a way to satify the formula What would be the stages to proving that all problems in NP belong to P - correct answer When does a deterministic turing machine accept an input - correct answerWhen a symbol halts in an accepting state after consuming all the input symbols When does a non deterministic turing machine accept an input - correct answer- If there is at least 1 way of processing the input in the machine that halts in an accepting state- Vice versa, if there is no way of processing the input that halts in an accepting state, then the input is not accepted