MHB Is the Complexity of Satisfiable Boolean Expressions in NP?

AI Thread Summary
The discussion centers on the representation of Boolean expressions and the classification of the language L, which consists of all strings representing satisfiable Boolean expressions. The claim is made that L is in NP, supported by a nondeterministic algorithm that guesses a satisfying assignment of binary values to the variables. The process involves substituting these values into the expression, which may require adjustments to the string format, and then evaluating the expression to check if it yields a value of 1. The evaluation can be performed in polynomial time, even with basic algorithms, leading to the conclusion that determining the satisfiability of a Boolean expression is indeed in NP. The explanation emphasizes the steps of guessing, substitution, evaluation, and acceptance based on the result, suggesting that a clear understanding of these steps is crucial for implementing the algorithm in programming languages.
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! :o

The Boolean expression $(p_1+p_2)*p_3$ can be represented by the string $(1+2)3$, where integer $i$ represents variable $p_i$.

Consider the language $L$ consisting of all strings representing satisiable Boolean expressions (those for which some assignment of $0$'s and $1$;1 to the variables gives the expression the value 1).

We claim that $L$ is in $\mathcal{NP}$.

A nondeterministic algorithm to accept $L$ begins by "guessing" a satisfying assignment of $0$'s and $1$'s to the propositional variables in an input string, if such an assignment exists.
Then, the value ($0$ or $1$) of each variable is substituted for the variable wherever it occurs in the input string.
Some shifting of the string will be needed to close up gaps when the single symbol $0$ or $1$ is substituted for a decimal representationm of a propositional variable.
Then the resulting expression is evaluated to verify that it has the value $1$.
The evaluation can be done in time proportional to its length by a number of parsing algorithms.
Even without using an efficient parsing algorithm, the reader should have a little trouble evaluating a proposition in $O(n^2)$ steps.
Hence there is a nondeterministic Turing machine of polynomial time complexity to accept satisfiable Boolean expressions, and thus the problem of determining whether a Boolean expression is satisfiable is in $\mathcal{NP}$.Could you explain me how we have shown that there is a nondeterministic Turing machine of polynomial time complexity to accept satisfiable Boolean expressions?? (Wondering)

I haven't understood it...
 
Technology news on Phys.org
The details are a bit messy, but the idea is the following.

(1) Nondeterministically choose a sequence of $n$ zeros and ones where $n$ is the number of variables in the expression.

(2) Substitute chosen values for variables. The result is an expression containing 0, 1 and operations.

(3) Evaluate the resulting expression.

(4) Accept if the result is 1.

With some handwaving one can show that this requires polynomial time. I recommend understanding this first if you write this algorithm using not a Turing machine, but your favorite programming languages with all data structures (such as trees) and standard functions available.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top