-2
$\begingroup$

Let a, b and c be propostional wffs. Find two different wffs where the statement "if a then b else c" reflects the meaning of each wffs.

I found what this statement is represented as but i got stuck from there. Please help!!!

  • 0
    What is a wffs? And what does "reflects the meaning of each wffs" mean?2017-01-25
  • 0
    wff is a well formed formula2017-01-25
  • 0
    What do you mean by "I found what this statement is represented as"? Does this mean you have answered the question but there is more to it?2017-01-25
  • 0
    yes it is represented as (A -> B and not A -> C) idk where to go from there2017-01-25
  • 0
    Do you mean $(a\rightarrow b) \lor c$, or do you mean $(a\rightarrow (b\lor c)))$ I.e, do you mean to say "(if a then b) or c", or do you mean "(if a) then (b else c). The statement is ambiguous, and each interpretation is different.2017-01-25

3 Answers 3

2

The problem (I have) here is to precisely interpret the statement "if A then B else C". If as a programmer I would interpret it as if $A$ is true then the truth value of the statement is that of $B$ otherwise (if $A$ is false) it's the truth value is that of $C$.

One could for example express this (in disjunctive normal form) as:

$$(A\land B) \lor (\neg A\land C)$$

Then one could of course rewrite it (in conjunctive normal form) as:

$$(A\lor C) \land (\neg A\lor B)$$

If you're a mathematician you might tend to interpret the statement as something extending the notion of implication. Beginning with if $A$ then $B$ would mean that $A$ implies $B$, and extending that into that also $\neg A$ implies $C$. In that case it would be expressed as:

$$(A\Rightarrow B)\land(\neg A\Rightarrow C)$$

which is the same as the above since in disjunctive normal normal form it would be:

$$(A\land B)\lor(\neg A\land C)$$

  • 0
    In your last line, how is it different from above (it looks like the same thing)?2017-01-25
  • 0
    @spaceisdarkgreen My mistake, I flipped the variables in my Karnaugh diagram somewhere. I have corrected this. They are actual the same (which surprised me somehow).2017-01-25
2
  1. "If $a$ then $b$" can be represented as $$a \Rightarrow b$$
  2. "else $c$" in this case means "if not $a$ then $c$", so $$\neg a \Rightarrow c$$
  3. Combine these two statements using "and", and we have: $$(a\Rightarrow b)\wedge (\neg a \Rightarrow c)$$

  4. This statement can be represented equivalently as: $$(\neg a \vee b)\wedge (a \vee c)$$

Edit

According to the comment by @amWhy:

"if $a$ then $b$ else $c$" is true iff $a$ and $b$ are true or $a$ is false and $c$ is true. It leads to another equivalent statement: $$(a\wedge b)\vee(\neg a \wedge c)$$ So let's denote: $$P(a,b,c)=(a\Rightarrow b)\wedge (\neg a \Rightarrow c)\\ Q(a,b,c)=(\neg a \vee b)\wedge (a \vee c)\\ R(a,b,c)=(a\wedge b)\vee(\neg a \wedge c)\\ S(a,b,c)=(a\Rightarrow b)\vee(\neg a \Rightarrow c)$$ We wan't to find statements that are equivalent to $R(a,b,c)$. Let's biuld a table: $$\begin{array}.a&b&c&|&P(a,b,c)&|&Q(a,b,c)&|&R(a,b,c)&|&S(a,b,c)\\ \hline 0&0&0&|&0&|&0&|&0&|&\color{red}1\\ 0&0&1&|&1&|&1&|&1&|&1\\ 0&1&0&|&0&|&0&|&0&|&\color{red}1\\ 0&1&1&|&1&|&1&|&1&|&1\\ 1&0&0&|&0&|&0&|&0&|&\color{red}1\\ 1&0&1&|&0&|&0&|&0&|&\color{red}1\\ 1&1&0&|&1&|&1&|&1&|&1\\ 1&1&1&|&1&|&1&|&1&|&1\end{array}$$ As we can see, the statemets $P(a,b,c), Q(a,b,c)$ and $R(a,b,c)$ are equivalent, while statement $S(a,b,c)$ is different from these three in four cases

  • 0
    I think your conjunction here is (step 3) is incorrect. Else means "or else".2017-01-25
  • 0
    @amWhy I've edited my answer to explain my point.2017-01-25
  • 0
    Nice write-up, Jaroslaw!2017-01-25
  • 1
    This is maybe a bit late to bring this up, but i think line 3 of your table is incorrect, P, Q and R should evaluate to false, but S should evaluate to true. because a -> b is true if a is false and b is true. It doesnt change anything else with the rest of the post, but just in case anyone was getting confused!2018-04-19
  • 0
    @guskenny83 good point, thank you.2018-04-19
0

I think one equivalent statement would be $(a\land b)\vee(\neg a\land c)$. If you redistribute that I think you get $(a\lor\neg a)\land(b\lor c)\iff b\lor c$. The first shows your two scenarios, while the second highlights that one of $b$ or $c$ will occur regardless or $a$.

  • 0
    how did you get there? im assuming you converted a->b to (not a or b) which leaves you with (not a or b) and (not a -> c)2017-01-25
  • 0
    Sort of, I figured there were two options: either $a$ and $b$ happen, or $a$ doesn't happen and $c$ happens. This would translate to $(a\land b)\lor(\neg a\land c)$. Not sure if that makes logical sense, but intuitively it felt right2017-01-25