Sie sind auf Seite 1von 10

Report Form 2020/2021

Ministry Of Higher Education And Scientific Research

University Of Baghdad

Department Of Computer Science

Student Name:- Saif Asaad Abdulraheem

Title:- Binary Logic

Course:-Discrete Structures

Stage:- First Year B

Lecturer Name:-Auhood Al-Saadi


Logic
1.1 Introduction

In this report we introduce the principles of logic that are essential for
problem solving in mathematics. The ability to reason using the principles of logic is key
to seek the truth which is our goal in mathematics.
Before we explore and study logic, let us start by spending some time motivating this
topic. Mathematicians reduce problems to the manipulation of symbols using a set of rules.
As an illustration, let us consider the following problem:
Example 1.1 Joe is 7 years older than Themba. Five years from now Joe will be twice
Themba’s age. How old are Joe and Themba?
Solution. To answer the above question, we reduce the problem using symbolic formula-
tion. We let Themba’s age be x . Then Joe’s age is x + 7. We are given that five years from
now Joe will be twice Themba’s age. In symbols, (x + 7) + 5 = 2( x + 5). Solving for x yields
x = 2. Therefore, Themba is 2 years old and Joe is 9.
Our objective is to reduce the process of mathematical reasoning, i.e., logic, to the
manipulation of symbols using a set of rules. The central concept of deductive logic
is the concept of argument form. An argument is a sequence of statements aimed at
demonstrating the truth of an assertion (a “claim”). Consider the following two arguments.
Argument 1. If x is a real number such that x < − 2 or x > 2, then x2 > 4. Therefore,
if x2 ≤ 4, then x ≥ −2 and x ≤ 2.
Argument 2. If it is raining or I am sick, then I stay at home. Therefore, if I do not
stay at home, then it is not raining and I am not sick.

Although the content of the above two arguments is very different, their logical form is
the same. To illustrate the logical form of these arguments, we use letters of the alphabet
(such as p, q and r) to represent the component sentences and the expression “not p” to
refer to the sentence “It is not the case that p.” Then the common logical form of both the
arguments above is as follows:

If p or q, then r. Therefore, if not r, then not p and not q.


We start by identify and giving names to the building blocks which make up an argument.
In Arguments 1 and 2, we identified the building blocks as follows:
Argument 1. If x is a real number such that x < 2 or x 2
| {z } > 2}, then x
| {z

| {z> 4}.
p q r
Therefore, if x 2 ≤ 4, then x ≥ −2 and x ≤ 2.
| {z } | {z } | {z }
not r not p not q
Argument 2. If it is raining (p ) or I am sick ( q), then I stay at home (r ).
Therefore, if I do not stay at home (not r), then it is not raining (not p)
and I am not sick (not q ).

1
1.2 Statements

In mathematics, we are constantly dealing with statements. By a statement we shall mean


the following:

Definition. A statement (or proposition) is a declarative


sentence that is true or false, but not both.

Example 1.2 In this example, we consider the following sentences.

(i) One plus one equals two.


(ii) One plus one equals three.
(iii) He is a university student.
Sentences (i) and (ii) are both statements (only the first of which is true). On the other
hand, sentence (iii) is neither true nor false (the truth or falsity depends on the reference
for the pronoun he . For some values of he the sentence is true; for others it is false), and so
it is not a statement.

Every statement has a truth value, namely true (denoted by T) or false (denoted by
F ). We often use p, q and r to denote statements, or perhaps p1 , p2 , . . . , pn if there are
several statements involved. For example, we might write

p : One plus one equals two.


q : One plus one equals three.

We have seen that p and q are statements, where p has truth value T and q has truth
value F .

The possible truth values of a statement are often given in a table, called a truth table .
The truth values for two statements p and q are given in Figure 1.1. Since there are two
possible truth values for each of p and q, there are four possible combinations of truth values
for p and q. It is customary to consider the four combinations of truth values in the order
of TT, TF, FT, FF from top to bottom as shown in Figure 1.1.

p q
T T
T F
F T
F F

Figure 1.1 A truth table for two statements p and q .

2
1.3 Negation

Definition. Given a statement p, the negation of p is the


statement “not p” or “It is not the case that p” and is
denoted by ∼ p .

The negation of statement p has the opposite truth value from p : if p is true, then ∼ p is
false; if p is false, then ∼ p is true. The truth table for ∼ p (in terms of the possible truth
values of p) is given in Figure 1.2.

p ∼p
T F
F T

Figure 1.2 A truth table for negation.

For example, consider the statement

p : The integer 2 is even.

Then the negation of p is the statement

∼ p: It is not the case that the integer 2 is even.

It would be better to write

∼ p : The integer 2 is not even.

Or better yet to write


∼ p : The integer 2 is odd .

1.4 Conjunction

Next we consider the conjunction of two statements.

Definition. Given two statements p and q, the conjunction


of p and q is the statement “p and q ” and is denoted by p ∧ q.

The conjunction p ∧ q is true only if both p and q are true; otherwise, p ∧ q is false. For
example, consider the statements
p: The integer 2 is even.
q : 4 is less than 3.

3
The conjunction of p and q , namely,
p ∧ q : The integer 2 is even and 4 is less than 3 .
is a false statement since q is false (even though p is true). The truth table for the conjunc-
tion of two statements is shown in Figure 1.3. (As before, we write the truth values for p
and q in the order of TT, TF, FT, FF from top to bottom in the table.) This truth table
describes precisely when p∧ q is true (or false).

p q p ∧q
T T T
T F F
F T F
F F F

Figure 1.3 A truth table for conjunction.

1.5 Disjunction

Definition. Given two statements p and q, the disjunction


of p and q is the statement “p or q” and is denoted by p∨ q .

The disjunction p ∨ q is true if at least one of p and q is true; otherwise, p ∨ q is false.


Therefore, p ∨ q is true if exactly one of p and q is true or if both p and q are true. Thus
for the statements p and q described earlier, the disjunction of p and q, namely,

p ∨ q : The integer 2 is even or 4 is less than 3.


is a true statement since at least one of p and q is true (in this case, p is true). The truth
table for the disjunction of two statements is shown in Figure 1.3.

p q p ∨q
T T T
T F T
F T T
F F F

Figure 1.4 A truth table for disjunction.

4
1.6 The Implication

Of special importance to us will be a connective called the implication (also called the
conditional).

Definition. Given two statements p and q, the implication of p and


q is the statement “If p, then q” and is denoted by p → q. We call p
the hypothesis of the implication and q the conclusion.

The implication p → q can be expressed in words in several ways in addition to the


wording “If p, then q”, namely:

If p, then q.
p implies q.
q if p.
p only if q.
p is sufficient for q.
q is necessary for p.

The truth table for the implication p → q is shown in Figure 1.5.

p q p→q
T T T
T F F
F T T
F F T

Figure 1.5 A truth table for implication.

Notice that the only situation for which the implication p → q is false is when p is true
and q is false. The truth table for p → q is actually a definition, but let us convince ourselves
with an example that the truth values in this truth table are indeed justified.
Example 1.3 Suppose your boss makes you the following promise:

“If you meet the month-end deadline, then you will get a bonus.”

Under what circumstances are you justified in saying that your boss spoke falsely?
Solution. The answer is: You do meet the month-end deadline and you do not get a
bonus. Your boss’s promise only says you will get a bonus if a certain condition (you meet

5
the month-end deadline) is met; it says nothing about what will happen if the condition is
not met. So if the condition is not met, your boss did not lie (your boss promised nothing
if you did not meet the month-end deadline); so your boss told the truth in this case. Are
you convinced? Good! If not, let us then check the truth and falseness of the implication
based on the various combinations of the truth values of the statements

p : You meet the month-end deadline.


q : You get a bonus.

The given statement can be written as p → q. Suppose first that p is true and q is true.
That is, you meet the month-end deadline and you do get a bonus. Did your boss tell the
truth? Yes, indeed. So if p and q are both true, then so too is p → q, which agrees with the
first row of the truth table of Figure 1.5.
Second, suppose that p is true and q is false. That is, you meet the month-end deadline
and you did not get a bonus. Then your boss did not do as he/she promised. What your
boss said was false, which agrees with the second row of the truth table of Figure 1.5.
Third, suppose that p is false and q is true. That is, you did not meet the month-end
deadline and you did get a bonus. Your boss (who was most generous) did not lie (your
boss promised nothing if you did not meet the month-end deadline); so he/she told the
truth. This agrees with the third row of the truth table of Figure 1.5.
Finally, suppose that p and q are both false. That is, you did not meet the month-end
deadline and you did not get a bonus. Your boss did not lie here either. Your boss only
promised you a bonus if you met the month-end deadline. So your boss told the truth. This
agrees with the fourth row of the truth table of Figure 1.5.
In summary, the implication p → q is false only when p is true and q is false. A conditional
(or implication) statement that is true by virtue of the fact that its hypothesis is false is
said to be vacuously true or true by default. Thus the statement: “If you meet the
month-end deadline, then you will get a bonus” is vacuously true if you do not meet the
month-end deadline!

1.7 The converse, inverse and contrapositive of an implica-


tion

Definition. Let p and q be two statements.


The statement q → p is called the converse of the implication p → q .
The statement ∼ p →∼ q is called the inverse of the implication p → q .
The statement ∼ q →∼ p is called the contrapositive of the implication p → q .

Example 1.4 Write the converse, inverse and contrapositive of the statement in Exam-
ple 1.3.

6
Solution. Recall that the given statement can be written as p → q where p and q are the
statements
p : You meet the month-end deadline.
q : You get a bonus.
The converse of this implication is q → p, which is
q → p : If you get a bonus, then you have met the month-end deadline .

The inverse of this implication is ∼ p →∼ q, which is


∼ p →∼ q : If you do not meet the month-end deadline, then you will not get a bonus.
The contrapositive of this implication is ∼ q →∼ p, which is
∼ q →∼ p : If you do not get a bonus, then you will not have met the month-end deadline .

Example 1.5 Write the converse, inverse and contrapositive of the following statements:
“If today is Saturday, then I will go for a 10km run.”
Solution. Let p and q be the following statements:
p : Today is Saturday .
q : I will go for a 10km run.

Then the given statement can be written as p → q. The converse of this implication is
q → p, which is
q → p: If I go for a 10km run, then today is Saturday .

The inverse of this implication is ∼ p →∼ q, which is


∼ p →∼ q : If today is not Saturday, then I will not go for a 10km run .
The contrapositive of this implication is ∼ q →∼ p, which is
∼ q →∼ p : If I do not go for a 10km run, then today is not Saturday.

1.8 Compound Statements

The symbols ∼, ∧, ∨ and → are sometimes referred to as logical connectives. From given
statements, we can use these logical connectives to form more intricate statements, called
compound statements.

Definition. A compound statement (or statement form or for-


mula) is a statement made up of one or more statements with statement
variables (such as p, q, and r ) and at least one logical connective (such
as ∼ , ∧, ∨ and →). The truth table for a given statement form displays
the truth values that correspond to the different combinations of truth
values for the variables.

For example, for given statements p and q, the conjunction p∧q is a compound statement.
For a slightly more complex example, consider the compound statement given by
((∼ p )∨ ∼ ( q ∧ r )) ∨ (∼ ( s ∧ (q ∨ ( ∼ t)))).

7
In compound statements, we avoid the use of many parentheses when no confusion
arises . We often omit the outer pair of parentheses in a compound statement. For example,
we write ∼ p rather than (∼ p). In expressions using the logical connectives ∼, ∧ , ∨ and
→, we adopt the following order of operation :
∼ performed first,
∧, ∨ performed second,
→ performed third.

For example,
∼ p ∧ q = (∼ p ) ∧ q.

As in ordinary algebra, however, the order of operation can be overridden by the use of
parentheses. Thus,
∼ (p ∨ q )
represents the negation of the disjunction of p and q. Notice that the symbols ∧ and ∨
are coequal in order of operation. Therefore an expression such as p ∧ q ∨ r is considered
ambiguous. It should be written as either

(p ∧ q ) ∨ r or p ∧ (q ∨ r)
.

Example 1.6 Write each of the following sentences symbolically, letting p and q be the
statements:
p : It is hot.
q : It is sunny.
(a) It is not hot and it is sunny.
(b) It is not hot and it is not sunny.
Solution. (a) ( ∼ p) ∧ q .

(b) (∼ p) ∧ (∼ q ).

Example 1.6 Construct the truth table for the compound statement
(p → q ) ∧ (q → p ).
Solution. Set up columns labelled p, q, p → q, q → p , and ( p → q )∧ ( q → p). Complete the
p and q columns with all four possible combinations of truth values for p and q (in the order
of TT, TF, FT, FF from top to bottom). Then use the truth tables for → (see Figure 1.5)
to fill in the p → q and q → p columns. Finally, using the truth table for ∧ (see Figure 1.3),
fill in the (p → q) ∧ ( q → p) column. The resulting truth table is given in Figure 1.6.

p q p →q q→p (p → q ) ∧ (q → p )
T T T T T
T F F T F
F T T F F
F F T T T

Figure 1.6 A truth table for (p → q ) ∧ (q → q ).

8
References

[1] Chartrand G., A. D. Polimeni and P. Zang, A Transition to Advanced Mathematics .


Addison-Wesley, New York (2002).

[2] Epp S. S., Discrete Mathematics with Applications (Third Edition). Thomson
Brooks/Cole (2004).

[3] Johnsonbaugh R., Discrete Mathematics (Fourth Edition). Prentice Hall, Inc., New
Jersey (1997).

[4] Malik D. S. and M. K. Sen, Discrete Mathematical Structures: Theory and Applications
Thomson Course Technology (2004).

10

Das könnte Ihnen auch gefallen