<p>B-Trees, N-ary Trees, Autocracy and Democracy</p>

<p><a href="http://rkvsraman.blogspot.in/2008/08/b-trees-n-ary-trees-autocracy-and.html" rel="nofollow">http://rkvsraman.blogspot.in/2008/08/b-trees-n-ary-trees-autocracy-and.html</a> </p>

CC BY-SA 3.0
2015-03-05T12:31:48.383Z
2015-03-05T12:31:48.383Z
RKVS Raman
<p>There is a very nice metaphor on decidable languages in the book <a href="http://en.wikipedia.org/wiki/G%C3%B6del,_Escher,_Bach" rel="nofollow noreferrer">Gödel, Escher, Bach</a> by Douglas Hofstadter.</p>

<p>He uses drawings as an analogy for recursively enumerable languages.
Every time you draw something on a sheet of paper, the part of the sheet that is not used by your drawing can be viewed as the "complement" of your drawing.</p>

<p>The artist M.C. Escher plays with such complements in pictures like this one:</p>

<p><img src="https://i.sstatic.net/Oq8Iy.jpg" alt="Tessellation by Escher"> </p>

<p>We can view this as a picture of birds, whose complement is a picture of fishes.</p>

<p>The behaviour is the same with decidable languages: both the language and its complement are recursively enumerable.</p>

<p>To sum up, it allows to graphically view an object that "makes sense" (in this case it stands for recursively enumerable), such that the "hole" it leaves in the universe also "makes sense".</p>

CC BY-SA 3.0
2015-03-05T13:08:09.290Z
2015-03-05T13:23:18.743Z
2015-03-05T13:23:18.743Z
Denis
<p>Water filling algorithm for channel allocation
<a href="http://en.wikipedia.org/wiki/Water_filling_algorithm" rel="nofollow">http://en.wikipedia.org/wiki/Water_filling_algorithm</a></p>

CC BY-SA 3.0
2014-11-04T12:11:20.560Z
2014-11-04T12:11:20.560Z
Aryeh
<p>Dijkstra's Algorithm and Human Psyche</p>

<p><a href="http://rkvsraman.blogspot.in/2005/12/dijkstras-algorithm-and-human-psyche.html" rel="nofollow">http://rkvsraman.blogspot.in/2005/12/dijkstras-algorithm-and-human-psyche.html</a></p>

CC BY-SA 3.0
2015-03-05T12:33:55.070Z
2015-03-05T12:33:55.070Z
RKVS Raman
<p>Recently I found an interesting algorithm book entitled <a href="http://books.google.com.hk/books?id=jfBGAAAAQBAJ&amp;pg=PA1&amp;lpg=PA1&amp;dq=explaining+algorithms+using+metaphors&amp;source=bl&amp;ots=WzN9sRRw6e&amp;sig=LZiwzBgOxMK_iXdijfTjQoX6ZFY&amp;hl=en&amp;sa=X&amp;ei=TPBVVPLQO-TYmgW0t4KYBw&amp;ved=0CEEQ6AEwBQ#v=onepage&amp;q=explaining%20algorithms%20using%20metaphors&amp;f=false">'Explaining Algorithms Using Metaphors' (Google books)</a> by Michal Forišek and Monika Steinová. "Good" metaphors help people understand and even visualize the abstract concepts and ideas behind algorithms. </p>

<p>For example,</p>

<blockquote>
  <p>One well-known exposition of the shortest path using the balls-and-strings model
  looks as follows: To find the shortest path between $s$ and $t$, one just grabs the corresponding two balls and tries to pull them apart.  </p>
</blockquote>

<p>My question:</p>

<blockquote>
  <p>I would like to see as many metaphors as possible for computer science algorithms/concepts/ideas.<br>
  Do you know any? Do you have your own ones?     </p>
</blockquote>

CC BY-SA 3.0
2015-03-05T14:06:07.203Z
I think Knuth's *The Art of Computer Programming* has something about external sorting and snowploughs and elevators.
Zsbán Ambrus
CC BY-SA 3.0
2015-03-06T09:09:51.463Z
Stories can also be dangerous: it can be easier to try to make the facts fit the existing narrative, even when the story is no longer suitable and should be discarded.  See also https://mathoverflow.net/q/2358/7252 for some mathematics examples.
András Salamon
<ds.algorithms><reference-request><soft-question><big-list><intuition>
Explaining computer science algorithms/concepts/ideas using metaphors
hengxin
# Explaining computer science algorithms/concepts/ideas using metaphors

(Asked by: username_0 on 2014-11-02)

Recently I found an interesting algorithm book entitled ['Explaining Algorithms Using Metaphors' (Google books)](http://books.google.com.hk/books?id=jfBGAAAAQBAJ&pg=PA1&lpg=PA1&dq=explaining+algorithms+using+metaphors&source=bl&ots=WzN9sRRw6e&sig=LZiwzBgOxMK_iXdijfTjQoX6ZFY&hl=en&sa=X&ei=TPBVVPLQO-TYmgW0t4KYBw&ved=0CEEQ6AEwBQ#v=onepage&q=explaining%20algorithms%20using%20metaphors&f=false) by Michal Forišek and Monika Steinová. "Good" metaphors help people understand and even visualize the abstract concepts and ideas behind algorithms.

For example,

> One well-known exposition of the shortest path using the balls-and-strings model
> looks as follows: To find the shortest path between $s$ and $t$, one just grabs the corresponding two balls and tries to pull them apart.

My question:

> I would like to see as many metaphors as possible for computer science algorithms/concepts/ideas.  
> Do you know any? Do you have your own ones?

**Tags:** ds.algorithms, reference-request, soft-question, big-list, intuition

> **Comments:**
> **username_1**: I think Knuth's *The Art of Computer Programming* has something about external sorting and snowploughs and elevators.  
> **username_2**: Stories can also be dangerous: it can be easier to try to make the facts fit the existing narrative, even when the story is no longer suitable and should be discarded.  See also https://mathoverflow.net/q/2358/7252 for some mathematics examples.  

---

## 4 answers

### Answer by username_3 on 2015-03-05. Score: 2

B-Trees, N-ary Trees, Autocracy and Democracy

<http://rkvsraman.blogspot.in/2008/08/b-trees-n-ary-trees-autocracy-and.html>


---

### Answer by username_4 on 2015-03-05. Score: 2

There is a very nice metaphor on decidable languages in the book [Gödel, Escher, Bach](http://en.wikipedia.org/wiki/G%C3%B6del,_Escher,_Bach) by Douglas Hofstadter.

He uses drawings as an analogy for recursively enumerable languages.
Every time you draw something on a sheet of paper, the part of the sheet that is not used by your drawing can be viewed as the "complement" of your drawing.

The artist M.C. Escher plays with such complements in pictures like this one:

![Tessellation by Escher](https://i.sstatic.net/Oq8Iy.jpg)

We can view this as a picture of birds, whose complement is a picture of fishes.

The behaviour is the same with decidable languages: both the language and its complement are recursively enumerable.

To sum up, it allows to graphically view an object that "makes sense" (in this case it stands for recursively enumerable), such that the "hole" it leaves in the universe also "makes sense".


---

### Answer by username_5 on 2014-11-04. Score: 1

Water filling algorithm for channel allocation
<http://en.wikipedia.org/wiki/Water_filling_algorithm>


---

### Answer by username_3 on 2015-03-05. Score: 0

Dijkstra's Algorithm and Human Psyche

<http://rkvsraman.blogspot.in/2005/12/dijkstras-algorithm-and-human-psyche.html>


---

