The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+23 votes
2.7k views

"If $X$ then $Y$ unless $Z$" is represented by which of the following formulas in prepositional 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$
asked in Mathematical Logic by Veteran (59.5k points)
retagged by | 2.7k views
+3

X→ (¬ZY)

+5
Basic Concept   A Unless B <=>  ~B -----> A (Conditional Statement)

                                           <=>   ~(~B ) ˅ A

                                         <=>    B ˅ A

                                        <=>     A ˅ B
0
good trick sir ...thanks lakshman sir

6 Answers

+51 votes
Best answer
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).

answered by Boss (13.5k points)
edited by
+1
Well explained
0
Someone please explain me this.
0
Cann't i write it as $xy + x'z$, if x is true then y else z
0
very beautifull & crisp explanation thank you @Vikrant sir
+33 votes
Answer is a) $(X∧¬Z)→Y$

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

Implication "$P$ implies $Q$" i.e., $(p→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

one is " if $P$ then $Q$ "

another is  "$Q$ unless $¬P$"  

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

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

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

So we get premise $P= 'X'$ and $'¬Z',$ conclusion $Q = 'Y'$

Equivalent propositional formula $(X∧¬Z)→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$"  $⇔(X→Y)$ unless $Z$

$\quad \quad ⇔ ¬Z→(X→Y)$
$\quad \quad⇔¬Z→(¬X \vee Y)$
$\quad \quad⇔Z \vee ¬X \vee Y$
$\quad \quad⇔ ¬(X∧¬Z) \vee Y $
$\quad \quad⇔ (X∧¬Z)→Y$
answered by (307 points)
edited by
0
In Rosen, page:17,example:2, there is a similar question.

q:"you can ride roller coaster"
r:"you are under 4feet tall"
s:"you are older than 16"

For representing" you cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old"

(-q) if (r unless s)
(-q) if (-s --> r)
( -s --> r ) --> (-q) is the answer I"m getting, however, in the example he replaced unless with and not and gave answer (r ^ -s ) --> -q;

Now, which is correct?
0
Best explanation for this question.Thanks sourav.
0
Better Explanation ... Unless Can be treated as "OR"
0

@ShanthanK

Same problem with me

anyone explain??

+8 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.
answered by Active (2.6k points)
+1 vote
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.
answered by Active (4.3k points)
+1 vote

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.

answered by Active (4.3k points)
0 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
answered by (191 points)
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

38,176 questions
45,681 answers
132,625 comments
49,576 users