Presentation is loading. Please wait.

Presentation is loading. Please wait.

MATH 245 Spring 2009 This is mathematics for computer science

Similar presentations


Presentation on theme: "MATH 245 Spring 2009 This is mathematics for computer science"— Presentation transcript:

1 MATH 245 Spring 2009 This is mathematics for computer science
Logic and proof Induction and recursion Counting and Probability Course structure Weekly homework Bi-weekly quizes (rewriteable)‏ Final

2 How to Succeed Read the book Ask questions in class Form study groups
Seek help early and often Check web site:

3 Logic Need formal, careful rules for reasoning Avoid false conclusions
Facilitate decision making and design Based in Philosophy first and then Mathematics (all scientists were philosophers then (time of Aristotle))‏

4 Statement A true or false sentence Good Bad
John got an A in Geometry last semester. Crows are birds. Bad John is a religious X + Y = 5 Variables are used to represent a statement: p, q, r, ...

5 Logic Compound Statements
Two or more statements joined by not (~), and (^), or (v)‏ p = It is Monday, q = It is February, r = School is not in session. ~p q ^ r q v ~r

6 Truth Tables p q p v q t t t t f t f t t f f f
p q r p ^ q ~r (p ^ q) v ~r t t t t f t t t f t t t t f t f f f t f f f t t f t t f f f f t f f t t f f t f f t f f f f t t

7 Logical Equivalence p q p v q q v p t t t t t f t t f t t t f f f f
Useful to simplify or otherwise manipulate compound logic statements. E.G. Simplifying boolean conditions in coding

8 De Morgan's Laws Rules for NOT combined with AND, OR
~( p v q ) == ~p ^ ~q ~( p ^ q ) == ~p v ~q Can use a Truth Table to prove these

9 Tautologies and Contradictions
Tautology – compound statement that is always true: (p v ~p) Contradiction – one that is never true: (p ^ ~p)‏

10 Conditional Statements
The troublesome if ; implication If it rains then ... p -> q ( hypothesis implies conclusion )‏ Truth Table is the troublesome part p q p -> q t t t t f f f t t (weird?) f f t (seems so)‏

11 Logical Equivalences Operator precedence Show TT for p ^ ~q -> r
Show p -> q == ~p v q

12 Negation of a conditional
~( p -> q ) ?? Since TT is F only when p is T and q is F, ~p ^ q Can also use the above equivalence and De Morgan's Laws NEVER use “if” in the negation of an “if” Negate: if PLU is in Tacoma then it is in Washington

13 Contrapositive An implication stated with negatives (sort of De Morgans Law again)‏ Contrapositive of p -> q is ~q -> ~p These are equivalent Contrapositive: if PLU is in Tacoma then it is in Washington

14 Converse and Inverse of p -> q
Converse is q -> p Inverse is ~p -> ~q Converse and Inverse: if PLU is in Tacoma then it is in Washington

15 Only If and Biconditional of p -> q
Only If: q only if p Another way to say if p then q Biconditional: p if and only if q (true when p and q are equal)‏

16 Necessary and Sufficient Conditions
Alternate ways of saying if, only if r is a sufficient condition for s if r then s (r -> s) r is a necessary condition for s r iff s ( r <-> s )‏

17 Logic and English Compound statement sentences need not be related if = 4 then today is Monday English if usually means iff if you work hard then you will succeed English “or” usually mean exclusive or PLU is in Tacoma or it is in Washington


Download ppt "MATH 245 Spring 2009 This is mathematics for computer science"

Similar presentations


Ads by Google