AufEx4 03 01
AufEx4 03 01
CHAPTER
Logic
3
Logic Statements
Every language contains di erent types of sentences,
such as statements, questions, and commands. For
instance,
“Is the test today?” is a question.
“Go get the newspaper” is a command.
“This is a nice car” is an opinion.
“Denver is the capital of Colorado” is a statement of fact.
4
Logic Statements
The symbolic logic that Boole was instrumental in
creating applies only to sentences that are statements as
de ned below.
5
Example 1 – Identify Statements
Determine whether each sentence is a statement.
a. Florida is a state in the United States.
b. How are you?
c. 99 + 2 is a prime number.
d. x + 1 = 5.
Solution:
a. Florida is one of the 50 states in the United States, so
this sentence is true and it is a statement.
b. The sentence “How are you?” is a question; it is not a
declarative sentence. Thus it is not a statement.
6
Example 1 – Solution cont’d
c. You may not know whether 99 + 2 is a prime number;
however, you do know that it is a whole number
larger than 1, so it is either a prime number or it is not
a prime number. The sentence is either true or it is
false, and it is not both true and false, so it is a
statement.
d. x + 1 = 5 is a statement. It is known as an open
statement. It is true for x = 4, and it is false for any
other values of x. For any given value of x, it is true or
false but not both.
7
Simple Statements and
Compound Statements
8
Simple Statements and Compound
Statements
10
Simple Statements and Compound
Statements
12
Simple Statements and Compound
Statements
We will often nd it useful to write compound statements
in symbolic form.
13
Example 3 – Write Compound Statements in Symbolic Form
Consider the following simple statements.
p: Today is Friday.
q: It is raining.
r : I am going to a movie.
s: I am not going to the basketball game.
Write the following compound statements in symbolic
form.
a. Today is Friday and it is raining.
b. It is not raining and I am going to a movie.
c. I am going to the basketball game or I am going to a
movie.
d. If it is raining, then I am not going to the basketball 14
Example 3 – Solution
15
Simple Statements and Compound
Statements
In the next example, we translate symbolic statements
into English sentences.
16
Example 4 – Translate Symbolic Statements
Consider the following statements.
p: The game will be played in Atlanta.
q: The game will be shown on CBS.
r : The game will not be shown on ESPN.
s: The Mets are favored to win.
Write each of the following symbolic statements in words.
17
Example 4 – Solution
a. The game will be shown on CBS and the game will be
played in Atlanta.
b. The game will be shown on ESPN and the Mets are
favored to win.
c. The Mets are favored to win if and only if the game will
not be played in Atlanta.
18
Compound Statements and
Grouping Symbols
19
Compound Statements and Grouping
Symbols
If a compound statement is written in symbolic form, then
parentheses are used to indicate which simple
statements are grouped together.
Table 3.2 illustrates the use of parentheses to indicate
groupings for some statements in symbolic form.
Table 3.2
20
Compound Statements and Grouping
Symbols
If a compound statement is written as an English
sentence, then a comma is used to indicate which simple
statements are grouped together. Statements on the
same side of a comma are grouped together. See Table
3.3.
Table 3.3
21
Compound Statements and Grouping
Symbols
If a statement in symbolic form is written as an English
sentence, then the simple statements that appear
together in parentheses in the symbolic form will all be on
the same side of the comma that appears in the English
sentence.
22
Example 5 – Translate Compound Statements
Let p, q, and r represent the following.
p: You get a promotion.
q: You complete the training.
r: You will receive a bonus.
a. Write as an English sentence.
b. Write “If you do not complete the training, then you will
not get a promotion and you will not receive a bonus.”
in
symbolic form.
23
Example 5(a) – Solution
Because the p and the q statements both appear in
parentheses in the symbolic form, they are placed to the
left of the comma in the English sentence.
25
Compound Statements and Grouping
Symbols
If you order cake and ice cream in a restaurant, the waiter
will bring both cake and ice cream. In general, the
conjunction is true if both p and q are true, and the
conjunction is false if either p or q is false.
The truth table at the right
shows the four possible
cases that arise when we
form a conjunction of two
statements.
26
Compound Statements and Grouping
Symbols
Any disjunction is true if p is true or q is true or both
p and q are true. The truth table below shows that the
disjunction p or q is false if both p and q are false;
however, it is true in all other cases.
27
Example 6 – Determine the Truth Value of a Statement
Determine whether each statement is true or false.
a. 7 5.
b. 5 is a whole number and 5 is an even number.
c. 2 is a prime number and 2 is an even number.
Solution:
a. 7 5 means 7 > 5 or 7 = 5. Because 7 > 5 is true, the
statement 7 5 is a true statement.
b. This is a false statement because 5 is not an even
number.
c. This is a true statement because each simple
statement is true. 28
Quanti ers and Negation
29
Quanti ers and Negation
In a statement, the word some and the phrases there
exists and at least one are called existential quanti ers.
Existential quanti ers are used as pre xes to assert the
existence of something.
In a statement, the words none, no, all, and every are
called universal quanti ers. The universal quanti ers
none and no deny the existence of something, whereas
the universal quanti ers all and every are used to assert
that every element of a given set satis es some condition.
30
Quanti ers and Negation
What is the negation of the false statement, “No doctors
write in a legible manner”?
Whatever the negation is, we know it must be a true
statement. The negation cannot be “All doctors write in a
legible manner,” because this is also a false statement.
The negation is “Some doctors write in a legible manner.”
This can also be stated as, “There exists at least one
doctor who writes in a legible manner.”
31
Quanti ers and Negation
Table 3.4A illustrates how to write the negation of some
quanti ed statements.
32
Example 7 – Write the Negation of a Quanti ed Statement
Write the negation of each of the following statements.
a. Some airports are open.
b. All movies are worth the price of admission.
c. No odd numbers are divisible by 2.
Solution:
a. No airports are open.
b. Some movies are not worth the price of admission.
c. Some odd numbers are divisible by 2.
33