How do you find out the number of rows that is needed for the truth table?

73 Views Asked by At

How do you find out the number of rows that is needed for the truth table?

For example, for $A\implies B$ is a $4\ \text{x}\ 2$ table. What about if we want to make a table for, say,

$A\implies(P\implies R)$?

1

There are 1 best solutions below

0
On BEST ANSWER

Suppose you need a table with $f(n)$ rows to track through all the possible assignments of truth-values to $n$ variables. Then if we want to add another variable $X$, and track through all the possible assignments of truth-values to $X$ plus $n$ other variables, then you'll need to consider the case where $X$ is true, combined with the $f(n)$ assignments to the other variables, and then consider the case where $X$ is false, combined again with the $f(n)$ assignments to the other variables. That means $f(n + 1) = 2f(n)$.

Since $f(1) = 2$ (obviously!), it follows that $f(n) = 2^n$.