Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (30pts) Build a truth table to determine whether the following proposition is

ID: 3879643 • Letter: 1

Question

1. (30pts) Build a truth table to determine whether the following proposition is a tautology, contradiction or contingency:

(pq)(¬pq)

2. (30pts) A compound proposition is satisfiable if there is an assignment of truth values to its variables that makes it true. That is, satisfiable if there is at least one TRUE in the truth table. • Write a program that checks whether the following compound proposition is satisfiable and outputs the conclusion: (p¬q)(q¬r)(r¬p)

• If the compound proposition is satisfiable, find and print out all assignments of truth values for p, r, and q that make it true. Note: You must let the program check the satisfiability and then output in the console the conclusion, rather than calculate the truth table and eye-check the satisfiability. Otherwise, you will get point deduction.

Explanation / Answer

1)

TRUTH TABLE

p | q | ~p | p<->q | (~p and q) | ((p<->q) and (~p and q))
T | T | F | T | F | F
T | F | F | F | F | F
F | T | T | F | T | F
F | F | T | T | F | F

it is a contradiction

2)

program

P = [True,False]
Q = [True,False]
R = [True,False]
s=0
for p in P:
for q in Q:
for r in R:
if((p or ~q)and(q or ~r)and(r or ~p)):
s=1
break
if(s==1):
print("satisfiable")
else:
print("Not satisfiable")

output:


satisfiable