The "banana-split" law in action.
The notes show how this theorem can be used to reason about two algorithms for calculating the average of a list of numbers, and prove their equivalence: A straightforward inefficient solution (sum/len) and more careful implementation that only traverses the list once.
Posted to functional by Ehud Lamm on 2/27/03; 12:00:18 PM
|