Re: Logic Problems
- Subject: [mg2454] Re: Logic Problems
- From: bshoels at rs5.tcs.tulane.edu (Brett Shoelson)
- Date: Thu, 9 Nov 1995 04:46:09 GMT
- Approved: usenet@wri.com
- Distribution: local
- Newsgroups: wri.mathgroup
- Organization: Tulane University
- Sender: daemon at wri.com ( )
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