Question

In: Computer Science

Show that the following problem is NP-hard. Input: A boolean function in CNF such that every...

Show that the following problem is NP-hard.

Input: A boolean function in CNF such that every clause has at most three literals and every variable appears in at most three clauses.

Output: An assignment that evaluates the given function TRUE.

Solutions

Expert Solution

Now consider the Almost-SAT problem which is defined below:
Input: A CNF formula F having m clauses in n variables x1, x2, . . . , xn. There is no
restriction on the number of variables in each clause.
• Output: YES if there is an assignment to the variables which satisfies exactly m − 1
clauses, and NO otherwise.
For example, given the boolean formula F to be
F = (x1 ∨ x2) ∧ (x1 ∨ x¯3 ∨ x¯4 ∨ x5) ∧ (¯x2) ∧ (x2 ∨ x5)
Here is one assignment to the variables which satisfies all four clauses: x1 = T, x2 = F, x3 =
F, x4 = T, x5 = T. So the expected output of SAT on this example will be YES.
This formula also has an assignment which satisfies exactly 3 of the 4 clauses: x1 = T, x2 =
T, x3 = F, x4 = T, x5 = T. So the expected output of Almost-SAT on F is also YES.
The goal of this problem is to show that Almost-SAT is NP-complete.
We will first prove that Almost-SAT is in NP. A problem is said to be in NP
if a solution to the problem can be verified in polynomial time. Give a polynomial time
algorithm which takes as input an assignment to each variable, and verifies whether it is a
solution to Almost-SAT or not.
SOLUTION:
Loop through all the clauses and check whether each of them is satisfied. Maintain a global
counter, and check whether it equals to m − 1 at the end.
This algorithm runs in poly time because there is at most m clauses.


Related Solutions

What is NP? What is P? What is NP-complete? What is NP- hard?
What is NP? What is P? What is NP-complete? What is NP- hard? Give brief definitions. Give an example of an NP- complete problem. Is P equal to NP?
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove...
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove the decision version of 0/1 KNAPSACK problem is NP-Complete. In this problem, we use PARTITION problem as the source problem.) (a) Give the decision version of the O/1 KNAPSACK problem, and name it as DK. (b) Show that DK is NP-complete (by reducing PARTITION problem to DK). (c) Explain why showing DK, the decision version of the O/1 KNAPSACK problem, is NP-Complete is good...
What is P-Problem? What is NP-Problem? What is NP-Complete problem?
What is P-Problem? What is NP-Problem? What is NP-Complete problem?
show that every function can be expressed as the sum of an even function and an...
show that every function can be expressed as the sum of an even function and an odd function and that there is only one way to do this.
computer organazation , Boolean algebra1. Show the Boolean algebra reduction to minimal form for each....
computer organazation , Boolean algebra1. Show the Boolean algebra reduction to minimal form for each. Show each step, and cite the rule number which allows it.a . (AB)’ (A’ + B) (B’ + B)b . A’(A+B) + (B + A)(A + B’)
(A) Minimize the following Boolean expression as much as possible and Design the obtained function with...
(A) Minimize the following Boolean expression as much as possible and Design the obtained function with NAND universal logic gates Y = AB + A(B+C) + B (B+C) (B) Design a logic gate circuit diagram ( combination circuit ) that accepts a 3 - bit BCD number and generates an output binary number equal to the square of input number.
Declare and define a function named getCurrentHours_OR_Month that accepts one Boolean parameter. If the Boolean parameter...
Declare and define a function named getCurrentHours_OR_Month that accepts one Boolean parameter. If the Boolean parameter is true, the function returns current hours; if the Boolean parameter is false, the function returns current month. o This function will obtain the current system time and extract the hours or the month value from the system time depending on the Boolean being received. o This function will return the extracted value as an integer value. o Note that the system time displays...
Problem 3: A firm has the following production function: ?(?, ?) = √?√?. A) Show whether...
Problem 3: A firm has the following production function: ?(?, ?) = √?√?. A) Show whether this firm’s technology exhibits constant, increasing, or decreasing returns to scale. B) What is the firm’s Technical Rate of Substitution? C) What is the optimality condition that determines the firm’s optimal level of inputs? D) Is the marginal product of input ? increasing, constant, or decreasing in ?? E) Suppose the firm wants to produce exactly ? units and that input ? costs $??...
Write a simplified expression for the Boolean function defined by each of the following Kmaps. 00                   ...
Write a simplified expression for the Boolean function defined by each of the following Kmaps. 00                    01                 11 10 YZ 0 1 1 0 1 0 0 1 X 0 1 00                    01                 11 10 YZ 0 1 1 1 1 0 0 0 X 0 1 00                    01                 11 10 YZ 1 1 1 0 1 1 1 1 X 0 1
How does a fixed input differ from a variable input?What does a cost function show?What is...
How does a fixed input differ from a variable input?What does a cost function show?What is marginal cost?Is the marginal cost likely to be constant regardless of the level of output produced?What is the relationship between a firm’s marginal cost curve and its output supply curve? ( Please type it,thanks)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT