Generating Truth Table for n Atoms


#1

I want to create a code for n Atoms to obtain a Truth Table. Right now, I have the following for 1 Atom.

P<-function(I)
{
  if(I==1)
  {
    return(matrix(c(T,T)))
  }
  else if(I==2)
  {
    return(matrix(c(T,F)))
  }
  else if(I==3)
  {return((matrix(c(F,T))))
  }
  else{return(matrix(c(F,F)))}
}

#2

It is unlikely that anyone knows the context or meaning of this question.

Can you give us some background and maybe broader examples of the problem?


#3

A post was split to a new topic: Suggestions for translations of C-code to R-code