Truth table $2^n$ rule rows I understand the rule of $2^n$ rows for $n$ inputs but how do you show how many of those rows are T
 A: As far as we know, there is no good way in general to figure out how many of the rows will evaluate to true without writing out the table. The problem is known as #Sat and is NP-hard (since just Sat is NP-complete). While we do not have a proof that there is no good way to solve NP-hard problems like the one you are asking about, at least this tells us that no fast method is known, since it would solve one of the most famous open problems in mathematics: the P = NP problem.
If you are asking about a specific formula, or even a specific class of formulas, there might be good ways to figure it out; but in general, there is not, as far as anyone knows.
A: This is hard in general, but there are ways to find the solution for truth tables based on simple rules. In particular, if the rule to find the truth table is such that no variable appears more than once, we can find the number of true rows recursively.
Define $N(T)$ to be the number of rows of the truth table of $T$ which are true and $M(T)$ be the number of rows which are false.
If the rule is of the form $T = T_1 \& T_2$ where $T_1$ and $T_2$ are expressions which do not have any common variables, it is easy to see that $N(T) = N(T_1) N(T_2)$.
Similarly, if $T = T_1 | T_2$, we have $N(T) = \left[N(T_1)+M(T_1)\right]\left[N(T_2)+M(T_2)\right]-M(T_1)M(T_2)$
Hence try to see whether this kind of recursive splitting of the rule into subrules without overlap is possible. If so, you can find the final answer pretty efficiently with recursion.
