Skip to main content

Diagonalizing the Psalms

Mathematics-inspired manipulations of scripture

A Bible open to Psalm 22

Mathematics of Biblical proportions.

This article was published in Scientific American’s former blog network and reflects the views of the author, not necessarily those of Scientific American


As I was drifting off to sleep one night, I had one of those brilliant ideas that only comes along when you’re drifting off to sleep: diagonalizing the psalms. Earlier that day I had noticed that Psalm 119 was very long—longer than 119 verses, in fact—and wondered how many psalms from the Book of Psalms have at least as many verses as their number in the psalter. One thing led to another, and my subconscious decided the idea of applying Cantor’s diagonal argument to create a new psalm seemed incredibly compelling.

Cantor’s diagonal argument is one of my very favorite proofs. I still get goosebumps sometimes thinking about it. It is a proof that the infinity of the counting numbers 1, 2, 3, 4,… is smaller than the infinity of the real numbers, or even the real numbers between 0 and 1. The real numbers are unlistable, or uncountable. The argument goes like this: Suppose you have a way to list the real numbers. That is, you have some infinite string of decimal digits for the first number on your list, a different infinite string of decimal digits for the second number on your list, and so on. You claim that every real number appears somewhere on this list, but Cantor says he will create a number that is not on the list. He builds this new number this way: The first digit of the new number is anything other than the first digit of the first number. The second digit of the new number is anything other than the second digit of the second number, and so on. (It really doesn’t matter what other digit you choose in each place, as long as it doesn’t match.) The Nth digit of the new number doesn’t match the Nth digit of the Nth number on your list.

How do we know the number doesn’t appear on the list? Well, it can’t be the first number on the list because it doesn’t have the same first digit. It can’t be the second number on the list because it doesn’t have the same second digit. You get the idea. You could add the new number to the list somewhere, but Cantor will just produce another number not on your list, and another one after that, as if pulling rabbits out of a hat. (The argument doesn't work for the list of whole numbers because they have a finite number of digits and doesn't work for rational numbers because it doesn't produce a rational number.)


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


My first idea for diagonalizing the psalms was just to make a diagonal psalm: the first verse of Psalm 1, the second verse of Psalm 2, and the Nth verse of any Psalm N that has at least N verses. With the help of the Book of Common Prayer and this list of the psalms ordered by length, I came up with my first diagonal psalm:

A First Diagonal Psalm

Happy are they who have not walked in the counsel of the wicked, *
    nor lingered in the way of sinners,
    nor sat in the seats of the scornful!
Why do the kings of the earth rise up in revolt,
and the princes plot together, *
    against the LORD and against his Anointed?
But you, O LORD, are a shield about me; *
    you are my glory, the one who lifts up my head.
Tremble, then, and do not sin; *
    speak to your heart in silence upon your bed.
Braggarts cannot stand in your sight; *
    you hate all those who work wickedness.
I grow weary because of my groaning; *
    every night I drench my bed
    and flood my couch with tears.
Awake, O my God, decree justice; *
    let the assembly of the peoples gather round you.
All sheep and oxen, *
    even the wild beasts of the field,
The LORD will be a refuge for the oppressed, *
    a refuge in time of trouble.
The innocent are broken and humbled before them; *
    the helpless fall before their power.
He delivered me from my strong enemies
and from those who hated me; *
    for they were too mighty for me.
Praise the LORD, you that fear him; *
    stand in awe of him, O offspring of Israel;
    all you of Jacob's line, give glory.
I have seen the wicked in their arrogance, *
    flourishing like a tree in full leaf.
In your sight all the wicked of the earth are but dross; *
    therefore I love your decrees.

It definitely doesn’t have the coherence of the actual psalms, but it hits some of the highlights of the book as a whole: wickedness is bad, animals exist, God protects the faithful. I was a little surprised it only has 14 verses. Only Psalms 1-10, 18, 22, 37, and 119 have enough verses to appear in my diagonalized psalms. There are a lot of psalms that are pretty long, but few of them line up well with their numbers. I was most disappointed with Psalm 78, which nearly makes the list but has only 72 verses. (Would anyone mind terribly if we swapped psalms 72 and 78?)

My first diagonal psalm might be a Cliff’s Notes version of the Psalter, but it’s kind of a shame that a poem born of the observation that Psalm 119 is long is so short. It would be nice if a newly created psalm felt longer. One option would be to insert a pause for every psalm that does not have enough verses. It starts out strong and then peters out quickly.

A Dramatic Diagonal Psalm

Happy are they who have not walked in the counsel of the wicked, *
    nor lingered in the way of sinners,
    nor sat in the seats of the scornful!
Why do the kings of the earth rise up in revolt,
and the princes plot together, *
    against the LORD and against his Anointed?
But you, O LORD, are a shield about me; *
    you are my glory, the one who lifts up my head.
Tremble, then, and do not sin; *
    speak to your heart in silence upon your bed.
Braggarts cannot stand in your sight; *
    you hate all those who work wickedness.
I grow weary because of my groaning; *
    every night I drench my bed
    and flood my couch with tears.
Awake, O my God, decree justice; *
    let the assembly of the peoples gather round you.
All sheep and oxen, *
    even the wild beasts of the field,
The LORD will be a refuge for the oppressed, *
    a refuge in time of trouble.
The innocent are broken and humbled before them; *
    the helpless fall before their power.
(7 pauses)
He delivered me from my strong enemies
and from those who hated me; *
    for they were too mighty for me.
(3 pauses)
Praise the LORD, you that fear him; *
    stand in awe of him, O offspring of Israel;
    all you of Jacob's line, give glory.
(14 pauses)
I have seen the wicked in their arrogance, *
    flourishing like a tree in full leaf.
(81 pauses)
In your sight all the wicked of the earth are but dross; *
    therefore I love your decrees.
(31 pauses)

If you want to choose a set duration for the pauses, this would be a perfect way to emphasize how many psalms are being omitted in a dramatic reading of the psalm. If using this psalm as the text for a choral composition, the voices could rest during the pauses while any instruments played.

An option that would allow all psalms to contribute would be to throw in some modular arithmetic. Modular arithmetic is also called clock arithmetic because it treats numbers as if they wrapped around in a cycle. Five hours after 10:00 is usually called 3:00, not 15:00, because we reset from 12 to 1. To make a diagonal psalm this way, suppose Psalm N is M verses long. The Nth verse of this diagonal psalm is the N (mod M) verse of Psalm N. The first 10 verses of this psalm are the same as my first diagonal psalm. Then we get to Psalm 11, which has only 8 verses. Eleven is 3 mod 8, so we add the third verse of Psalm 11. Psalm 12 also has 8 verses, so we’d use the fourth verse in our psalm because 12 is 4 mod 8. At 150 verses, this diagonal psalm is still shorter than Psalm 119! (But long enough that you'll need to click "Show/hide" below to expand.)

A Modular Diagonal Psalm

Show/hide

Although they were inspired by late-night ruminations on Cantor’s diagonal argument, none of these psalms actually employs a key element of Cantor’s argument, changing some aspect of the nth entry. Even if the purpose of the diagonal psalm were to create a psalm not in the Psalter, we would not require this technique. It’s pretty easy to see by inspection that none of the versions we’ve made match any already-existing psalm. But as this exercise was never one of practicality, I decided to write one last psalm based on this part of Cantor’s argument. There are a lot of ways to alter the nth verse of the nth psalm. I decided to incorporate the N+7 idea from French experimental literary group Oulipo. This psalm is created by replacing the first noun in the nth verse of the nth psalm by the noun 7 after it in a dictionary. Because I do not actually own a physical dictionary and online dictionaries are not easy to browse, I used this online N+7 generator. (Its dictionary doesn’t have “arrogance,” so I browsed an online dictionary to replace that one.)

An Oulipian Cantorian Diagonal Psalm

Happy are they who have not walked in the counterbalance of the wicked, *
    nor lingered in the way of sinners,
    nor sat in the seats of the scornful!
Why do the kips of the earth rise up in revolt,
and the princes plot together, *
    against the LORD and against his Anointed?
But you, O LORD, are a shingle about me; *
    you are my glory, the one who lifts up my head.
Tremble, then, and do not sin; *
    speak to your heartthrob in silence upon your bed.
Branches cannot stand in your sight; *
    you hate all those who work wickedness.
I grow weary because of my groaning; *
    every nightlight I drench my bed
    and flood my couch with tears.
Awake, O my God, decree kayak; *
    let the assembly of the peoples gather round you.
All shelves and oxen, *
    even the wild beasts of the field,
The LORD will be a regatta for the oppressed, *
    a refuge in time of trouble.
The innocent are broken and humbled before them; *
    the helpless fall before their praise.
He delivered me from my strong Englishmen
and from those who hated me; *
    for they were too mighty for me.
Praise the LORD, you that fear him; *
    stand in babble of him, O offspring of Israel;
    all you of Jacob's line, give glory.
I have seen the wicked in their arrowsmith, *
    flourishing like a tree in full leaf.
In your signature all the wicked of the earth are but dross; *
    therefore I love your decrees.

Because the first noun of the first verse is different from the first noun of Psalm 1, we know this is not Psalm 1. Because the first noun of the second verse is different from the first noun of Psalm 2, we know it is not Psalm 2. And so we have triumphed. My dream of a Cantor-style diagonalized psalm has been made reality!

For another exploration of algorithmic religion, check out the Flash Forward podcast episode "Our Father, who art in algorithm."