Ask your own question, for FREE!
Mathematics 10 Online
OpenStudy (anonymous):

Anyone familiar with Mathematica?

OpenStudy (anonymous):

Yo

OpenStudy (anonymous):

Hey

OpenStudy (anonymous):

I need help generating some truth tables using mathematica

OpenStudy (anonymous):

What tables?

OpenStudy (anonymous):

\[((p->q)||-p)\]

OpenStudy (anonymous):

using commands

OpenStudy (anonymous):

pp = {True, False}; qq = {True, False}; Table[{"p=" pp[[m]], "q=" qq[[n]], "((p\[Minus]>q)||\[Minus]p)=" Implies[pp[[m]], qq[[n]]] || ! pp[[m]]} , {m, 1, 2}, {n, 1, 2}]

OpenStudy (anonymous):

Output \[ \left( \begin{array}{cc} \{\text{p=} \text{True},\text{q=} \text{True},\text{((p-$>$q)$||$-p)=} \text{True}\} & \{\text{p=} \text{True},\text{q=} \text{False},\text{((p-$>$q)$||$-p)=} \text{False}\} \\ \{\text{p=} \text{False},\text{q=} \text{True},\text{True}\} & \{\text{p=} \text{False},\text{q=} \text{False},\text{True}\} \\ \end{array} \right) \]

OpenStudy (anonymous):

Give me one sec, I'll show you what I'm putting in

OpenStudy (anonymous):

truthtable = BooleanTable[{p, q, Implies[p, q] , Or[Not[p]]}, {p, q}]; TableForm[truthtable, TableHeadings -> {None, {"p", "q", "((p\[RightArrow]q)\[Or]\[Not]p)"}}, TableSpacing -> {1, 4}]

OpenStudy (anonymous):

I'm getting the correct truth values for the expression, but I'm also getting an extra row of values

OpenStudy (anonymous):

BooleanTable[{p, q}, {p, q}] = {{True, True}, {True, False}, {False, True}, {False, False}}

OpenStudy (anonymous):

Your method is better than mine

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!