0% found this document useful (0 votes)
34 views47 pages

Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views47 pages

Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

INSTITUTE OF ACCOUNTANCY ARUSHA

DISCRETE MATHEMATICS
LOGIC

FACILITATOR John Francis and Hawa Mofi


Email [email protected]
CODE: CYU 07102
PROGRAM: BCSe

November 5, 2021

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Definition
Logic is the mathematical concepts used to draw a conclusion
whether the given statement is true or false.
It is used in computer programming and designing of
machines and also it is used in electric circuit.
Statement is a group of words which can be judged to be true
or false but not both.
Proposition is a sentence that is either true or false but not
both.
Propositional variables that is, variables that represent
propositions or It is a representative letter in which it carries
meanings of either being true or false eg p, q, r , s etc
Example; Joyce is writing and Peter is reading
Solution;
Let P be ”Joyce is writing” and let q be Peter is reading

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Identification of a proposition from a statement
Consider the following examples given below;
1. Washington, D.C., is the capital of the United States of
America
2. Toronto is the capital of Canada.
3. 2 + 2 = 3.
4. What time is it?
5. Read this carefully
Therefore, the following sentences, i.e (1),(2) and (3) are
propositions while the sentences number 4 and number 5 are
not propositions.
Again, Propositions 1 is true, whereas 2 and 3 are false.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
cont...
Truth Value is the true or false of a statement.
If the statement is true then its truth value is TRUE or T and
if the statement is false then its truth value is FALSE or F.
Truth table is the table which used to show the validity of the
compound statement, or is a table used to determine specific
truth values of a given logical statement.
Logical connective are connectives used to connect simple
logical statements to make up logical compound statement.
Logical connectives are categorized as follows;
i. Conjunction (∧); Connective words which stands for
conjunctions are and, but, both, while.
ii. Disjunction (∨); Connective words which stands for
Disjunction are or, either or

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont..
iii. Conditional (Implication) (→); Condition is the connective
in which one proposition implies another proposition.
Connective words which stands for Condition are if....then...,
only if.., necessary for.., therefore..., sufficient for.., implies,
necessary, whenever, condition,unless,when,follows from
iv. Bi-condition (Double implication )(↔); Connective words
which stands for Bi-condition are if and only if, sufficient and
necessary for
Negation; This is the opposite of the stated statement, and
denoted by ¬
For example; Find the negation of the proposition, “Michael’s
PC runs Linux”
Solution: The negation is, “Michael’s PC does not run Linux.”
We can construct compound propositions using the logical
operators ( ¬, ∧, ∨, →, and ↔).

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
CONVERSE, CONTRAPOSITIVE, AND INVERSE
We can form some new conditional statements either by reversing,
opposite of the reverse or negating the conditional statement, e.g
conditional statement p → q
The proposition q → p is called the converse of p → q.
The proposition ¬q → ¬p is called the contrapositive of
p → q.
The proposition ¬p → ¬q is called the inverse of p → q
Suppose we start with the conditional statement “If it rained
last night, then the sidewalk is wet.”
The converse of the conditional statement is “If the sidewalk
is wet, then it rained last night.”
The contrapositive of the conditional statement is “If the
sidewalk is not wet, then it did not rain last night.”
The inverse of the conditional statement is “If it did not rain
last night, then the sidewalk is not wet.”

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Construction of a truth table from a statement
Statement; Robert is reading or writing
Let p = Robert is reading and q = Robert is writing
Connective is ’ or’(∨)
The proposition from a statement is p ∨ q
Therefore, It’s truth table of p ∨ q is;

FACILITATOR AJohn
vertex of Hawa
Francis and degree zero [email protected]
Mofi Email is called isolated
INSTITUTE OF and A CYU
CODE: vertex
ACCOUNTANCY 07102 is DISCRETE MATHE
ARUSHA
PROGRAM: BCS
Logic and Bit Operations
Computers represent information using bits. A bit is a symbol
with two possible values, namely, 0 (zero) and 1 (one).
This meaning of the word bit comes from binary digit,
because zeros and ones are the digits used in binary
representations of numbers.
The well-known statistician John Tukey introduced this
terminology in 1946. A bit can be used to represent a truth
value, because there are two truth values, namely, true and
false.
As is customarily done, we will use a 1 bit to represent true
and a 0 bit to represent false. That is, 1 represents T (true),
0 represents F (false).
Computer bit operations correspond to the logical
connectives. By replacing true by a one and false by a zero in
the truth tables for the operators

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont..
We will also use the notation OR, AND and XOR for the
operators ∨, ∧, and ⊕
Table for the Bit Operators ∨, ∧, and ⊕ are shown below;

Information is often represented using bit strings, which are


lists of zeros and ones.
A bit string is a sequence of zero or more bits. The length of
this string is the number of bits in the string. For example;
101010011 is a bit string of length nine.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
cont...
We use the symbols ∨, ∧, and ⊕ to represent the bitwise
OR, bitwise AND, and bitwise XOR operations, respectively.
We illustrate bitwise operations on bit strings with Example
below.
Find the bitwise OR, bitwise AND, and bitwise XOR of the bit
strings 01 1011 0110 and 11 0001 1101.
Solution: The bitwise OR, bitwise AND, and bitwise XOR of
these strings are obtained by taking the OR, AND, and XOR
of the corresponding bits, respectively. This gives us

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
LAWS OF ALGEBRA OF PROPOSITION
The following are laws of algebra used to simplify propositions;

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Definition
A compound proposition that is always true, no matter what
the truth values of the propositional variables that occur in it,
is called a tautology.
A compound proposition that is always false is called a
contradiction(Fallency).
A compound proposition that is neither a tautology nor a
contradiction is called a contingency.

Example; Show that ¬(p → q) and p ∧ ¬q are logically


equivalent
Solution.
¬(p → q) = ¬(¬p ∨ q)
¬(p → q) = ¬(¬p) ∧ ¬q
∴ ¬(p → q) = p ∧ ¬q

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont...
Example; Simplify by using law of algebra (p ∧ q) → ¬q
Solution

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont...
Computer programs have been developed to automate the task of
reasoning and proving theorems.
Example; Check if the following argument is valid “If I am
clever then I understand Logic. I don’t understand Logic.
Therefore I am not clever”
Solution Let p = I am clever and q = I understand Logic
Compound statement [(p → q) ∧ ¬q] → ¬p

Hence the argument is valid because it is TAUTOLOGY

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Alternative

[(p → q) ∧ ¬q] → ¬p
¬ [(p → q) ∧ ¬q] ∨ ¬p
[¬(¬p ∨ q) ∨ q] ∨ ¬p
[(p ∧ ¬q) ∨ q] ∨ ¬p
[(p ∨ q) ∧ (¬q ∨ q)] ∨ ¬p
[(p ∨ q) ∧ T ] ∨ ¬p
(p ∨ q) ∨ ¬p
(q ∨ p) ∨ ¬p
q ∨ (p ∨ ¬p)
q∨T
T.

∴ [(p → q) ∧ ¬q] → ¬p = T
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Application of propositional logic
Logic has many important applications to mathematics and
computer science. Statements in mathematics and the
sciences and in natural language often are ambiguous.
To make such statements precise, they can be translated into
the language of logic.
Propositional logic and its rules can be used to design
computer circuits, to construct computer programs, to verify
the correctness of programs.

Step to convert or translating the English sentences into


propositional logic are as follows;
Identify the proposition and represent in propositional
variables.
Determine the appropriate logic connectives.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Translating sentences into compound statements ( logical
expressions) and vice versa
Example; If Maria learns discrete mathematics, then she will
find a good job. Translate the sentences into compound
statements ( logical expressions)
Solution; Let p be the statement “Maria learns discrete
mathematics” and q the statement “She will find a good
job.” Therefore,the logical expressions p → q
Example; Let p be the statement “You can take the flight,”
and let q be the statement “You buy a ticket.” Then
p ↔ q.Translate the compound statements ( logical
expressions) into statements.
Solution;
You can take the flight if and only if you buy a ticket

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
System Specifications
System and software engineers take requirements in English
language and express them in a precise specification language
based on logic
Example; Express the specification “The automated reply
cannot be sent when the file system is full” using logical
connectives.
Solution; let p denote “The automated reply can be sent” and
q denote “The file system is full.”
Therefore, our specification can be represented by the
conditional statement q → ¬p.

Definition;
A list of propositions is consistent if it is possible to assign
truth values to the propositional variable so that each
proposition is true.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
System Specifications
Example; Determine whether these system specifications are
consistent: “The diagnostic message is stored in the buffer or
it is retransmitted.” “The diagnostic message is not stored in
the buffer.” “If the diagnostic message is stored in the buffer,
then it is retransmitted.”
Solution; Let p denote “The diagnostic message is stored in
the buffer” and let q denote “The diagnostic message is
retransmitted.”
The specifications can then be written as p ∨ q, ¬p, and
p → q.
An assignment of truth values that makes all three
specifications true.
When p is false and q is true, all the three statements is true
p ∨ q ≡ T , ¬p ≡ T and p → q ≡ T
Therefore, the specification is consistent.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Logic Puzzles
Puzzles that can be solved using logical reasoning are known
as logic puzzles. Also, computer programs designed to carry
out logical reasoning
To convert the statements to proposition logic and end up
with something that make sense. For example;
”An island that has two kinds of inhabitants, knights who
always tell the truth, and knaves who always lie”. You
encounter two people A and B. What are the type A and B, if
A says “B is a knight” and B says “The two of us are
opposite types?
Solution: Let p and q be the statements that A is a knight
and B is a knight, respectively, so that ¬p and ¬q are the
statements that A is a knave and B is a knave, respectively.
If A is a knight then p is true since knight tell the truth, q
must also be true because A and B are the same type.
Then,(p ∧ ¬q) ∨ (¬p ∧ q), would have to be true, but if it is
not a knight, therefore ¬p must be true.
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
If A is a knave, then B must not be a knight since knave
always lie. So then both ¬p and ¬q hold since both are
knaves.

Logic Circuits
Propositional logic can be applied to the design of computer
hardware.
A logic circuit (or digital circuit) receives input signals
p1 , p2 , .., pn , each a bit [either 0 (off) or 1 (on)], and
produces output signals s1 , s2 , .., sn , each a bit.
Here we will restrict our attention to logic circuits with a
single output signal; in general, digital circuits may have
multiple outputs
The Basic logic gates are shown below.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont...
Complicated digital circuits can be constructed from three
basic circuits, called gates
We use combinations of these three basic gates to build more
complicated circuits called combinatorial circuit as shown
below.
A combinatorial circuit are shown below.

Therefore, the final output (p ∧ ¬q) ∨ ¬r .

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Predicates
Suppose that we know that “Every computer connected to the
university network is functioning properly.”
No rules of propositional logic allow us to conclude the truth of the
statement
Here we will introduce a more powerful type of logic called
predicate logic.
Statements involving variables, such as
x > 3, x = y + 3, x + y = z
These statements are neither true nor false when the values of
the variables are not specified.
The statement “x is greater than 3” has two parts. The first
part is the variable x, (the subject of the statement). The
second part is the predicate,(“is greater than 3” ), refers to a
property that the subject of the statement can have.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont..
We can denote the statement “x is greater than 3” by P(x),
where P denotes the predicate “is greater than 3” and x is
the variable.
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.
Example; Let Q(x, y) denote the statement x = y + 3. What
are the truth values of the propositions Q(1, 2) and Q(3, 0)?
Solution: To obtain Q(1, 2), set x = 1 and y = 2 in the
statement Q(x, y). Hence, Q(1, 2) is the statement
1 = 2 + 3,which is false. The statement Q(3, 0) is the
proposition 3 = 0 + 3, which is true.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont...
In general, a statement involving the n variables x1 , x2 , ..., xn can
be denoted by P(x1 , x2 , ..., xn ).
A statement of the form P(x1 , x2 , ..., xn ) is the value of the
propositional function P at the n-tuple (x1 , x2 , ..., xn ), and P
is also called an n-place predicate.

Quantifiers is when the variables in a propositional function


are assigned values, the resulting statement becomes a
proposition with a certain truth value.
In English, the words all, some, many, none, and few are used
in quantifications.
There are two type of Quantifiers, Namely are;
i. Universal quantification, which tells us that a predicate is true
for every element under consideration
ii. Existential quantification, which tells us that there is one or
more element under consideration for which the predicate is
true.
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
cont...
The universal quantification of P(x) is the statement “P(x)
for all values of x in the domain.” The notation ∀xP(x)
denotes the universal quantification of P(x). Here ∀ is called
the universal quantifier. We read ∀xP(x) as “for all xP(x)” or
“for every xP(x).
When all the elements in the domain can be listed say,
x1 , x2 , ..., xn , it follows that the universal quantification
∀xP(x) is the same as the conjunction
P(x1 ) ∧ P(x2 ) ∧ ... ∧ P(xn ) because this conjunction is true if
and only if P(x1 ), P(x2 ), ..., P(xn ) are all true.
The existential quantification of P(x) is the proposition
“There exists an element x in the domain such that P(x).”
We use the notation ∃xP(x) for the existential quantification
of P(x). Here ∃ is called the existential quantifier.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont..
When all the elements in the domain can be listed say,
x1 , x2 , ..., xn , it follows that the existential quantification
∃P(x) is the same as the disjunction
P(x1 ) ∨ P(x2 ) ∨ ... ∨ P(xn ) because this disjunction is true if
and only if at least one of P(x1 ), P(x2 ), ..., P(xn ) is true.
Example 1; Let P(x) be the statement “x + 1 > x.” What is
the truth value of the quantification ∀xP(x), where the
domain consists of all real numbers?
Solution: Because P(x) is true for all real numbers x, the
quantification∀xP(x) is true.
Example 2; Let P(x) denote the statement “x > 3.” What is
the truth value of the quantification ∃P(x), where the domain
consists of all real numbers?
Solution: Because x > 3 is sometimes true for instance, when
x = 4,the existential quantification of P(x), which is ∃P(x)
(x), is true.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Logical Equivalences Involving Quantifiers
Statements involving predicates and quantifiers are logically
equivalent if and only if they have the same truth value no matter
which predicates are substituted into these statements and which
domain of discourse is used for the variables in these propositional
functions. We use the notation S ≡ T to indicate that two
statements S and T involving predicates and quantifiers are
logically equivalent.
Example; Show that ∀x(P(x) ∧ Q(x)) and ∀xP(x) ∧ ∀xQ(x)
are logically equivalent
Solution; Suppose we have particular predicates P and Q, with
a common domain.
i. First, we show that if ∀x(P(x) ∧ Q(x)) is true, then
∀xP(x) ∧ ∀xQ(x) is true.
ii. Second, we show that if ∀xP(x) ∧ ∀xQ(x) is true, then
∀x(P(x) ∧ Q(x)) is true.
iii. So, suppose that ∀x(P(x) ∧ Q(x)) is true. This means that if
a is in the domain, then P(a) ∧ Q(a) is true
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont...
iv. Hence, P(a) is true and Q(a) is true. Because P(a) is true
and Q(a) is true for every element in the domain,we can
conclude that ∀xP(x) and ∀xQ(x) are both true. This means
that ∀xP(x) ∧ ∀xQ(x) is true.
v. Next, suppose that ∀xP(x) ∧ ∀xQ(x) is true. It follows that
∀xP(x) is true and ∀xQ(x) is true. Hence, if a is in the
domain, then P(a) is true and Q(a) is true [because P(x) and
Q(x) are both true for all elements in the domain.
vi. It follows that for all a, P(a) ∧ Q(a) is true. It follows that
∀x(P(x) ∧ Q(x)) is true. We can now conclude that

∀x(P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀xQ(x)

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Negating Quantified Expressions
Consider the statement below;“Every student in your class has
taken a course in calculus.”
This statement is a universal quantification, namely,∀xP(x)
Where P(x) is the statement “x has taken a course in
calculus” and the domain consists of the students in your
class.
The negation of this statement is “There is a student in your
class who has not taken a course in calculus.” namely;
∃x¬P(x).
This example illustrates the following logical equivalence:
¬∀xP(x) ≡ ∃x¬P(x)
Example; What are the negations of the statements
∀x(x 2 > x)
Solution: The negation of ∀x(x 2 > x) is the statement
¬∀x(x 2 > x), which is equivalent to ∃¬x(x 2 > x). This can
be rewritten as ∃x(x 2 ≤ x).
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Nested Quantifiers
Nested quantifiers s when one quantifier is within the scope of
another, such as ∀x∃y (x + y = 0), is the same thing as
∀xQ(x), where Q(x) is ∃yP(x, y ), where P (x, y) is x + y = 0.
Nested quantifiers commonly occur in mathematics and
computer science.
Nested quantifiers can be used to translate English sentences
such as “The sum of two positive integers is always positive”
into logical statements.
Example; Translate into English the statement
∀x∀y ((x > 0) ∧ (y < 0) → (xy < 0)), where the domain for
both variables consists of all real numbers.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont..
Solution: This statement says that for every real number x
and for every real number y, if x > 0 and y < 0, then xy < 0.
That is, this statement says that for real numbers x and y, if x
is positive and y is negative, then xy is negative.
Therefore; The product of a positive real number and a
negative real number is always a negative real number.
Example; Translate the statement “The sum of two positive
integers is always positive” into a logical expression.
Solution; we can express this statement as
∀x∀y ((x > 0) ∧ (y > 0) → (x + y > 0)),
Then the statement “The sum of two positive integers is
always positive” becomes “For every two positive integers, the
sum of these integers is positive.
Therefore, We can express this as ∀x∀y (x + y > 0)) where
the domain for both variables consists of all positive integers.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Negating Nested Quantifiers
Statements involving nested quantifiers can be negated by
successively applying the rules for negating statements
involving a single quantifier.
Example; Express the negation of the statement ∀x∃y (xy = 1)
Solution;
Given; ∀x∃y (xy = 1)

¬(∀x∃y (xy = 1))

¬∀x¬∃y ¬(xy = 1)
∴ ∃x∀y (xy 6= 1)

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Definition
An argument is the combination of different compound
statements (or premises), or an argument is a sequence of
premises (or propositions) together with its conclusion.
i.e. [P1 ∧ P2 ∧ P3 ∧ ... ∧ Pn ] → Conclusion
Validity means valid or invalid of logical statement.
The argument can be valid (Tautology) invalid
(Contradiction/fallacy)
A valid argument is an argument which is always true, or an
argument which the truth of its premises entire the truth of
its conclusion.
The premises represented by P1 ∧ P2 ∧ P3 ∧ ... ∧ Pn are joined
using connective “and” or “∧” and the conclusion is given by
words like “Thus” or “Therefore” and denoted by “ →” an
implication.

i.e[P1 ∧ P2 ∧ P3 ∧ ... ∧ Pn ] → Conclusion

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Rules of Inference for Propositional Logic
We can always use a truth table to show that an argument
form is valid. We do this by showing that whenever the
premises are true, the conclusion must also be true.
Rules of inference is when the steps of arguments are
displayed on separate lines with the reason for each step
stated. These rules of inference can be used as building blocks
to construct more complicated valid argument forms.
Example; State the rule of inference which is the basis of the
following argument: “It is below freezing and raining now.
Therefore, it is below freezing now.”
Solution: Let p be the proposition “It is below freezing now,”
and let q be the proposition “It is raining now.” This
argument(Simplification form) is of the form,

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Modus Tollens
p→q
¬q
∴ ¬p
Example; Let p be ”It is snowing” and q be ”I will study
discrete Mathematics”
”If It is snowing, then I will study discrete Mathematics”
”I will not study discrete Mathematics”
Therefore,”It is snowing”
p→q
Hypothetical syllogism q → r
∴p→r
Example; Let p be ”It snow” and q be ”I will study discrete
Mathematics” and r be ”I will get an A”
”If It snow, then I will study discrete Mathematics”
”If I will study discrete Mathematics, I will get an A ”
Therefore,”It snow, I will get an A”
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Disjunctive syllogism
p∨q
¬p
∴q
Example; Let p be ”I will study discrete Mathematics” and q
be ”I will study English literature”
”I will study discrete Mathematics or I will study English
literature”
”I will not study discrete Mathematics”
Therefore,”I will study English literature”
p
Addition;
∴p∨q
Example; Let p be ”I will study discrete Mathematics” and q
be ”I will visit Serengeti National park”
”I will study discrete Mathematics”
Therefore,”I will study discrete Mathematics or I will visit
Serengeti National park”
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Conjuction
p
q
∴p∧q
Example; Let p be ”I will study discrete Mathematics” and q
be ”I will study English literature”
”I will study discrete Mathematics”
”I will study English literature”
Therefore,”I will study discrete Mathematics and I will study
English literature”
¬p ∨ r
Resolution; p ∨ q
∴q∨r
Example; ”I will not study discrete Mathematics or I will study
English literature”
”I will study discrete Mathematics or I will study Database”
Therefore,”I will study Database or I will study English
literature”
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont...
The following are the Rules of Inference for Propositional Logic.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Use inferencing rules in building arguments
Valid argument is a sequence of statements. Each statements
is either a premise or follows from previous statements by
rules of inference. Last statement is called conclusion.
A valid argument takes the following forms;

s1

s2

..
.

sn

∴C

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Cont..
Example; Show that the premises “It is not sunny this
afternoon and it is colder than yesterday,” “We will go
swimming only if it is sunny,” “If we do not go swimming,
then we will take a canoe trip,” and “If we take a canoe trip,
then we will be home by sunset” lead to the conclusion “We
will be home by sunset.”
Solution: Let p be “It is sunny this afternoon,” q be “It is
colder than yesterday,” r the proposition “We will go
swimming,” s the proposition “We will take a canoe trip,” and
t the proposition “We will be home by sunset.”
Then the premises become ¬p ∧ q, r → p, ¬r → s, and s → t.
The conclusion is simply t.
We need to give a valid argument with premises
¬p ∧ q, r → p, ¬r → s, and s → t and conclusion t.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
cont..
We construct an argument to show that our premises lead to
the desired conclusion as follows.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Inferencing rules for quantified statements
There are some important rules of inference for statements
involving quantifiers.
∀xP(x)
Universal Instantiation (UI);
∴ P(c)
Example; Our domain consist of all dogs and fido is a dog
”All dogs are cuddy”
”Therefore, Fido is cuddy”
∃xP(x)
Existantial Instantiation (EI);
∴ P(c) for some element c
Example; ”There is someone who got an A in the course”
”Therefore, Let’s call her a and say that a got an A”
Universal generalization (UG) is the rule of inference that
states that ∀xP(x) is true, given the premise that P (c) is true
for all elements c in the domain while Existential
generalization is the rule of inference that is used to conclude
that ∃xP(x) is true when a particular element c with P (c)
true is known.
FACILITATOR John Francis and Hawa Mofi Email [email protected]
INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Inferencing rules for quantified statements
For example; Universal instantiation is the rule of inference
used to conclude that P (c) is true, where c is a particular
member of the domain, given the premise ∀xP(x)

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
cont..
Example; Show that the premises “Everyone in this discrete
mathematics class has taken a course in computer science”
and “Marla is a student in this class” imply the conclusion
“Marla has taken a course in computer science.”
Solution: Let D(x) denote “x is in this discrete
mathematics class,” and let C(x) denote “x has taken a
course in computer science.” Then the premises are
∀x(D(x) → C (x)) and D(Marla). The conclusion is C(Marla).
The following
steps can be used to establish the conclusion from the premises.

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
Combining Rules of Inference for Propositions and Quantified
Statements
We have developed rules of inference both for propositions
and for quantified statements.
We will need to use this combination of rules of inference
because universal instantiation and modus ponens are used
together, this combination of rules is sometimes called
universal modus ponens.
This rule tells us that if ∀x(P(x) → Q(x)) is true, and if P
(a) is true for a particular element a in the domain of the
universal quantifier, then Q(a) must also be true.
If P(a) → Q(a) is true. Then, by modus ponens, Q(a) must
also be true.
∀x(P(x) → Q(x))
P(a), where a is a particular element in the domain
∴ Q(a)

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS
End

FACILITATOR John Francis and Hawa Mofi Email [email protected]


INSTITUTE OF CODE:
ACCOUNTANCY
CYU 07102
ARUSHA
PROGRAM:
DISCRETE MATHE
BCS

You might also like