Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

MODULE 1: ELEMENTARY LOGIC

LOGIC
- Is the basis of all mathematical reasoning, and it has practical applications to the
design of computing machines, to artificial intelligence, to computer programming, to
programming languages, and to other areas of computer science.
PROPOSITIONAL CALCULUS
- Is the study of the logical relationships between statements called propositions, which
are usually interpretable as meaningful assertions in real-life contexts.

In the development of any mathematical theory, assertions are made in the form
of sentences. Such verbal or written assertions, called statement or propositions, are
declarative sentences that are either true or false but not both. That is, it is a sentence
that can be assigned the truth value true (T) or the truth value false (F), but not both.
Examples of Proposition:
 Today is Saturday
 2+5=9
 5 is a prime number
 a=b is divisible by 2
 Every natural number can be written as the sum of the squares of three natural
numbers
 He is over 5 feet tall
 7=8+15
*Notice that each proposition shown has a subject and a verb. In 2+5=9, the subject is
2+5 and the verb is = (equals); in 5 is a prime number, 5 is the subject and the verb is
“is”
The following sentences are not statements or propositions:
 Why should we study Math Logic?
 Let her go.
 Eat at the restaurant.
 Enjoy your holiday.

PREDICATES
- Let X be some universal set and let x be a variable that assumes value in X.
Statements involving x such as x=3, x>10, and x € N are very common. Such
statements are not propositions because of the presence of x. However, they become
propositions when a particular value is substituted for x. For instance, if x=2, the
previous three statements become the propositions 2=3, 2>10, and 2 € N.
- Definition: Statements that include variables and that become propositions upon
substitution of values for those variables are called predicates or propositional
functions.
- A predicate is also defined as sentence that contains a finite number of variables and
becomes a statement when specific values are substituted for the variables. The
domain of a predicate variable is the set all values that may be substituted in place of
the variable.
- Predicates may involve more than one variable such as the following:
a. x+y>2
b. x+y=1
c. x² + y² = z²
d. { x, y, z}

- The truth set of a predicate is the set of values of its variable or variables for which
the proposition is true.
Example:
 F(x) = x² ≤ x, for some integer x
Solution:
Substituting integers for x gives:
1² = 1; and 0² = 0
Thus, f(x) is true for the truth set {0,1}
 F(x) = 3ˣ < 82, x positive integer N
Answer: The truth set is {1,2,3,4}
 F(x) 2ˣ < 65, x any whole number W
Asswer: The truth set is {0,1,2,3,4,5,6}
 F(x) = x² + x ≤ 0, x any real number R
Answer: The truth set is {-1,0}
 F(x) = x² > o, x € Z (integer)
Answer: The truth set is the set of integers except 0

COMPOUND STATEMENTS
- In mathematics, the letters x,y,z,p,q,r often denote variables that can be replaced by
real numbers, and these variables can be combined with the familiar operations +, x, -
and ÷. In logic, letters x,y,z,p,q,r denote propositional variables; that is, variables that
can be replaced by statements.
- We will generally use small letters such as p,q,r,etc. to stand for propositions except
in some cases and we will combine propositions to obtain compound propositions
using standard connectivity symbols such as the following:
Connective Symbol Mathematical Term
not ~ Negation
and ^ Conjunction
or ˅ Disjunction
If…. then…. → Conditional or implication
If and only if ↔ Biconditional or material
equivalence

- Statements or propositional variables can be combined by logical connectives to


obtain compound statements.
Example:
p: Today is Saturday.
q: I will carry my umbrella in going out
We may combine the two statements by connective and form the compound statement
p and q. the truth value of a compound statements depends only on the truth values of
the statements being combined and on the types of connectives being used.
NEGATION
- Negation is an operator which gives the opposite statement of the previous statement.
It is also known as NOT. It is an operation who gives the opposite result. If input is true
then output is false. If input is false then the output is true. It has one input and one
output.
EXAMPLE:
Statement: This year is a leap year.
Negation: This year is not a leap year.

Statement: Amar is taller than Vivek.


Negation: Amar is not taller than Vivek.

INPUT (P) OUTPUT (~P)


T F
F T

DISJUNCTION
- We can join two statement by “OR” operand. It is also known as Disjuntion. In this
operator, if any one of the statement is true then the result is true, and if both the
statement is false then result will be false. It has two or more input but only one output.
Given the statements:
a. 10 + 1 = 11
b. 18 + 1 = 181
In this, statement A is true and statement B is false.
A B A˅B
T F T
The disjunction of a compound statement is only false if both the combining statements
are false else the disjunction is true.

Truth table for OR (disjunction)


INPUT INPUT INPUT
P Q P ORQ
T T T
T F T
F T T
F F F

CONJUCTION
- We can join two statements by “AND” operand. It is also known as Conjunction. In this
operator, if any one of the statement is false then result is false, and if both the
statement is true. It has two or more input but not only one output.
Given the statements:
a: 10 + 1 = 11
b: 18 + 1 =181
In this, statement A is true and statement B is false.
A B A^B
T F F
The conjunction of a compound statement is only true if both the combining statement is
only true it both the combining statements are true else the conjunction is false.

The table for AND (conjunction)


INPUT INPUT INPUT
P Q P AND Q
T T T
T F F
F T F
F F F

ARGUMENTS
- Expressed in ordinary English can be expressed in the notation of mathematical logic
and then studied.
Consider the following argument:
-If it not a good weather in the afternoon, then it is going to rain in the evening.
- If it is going to rain in the evening, I should take my umbrella with me.
Therefore, if it is not a good weather in the afternoon, I should take my umbrella with
me.

This argument involves propositions, which can be represented by letters:


p: It is not a good weather in the afternoon.
q: It is going to rain in the evening
r: I should take umbrella with me.
Just like the propositions, these propositions can be true or false.
p → q premises
q→r
--------
p → r conclusion
where the → should be read as “implies”.

The notation p → q is called a conditional statement, or implication. The


statement p is called the antecedent or hypothesis and the statement q is called the
consequent or conclusion. The connective if…the… is denoted by the symbol →.

The proposition q → p is called the converse of the proposition p → q. it turns


out that p → q is equivalent to ~q → ~p, which is called the contrapositive of p → q.
note that if p → q, it does not necessarily imply that q → p. thus, of p → q is true, then q
→ p is not necessarily true.

Sentence given English can be expressed in notations of mathematical logic:


Illustration:
~ If it is cloudy, then it is going to rain.
~ If it is going to rain, I should take my umbrella.
Therefore, of it cloudy, I should take my umbrella.
This argument involves various propositions which we may represent by letters.
p: It id cloudy
q: It is going to rain.
r: I should take my umbrella.
We may formalize the preceding propositions as follow:
p→q Given or
q→r premises
----------
Therefore, p → r Conclusion
Illustration:
If the weather is fine, then the schedule of a project can go on.
This is compound proposition p → q where
p: “the weather is fine” and
q: “the schedule of project can go on”.
Assume this is a true proposition. Its converse q → p reads: “if the schedule of a project
can go on, then the weather is fine.”
Fortunately, this is a false statement.
The contrapositive ~q → ~p says: “If the schedule of project cannot go on, the
weather is not fine.” Not only that this is a true proposition, but most people would agree
that this follows “logically” from p → q.
In the preceding illustration, the truth of p → q does not imply that q → p is true,
but it suggests that the truth of contrapositive ~q → ~p follows that of p → q.

TRUTH TABLES
The truth values of a proposition built up from other propositions by using
required connectives which are restively determined by the truth values of the original
propositions and the way the proposition is built up for them.
The decision of accepting rejecting a statement depends on the truth values of a
proposition. An acceptable statement is given a decision value or truth value “true” and
an unacceptable statement is given a decision value “false”.
Most logicians symbolize truth values as T or F (for True or False), while others
symbolize them as 1 or 0 (for True or False).

Negation
The proposition ~p should not be true exactly when p is true, and vice-versa. We
will use 0’s and 1’s signify False and True.
p ~p
0 1
1 0

Conjunction
The conjunction of two statements p and q denoted by p ˄ q is defined by the
following truth table.
p q p˄q
1 1 1
1 0 0
0 1 0
0 0 0
There is only one condition for p ˄ q to be true and this is when both statements
are true.

Disjunction
The disjunction of two statement p, q denoted by p ˅ q is defined in the tables as
follows:
p q p˅q
1 1 1
1 0 1
0 1 1
0 0 0
This means that the disjunction of two statements is true at least one of the
statements is true.

Implication
The conditional implication or simply implication means that the truth of p implies
the truth of 1. If p is true, then q must be true. The only way that this can fail (or be
false) is when p is true while q is false.
The truth table of p → q is given in the following matrix.
p q p→q
1 1 1
1 0 0
0 1 1
0 0 1

Material Equivalence
The material equivalence of p and q, also known as the biconditional, denoted by
p ↔ q is defined by the following truth table for (p → q) ˄ (q → p).

p q p→q q→p (p → q) ˄ (q → p)
1 1 1 1 1
1 0 0 1 0
0 1 1 0
0 0 1 1 1

This matrix for material equivalence of p and q is arranged in the table as follows:
p q p↔q
1 1 1
1 0 0
0 1 0
0 0 1
A truth value for a compound proposition built up from propositions p, q, r, … is a
table giving the truth values of the compound proposition in terms of the truth values of
p, q, r, ……

Diagram of Decision Value


We can give the decision value of compound propositions if we know the
decision values of the component parts.

Example 1: Construct the truth table for the compound propositions (p ˅ q) ˄ ~ (p → q)


p q p˅q p→q ~ (p → q) GIVEN
T T T T F F
T F T F T T
F T T T F F
F F F T F F

Example 2: Set the truth table for the compound proposition (p ˄ ~q) [(p ˅ ~q) → (~p ˄
q)]
p q ~q p ˄ ~q p ˅ ~q ~p ~p ˄ q [(p ˅ ~q) → (~p ˄ q)] GIVEN

T T F F T F F F T
T F T T T F F F F
F T F F F T T T T
F F T F T T F F T

Example 3: Form the truth table for (p → r) ˅ [(p ˄ ~r) → (r ˅ ~q)]


p q r p→r ~r p ˄ ~r ~q r ˅ ~q [(p ˄ ~r) → (r ˅ ~q)] GIVEN
T T T T F F F T T T
T T F F T T F F F F
T F T T F F T T T T
T F F F T T T T T T
F T T T F F F T T T
F T F T T F F F T T
F F T T F F T T T T
F F F T T F T T T T

You might also like