Message Boards Message Boards

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

How to enter a truth table into Wolfram|Alpha?

Posted 9 years ago

Hello!

Given the input variables a and b and the output variables x and y, what do I have to enter into Wolfram|Alpha to solve this truth table:

a b | x y
0 0 | 0 0
0 1 | 0 1
1 0 | 0 0
1 1 | 1 0

The desired result is:

x = a AND b
y = NOT(a) AND b

Thanks!

Lucas.

POSTED BY: Lucas Petritsch
2 Replies

Thanks Sean!

I had already tried various "permutations" of the syntax in the documentation. I always get the answer:

Wolfram|Alpha doesn't understand your query

Showing instead result for query: True, False

Using your example: http://www.wolframalpha.com/input/?i=BooleanFunction[{{False%2C+False}+-%3E+True%2C+{False%2C+True}+-%3E+False%2C+{True%2C+False}+-%3E+True%2C+{True%2C+True}+-%3E+True}%2C+{x%2C+y}]

Does Wolfram|Alpha really not understand Mathematica's syntax? If so, a hint within the reply of Wolfram|Alpha would be nice:

"Please use Mathematica for such advanced demands!"

POSTED BY: Lucas Petritsch

This is probably something you need Mathematica Online to do. You probably can't do it in Wolfram|Alpha alone.

The function you want is called BooleanFunction:

BooleanFunction[{{False, False} -> True, {False, True} -> False, {True, False} -> True, {True, True} -> True}, {x, y}]

Please see the documentation for more examples.

POSTED BY: Sean Clarke
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