2791: Bookshelf Sorting

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
Bookshelf Sorting
Of course, I sort all my bookshelves the normal way, alphabetically (by first sentence).
Title text: Of course, I sort all my bookshelves the normal way, alphabetically (by first sentence).


Some people like to sort their bookshelves by the visible color of the book's spine, for example by hue to create a rainbow effect. This is pleasing to the eye, but may be unhelpful when trying to find a specific book. Literary enthusiasts (AKA "Book People") frequently dislike this system, because it emphasizes appearance at the expense of making books easy to find. On a philosophical level, treating books as decorations, rather than reading material, upsets many purists. "Book people" are more likely to have a practical system for arranging their books, either by category, genre, title, author name, or some combination of those. For a large library, a more rigorous organizational scheme such as the Dewey Decimal Classification might be used.

Unfortunately, Randall has found a much worse method of book organization - instead of sorting the books as discrete units, he has sorted their individual pages by number. This would require physically separating each book into its individual pages, and then organizing them into groups by page number. This effectively destroys every book, and requires anyone trying to read them to laboriously find each individual page (among many pages of the same number), and then replace it in the correct space after reading. Adding a new book would require individually placing potentially hundreds of pages. Where pages are not numbered, finding their place would be nearly impossible.

He doesn't denote whether he's using any particular sub-method to sort the pages within each page number, and if so, whether this is consistent per book (e.g. alphabetically by the book title), or does each page number sort independently? If the latter (e.g. each group of pages of a particular number is sorted by the first word or words on that page, similar to what is described in the title text), it would be especially difficult to reunite all the pages of a book as each page would be in a different location relative to the other pages.

From the picture, Randall's system appears to work by absolute physical page count, including the front and rear covers as 'pages'. All the front covers are on the left side, then the first internal leaf of each book (counted as the second page), then the second internal leaf, etc. This produces repeating patterns of taller and shorter loose-leaf pages, echoing the proportions of each cover, having gathered together a page of the same position in each different book. The back covers are mixed in to whatever group falls after the last internal leaf from the same book, and so are intermixed with pages from longer books. The left-most front cover matches the right-most back cover, the second front cover matches the 2nd-to-last back cover, etc. with the last of the front covers matching the first of the back covers. At the end, there are only the last pages of the longest book left, now all uniform in size, and its rear cover.

From the number of repeated page patterns, it can be determined that the shortest (inner-most) book contains approximately 28 pages, the next shortest book has about 30, the next around 32, the next around 40, etc. It gets harder to tell as the number of pages in each group gets fewer and fewer. In total Randall's bookshelf contains 11 books.

The caption claims that "book people" get way angrier at this system, likely because it involves physically destroying books, rendering them almost unreadable. People with a strong affinity for books are often upset at volumes being treated with such disrespect.

In the title text Randall claims he sorts his bookshelf alphabetically, but by the first sentence. He describes this as "the normal way", even though the typical practice is to sort books either by title or author.

Sorting by first line was, in fact, a common sorting method before books had titles, known as Incipit. In modern times, however, that method is wildly obsolete, as books are almost always identified by titles, few people memorize the opening lines of their books, and a film titled In a hole in the ground there lived a hobbit would not receive any funding.[citation needed] However, papal encyclicals are still named after their first words, and thus would be sorted after their first sentence. For example, the encyclical titled Quanta Cura begins with "Quanta cura ac pastorali vigilantia Romani Pontifices Prædecessores Nostri, exsequentes [...]".

In somewhat similar fashion, the 114 chapters of the Quran are roughly sorted by their length. American church hymnals list hymns by relatively meaningless numbers, but then index them by tune name, text title, first line and meter.

Some books do have very well-known first lines, so sorting by first line could be used to demonstrate a level of literary sophistication on the part of the bookshelf owner, but could hardly be considered "normal".

Other pop culture references to sorting by first sentence occur in the Good Omens TV show season 2 episode 2, where the archangel Gabriel, while suffering from amnesia, reorganizes the books in the bookshop alphabetically by first sentence to pass the time.


[A bookshelf hanging on a wall is shown. It is covered almost from left to right but not with ordinary books. To the left there are 11 covers next to each other without any paper between them. They have different heights and shades of gray. After the last of these there follows many leaves of paper of differing heights similarly to that of the covers. The top of the papers thus form a wave shape with more than twenty peaks before they reach another cover. After that there follows similar patterns with paper in different height and then a cover in between more papers. But there is a much shorter distance between the first and second cover than before the first cover, after the initial 11 covers. The next two covers are close to the first, then there is a longer stretch of paper to the fourth, much less to the fifth, and then the next three covers comes very close. There is again quite long distance to the ninth and tenth cover, and here the number of different heights for the paper are clearly less than the previous paper stretches. Finally before the last and 11th cover all the paper, not much of it though, are of the same height, and just a bit lower than the final cover. The 11 covers at the start matches the 11 covers later and they comes in reverse order throughout the paper stretches as they are sorted to begin with, so the first and last cover matches, as does number 2 and the second last etc. There is a caption beneath the panel:]
Book people hate seeing books sorted by colors, but it turns out they get way more angry if you sort the pages by number.

comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!


Oh wow, literally 14 captchas to save my edit? Sorry if someone else was working on it too, apparently someone added transcript while I was doing captchas, and when it finally went through it might have overwritten something. 22:05, 19 June 2023 (UTC)

I fixed a lot of the typos, but should we use color or colour? Trogdor147 (talk) 22:11, 19 June 2023 (UTC)

Because Randall is 'Merkin, full Webster-inspired leftpondian spelling tends to be the norm. (Including people editing correct-for-the-author Discussion contributions... which they really shouldn't!) But I'm happy to see "colour", "centre", "aluminium", etc for as long as nobody has yet decided to normalise(/normalize) everything. ;) 23:06, 19 June 2023 (UTC)
Have no idea what the previous means but Randall is American so this page uses American English spelling. So color, center and aluminum etc (and Normalize) --Kynde (talk) 06:03, 20 June 2023 (UTC)
I just said what you said, but additionally putting in my oar in about non-standard (to me!) English spelling occasionally forced on us by them damnyankees. :P 09:29, 20 June 2023 (UTC)
The usual slur for the country is 'Murica, so by "Merkin" I assume you would write 'Murican. :) (I'm amused my spell check is fine with 'Murica, as highlighted by it NOT liking 'Murican). Which I say as a Canadian, THE foreign country with the most exposure to them, LOL! I glory in using Canadian/British spelling (for which we only disagree on "aluminum" in that list), and just assume someone might eventually "correct" me. :) But, yes, typically accepted and understood is to go with the American forms NiceGuy1 (talk) 06:23, 24 June 2023 (UTC)
I used "'Merkin" mostly because of a hangover from an old tradition on a BBS I used to frequent where the word 'merkin' was commonly used to refer to our resident 'Merkins (in a good-natured, and fully reciprocated way). I imagine it was independently developed (with or without more intent to be derogatory) elsewhere, as being so obvious, but I know where I got it from - and the nostalgia of that era sometimes leaches through even several decades on. I always try to make it obvious that I'm not being vicious in my use (at the very least, bring it up in ridiculous circumstances), and would never use it in a heated exchange, much as I may (and have) used "damnyankee" with obvious disregard of the Mason-Dixon line, "rebellious colonials" even though we're talking of so few actual full-blooded descendents of those people (in amongst many other more recent immigrants/much more native lineages) or other epithets. (If I'm ever actually angry, I'm far more likely cool and precise, but even something like "USAian" isn't often going to be a flung insult. Just distinguishing those who (mostly) sit between Canada and Mexico, non-inclusively.) Of course, if I have to explain all this then I'm probably open to having had some misinterpretation already happen. But what was said and done still was said and done, and here's just my account of why for you to take on-board however you still so wish! 14:18, 24 June 2023 (UTC)
Ahh, I KNEW I knew the word "merkin" from somewhere. NO idea how I've heard it, but yeah, as a lady's er, hairpiece. (Maybe even in this context, as being amusingly similar to "Murican"). Since it seems like an unreal and unused concept, it seems weird to have a word for it, LOL! (Maybe more in hairier times like the 60s, where maybe follicly-challenged ladies may have felt embarrassed, I guess?) It's hard for me to imagine women wanting hair so badly to use a merkin and not just wait for natural growth. :) NiceGuy1 (talk) 05:52, 25 June 2023 (UTC)
I understand it's far older than that, originally. Centuries-old measure to disguise the ravsges of STDs/'cover back up' after aggressive anti-lice practice. (As per head hair, and wigs, but a different set of lice.) 15:29, 25 June 2023 (UTC)

Does the mirroring of the order of the covers mean that there is a secondary sort order? The longest book is first. (talk) (please sign your comments with ~~~~)

Good eye that the small books are nested inside the large. Should go in the explanation imo. 00:47, 21 June 2023 (UTC)
I'm pretty sure, that the total length (in pages/sheets) is the secondary order. In fact, I find the first half of the paragraph with all the discussion of other possible choices that obviously don't match the drawing a great distraction before the actual ordering is disclosed. I would just delete that stuff, or move it to a following paragraph with a "Other orderings that _could_ have been used..." lead in. MAP (talk) 18:58, 21 June 2023 (UTC)

It looks like all of the front covers are at the left and the back covers are sorted by the number of pages in the book.

It looks like each group of pages is sorted randomly. Note that each book has a unique height. You can see the height distributions change as books end at their back covers and are no longer included in clumps. The books seem short? A careful eye may be able to identify the location of every page. 01:53, 20 June 2023 (UTC)
To me it looks like the longest books are really really long and that it doesn't match the size of the front. --Kynde (talk) 06:03, 20 June 2023 (UTC)
The last "pages and rear cover" is obviously the real thickness of the end bit of the last book (where it is the only representative). The penultimate pages section is therefore 2x the thickness of the pages from either book which has such pages (give or take paper-quality/weight), and so on until the first paper-bundle is eleven times the thickness of the books that all have pages one-to-whatever.
Which means it should be 'easy' (...FCVO) to reconstruct the uncollated and re-bound individual book widths from pixel measurements alone (and use the visibly cyclic nature of the initial 11-collated page 1s, 2s, etc to estimate the 'page density' to even get a good approximation of page-counts). But I must admit that there seems a lot more paper there than eleven books would normally have. Unless peculiarly short-and-fat.
In fact, I'm glancing at a bookshelf unit opposite where I'm sitting. It looks narrower than the drawing (just measured: 750mm, or 2'5½" internal to its sides; I reckon the comic bookshelf is the traditional 3ft/yard length, though obviously less the end bits where unobtrusive bookends could be for an 'open' version like that) and yet it has thirty books crammed in on one of its levels, and some of those being 'mighty tomes' (830 pages, 469, 454, 944, 778... just by 'last numbered'). Thinnest book in the sequence is 122 pages. The whole lot is a mixture of hardbacks, paperbacks and those intermediate 'card-bound' types that I forget the name of. If they were all hardback, I'd have to lose at least one (maybe two) of the thinner ones, but can't account for anything above a dozen of the difference, that way. Similar for the other levels of shelving, and I've got more (and thicker, at first glance) books on other shelves in this room and elsewhere.
So artistic licence, probably, but I get the impression that the mix of relative proportions are probably taken from RL, just exagerated for drawability.
And an unbound book, leaf torn assunder from fellow-folio leaf, probably gains a bit of 'air gap', now that it has no spine to help 'bookend the book', the standing-power of singular hardback covers alone can't be that stable to resist all that paper wanting to domino-lean outwards, like a reasonably long book or two can to retain thinner works within the central part of the shelving. It looks like an engineering problem, in miniature, working with tolerances and margins (NPI!) to not have everything decide to schluff sideways; and possible off the shelf entirely! 09:29, 20 June 2023 (UTC)
Did you skillfully defuse my nerd snipe regarding mapping the page locations? 00:47, 21 June 2023 (UTC)
I added my observations about the order of the books to the explanation. -boB (talk) 17:10, 21 June 2023 (UTC)

Why not sort by ISO 2108? -- Hamslabs (talk) (please sign your comments with ~~~~)

By ISBN? You mean order by the publishers' registration date? Lol. No, that's useless unless you're trying to make a point about publishing industry consolidation, which you could more effectively do by sorting on parent company identity. (But making that point would be a pretty good idea.[1]) 06:29, 20 June 2023 (UTC)

There are so many drawbacks from destroying books to sort the pages and zero advantages (except to horrify book people with the destruction of books), so all the crap about the good and bad is not relevant! I will delete it. --Kynde (talk) 06:06, 20 June 2023 (UTC)

Go for it, landed gentry! 06:09, 20 June 2023 (UTC)
I agree that adding supposed "advantages" to the sorting method is probably superfluous, but I instinctively added a summary of the disadvantages, since that is what we usually do on ExplainXKCD. It can often be illuminating to actually break down the reasons why something is bad - even if it seems obvious, I often discover nuances that I'd never even considered this way. Hawthorn (talk) 13:03, 20 June 2023 (UTC)
The content of the shelf happens when somebody digitizes a personal library by cutting the bindings off books and feeding large clumps of their pages through a document scanner. You’ve already digitized them, so the loose pages are a novelty rather than the primary source for the content. 00:44, 21 June 2023 (UTC)
Oh, there ARE no advantages, that's the joke of the comic, that doing this is too weird to be allowed, LOL! NiceGuy1 (talk) 06:23, 24 June 2023 (UTC)

... books? 06:51, 20 June 2023 (UTC)

There's a compromise between sorting by colour and sorting by topic. -- 14:14, 20 June 2023 (UTC)

Are there any famous books where the first line is "Aaaaaaahhhh", thereby making it first in Randall's bookshelf? 18:15, 20 June 2023 (UTC)

I don't know. But I haven't written any part of Earthly Powers. "Sorry, but we can't advertise your book."-- 21:30, 20 June 2023 (UTC)

I would think the obvious way to sort books would be alphabetically by most important word. For genre fiction, that would be the 40000th word, since that is the one that makes it eligible for a Nebula Award for Best Novel. 05:13, 21 June 2023 (UTC)

I sort my library by the product from multiplying the Dewey and LoC numbers together. I like it, but its hard to make the code fit onto those little spine tags.

Number of covers[edit]

Can someone help me....count? The number of front covers don't match the number of back covers, correct?

I count 11 front and 11 back covers. The last two books are around the same color and may look like a thicker book, but are actually one extra-skinny shorter book next to one taller one. Click on the picture (twice) for a larger version where you can see it more clearly. -boB (talk) 17:09, 21 June 2023 (UTC)
That was the one, thanks. (although, I was secretly hoping that it was a secret in-joke) 17:58, 21 June 2023 (UTC)