MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Logic Problems


DR JOHN C ERB (TTCJ34A at prodigy.com) wrote:
: Can Mathematica be used to solve logic problems?  As a
: simplistic example: Mary is older than Tom; Tom is older
: than Sue; is Mary older than Sue?  I would like to be able
: to do this type of problem without specifying values (i.e., 
: ageMary=35).
: Thank you.
: John C. Erb 

Try this:

In:

mary>tom;
tom>sue;
Sort[{mary,tom,sue},(#2<#1)&]

Out:

{mary, tom, sue}

Of course, this implies some personal bias (namely, "older than" =
"greater than"). Hope this helps.
Brett
bshoels at rs6000.tcs.tulane.edu



  • Prev by Date: Turning Off Commutativity
  • Next by Date: Modulus 10 or 11
  • Previous by thread: Logic Problems
  • Next by thread: Logic Problems