Problems on Propositional Logic and Predicate logic Propositional logic

Predicate logic

Additional problems Propositional logic Fill in the corresponding truth values (T or F) of the expressions

(the shadowed area contains the answers) P Q expression Value T T P V Q T T F P Λ ¬ Q T F T P → Q T F F ¬P « Q F Represent as propositional expressions: Tom is a math major but not computer science major P: Tom is a math major

Q: Tom is a computer science major Use De Morgan's Laws to write the negation of the expression, and translate the negation in English Solution: P Λ ¬ Q (Tom is a math major but not computer science major) ¬ (P Λ ¬ Q) = ¬ P V Q (De Morgan's Laws) translation: ¬ P V Q is equivalent to P → Q If Tom is a math major then Tom is a computer science major Let P = "John is healthy"

Q = "John is wealthy"

R = "John is wise" Represent: John is healthy and wealthy but not wise: P Λ Q Λ ¬ R John is not wealthy but he is healthy and wise: ¬ Q Λ P Λ R John is neither healthy nor wealthy nor wise: ¬ P Λ ¬ Q Λ ¬R Translate the sentences into propositional expressions: "Neither the fox nor the lynx can catch the hare if the hare is alert and quick." Let

P: The fox can catch the hare

Q: The lynx can catch the hare.

R: The hare is alert

S: The hare is quick Translation into logic: (R Λ S) → ~P Λ ~Q Since ~P Λ ~Q is equivalent to ~( P V Q), another translations is:

(R Λ S) → ~( P V Q) "You can either (stay at the hotel and watch TV ) or (you can go to the museum and spend some time there)". The parentheses are used to avoid ambiguity concerning the priority of the logical connectives. P: You stay at the hotel.

Q: You watch TV

R: You go to the museum

S: You spend some time in the museum Translation: (P Λ Q) V (R Λ S) Write down the logical identities: P V T =

P V F =

P V ~P =

…. Conditional statements: 6.1. For the implication P → ~Q indicate which of the following expressions is its contrapositive, its converse and its inverse: P → Q, ~Q → P, ~P → ~Q, ~P → Q, ~Q → ~P, Q → ~P 6.2. Given a conditional statement in English, translate the sentence into a logical expression write the negation of the logical expression and translate the negation into English write the converse of the logical expression and translate the converse into English write the inverse of the logical expression and translate the inverse into English write the contrapositive of the logical expression and translate the contrapositive into English "If we are on vacation we go fishing." Let

P: we are on vacation

Q: we go fishing The logical expression for the above sentence is: P → Q negation: P Λ ¬ Q

"We are on vacation and we do not go fishing." converse: Q → P

"If we go fishing, we are on vacation." inverse: ¬ P → ¬ Q

"If we are not on vacation, we don't go fishing." contrapositive: ¬ Q → ¬ P

"If we don't go fishing, we are not on vacation." 6.3. Write the contrapositive, converse and inverse of the expressions:

P → Q, ~P → Q, Q → ~P contrapositive converse inverse P → Q ~Q → ~ P Q → P ~P → ~Q ~P → Q ~ Q → P Q → ~P P → ~Q Q → ~P P → ~Q ~P → Q ~ Q → P Determine whether the following arguments are valid or invalid: Premises: If I read the newspaper in the kitchen, my glasses would be on the kitchen table. I did not read the newspaper in the kitchen. Conclusion : My glasses are not on the kitchen table. Solution: This is an invalid argument.

In order to show this we will represent the argument formally. Let

P: I read the newspaper in the kitchen

Q: my glasses would be on the kitchen table. Formal representation:

(1) P → Q

(2) ~P

(3) Therefore ~Q We know that when P is false, i.e. we have ~P, the implication is true

for any value of Q.

Hence we cannot say whether Q is true or false.

The error in the above argument is called inverse error. Premises: If I don't study hard, I will not pass this course If I don't pass this course I cannot graduate this year. Conclusion: If I don't study hard, I won't graduate this year. Solution: This is a valid argument, based on the hypothetical syllogism.

In order to show this we will represent the argument formally. Let

P: I don't study hard

Q: I will not pass this course

R: I cannot graduate this year Formal representation:

(1) P → Q

(2) Q → R

(3) Therefore P → R Premises: You will get an extra credit if you write a paper or if you solve the test problems. You don’t write a paper, however you get an extra credit. Conclusion: You have solved the test problems. Solution: This is an invalid argument.

In order to show this we will represent the argument formally. Let

P: you get an extra credit

Q: you write a paper

R: you solve the problems Formal representation:

(1) (Q V R) → P

(2) ~Q

(3) P

(4) Therefore R The above argument is a combination of disjunctive syllogism and modus ponens, however the modus ponens is not applied correctly.

The disjunctive syllogism consists in the following: Given that (Q V R) is true, and that Q is false (~Q is true) we conclude that R is true. However we cannot know whether Q V R is true, given that P is true.

The error in concluding that Q V R is true is called converse error. Premises: You will get an extra credit if you write a paper or if you solve the test problems. You don’t write a paper and you don't get an extra credit. Conclusion: You have not solved the test problems. Solution: This is a valid argument.

In order to show this we will represent the argument formally. Let

P: you get an extra credit

Q: you write a paper

R: you solve the problems Formal representation:

(1) (Q V R) → P

(2) ~Q

(3) ~P

(4) Therefore ~R From ~P we can conclude that Q V R is false (modus tollens).

A disjunction is false only when both of its sides are false.

Hence R must be false. Note, that the premise ~Q is not necessary. Since both sides of the disjunction must be false, Q must be false too.

A valid argument would be the following one:

(1) (Q V R) → P

(2) ~P

(3) Therefore ~Q and ~R Predicate logic Translate the sentences in quantified expressions of predicate logic, write down the negated expression and then translate the negated expression in English. The predicates to be used are given in parentheses. Some problems are difficult. (problem(x), difficult(x)) $ x, (problem(x) L difficult(x)) Negation: ~( $ x, (problem(x) L difficult(x))) = " x (~(problem(x) L difficult(x))) = " x (~problem(x) V ~ difficult(x)) = " x (problem(x) ® ~ difficult(x)) Translation: No problems are difficult. All students that study discrete math are good at logic.

(student(x), study_discrete_math(x), good_at_logic(x)) " x (student(x) L study_discrete_math(x) ® good_at_logic(x)) Negation: ~ ( " x (student(x) L study_discrete_math(x) ® good_at_logic(x)) = $ x (~ (student(x) L study_discrete_math(x) ® good_at_logic(x))) = $ x (~ ( ~( student(x) L study_discrete_math(x)) V good_at_logic(x))) = $ x (~ ( (~student(x) V ~study_discrete_math(x)) V good_at_logic(x))) = $ x (~ ( ~student(x) V ~study_discrete_math(x) V good_at_logic(x))) = $ x ((student(x) L study_discrete_math(x)) L ~ good_at_logic(x))) Translation: There is a student that studies discrete math and is not good at logic No students are allowed to carry guns. (student(x), carry_gun(x)) " x (student(x) ® ~carry_gun(x)) Negation: ~( " x, (student(x) ® ~carry_gun(x))) = $ x, ~(student(x) ® ~carry_gun(x))) = $ x, ~(~student(x) V ~carry_gun(x)) = $ x, (student(x) L carry_gun(x)) Translation:There is a student that carries a gun International students are not eligible for federal loans.

(international_student(x), eligible(x)) " x (international_student(x) ® ~eligible(x)) Negation: ~( " x (international_student(x) ® ~eligible(x))) = $ x, ~(international_student(x) ® ~eligible(x)) = $ x, ~(~international_student(x) V ~eligible(x)) = $ x, (international_student(x) L eligible(x)) Translation: Some international students are eligible for federal loans. Additional problems Study the exam-like problems provided in the lecture notes on Logic Review also quizes and homework assignments.