Building truth tables of logical expressions
A truth table shows the value of an expression for every possible combination of its variables. The procedure: 1) find the number of variables n; 2) count the operations k; 3) fix the order of operations from the brackets and priorities; 4) the number of columns is c = n + k; 5) write the variables and each operation in the header row; 6) the number of rows is r = 2ⁿ (not counting the header); 7) write the values of the variables as binary numbers in increasing order (00, 01, 10, 11…); 8) fill the columns from left to right. Each variable has two values, so n variables give 2·2·…·2 = 2ⁿ combinations: 4 rows for two, 8 for three, 16 for four. The last column gives the value of the whole expression.
“Table masters”: each group gets an expression on the board, first writes the number of columns and rows, then fills in the table. The first group to finish without mistakes wins.