Professional Documents
Culture Documents
Examples:
true
11213 is prime.
Examples of Non-Proposition
p q pq
T T T
T F F
F T F
F F F
Note that a conjunction p1 p2 … pn of n
propositions will have 2n rows in its truth table
The Disjunction Operator
p q pq
T T T
T F F
F T
T
F F
p q is false only when p is true but q is not true.
T
English Phrases Meaning p q
“p implies q” “p only if q”
“if p, then q” “p is sufficient for q”
“if p, q” “q is necessary for p”
“when p, q” “q follows from p”
“whenever p, q” “q is implied by p”
“q if p”
“q when p”
“q whenever p”
Converse, Inverse, Contrapositive
Some terminology, for an implication p q:
Its converse is: q p.
Its inverse is: ¬p ¬q.
Its contrapositive: ¬q ¬p.
p q pq qp p q q p
T T T T T T
T F F
F T T T F
T
F F F F T
One of these three
T has the same meaning (same truth table) as
p q.Can you figure out which?
T T T
Examples
p: Today is Easter
q: Tomorrow is Monday
pq:
If today is Easter then tomorrow is Monday.
qp
p q pq p q p q (p q)
TT T F F F F
TF F F
F T T T T
F F F T
F T T
Show that
F T T
(p q) p q (De Morgan’s law)
p → q p q T T
p (q r) (p q) (p r) (distributive law)
0 1 – Bit values or Logical values or Boolean values
64 32 16 8 4 2 1
9 0 1 0 0 1 converting normal
2 1 0
Examples: Find the values of bit and, or, Xor for 1. 24 and 36 2. 9
and 16 3. 58 and 67
Rules for
Addition of Bits
Examples for Addition:
0 0101
1 1010
+1
1 1011
Subtraction Rules
1101
=0
1010
0 0 1 1
Numbers Systems:
• The decimal number system
• The binary number system
• The octal number system and
• The hexadecimal number system
Decimal to Binary
Binary to Decimal:
Example : Find the decimal value of the binary number (11001011)2 using the positional
notation method of binary to decimal conversion.
Decimal to Octal
Example : Convert Decimal number 2980 to octal
Octal to Decimal:
Example: Let P (x) denote the statement “x > 3.” What are the truth values
of P (4) and P (2)?
Solution: We obtain the statement P (4) by setting x = 4 in the statement “x
> 3.” Hence, P (4), which is the statement “4 > 3,” is true. However, P (2),
which is the statement “2 > 3,” is false
Topic #3 – Predicate Logic
Example : Let A(x) denote the statement “Computer x is under attack by an
intruder.” Suppose that of the computers on campus, only CS2 and MATH1
are currently under attack by intruders. What are truth values of A(CS1),
A(CS2), and A(MATH1)?
• Similarly, because CS2 and MATH1 are on the list of computers under
attack, we know that A(CS2) and A(MATH1) are true.
Topic #3 – Predicate Logic
Example: let P(x) = “x + 1 > x” We can then say, “For any number
x, P(x) is true” instead of (0+1 > 0) Λ (1+1>1) Λ (2+1>2) Λ……...
• The collection of values that a variable x can take is called x’s
universe of discourse or the domain of discourse (often just
referred to as the domain).
Topic #3 – Predicate Logic
Quantifier Expressions
Quantifiers provide a notation that allows us to quantify (count) how
many objects in the universe of discourse satisfy the given predicate.
• ∀ is the FOR ∀LL or universal quantifier
∀x P(x) means for all x in the domain, P(x).
• Ǝ is the Ǝxists or existential quantifier
Ǝx P(x) means there exists an x in the domain (that is, 1 or more)
such that P(x).
Example for Universal Quantifier
Example for Existential Quantifier:
Proofs
A Mathematical system consists of:
• Undefined terms
• Definitions
• Axioms
• Direct proof: p q
A direct method of attack that assumes the truth of proposition
p, axioms and proven theorems so that the truth of proposition
q is obtained.
Indirect proof :
The method of proof by contradiction of a theorem p q consists of the
following steps:
1. Assume p is true and q is false
2. Show that ~p is also true.
3. Then we have that p ^ (~p) is true.
4. But this is impossible, since the statement p ^ (~p) is always false. There
is a contradiction!
5. So, q cannot be false and therefore it is true.
5. Rule of Conjunction
• P
• q
• Therefore, p ^ q
Rules of inference (3) :