Fall2022
Fall2022
Instructions:
1. You are allowed to keep only the following items with you on your table: writing utensils,
stationery box, your HU ID card, your “cheat sheet”, and a drinks container. Please deposit
other items, e.g. bags and devices at the front of the classroom.
2. Make sure that your HU ID card is clearly visible on your table.
3. Your cheat sheet must meet the requirements shared earlier. Non-compliant cheat sheets
will be confiscated.
4. Please ensure sufficient writing utensils in working condition. Do not bother others during
the exam.
5. The problems in this exam rely on argumentation. Make sure to provide sound justifications
that are both precise and concise.
6. If your answer to a problem exceeds 10 lines, it is very likely that you are on the wrong
track.
7. Please submit this problem paper and your cheat sheet with your answer book.
8. This exam consists of 6 problems for 75 points, printed on 5 sides.
(c) 5 points The relation between computability and Turing recognizability or decidability.
Solution: The Church-Turing thesis establishes that any algorithm with a finite
number of steps in which every step does a finite amount of work can be expressed
as a Turing machine. If we consider algorithms that involve an infinite amount of
work, whatever tease may be, they will be beyond the scope of a Turing machine.
We have already encountered examples of languages that cannot be recognized, let
alone decided, by a Turing machine.
Page 2 of 5
CS 212, Fall 2022 Final Examination 12 Dec, 2022
Then AT M is decidable.
But AT M is not decidable. ⊥
Solution: The halting problem is to determine whether a given algorithm will eventually
halt on a given input. It turns out that the answer is no. In general, given an algorithm
and an input, it cannot be determined whether the algorithm will halt. This conveys
that there is at least one problem that a computer cannot solve. And if there is one,
there may be others. This result is also counter-intuitive, as it originally seems that the
problem must have an easy positive answer. Also, once we know that one problem is
undecidable, we can use it along with reducibility to argue about the undecidability of
other problems.
Page 3 of 5
CS 212, Fall 2022 Final Examination 12 Dec, 2022
Solution: Problems in P are those that can be decided in polynomial time. Prob-
lems in NP are those that can be verified in polynomial time. P is a subset of
NP. The problems in NP that are also in P can be decided in polynomial time.
It is not known whether the other problems in NP can be decided in polynomial
time or not. The P vs. NP problem is to decisively conclude whether such prob-
lems can or cannot be decided in polynomial time. The best known algorithms to
such problems all take exponential time. A solution to the P vs. NP problem will
either result in polynomial time algorithms for problems that previously required
exponential time, or establish that the search for such algorithms is futile.
(b) 5 points What is NP-completeness and how can it assist in finding a solution to the
P vs. NP problem?
Solution: We prove that F ACT is not in P by showing that any algorithm for it
cannot run in polynomial time.
Proof. In general, the algorithm to decide F ACT needs to compute n!. For this, it
needs the magnitude of n in order to compute the O(n) products for n!. But what
it is given is hni, the string representation of n on the tape. The magnitude of the
number is an exponential function of the length of its representation. (This was
also the insight in WC 10). Therefore, the algorithm is not in P.
COLOR = {G | there is a way of assigning colors to the vertices of the graph G, such
that no two adjacent vertices are assigned the same color, and the entire graph can be
colored with 4 colors}
Page 4 of 5
CS 212, Fall 2022 Final Examination 12 Dec, 2022
Page 5 of 5