01-prop_logic

01-prop_logic - CSIS1118 Foundations of Computer Science...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CSIS1118 oundations of Computer Science Foundations of Computer Science ogic Logic Hubert Chan ([O1, O2]; chapters 1.1, 1.2) 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ogic (Chapter 1) Logic (Chapter 1) •P r o positional Logic Basic Definitions Logical operators • Predicate Logic Predicates Quantified expressions 2
Background image of page 2
ogic IQ questions Logic IQ questions xample 1 (Section 1.1, Q61): Example 1 (Section 1.1, Q61): Steve would like to determine the relative salaries of three coworkers using two facts. First, he knows the following. You an assume that they all have different salaries can assume that they all have different salaries. If Fred is not the highest paid of the three, then Janice is. If Janice is not the lowest paid, then Maggie is paid the most. I it possible to determine the relative salaries of Fred, s t poss b e to dete e t e e at e sa a es o ed, Maggie, and Janice from what Steve knows? If so, who is paid the most and who the least? Explain your answer. 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example 2 (Section 1.1, Q60): our friends have been identified as suspects for an Four friends have been identified as suspects for an unauthorized access into a computer system. They have made statements to the investigating authorities. You can assume that only one of them did it. Alice said “Peter did it.” John said “I did not do it.” Peter said “Diana did it.” iana said “Peter lied when he said that I did it ” Diana said Peter lied when he said that I did it. a) If the authorities also know that exactly one of the four suspects is telling the truth, who did it? b) If the authorities also know that exactly one of the four suspects is lying, who did it? 4
Background image of page 4
ropositions efinition Propositions Definition • Def: A proposition is a statement that is either true ( T ) or false ( F ), but not both . hich of the followings are propositions? Which of the followings are propositions? 1 + 1 = 7. Do you feel hungry? yg y Hong Kong is the largest city of China. 1 + 3. x + 2. Come here quickly! 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ompound Proposition Compound Proposition • A proposition (compound proposition) can be formed by ombining several propositions using logical operators combining several propositions using logical operators. • Logical operators: (negation), (and), (or), (exclusive or), (implication), (biconditional) • Example: Mr. Wong is stupid and his wife is lazy. p : Mr. Wong is stupid q : his wife is lazy. p q : where stands for connective “and” A compound proposition also has a truth value (T or F) depending on the truth values of its constituting propositions and the operator(s). 6
Background image of page 6
ogical operators Logical operators • And (Conjunction) - Let p and q be two propositions, (p ) is defined to be true if both p and q are true, and false q) is defined to be true if both p and q are true, and false otherwise.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 25

01-prop_logic - CSIS1118 Foundations of Computer Science...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online