Truth Table

Mathlet

by clicking on this button. Truth Table will come up in a new window. Click on the button again to when you're ready to close Truth Table. If it doesn't come up, you may not have support for Java 2 applets. See the Java 2 page.

This mathlet creates the truth table for a logical compound proposition. Type one in (followed by the ENTER key) using the following syntax:

Mathlet Symbol Mathematics Symbol Meaning
! tilde not
& and and
| or or
-> implies implies
<-> iff if and only if
|| exclusive or exclusive or
p p truth variable
T T true
F F false

For a truth variable, any lowercase letter in the ranges a-e, g-s, u-z (i.e. omitting f and t which are reserved for false and true) may be used. The negation operator, !, is applied before all others, which are are evaluated left-to-right. Parentheses, ( ), and brackets, [ ], may be used to enforce a different evaluation order.

E.g.
p -> q
p & (q | r)
[(p -> q) & (q -> r)] -> (p -> r)
are all syntactically correct.

To Do

The yellow monitor yellow monitor next to an exercise suggests that you should solve it using the mathlet and a yellow pencil yellow pencil indicates that pencil-and-paper computation might be necessary.

die 1. Get familiar with the mathlet by generating the truth tables for the elementary propositions
tildep
p and q
p or q
p implies q
p iff q
p exclusive or q
and check to see that they're correct!
die 2. Show that p implies q is logically equivalent to notp or q by creating their truth tables.
die 3. The converse of p implies q is q implies p and the contrapositive of p implies q is notq implies tildep. Show that the converse is not logically equivalent to the contrapositive by creating their truth tables.
die 4. Show that the contrapositive of p implies q is logically equivalent to p implies q by creating their truth tables.
die 5. Prove the distributive law, p or (q and r) is logically equivalent to (p or q) and (p or r), by creating two truth tables.
diepencil 6. Translate the following sentence into a logical proposition using three logic variables.
You can connect to the Internet from your dorm room only if you are a CS major or you have not defaulted on your tuition payments.
Then use Truth Table to create the truth table for this proposition. Under what circumstances can a student not connect to the Internet from her dorm room? Use the truth table to back up your assertion. If you are a CS major and have defaulted on your tuition payments, can you connect? Again, use the truth table to justify your conclusion.
diepencil 7. Create a logical proposition s in two propositional variables p and q, with the following truth table. Use only tilde, and, and or in your proposition.
p q s
T T F
T F T
F T F
F F T
Now do the same thing for three propositional variables, p, q, and r.
p q r s
T T T T
T T F F
T F T F
T F F T
F T T F
F T F T
F F T F
F F F T
Informally describe an algorithm to do this for an arbitrary truth table with n propositional variables.