Proofs are a convincing demonstration In algorithm it often consists of deductive reasoning rather than empirical arguments. Proofs are often used to prove an algorithm will work for some or all cases.
Types of proofs
There are two main methods of proofs used for VCE Algorithms.
Proof by Induction
First, prove the first case. Then assume that the th case is true. Prove the th case
Proof by Contradiction
Create a conjecture that is the opposite of what you are trying to prove. Prove that such a conjecture cannot be true as it creates contradictions. As such the original proposal must be true.’
If is the statement that states that is true and is false () (De Morgan’s laws)
Thus show that if one assumes is true and is false, they will arrive at a contradiction.
Loop invariance is a condition that is true at the beginning and end of every iteration of a loop. Can be used in proofs.? Case is correct, show ?
Proof Examples
Induction
See proof of correctness for:
- Dijkstra’s algorithm
- Floyd-Warshall algorithm
- Bellman-Ford algorithm (to be completed)
Contradiction
- Pigeon hole principle
- DAG source (to be completed)