Creating Truth Tables: Arranging Variables w/ 3+ Props

  • Context: High School 
  • Thread starter Thread starter Bashyboy
  • Start date Start date
Click For Summary
SUMMARY

This discussion focuses on creating truth tables for propositional variables, specifically when the number of variables exceeds two. The key takeaway is that for n propositional variables, there are 2n combinations. The method involves dividing the total number of rows by 2 for each subsequent variable to establish a periodic pattern of truth values. A computer program has been developed to automate this process using the described algorithm.

PREREQUISITES
  • Understanding of propositional logic and truth values
  • Familiarity with binary arithmetic concepts
  • Basic programming skills for implementing algorithms
  • Knowledge of algorithmic thinking for recursive processes
NEXT STEPS
  • Research "Constructing truth tables for n variables" to deepen understanding of combinations
  • Explore "Binary counting methods" for insights on periodic patterns
  • Learn about "Algorithm design in programming" to enhance coding skills
  • Investigate "Python programming for logic simulations" to implement truth table generators
USEFUL FOR

This discussion is beneficial for students of logic, computer science enthusiasts, and programmers interested in automating logical computations and truth table generation.

Bashyboy
Messages
1,419
Reaction score
5
I am having a little bit of difficulty in arranging the truth value of a each propositional variable, specifically when the amount of propositional variables exceeds 2. I know if I have three propositional variables, then I have eight combinations, meaning my first column would look like:

P
T
T
T
T
F
F
F
F

Is there a general pattern to follow for creating columns for, say, Q and R?
 
Physics news on Phys.org
Think of doing a countdown in binary arithmetic.
111
110
101
100
010
...etc
If you read down the columns, the entries have a periodic pattern. The period of a column is half the period of the column to its left.
 
Count the number of distinct sentence letters, say this number is n. Then the total number of rows will be 2n. For your first sentence letter divide 2n in half. Say the result is m. So make m T's and m F's under the first letter. Then take m and divide it in half coming up with, say, p, and make p T's and p F's under the next letter. Then divide p in half and make that many T's and that many F's under the next sentence letter. Continue this process until the number you obtain by dividing in half is the number one. Then make one T and one F under the last letter until you reach the end.

As an example for 3 sentence letters there are eight possibilities. So for the first letter we make 4 (8/2) T's and 4 F's. Then we make 2 (4/2) T's and 2 F's until we reach the end. Finally, we make 1 (2/2) T and 1 F down the column until we reach the eighth row.

I have a computer program that I've written for making truth tables that uses this algorithm for filling in the possibilities.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K