0% found this document useful (0 votes)
65 views

Logic

Here are the answers to the seatwork: I. 1. The proposition p∨q → p∧q is a contingency. 2. The proposition [(p ∨ q) ∧ r] → [(p ∧ r) ∨ q] is a tautology. II. The biconditional p → q → r ⇔ p → (q → r) is correct. It is a tautology. III. 1. Bitwise OR: 1111011 Bitwise AND: 0100000 Bitwise XOR: 1011010 2. Bitwise OR: 11111010 Bitwise AND: 10101000 Bitwise XOR: 01010010
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Logic

Here are the answers to the seatwork: I. 1. The proposition p∨q → p∧q is a contingency. 2. The proposition [(p ∨ q) ∧ r] → [(p ∧ r) ∨ q] is a tautology. II. The biconditional p → q → r ⇔ p → (q → r) is correct. It is a tautology. III. 1. Bitwise OR: 1111011 Bitwise AND: 0100000 Bitwise XOR: 1011010 2. Bitwise OR: 11111010 Bitwise AND: 10101000 Bitwise XOR: 01010010
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Mathematical

Logic
Language
• a systematic means of communicating by the use of
sounds or conventional symbols (Chen, 2010)
Mathematics as a Language
It is a universal language, the only one shared by all human beings
regardless of culture, religion, or gender.

Not everyone can be proficient in English, French, Chinese or


Japanese but most possess math literacy.
Mathematical Language Elements
Symbols for number: 0, 1, 2, …
Symbols for operation: +, -, x, …
Symbols for values: x, y, z, …
Other special symbols: <, >, π, …

Start of the alphabet a, b, c for constants (fixed values)

From i to n i, j, k, n positive integers (for counting)

End of the alphabet x, y, z For variables (unknown)


Mathematical Language Elements
Constants
Noun
12, - 58
Operations
Verb
=, >, <
Variables
Pronouns
5x – 8, x, y
Mathematical Sentences
Sentences
3x + 7 = 24, 2x + 3y = 7
Propositional Calculus
A proposition is a complete declarative sentence that use either true or
false, but not both.

If a proposition p is true, its truth value is true, denoted by T. If its is


false, its truth value is false, denoted by F.
Propositional Calculus
Examples:
• Manila is the capital of the Philippines.
• Shanghai is the capital of China.
• 1+1=2
• 2+2=3
Non-examples:
• Is it time?
• Pay attention to this.
• x+1=2
• x+y=z
Connectives and Compound
Propositions
A propositional connective is an operation that combines
two propositions to yield a new one whose truth value
depends only on the truth values of the two original
propositions. Propositions built up by combining
propositions using propositional connectives are called
compound propositions.
Propositional Connectives (A Review)
Let p be a proposition and q be another proposition.

Exclusive Disjunction
Conjunction Disjunction
(exclusive or/
p q (and) (or)
either but not both)
p˄q p˅q
p⨁q
T T T T F
T F F T T
F T F T T
F F F F F

p: Today is Friday.; q: It is raining today.

Conjunction: Today is Friday and it is raining today.


Disjunction: Today is Friday or it is raining today.
Exclusive Disjunction: Either today is Friday or it is raining, but not both.
Propositional Connectives (A Review)
Let p be a proposition and q be another proposition.

Conditional/Implication Biconditional
p q (If – then/ implies) (if and only if)
p→q p↔q
T T T T
T F F F
F T T F
F F T T

p: Today is Friday.; q: It is raining today.

Conditional: If today is Friday, then it is raining today.


Biconditional: Today is Friday if and only if it is raining today,
Negation
Negation is unary. Let p be a proposition. The “negation” of p is
written as ~p. Observe that p and ~p cannot both have the same
truth value.

TRUTH TABLE FOR NEGATION

p ~p
T F
F T

Example : Let p : Today is Friday.


~p : Today is not Friday.
Conditionals
In 𝑝 → 𝑞, the proposition p is the hypothesis or antecedent and
the proposition q is the conclusion or consequence.
Types of conditional statements:
(a) Conditional (𝑝 → 𝑞)
If today is Friday, then it is raining today.

(b) Converse (𝑞 → 𝑝)
If it is raining today, then today is Friday.

(c) Inverse (~𝑝 → ~𝑞)


If today is not Friday, then it is not raining today.

(d) Contrapositive (~𝑞 → ~𝑝)


If it is not raining today, then today is not Friday.
Compound Proposition
A compound proposition that is always true, regardless of the truth
values of the proposition that occur in it, is called a tautology. A
contradiction is a compound proposition that is always false. While a
contingency is neither a tautology nor a contradiction.

For each of the following compound propositions, determine if it a


tautology, contradiction or contingency.
(a) 𝑝 ∨ 𝑞 ∧ ~𝑝 ∧ ~𝑞
(b) (~ 𝑝 ↔ 𝑞 → 𝑟) ∨ (𝑝 ∧ ~𝑟)
Logical Equivalence
The propositions p and q are logically equivalent if 𝑝 ↔ 𝑞 is a tautology.
It is denoted by the notion 𝑝 ⟺ 𝑞. An implication is always logically
equivalent to its own contrapositive.

Logical
Name Logical Equivalence Name
Equivalence
𝑝∧𝑻 ⟺𝑝 𝑝∨𝑞 ⟺𝑞∨𝑝 Commutative
Identity laws
𝑝∨𝑭⟺𝑝 𝑝∧𝑞 ⟺𝑞∧𝑝 laws
𝑝∨𝑻⟺𝑻 Domination (𝑝 ∨ 𝑞) ∨ 𝑟 ⟺ 𝑝 ∨ (𝑞 ∨ 𝑟) Associative
𝑝∧𝑭⟺𝑭 Laws (𝑝 ∧ 𝑞) ∧ 𝑟 ⟺ 𝑝 ∧ (𝑞 ∧ 𝑟) laws
𝑝∨𝑝⟺𝑝 Idempotent 𝑝 ∧ (𝑞 ∨ 𝑟) ⟺ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟) Distributive
𝑝∧𝑝⟺𝑝 laws 𝑝 ∨ (𝑞 ∧ 𝑟) ⟺ (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟) laws
Double ~ 𝑝 ∧ 𝑞 ⟺ ~𝑝 ∨ ~𝑞 De Morgan’s
~(~𝑝) ⟺ 𝑝
negation law ~ 𝑝 ∨ 𝑞 ⟺ ~𝑝 ∧ ~𝑞 laws
Bit Operations
Bit is short for binary digit. Computers represent information using bits.
A bit has two possible values, 0 and 1, which represent a truth value.
As customary done, 1 will be used to represent T and 0 will be used to
represent F.

A bit string is a sequence of zero or more bits. The length of this string
is the number of bits in the string. Hence, 101001100 is a bit string of
length 9.

A byte is 8 bits.
A word is 16 bits or 2 bytes.
Bit Operations
What is the decimal value of the binary 10110001?

1 → 1 x 27 = 1 x 128 = 128
0 → 0 x 26 = 0 x 64 = 0
1 → 1 x 25 = 1 x 32 = 32
1 → 1 x 24 = 1 x 16 = 16
0 → 0 x 23 =0x 8= 0
0 → 0 x 22 =0x 4= 0
0 → 0 x 21 =0x 2= 0
1 → 1 x 20 =1x 1= 1
Some Logic Gates
The bitwise OR, bitwise AND, and bitwise XOR of two strings of the
same length are defined as the strings that have as their bits the
connectives OR, AND, and XOR of the corresponding bits in the two
strings respectively.

OR 0 1 AND 0 1 XOR 0 1
0 0 1 0 0 0 0 0 1
1 1 1 1 0 1 1 1 0

Consider the two bit strings 0110110110 and 1100011101. Find


(a) bitwise OR
(b) bitwise AND
(c) bitwise XOR
SEATWORK
I. Construct the truth table for the following compound
propositions. After which, tell if the proposition is a
tautology, contradiction or contingency.
1. 𝑝∨𝑞 → 𝑝∧𝑞
2. [(𝑝 ∨ 𝑞) ∧ 𝑟] → [(𝑝 ∧ 𝑟) ∨ 𝑞]
II. Tell if 𝑝 → 𝑞 → 𝑟 ⇔ 𝑝 → (𝑞 → 𝑟) is correct.
III. Find the bitwise OR, bitwise AND, and bitwise XOR of
each pair of bit strings.
1. 1011110, 0100001
2. 11110000, 10101010

You might also like