[an error occurred while processing this directive]

## cs150: Notes 14

#### Definition Reminders

Big-Oh: upper bound. A function g is in O (f) iff there are positive constants c and n0 such that g(n) ≤ cf(n) for all n ≥ n0.

Ω: lower bound. A function g is in Ω (f) iff there are positive constants c and n0 such that g(n) ≥ cf(n) for all n ≥ n0.

Θ: tight bound. A function g is in Θ (f) iff g is in O(f) and g is in Ω(f).

Why are these operators useful for understanding the cost of evaluating procedures?

Prove n is not in Ω(n2).

#### Best-First Sort

```(define (sort lst cf)
(if (null? lst) lst
(let ((best (find-best lst cf)))
(cons best (sort (delete lst best) cf)))))

(define (find-best lst cf)
(if (= 1 (length lst)) (car lst)
(pick-better cf (car lst) (find-best (cdr lst) cf))))
```

#### Insertion Sort

```(define (insertsort cf lst)
(if (null? lst) null
(insertone cf (car lst) (insertsort cf (cdr lst)))))

(define (insertone cf el lst)
(if (null? lst) (list el)
(if (cf el (car lst)) (cons el lst)
(cons (car lst) (insertone cf el (cdr lst))))))
```
What is the asymptotic running time of the sort procedures?

Which sort procedure is faster?

#### Useful Proof Techniques

Proof by intimidation: "Trivial" or "obvious."
Proof by exhaustion: An issue or two of a journal devoted to your proof is useful.
Proof by omission: "The reader may easily supply the details", "The other 253 cases are analogous"
Proof by obfuscation: A long plotless sequence of true and/or meaningless syntactically related statements.
Proof by funding: How could three different government agencies be wrong?
Proof by lack of funding: How could anything funded by those bozos be correct?
Proof by democracy: A lot of people believe it's true: how could they all be wrong?
Proof by reference to inaccessible literature: The author cites a simple corollary of a theorem to be found in a privately circulated memoir of the Icelandic Philological Society, 1883. This works even better if the paper has never been translated from the original Icelandic.
Proof by forward reference: Reference is usually to a forthcoming paper of the author, which is often not as forthcoming as at first.
Proof by flashy graphics: A moving sequence of shaded, 3D color models will convince anyone that your object recognition algorithm works. An SGI workstation is helpful here.
Proof by vehement assertion: It is useful to have some kind of authority relation to the audience, so this is particularly useful in classroom settings.
Proof by vigorous handwaving: Works well in a classroom, seminar, or workshop setting.
Proof by cumbersome notation: Best done with access to at least four alphabets, special symbols, and the newest release of LaTeX.
Proof by lack of space: "The proof is not detailled due to lack of space in this proceedings..." works well in conjunction with proof by forward reference.

Selected from http://www.ai.sri.com/~luong/research/proof.html.
Be careful when using these proof techniques in your assignments, however. Only professors are allowed to use them.