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″

The proposition p∨q is called the disjunction of p and q.

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″

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

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.

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

- You get 100%, you get an A. Answer: True
- You get 100%, you do not get A. Answer: False
- You do not get 100%, you get an A. Answer: True
- You do not get 100%, you do not get an A. Answer: True

- If Adam got an A in Computer Science, then 4 + 5 = 9

is true from the definition of a conditional statement, because its conclusion is true. - If Adam got an A in Biology, then 6 + 7 = 9

is true if Adam did not get an A in Biology, even though 6+7=9 is false.

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:

- if you buy a ticket and can take the flight. Answer: True
- if you do not buy a ticket and you cannot take the flight. Answer: True
- you do not buy a ticket, but you can take the flight. Answer: False
- you buy a ticket but you cannot take the flight. Answer: False

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.

Try to fill out the above table:

The completed table is as below:

Otherwise, logical operators are applied in the following precedence.

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.

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: 2021