Homework 11
Last updated: Thu, 28 Apr 2022 11:53:20 -0400
Out: Wed April 27, 00:00 EST Due: Tue May 03, 23:59 EST
This assignment starts to explore NP and NP-Completeness.
Homework Problems
Solving Sudoku (5 + 5 = 10 pts)
Sudoku Implies P = NP? (9 pts)
Verifying a General Sudoku Game Solution (5 + 5 = 10 pts)
Poly Time Mapping Reducibility to the Halting Problem (10 pts)
README (1 point)
Total: 40 points
Submitting
Submit your solution to this assignment in Gradescope hw11. Please assign each page to the correct problem and make sure your solutions are legible.
A submission must also include a README containing the required information.
1 Solving Sudoku
A Sudoku game board is a square made up of 9 subgrids (arranged 3\times 3), where each subgrid itself has 9 boxes (also arranged 3 \times 3), so the overall game board is 9 \times 9.
A solution to this game requires putting a number from 1 to 9 in each box such that each row, column, and subgrid contains each number once and only once.
Compute the worst case running time for a "brute force" algorithm that solves a standard 3\times 3 Sudoku game by trying all possible solutions. Do not use Big-O notation.
Update (2022-04-28): You do not need to come up with an actual algorithm. To compute running time, you may assume that you have a deterministic, single-tape decider where the input is a 9 \times 9 board that has m pre-filled squares, and the decider just "tries all possible solutions" and accepts when it finds one, and otherwise rejects.
Then explain why solving the standard 3\times 3 Sudoku game is in \textbf{P}. (Since membership in \textbf{P} depends on the size of the input, be clear about what the size of the input is in this case.)
2 Sudoku Implies P = NP?
Prove that if the Sudoku problem from Problem 1 Solving Sudoku is NP-Complete, then \textbf{P} = \textbf{NP}.
3 Verifying a General Sudoku Game Solution
A general version of the Sudoku game allows the size of the board to change. Specifically, this general Sudoku game board has n\times n subgrids, each containing n \times n boxes (so overall, the board size is n^2\times n^2), and each subgrid/row/column must be filled with the numbers 1 to n^2 once and only once.
Formally, let \textit{GSUDOKU}=\left\{B \mid B \textrm{ is a solvable general Sudoku board}\right\}
Prove that \textit{GSUDOKU} \in \textbf{NP}.
Give two different solutions.
(This, along with the Solving Sudoku problem, demonstrates that when discussing \textbf{P} and \textbf{NP}, the only problems that are interesting are ones where the input can change in size.)
4 Poly Time Mapping Reducibility to the Halting Problem
Show that \textit{HAMPATH}\leq_\textrm{P} \textit{HALT}_\textsf{TM}