Discrete Mathematics for Computer
Science - Study Guide
Logic, sets, relations, combinatorics, graphs and proofs - the maths behind CS
Complete Study Guide | Key Concepts | Examples | Practice Questions
, 1. Logic and Proofs
Propositional logic formalises reasoning. Proof techniques are how CS establishes that algorithms and systems
are correct.
- Connectives: NOT (~), AND (/\), OR (\/), IMPLIES (->), IFF (<->).
- Truth tables decide tautologies; De Morgan's laws: ~(p /\ q) = ~p \/ ~q.
- Implication p -> q is false only when p is true and q is false.
- Proof methods: direct, contrapositive, contradiction, induction, counter-example.
- Mathematical induction: prove base case P(1), then P(k) -> P(k+1). The workhorse for loop/recursion
correctness.
TIP: To disprove a 'for all' statement, one counterexample suffices. To prove one, you must argue
generally.
Page 1
Science - Study Guide
Logic, sets, relations, combinatorics, graphs and proofs - the maths behind CS
Complete Study Guide | Key Concepts | Examples | Practice Questions
, 1. Logic and Proofs
Propositional logic formalises reasoning. Proof techniques are how CS establishes that algorithms and systems
are correct.
- Connectives: NOT (~), AND (/\), OR (\/), IMPLIES (->), IFF (<->).
- Truth tables decide tautologies; De Morgan's laws: ~(p /\ q) = ~p \/ ~q.
- Implication p -> q is false only when p is true and q is false.
- Proof methods: direct, contrapositive, contradiction, induction, counter-example.
- Mathematical induction: prove base case P(1), then P(k) -> P(k+1). The workhorse for loop/recursion
correctness.
TIP: To disprove a 'for all' statement, one counterexample suffices. To prove one, you must argue
generally.
Page 1