Truth Tables

A truth table displays the relationships between truth values (T or F) of different propositions.
Truth Table

Conjunction

Let p and q be propositions. The proposition ″p and q″ denoted by p∧q, is true when both p and q are true and is false otherwise. The proposition p∧q is called the conjunction of p and q.
Truth Table: Conjunction

Assume the following:
p = ″Omar has obtained very high overall score in the SAT Exam″
q = ″ The subject Biology in Omar's SAT results was the highest score″
Hence, p∧q = ″Omar has obtained very high score in the SAT Exam, and the subject Biology in Omar's SAT results was the highest score″

Disjunction

Let p and q be propositions. The proposition ″p or q″ denoted by p∨q, is false when both p and q are false and is true otherwise.
The proposition p∨q is called the disjunction of p and q.
Truth Table: Disjunction

Assume the following:
p∨q (the or is used inclusively, i.e., p∨q is true when either p or q or both are true).
p = ″Omar has obtained very high overall score in the SAT Exam″
q = ″ The subject Biology in Omar's SAT results was the highest score″
Hence, p∨q = ″Omar has obtained very high score in the SAT Exam, or the subject Biology in Omar's SAT results was the highest score″

Exclusive or

Let p and q be propositions. The proposition "p exclusive or q" denoted by p⊕q, is true when exactly one of p and q is true and it is false otherwise.

Truth Table: Exclusive

″Students who have taken calculus or computer science, but not both, can enroll in this class.″

Conditional Statement (implication)

Let p and q be propositions. The conditional statement p → q is the proposition ″if p, then q.″
The conditional statement p→q is false when p is true and q is false, and true otherwise.
In the conditional statement p→q, p is called the hypothesis and q is called the conclusion.
A conditional statement is also called implication.

Truth Table: Conditional Statement

Example: ″If you get 100% on the final, then you will get an A.″
Another example

Biconditional

Example: p = "You can take the flight,"
q = "You buy a ticket. "
Then p↔q is the statement "You can take the flight if and only if you buy a ticket."
Try these examples below and check if it is true or false:

Truth Tables of Compound Propositions

Four important logical connectives including conjunctions, disjunctions, conditional statements, and biconditional statements,
as well as negations can be used to build up compound propositions.
Example:
Construct the truth table of the compound proposition (p ∨ ¬q) → (p∧q)
For two propositional variables p and q, there are four rows in this truth table,
one for each of the pairs of truth values TT, TF, FT, and FF.

Truth Table: Conditional Statement

Try to fill out the above table:
The completed table is as below:

Truth Table: Conditional Statement

Precedence of Logical Operators

We will generally use parentheses to specify the order in which logical operators in a compound proposition are to be applied.
Otherwise, logical operators are applied in the following precedence.

Truth Table: Conditional Statement

Logic and Bit Operations

We need to encode two values True and False:
Computers represents data and programs using 0s and 1s
Logical truth values: True and False
A bit is sufficient to represent two possible values:
0 (False) or 1(True)
A variable that takes on values 0 or 1 is called a Boolean variable.

Truth Table: Conditional Statement

Definition: A bit string is a sequence of zero or more bits.
The length of this string is the number of bits in the string.
Example: Find the bitwise OR, bitwise AND, and bitwise XOR of the bit strings 01 1011 0110 and 11 0001 1101.
01 1011 0110
11 0001 1101
11 1011 1111 bitwise OR
01 0001 0100 bitwise AND
10 1010 1011 bitwise XOR


For more details, please contact me here.
Date of last modification: 2024