Re: ((a&&b)||c)==((a||c)&&(b||c))

• To: mathgroup at smc.vnet.net
• Subject: [mg62061] Re: [mg62015] ((a&&b)||c)==((a||c)&&(b||c))
• From: Daniel Lichtblau <danl at wolfram.com>
• Date: Thu, 10 Nov 2005 02:50:55 -0500 (EST)
• References: <200511090845.DAA17387@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Steven T. Hatton wrote:
> Why does Mathematica not determine that the following is true?
>
> ((a \[And] b) \[Or] c) == ((a \[Or] c) \[And] (b \[Or] c))
>
> This little function shows that the lhs  and rhs have the same truth tables,
> and are therefore equivalent:
>
> TruthTable[s_, argc_] := Module[
>     {tt = Tuples[{True, False}, argc]},
>     {#, s @@ #} & /@ tt // TableForm
>     ]
>

Equal does not do logical manipulations on its operands. Nor will
LogicalExpand automatically thread over Equal. Probably a better way to
implement your biconditional (mentioned in another MathGroup post today,
with regard to this same example) would be

biconditional[p_, q_] := Implies[p,q] && Implies[q,p]
(suggested by Andrzej Kozlowski, I think)

or

biconditional[p_, q_] := Not[Xor[p,q]]

or logical expand in advance and use

biconditional[p_, q_] := (p&&q) || (!p&&!q)

These remain in the realm of logical operations rather than
"arithmetic-like" operators such as Equal. Depending on your purpose
this might be preferable. The fact that you use a truth table above
indicates to me that you probably would be better served by strictly
logical operations.

Daniel Lichtblau
Wolfram Research

```

• Prev by Date: Re: feature request: invert plot axes
• Next by Date: GuideBook in the HelpBrowser(Linux)
• Previous by thread: Re: ((a&&b)||c)==((a||c)&&(b||c)) is not true
• Next by thread: Re: ((a&&b)||c)==((a||c)&&(b||c))