SI202: Week 1



SM242 Week 1 (Notes based on Epp Text, Chapter 1)

I. Logic

Are there "rules" or "laws" that govern proper reasoning? Can we prove, mathematically, that a particular argument is valid? To what extent can reasoning be automated?

1. Statement (proposition): a sentence that is either true or false, but not both.

Example. Determine if each of the following sentences is a statement.

a. 5 + 3 = 7

b. 21 / 7 = 3

c. MIDN Miller is President of the United States

d. Ah,…the joy of SM242!

e. He is a midshipman

f. MIDN Avworo has written C++ programs.

g. Baltimore is the capital of Maryland.

h. 3 * z < 9

i. Every even integer greater than 2 is the sum of two primes

j. This sentence is false.

2. Compound Statements: a more complex statement composed of simpler statements. The truth-value of a compound statement depends on the truth values of the simpler component statements. The component statements in a compound statement are often referred to as statement variables.

A compound statement usually consists of statement variables joined by logical connectives.

3. Logical Connectives:

A. Not (negation)

1. Mathematical symbol: ~

2. ~p means "it is not the case that p" where p is some statement.

3. Other notations: [pic], [pic]

4. C++ notation:

5. The negation of a statement has the opposite truth-value from the statement. If p is true, ~p is false.

6. The definition of negation is displayed in a truth table

p ~p

F T

T F

B. And (conjunction)

1. Mathematical symbol: [pic]

2. [pic] means “it is the case that p and q are true.”

3. C++ notation:

4. The conjunction of two statements p and q is true when and only when both p and q are both true.

5. The definition of conjunction is displayed in a truth table

p q [pic]

F F

F T

T F

T T

6. Example

p: MIDN Berrios is an officer

q: MIDN Berrios is a gentleman

[pic]:

C. Or (disjunction)

1. Mathematical Symbol: [pic]

2. Also called "inclusive or"

3. C++ notation:

4. The disjunction of two statements [pic] is true if either p or q is true, or if both p and q are true.

5. The definition of disjunction is displayed in a truth table

p q [pic]

6. Example

p: it is rainy

q: it is cold

[pic]:

D. Exclusive or

1. Mathematical Symbol: [pic] , XOR

2. [pic] is true if either p is true or q is true, but not both.

3. The definition of exclusive or is displayed in a truth table

p q [pic]

E. Precedence of logical connectives

Negation has higher precedence than conjunction([pic]) and disjunction([pic]). Conjunction and disjunction are usually considered to have the same precedence. Note that this differs from the C++ high-level language, in which conjunction has a higher precedence than disjunction.

Example: ~ p [pic] q is performed as

Parenthesis can be used to override normal precedence. Example:

It is important that we use parenthesis to avoid ambiguity

Example: Consider p [pic] q [pic] r . Is this (p [pic] q) [pic] r or p [pic] (q [pic] r) ?

4. Translating English into symbolic logic statements

A. Example

Let p = “It is chilly” and q = “It is overcast” . Translate each of the following compound statements into a mathematical statement using symbolic logic.

• It is not chilly but it is overcast

• It is not both chilly and overcast

• It is neither chilly nor overcast

B. Example

Let p = “0 < x” , q = “x < 2” and r = “x = 2”. Translate each of the following compound statements into a mathematical statement using symbolic logic, given that x is a particular real number.

• x [pic] 2

• 0 < x < 2

• 0 < x [pic] 3

5. Assigning truth values to compound statements

We know the truth table for p [pic] q and s [pic] r. But what is the truth table for a compound statement, such as ~(p [pic] q) [pic] (s [pic] r)?

To develop the truth table for a complex statement we must consider each combination of truth values for the component statements.

A. Example: Write the truth table for ~ p [pic] q

Start by making columns for p and q, considering all possible combinations of true and false.

p q

Now, use the definition of ~ to write a column for ~p. Then, write a column for ~[pic] using the definition of disjunction.

p q ~ p ~[pic]

B. Example Write a truth table for (p [pic] q) [pic] ~(p [pic] q)

p q

Have you seen this truth table before?

C. Example Write a truth table for ( p [pic] q ) [pic]~ r

6. Logical Equivalence

Two (compound) expressions are logically equivalent if and only if they have identical truth values for all possible combinations of truth values for the sub-expressions. If A and B are logically equivalent, we write [pic]. (Another notation for logical equivalence is [pic]; that is, if A and B are logically equivalent then [pic].)

To test if A and B and logically equivalent, construct truth tables for A and B. If the truth values of A and B match for all rows in the truth table, then [pic].

A. Example: Are p and ~ (~ p) logically equivalent?

p ~ p ~ (~ p)

F T F

T F T

B. Example: Are ~ [pic] and ~[pic] ~q logically equivalent?

p q [pic] ~[pic] ~[pic] ~[pic] ~[pic] ~q

F F F T T T T

F T F T T F F

T F F T F T F

T T T F F F F

7. DeMorgan’s Laws

A. Example. Show that ~( p [pic] q) [pic]~p [pic] ~q

Think about this equivalence. Does it make sense?

Consider the compound statement: MIDN Mincks is 20 years old and he is in the Navy.

For this to be true, it must be the case that it is true that MIDN Mincks is 20 years old and it is true that MIDN Mincks is in the Navy.

Now think of the negation of this compound statement. For this to be false, one or both of the parts of the compound statement must be false.

So, the negation of “MIDN Mincks is 20 years old and he is in the Navy” is

B. We can also slow that ~( [pic] q ) [pic]~ p [pic] ~ q

C. DeMorgan’s Laws

D. Example: What is the negation of the statement: “It is cold or it is raining.”

8. Tautologies A tautology is a statement that is always true.

Example: Consider [pic]~ p

p ~ p [pic]~ p

F T T

T F T

9. Contradictions A contradiction is a statement that is always false.

Example: Consider [pic] ~ p

p ~ p [pic] ~ p

F T F

T F F

10. Summary of Logical Equivalences (Text Chapter 1 page 14)

11. Using logical equivalences to simplify statements

We can use the table on page 14 of the text to simplify statements.

A. Example. Simplify the following compound statement:

( p [pic] ~q ) [pic] [ ( p [pic] q ) [pic] q ]

Applying the Absorption Law to the right side (the side in square brackets), we have:

( p [pic] ~q ) [pic] q

Then applying the Distributive Law, we have:

( p [pic] q ) [pic] ( ~q [pic] q )

Then, using the Negation Law, we have:

( p [pic] q ) [pic] T

where T is “true.” Then, using the Identity Law, we finally have:

( p [pic] q )

or, since parenthesis aren’t needed, p [pic] q.

B. Example. Simplify the following compound statement: ~(~p [pic] q) [pic]

12. Implication We want to be able to reason from a hypothesis to a conclusion. We want to be able to say “If p is true, then q must be true.” or, more compactly

“if p, then q.”

8 9

This is written symbolically as pγq. This is also called a “conditional.”

A. Examples: If MIDN Collard is a midshipman then MIDN Collard is in the Navy.

If x > 2 then x > 0.

If snow accumulation exceeds 50 inches then classes are canceled.

B. Truth table for pγq.

p q pγq

F F

F T

T F

T T

Suppose I tell you,

“If you have a 95 average then you will get an A.”

hypothesis conclusion

When is this sentence false?

Answer:

p q pγq

F F

F T

T F

T T

If we have statements p and q, then pγq is read “p implies q” and means that pγq is true.

C. Precedence: In expressions that contain “γ”, the “γ” is evaluated last.

D. English expressions which mean γ

In addition to expressing pγq as “if p then q,” the following English expressions are also used (note that these expressions parallel the normal English meaning of “if p then q”):

if p, q p implies q q if p q whenever p

E. Example. Construct a truth table for the statement p [pic] ~ q γ ~ p

F. Example: Show that the conditional pγq is logically equivalent to that statement ~ p [pic] q. That is, show pγq [pic] ~ p [pic] q

G. Example. Prove that ~( pγq ) is logically equivalent to p [pic] ~q.

(Do on your own!)

13. The contrapositive: The contrapositive of pγq is ~ q γ~ p.

A. A conditional statement is logically equivalent to its contrapositive.

B. Examples: Write each of the following in its equivalent contrapositive form.

• If today is Wednesday then tomorrow is Thursday.

• If the temperature goes up then it will be hotter.

• If today is Friday then I have a quiz today

C. Suppose we have the conditional p γ q . The contrapositive is ~ q γ ~ p which, in English, is

Think about this sentence. It says if q does not occur, then p does not occur. This means that p can only occur if q occurs. Or, to put it more succinctly:

To summarize, the following are all equivalent:

• if p then q

• if p, q

• q if p

• q whenever p

• p implies q

• p γ q

• if not q then not p

• ~ q γ ~ p

• p only if q

14. Example

Let a = “You can access the Internet from Bancroft Hall”

c = “You are a computer science major”

f = “You are a plebe”

Translate the following English sentence to a logical expression:

“You can access the Internet from Bancroft Hall only if you are a computer science major or you are not a plebe.”

15. Necessary and sufficient conditions

Consider the sentence “p is a sufficient condition for q.” Isn’t this what we normally mean in English when we say “if p then q”? Hopefully you answered “yes,” and so we have yet another meaning for p γ q, namely: “p is a sufficient condition for q.”

Try to hang on for one more! Consider the sentence “q is a necessary condition for p.” To say that q is a necessary condition for p means the occurrence of q is necessary for p to occur; if q does not occur then p can’t occur: ~ q γ ~ p (if not q, then not p).

But considering the contrapositive, this is the same as p γ q (i.e., if p then q).

So, to summarize again, the following are all equivalent:

• if p then q

• if p, q

• q if p

• q whenever p

• p implies q

• p γ q

• if not q then not p

• ~ q γ~ p

• p only if q

• p is a sufficient condition for q

• q is a necessary condition for p

16. Review

Question 1. Consider the sentence: MIDN Craner will get an A only if he hands in all his homework.

(a) Express this as if A then B.

(b) What would be an alternative equivalent way to express this?

(c) Is this a third way to express the original sentence? If MIDN Craner handed in all his homework, then he received an A.

(d) Express the original sentence as Blah is a necessary condition for Bleh.

(e) Express the original sentence as Blah is a sufficient condition for Bleh.

(f) Given the original sentence, can I conclude that MIDN Craner having handed in all his homework is a sufficient condition for his having received an A?

Question 2. Consider the sentence: If MIDN O’Brien is a midshipman at the USNA, then he is not married.

(a) Express this as Blah is a necessary condition for Bleh.

(b) Is this correct: Being a midshipman at USNA is a necessary condition for MIDN O’Brien to be unmarried.

(c) Express the original sentence as Blah is a sufficient condition for Bleh.

(d) From the original sentence, is it correct to conclude: Being unmarried is a sufficient condition for me to conclude that MIDN O’Brien is a USNA midshipman.

(e) Express the original sentence as p only if q.

Question 3. Consider the sentence:

The fact that MIDN Cunha lives in Bancroft Hall is a sufficient condition for me to conclude that he is a midshipman.

(a) Convert this statement to if p then q:

(b) Express this as Blah is a necessary condition for Bleh.

(c) From the original sentence, is it correct to conclude that living in Bancroft Hall is a necessary condition for being a midshipman?

(d) Express the original sentence as p only if q.

Question 4. Consider the sentence:

MIDN Harrison’s being a senior is a necessary condition for him to be Brigade Commander.

(a) Convert this statement to if p then q:

(b) Convert this statement to an alternative form of if p then q:

(c) Express the original sentence as Blah is a sufficient condition for Bleh.

Question 5. What is the truth value of this statement: If 2 + 2 = 5 then MIDN Tublin is a deity.

Question 6. What is the negation of the following statement: If MIDN Hess is a senior then she is cynical.

Question 7. Suppose p and q are statements and p → q is known to be false. What is the value of p [pic] q?

Question 8. What is the negation of the following statement:

If n is prime then n is odd or n is two.

Question 9. Suppose Midshipman Regulations are modified such that midshipmen can own pets (and harbor them in their Bancroft Hall room). However, Regulation 143.46.51 Section 15, Paragraph 5, Subparagraph 3, Subsection 400, says:

“It is against regulation for any midshipman to keep more than 2 dogs and 2 cats in his room in Bancroft Hall.”

Midshipman Marsal is found to be keeping 38 dogs and no cats in his room. Is he in violation of the aforementioned regulation? Explain.

Question 10. What is the negation of the statement “ x < 5 or x is odd” ?

Question 11. Your Company Officer tells you that he will make you Company Commander only if by senior year you have a CQPR greater than 2.8 and a military QPR greater than 3.0. When you reach senior year your CQPR is 3.5 and your military QPR is 3.6 but your Company Officer does not make you Company Commander. Did your Company Officer lie to you? Explain.

17. The converse: The converse of p → q is q → p.

In other words, the converse of if p then q is if q then p.

A. The converse of a statement is not logically equivalent to the statement. If a conditional statement is true, its converse may or may not be true.

B. Examples: What is the converse of the following statements?

• If today is Wednesday then tomorrow is Thursday.

• If today is Labor Day, then today is a holiday.

• If I can run 2 miles, then I can run 1 mile.

• If I turned on the light switch, then the light came on.

18. The inverse: The inverse of p γ q is ~ p γ ~ q.

In other words, the inverse of if p then q is if ~p then ~q.

A. The inverse of a statement is not logically equivalent to the statement. If a conditional statement is true, its inverse may or may not be true.

B. Examples. What is the inverse of the statements in the last example?









C. Answer the following three True/False questions.

i) A conditional statement and its converse are logically equivalent.

ii) A conditional statement and its inverse are logically equivalent.

iii) The converse and the inverse of a conditional statement are logically equivalent to each other.

D. Example. For each of the following statements, write the contrapositive, converse and inverse

• If he is an Ensign, then he is a naval officer.

Contrapositive:

Converse:

Inverse:

• If n is divisible by 10, then n is divisible by 5 and n is divisible by 2

Contrapositive: If n is not divisible by 5 or n is not divisible by 2, then n is not divisible by 10.

Converse: If n is divisible by 5 and n is divisible by 2 then n is divisible by 10.

Inverse: If n is not divisible by 10 then n is not divisible by 5 or n is not divisible by 2.

19. The biconditional

A. Given two statements p and q, the biconditional p ↔ q, read “p if and only if q,” is the statement that is true if p and q have the same truth values and is false if p and q have opposite truth values.

p q p ↔ q

Thus, the statement “p if and only if q” is really saying two things:





So saying “p if and only q” is saying: or, symbolically

B. Again, p ↔ q is logically equivalent to the conjunction of p γ q and q γ p. But we already said that p γ q is equivalent to the statement that

Similarly, we said that q γ p is equivalent to the statement

Taking the conjunction of these two statement we have p ↔ q is equivalent to saying

C. The following is an example of a biconditional: An integer is even if and only if it is divisible by 2.

D. To summarize, the following are all equivalent

• p ↔ q

• ( p γ q ) [pic] ( q γ p )

• p is a necessary and sufficient condition for q

• p if and only if q



E. Example: Express the statement “I am happy if and only if I have found true love” as the conjunction of two if-then statements.

F. Notation. From now on, we will very often abbreviate “if and only if” as iff.

-----------------------

~( p [pic] q) [pic]~p [pic] ~q

~( [pic] q ) [pic]~ p [pic] ~ q

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download