edited by
14,594 views
62 votes
62 votes

"If $X$ then $Y$ unless $Z$" is represented by which of the following formulas in propositional logic? ("$\neg$" is negation, "$\land$" is conjunction, and "$\rightarrow$" is implication)

  1. $(X\land \neg Z) \rightarrow Y$
  2. $(X \land Y) \rightarrow \neg Z$
  3. $X \rightarrow(Y\land \neg Z)$
  4. $(X \rightarrow Y)\land \neg Z$
edited by

10 Answers

Best answer
90 votes
90 votes

Answer is a) $(X \land \lnot Z)\to Y$

(refer page 6,7 Discrete Math,ed 7, Kenneth H Rosen)

Implication "$P$ implies $Q$" i.e., $(p \to Q)$, where $P$ is Premise and $Q$ is Conclusion, can be equivalently expressed in many ways. And the two equivalent expression relevant to the question are as follows:

  1. "If $P$ then $Q$"
  2. "$Q$ unless $\lnot P$" 


Both of these are equivalent to the propositional formula $(P \to Q)$,

Now compare "If $X$ then $Y$ unless $Z$" with  "$Q$ unless $\lnot P$" , here $(\lnot P = Z)$ so $(P = \lnot Z)$ and $(Q = Y)$

Compare with "if $P$ then $Q$", here $(P = X) , (Q= Y)$

So we get premise $P= X \text{ and } \lnot Z,$ conclusion $Q = Y$

Equivalent propositional formula $(X \land \lnot Z) \to Y$

PS: Someone messaged me that i have taken "If $X$ then ($Y$ unless $Z$)" in above explanation and how to know if we take "(If $X$ then $Y$) unless $Z$" or "If $X$ then ($Y$ unless $Z$)". So let me show that both way gives the same answer.

"(If $X$ then $Y$) unless $Z$"  $\equiv (X\to Y)$ unless $Z$

$$\begin{align}
&\equiv \lnot Z \to (X\to Y) \\
&\equiv \lnot Z\to (\lnot X \lor Y) \\
&\equiv Z \lor \lnot X \lor Y \\
&\equiv \lnot (X \land \lnot Z) \lor Y \\
&\equiv (X \land \lnot Z) \to Y
\end{align}$$

selected by
72 votes
72 votes
while ( not z )
{
if (X) then
    Y
}
or
unless( z ) 
{
if (X) then
    Y
}

this is what it means in programming. if you want to execute statement $Y$ then $X$ must be $\text{True}$ and $Z \text{False}$, which is equivalent to $(X\wedge \neg Z)Y.$

option (A).

edited by
19 votes
19 votes
The statement "If X then Y unless Z" means, if Z doesn't occur, X implies Y
i.e. ¬ Z→ (X→ Y), which is equivalent to Z∨ (X→ Y) (since P→ Q ≡ ¬ P∨ Q),
Which is then equivalent to Z∨ ( ¬X∨ Y). Now we can look into options which one matches with this.
So option A is (X∧ ¬ Z)→ Y = ¬ ((X∧ ¬ Z))∨ Y = ( ¬X∨ Z)∨ Y, which matches our expression.

So option A is correct.
8 votes
8 votes
I just to tried to simplify it more

Statement : IF X THEN Y UNLESS Z

we can write it like this (IF X THEN Y) UNLESS Z

whenever you see UNLESS  operator just keep in mind to replace it with "IF NOT " your work is half done

=> (IF X THEN Y) IF NOT Z

=> (IF X THEN Y) IF (NOT Z)

now see it falls in the form of Q if P which is another form of P->Q

=> ~Z -> (IF X THEN Y )

=> ~Z -> (X -> Y)

=> ~Z -> ( ~X ∨ Y)

=>~(~Z) ∨ ( ~X ∨ Y)

=> Z ∨ ~X ∨ Y

=> (Z ∨ ~X ) ∨ Y

=> ~ (~Z ∧ X ) ∨ Y

=>  (~Z ∧ X ) -> Y
Answer:

Related questions

18 votes
18 votes
2 answers
1
57 votes
57 votes
4 answers
3
30 votes
30 votes
3 answers
4
Kathleen asked Sep 15, 2014
9,203 views
In $2's$ complement addition, overflowis flagged whenever there is carry from sign bit additioncannot occur when a positive value is added to a negative valueis flagged w...