{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Proposition

# Proposition - CSS342 Propositions Professor Munehiro Fukuda...

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

CSS342: Propositions 1 CSS342: Propositions Professor: Munehiro Fukuda

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

View Full Document
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)
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

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

View Full Document
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
CSS342: Propositions 5 Binary Expressions in C++ Part1 How do you examine the behavior of if-else?

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.

{[ snackBarMessage ]}

### Page1 / 18

Proposition - CSS342 Propositions Professor Munehiro Fukuda...

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

View Full Document
Ask a homework question - tutors are online