Questions on use and formulation of logical operations, including both functions for programming and for mathematical operations.

learn more… | top users | synonyms

22
votes
4answers
5k views

Elegant solution to the Zebra [logic] Puzzle (“Einstein's Riddle”)

The famous Zebra Puzzle (Wikipedia), often called "Einstein's Riddle," is a logic puzzle that can be solved deductively by applying a list of logical rules. One version of the riddle (from Wikipedia) ...
12
votes
0answers
125 views

Logical AND of multiple patterns

Mathematica provides an equivalent for "logical OR" when pattern matching, using Alternatives or the infix | operator. For ...
8
votes
2answers
261 views

TrueQ returning False on true statement

Why does TrueQ return False on the following? TrueQ[Log[2]/Log[8] == 1/3] (* False *) ...
0
votes
1answer
48 views

Resolving a logical statement

I would like to test whether f[n] > 0 and f[n + 1] > 0 implies f[n + 2] > 0. This ...