Entropy in algorithm analysis
11011110.github.io·23h
Flag this post

What follows are some half-baked ideas for how the quantity called “entropy” used in some forms of algorithm analysis for algorithms including sorting and convex hulls can justify being called entropy.

The simplest of these is the run-based entropy used to analyze some comparison-based sorting algorithms. Here, a run in an unsorted input sequence is a subsequence of the input that is already sorted (let’s say, in the same ascending order that you are trying to produce for the whole sequence. If one partitions a length-(n) input into (r) maximal runs of sizes (n_i), then the entropy of the input is defined to be

[\mathrm{H}=-\sum_{i=1}^r \frac{n_i}{n}\log_2 \frac{n_i}{n}.]

(That (\mathrm{H}) is intended as a Greek capital letter eta, and I’m using (\lo…

Similar Posts

Loading similar posts...