I need to write the following sentence as a formula in propositional logic: Exactly 2 of the prepositions a,b,c are true. This is how I solved it: (a <-> b) -> c. Is it correct? If my solution is wrong, what would the correct option be? I am a beginner and I am trying to learn this on my own so I have no one else to ask, don't be to harsh on me please!
Propositional Logic Formula
88 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
No, that's not correct, because if all three are true, your expression is true, and you need an expression that is true if and only if exactly two out of three are true.
In fact, you really don't want to have any sub-expression like $a \leftrightarrow b$ do any of the 'work' in your whole expression, since that sub-expression is true iff either both $a$ and $b$ are true or both are false, and so if your whole expression evaluates to true if and only if exactly two are true, then that means that when $a$ and $B$ are true and $c$ is false, your whole expression is true, but given that thew whole expression relies on the sub-expression $a \leftrightarrow b$, and given that that sub-expression would also be true when $a$ and $b$ are both false, you end up with the whole expression being true when all three are false, which is not what you want. So, I wouldn't use $\leftrightarrow$ operator in your expression at all.
OK, here's a Hint:
You want to express that exactly two of the three are true. In other words, you want an expression that is true if and only if:
either $a$ and $b$ are true and $c$ is false, or $a$ and $c$ are true and $b$ is false, or $b$ and $c$ are true and $a$ is false
Hmm ... is there a way to put this last sentence into logic?
The easiest way would be a truth table:
$\begin{array}{C|C|C|C} A & B & C & & D\\ \hline F & F & F & & F \\ F & F & T & & F \\ F & T & F & & F \\ F & T & T & & T \\ T & F & F & & F \\ T & F & T & & T \\ T & T & F & & T \\ T & T & T & & F \\ \end{array}$
Now you can write your formula:
$(\lnot A \land B \land C) \lor (A \land \lnot B \land C) \lor (A \land B \land \lnot C)$