01logic_10

# 01logic_10 - ENGG1007 Foundations of Computer Science Logic...

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

1 ENGG1007 Foundations of Computer Science Logic Logic Prof. Francis Chin, Dr SM Yiu (chapters 1.1, 1.2)

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

View Full Document
2 ENGG1007 FCS Logic (Chapter 1) Logic (Chapter 1) • Propositional Logic ¾ Basic Definitions ¾ Logical operators • Predicate Logic ¾ Predicates ¾ Quantified expressions
3 ENGG1007 FCS Logic IQ questions Logic IQ questions 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 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. Is it possible to determine the relative salaries of Fred, Maggie, and Janice from what Steve knows? If so, who is paid the most and who the least? Explain your answer.

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

View Full Document
4 ENGG1007 FCS Example 2 (Section 1.1, Q60): 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.” 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?
5 ENGG1007 FCS Propositions Propositions Definition Definition • Def: A proposition is a statement that is either true ( T ) or false ( F ), but not both . • Which of the followings are propositions? ¾ 1 + 1 = 7. ¾ Do you feel hungry? ¾ Hong Kong is the largest city of China. ¾ 1 + 3. ¾ x + 2 = 5. ¾ Come here quickly!

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

View Full Document
6 ENGG1007 FCS Compound Proposition Compound Proposition • A proposition (compound proposition) can be formed by 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 :w h e r e 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).
7 ENGG1007 FCS Logical operators Logical operators • And (Conjunction) - Let p and q be two propositions, (p q) is defined to be true if both p and q are true, and false otherwise.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/10/2011 for the course ENGG 1007 taught by Professor Unknown during the Spring '11 term at HKU.

### Page1 / 22

01logic_10 - ENGG1007 Foundations of Computer Science Logic...

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

View Full Document
Ask a homework question - tutors are online