Entropy in algorithm analysis
11011110.github.io·13w

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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help