Subjects logic

Xor Truth

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Search Solutions

Xor Truth


1. Problem statement: Construct truth tables for the compound propositions $p \oplus p$, $p \oplus \lnot p$, and $p \oplus \lnot q$. 2. Definition: The exclusive or (XOR) is true exactly when the two operands have different truth values. $$A \oplus B \equiv (A \land \lnot B) \lor (\lnot A \land B)$$ 3. Part (a): $p \oplus p$. Evaluate for each value of $p$. | $p$ | $p \oplus p$ | |---|---| | $T$ | $F$ | | $F$ | $F$ | When $p$ is $T$, $(p \land \lnot p) \lor (\lnot p \land p) = (T \land F) \lor (F \land T) = F \lor F = F$. When $p$ is $F$, $(p \land \lnot p) \lor (\lnot p \land p) = (F \land T) \lor (T \land F) = F \lor F = F$. Thus $p \oplus p$ is always false, so $p \oplus p \equiv \bot$. 4. Part (b): $p \oplus \lnot p$. Algebraic simplification using the definition gives: $$p \oplus \lnot p = (p \land \lnot(\lnot p)) \lor (\lnot p \land \lnot p) = (p \land p) \lor (\lnot p \land \lnot p) = p \lor \lnot p = \top$$ Therefore $p \oplus \lnot p$ is always true, so it is a tautology. 5. Part (c): $p \oplus \lnot q$. We construct the truth table for $p$ and $q$. | $p$ | $q$ | $\lnot q$ | $p \oplus \lnot q$ | |---|---|---|---| | $T$ | $T$ | $F$ | $T$ | | $T$ | $F$ | $T$ | $F$ | | $F$ | $T$ | $F$ | $F$ | | $F$ | $F$ | $T$ | $T$ | Explain each row: when $p=T,q=T$ then $\lnot q=F$ and $(T \land \lnot F) \lor (F \land F) = (T \land T) \lor F = T$. When $p=T,q=F$ then $\lnot q=T$ and $(T \land \lnot T) \lor (F \land T) = (T \land F) \lor F = F$. When $p=F,q=T$ then $\lnot q=F$ and $(F \land \lnot F) \lor (T \land F) = F \lor F = F$. When $p=F,q=F$ then $\lnot q=T$ and $(F \land \lnot T) \lor (T \land T) = F \lor T = T$. Thus the truth table above is correct and $p \oplus \lnot q$ is true exactly when $p$ and $q$ differ in the pattern shown above.