Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'help with Distribute command and truth tables' topicStudent Support Forum > General > Archives > "help with Distribute command and truth tables"

Next Comment >Help | Reply To Topic
Author Comment/Response
ravi
04/22/06 07:21am

I am interested in making a truth table with a function as follows :
TruthTable[vars_List, expr_List]
I found the following code in the help documentation for the command Distribute :
TruthTable[vars_List, expr_] := Distribute[
Table[{True, False}, {Length[vars]}], List,
List, List, {##, Function[vars, expr][##]} &]
I would like to have help on the following points:
1. I don't understand the construction of the code shown above (see the nb file attached for details).
2. Can the function be constructed with an "Outer" instead of the "Distribute" command. This will perhaps help me in understanding the use of the commands better.
3. As I noted in the beginning, I am interested in making a truth table for a list of expressions instead of a single expression as in the code shown above. Would appreciate help in showing me how the above code can be modified.
Thanks,
Ravi

Attachment: Question_TruthTable.nb, URL: ,

Subject (listing for 'help with Distribute command and truth tables')
Author Date Posted
help with Distribute command and truth tables ravi 04/22/06 07:21am
Re: help with Distribute command and truth tables yehuda ben-s... 05/01/06 12:05pm
Next Comment >Help | Reply To Topic