Message Boards Message Boards

0
|
8281 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Evaluate logical expressions using the IMPLIES operator with 8 var in W|A?

Posted 7 years ago

I have found that Wolfram Alpha rarely understands queries in which the logical expression has more the three variables. I am trying to evaluate:

((A IMPLIES B) AND (B IMPLIES A) AND (C IMPLIES D) AND (D IMPLIES F) AND (E IMPLIES F) AND (F IMPLIES G) AND (G IMPLIES H))

I want to know how many truth valuations satisfy this logical statement, but I am only getting errors. Any ideas? Is this a problem with the engine?

POSTED BY: Ben Elo
2 Replies

THis might be out of reach for Wolfram|Alpha in terms of figuring out what is wanted. In Mathematica it can be done as below.

expr = And[Implies[aa, bb], Implies[bb, aa], Implies[cc, dd], 
   Implies[dd, ff], Implies[ee, ff], Implies[ff, gg], Implies[gg, hh]];
SatisfiabilityCount[expr]

(* Out[974]= 18 *)

One way to find explicit sets that give True, without showing all others, is to convert to an "exclusive sum-of-products" form. It will give an exclusive Or of conjunctions.

BooleanConvert[expr, "ESOP"]

(* Out[975]= (aa && bb && dd && ff && gg && hh) \[Xor] (! aa && ! bb && 
   dd && ff && gg && hh) \[Xor] (aa && bb && ! cc && ! dd && ! ee && 
   gg && hh) \[Xor] (aa && 
   bb && ! cc && ! dd && ! ee && ! ff && ! gg) \[Xor] (! aa && ! 
    bb && ! cc && ! dd && ! ee && gg && 
   hh) \[Xor] (! aa && ! bb && ! cc && ! dd && ! ee && ! ff && ! 
    gg) \[Xor] (aa && bb && ! cc && ! dd && ee && ff && gg && 
   hh) \[Xor] (! aa && ! bb && ! cc && ! dd && ee && ff && gg && hh) *)

By counting the number of atoms in each conjunction one can see how many cases give True (it is 2^(8-#atoms)). The totl for the above is indeed 18.

POSTED BY: Daniel Lichtblau
Posted 7 years ago

Sometimes using WolframAlpha to solve or simplify a part of a problem and then use that result to construct a simpler problem to get the final solution will work.

By simplifying (A IMPLIES B) AND (B IMPLIES A) to A<=>B this

WolframAlphaQuery

seemed to be successful.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract