MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re2: Is it doable in Mathematica? How?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39749] Re: [mg39727] Re2: [mg39704] Is it doable in Mathematica? How?
  • From: Dr Bob <drbob at bigfoot.com>
  • Date: Wed, 5 Mar 2003 00:05:35 -0500 (EST)
  • References: <200303040450.XAA25950@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

I had a typo.  Here's the right code.

row[a_, b_, c_] := {a, b, c, a && b && c, Implies[a || b, c]}
logicals = {False, True};
TableForm[Flatten[Outer[
      row, logicals, logicals, logicals], 2], TableHeadings -> {None, {a, 
b, \
c, a && b && c, "(a||b)\[Implies]c"}}]

Bobby

On Mon, 3 Mar 2003 23:50:29 -0500 (EST), Helge Andersson 
<helge at envic.chalmers.se> wrote:

> Dennis,
>
> Here is a slightly neater and clearer version of my earlier posting.
>
> tab1=Flatten[Table[{i,j,k},{i,0,1},{j,0,1},{k,0,1}],2]/.{0->False,1- 
> >True};
> {P,Q,R}=Transpose[tab1];
> och=And[P[[#]],Q[[#]],R[[#]]]&/@Range[Length[tab1]];
> eller=Or[P[[#]],Q[[#]],R[[#]]]&/@Range[Length[tab1]];
> ellermedfor=Implies[Or[P[[#]],Q[[#]]],R[[#]]]&/@Range[Length[tab1]];
> TableForm[Fold[Append,Transpose[tab1],{{},och,eller,ellermedfor}],TableHeadings- 
>
>
> >{{"P","Q","R"," 
> ","And[P,Q,R]","Or[P,Q,R]","Implies[Or[A,B],C]"},Range[Length[tab1]]}]
>
> /Helge Andersson
> Chalmers
> Sweden
>
>
> At 04:25 2003-03-03 -0500, you wrote:
>> I'd like to create a truth table for, say, A, B and C, as
>> well as two different expression, say, A&&B&&C and
>> (A||B) -> C. How do i go about that?
>>
>> I have tried Table, but since True/False are not allowed
>> there i got stuck. The help in Mathematica was of little
>> help in this case. Any hints or suggestions?
>>
>> --
>>
>> Vänligen
>> Konrad
>> ---------------------------------------------------
>> phone #1:  (+46/0) 708 - 70 73 92
>> phone #2: (+46/0) 704 - 79 96 95
>> url: http://konrads.webbsida.com
>> e-mail: chamsterkonrad at bigfoot.com
>> -----------------------------------
>>
>> Sleep - thing used by ineffective people
>> as a substitute for coffee
>>
>> Ambition - a poor excuse for not having
>> enough sence to be lazy
>> ---------------------------------------------------
>
>
>



-- 
majort at cox-internet.com
Bobby R. Treat



  • Prev by Date: Re: Is Sort stable?
  • Next by Date: webMathematica trouble - solution
  • Previous by thread: Re2: Is it doable in Mathematica? How?
  • Next by thread: Re: Is it doable in Mathematica? How?