Proposition - CSS342: Propositions Professor: Munehiro...

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

View Full Document Right Arrow Icon
CSS342: Propositions 1 CSS342: Propositions Professor: Munehiro Fukuda
Background image of page 1

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

View Full DocumentRight Arrow Icon
CSS342: Propositions 2 Introduction Propositional logic is useful in CS to analyze such behavior of code portions. Proposition: a statement that is either true or false, but not both Logic: reasoning whether a consequence of given statements is correct, but not whether each statement is true. Example: Proposition p: All mathematicians wear sandals. (A → B) Proposition q: Anyone who wears sandals is an algebraist (B → C) From p and q: All mathematicians are algebraists. (A → C)
Background image of page 2
CSS342: Propositions 3 Propositions Examples: In math 1. The only positive integers that divide 7 are 1 and 7 itself: (true) 2. For every positive integer n, there is a prime number larger than n: (true) In history 1. Alfred Hitchcock won an Academy Award in 1940 for directing “Rebecca”: (false, he has never won one for directing) 2. Seattle held the World’s Fair, Expo 62: (true ) In programming languages 1. Boolean expressions in if-else, while, and for statements for ( index = 0; index < 100; index++ ) { …….; } A proposition Not a proposition
Background image of page 3

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

View Full DocumentRight Arrow Icon
CSS342: Propositions 4 Compound propositions Conjunction of p and q True only if both p and q are true truth table Disjunction of p or q Notations: p v q, p || q True if either p or q or both are true truth table p q p ^ q F F F F T F T F F T T T p q p v q F F F F T T T F T T T T
Background image of page 4
CSS342: Propositions 5 Binary Expressions in C++ Part1 How do you examine the behavior of if-else?
Background image of page 5

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

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

This document was uploaded on 12/20/2009.

Page1 / 18

Proposition - CSS342: Propositions Professor: Munehiro...

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

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