2 | Proof by I, proof by C, algorithm Flashcards
Three types of Proof?
- Direct proof
- Indirect proof
proof by contradiction - Proof by induction
Steps for Proof by Induction
Theorem, eg P(n)
Base case, eg for a (often 0 or 1) prove P(a)
Induction hypothesis (IH) eg that for some value k, P(k) holds
Induction step (IS) Show that if P(k) holds, P(k+1) also holds.
–> combination of these steps shows that P(n) is true for all values of n.
Definition of an algorithm
Algorithm is a set of rules for carrying out calculation.
Execution of an algorithm must not include
- subjective decisions
- call for some intuition
Deterministic algorithm?
- given a particular input, will always produce the same output
- underlying machine always passing through the same sequence of states.
P Class?
- decisions problems
- easily solvable in Polynomial time w/ deterministic machine
NP Class?
- decisions problems
- Nondeterministic Polynomial time: solvable in polynomial time by a nondeterministic Turing machine.
- verifiable in polynomial time by a deterministic Turing machine.
NP-hard class
- (believed) can not be solved in polynomial time
- at least as hard as the hardest problem in NP
- Not all NP-hard problems are in NP.
- It takes a long time to check them.
NP Complete class
- both NP and NP-hard: hard problems in NP.
What is a tractable problem
Tractable means that a problem can be solved in practice as well as in theory
What is an intractable problem
problems that can be solved in theory but not in practice .
What is a heuristic?
- cannot control the error and it may be difficult to estimate it
- designed for problem solving more quickly when classic methods are too slow for finding an exact or approximate solution,
- or when classic methods fail to find any exact solution in a search space.
- This is achieved by trading optimality, completeness, accuracy, or precision for speed.
- In a way, it can be considered a shortcut.
Symbol for:
for all
∀
Symbol for:
such that
:
Symbol for:
there exists
∃