How can I construct a proposition P with the values given in the table using p,q, and r?
\begin{array}{|c3:c|}\hline p & q & r & P \\\hline 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 \\ 1 & 0 & 0 & 1\\ 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & 1 & 1 & 1 \\ \hline\end{array}
My fist idea wasto fill each row and given those values , keep filling the values of the following rows but I always got some contradiction, I have no idea how to solve this :/ Thanks if anyone can help me with another idea to solve the problem
Use Karnaugh maps:
The proposition is then given by covering the 1's with rectangles. We see that if r is false, P is true if p NAND q is true; this yields a term $\neg r\wedge\neg(p \wedge q)$, or (by de Morgan's laws) $\neg(r \vee(p\wedge q))$. If r is true then q must be true; this yields a term $r\wedge q$. Hence the final expression for P is the OR of these terms: $$\neg(r \vee(p\wedge q))\vee(r\wedge q)$$