Use a truth table to show that the propositions p ↔ q ↔ r and (p ↔ q) ∧ (q ↔ r) are not logically equivalent.

Assignment

Use a truth table to show that the propositions p ↔ q ↔ r and (p ↔ q) ∧ (q ↔ r) are not logically equivalent.

Write a program to input a positive integer n indicating the number of variables pi , and compute and print to standard output the corresponding truth table for (1). Each row of the output truth table should contain the truth values of the pi , the truth value of the compound proposition (1), and the number m of the pi that are true.

Experiment with your program, inspecting the output for various n, and conjecture a formula for the truth value of (1) in terms of n and m.

Use induction to prove that your formula is correct for all positive integer n (i.e., for any number of variables pi).

This can be written in Python

This content is for IT & Web programming task members only.
Log In Register