I.

One Thousand And One Nights is a book about love, wonder, magic, and morality. About genies, ape-people, and rhinoceroses who run around with elephants impaled on their horns. About how to use indexical uncertainty to hack the simulation running the universe to return the outcome you want. But most of all, it’s a book about how your wife is cheating on you with a black man.

Nights stretches from Morocco to China, across at least four centuries - and throughout that whole panoply of times and places, your wife is always cheating on you with a black man (if you’re black, don’t worry; she is cheating on you with a different black man). It’s a weird constant. Maybe it’s the author’s fetish. I realize that Nights includes folktales written over centuries by dozens of different people - from legends passed along in caravanserais, to stories getting collected and written down, to manuscripts brought to Europe, to Richard Burton writing the classic English translation, to the abridged and updated version of Burton I read. But somewhere in that process, probably multiple places, someone had a fetish about their wife cheating on them with a black man, and boy did they insert it into the story.

Our tale begins in Samarkand. One day the king, Shah Zaman, comes home unexpectedly and sees his wife cheating on him with a black man. He kills her in a rage, then falls sick with grief, and is taken to the palace of his brother, King Shahryar of Persia. While there, he sees King Shahryar’s wife cheat on him with a black man. He tells King Shahryar, who kills his wife in a rage too, then also falls sick with grief. The two grief-stricken kings decide to wander the world, expecting that maybe this will help in some way.

They come across a mighty king of the genies, and the brothers hide lest he see them and kill them. The genie falls asleep, and the genie’s wife finds them and demands they have sex with her or she’ll kill them. They have sex, and all the while, the genie’s wife is boasting about how even the king of the genies can’t prevent his wife from cheating. The two kings find this experience salutary - apparently the problem isn’t specific to them, it’s just an issue with the female sex in general. So they go back to the palace and everyone lives happily ever…no, actually, King Shahryar vows that he will bed a new woman every night, then kill her the following morning, thus ensuring nobody can ever cheat on him again.

So for however many years, King Shahryar beds a new woman every night, then kills her in the morning. After a while the kingdom begins to run dangerously low on women. The vizier frets over this, and his daughter Scheherazade hears him fretting. She develops a plan, and volunteers to be the king’s victim that night. After having sex, she tells the king a story. At the end, she says it’s too bad she’s going to die the next morning, because she knows other stories which are even better. Perhaps if the king spared her life for one night she could tell some of those too.

(I’d always heard that she leaves him at a cliff-hanger and makes him spare her to find out how it ends, which I think makes a better story, but this isn’t how the real Arabian Nights works).

Scheherazade’s stories are set in an idealized Middle East. The sultans are always wise and just, the princes are always strong and handsome, and almost a full half of viziers are non-evil. Named characters are always so beautiful and skilled and virtuous that it sometimes gets used it as a plot device - a character is separated from his family member or lover, so he wanders into a caravanserai and asks for news of someone who is excessively beautiful and skilled and virtuous. “Oh yes,” says one of the merchants, “I talked to a traveler from Cairo who said he encountered the most beautiful and skilled and virtuous person he’d ever seen in a garden there, he couldn’t shut up about them for days” - and now you know your long-lost brother must be in Cairo. In one case, a woman went searching for her long-lost son, tasted some pomegranate jam in Damascus, and immediately (and correctly!) concluded that only her son could make pomegranate jam that good. She demanded to know where the merchant had gotten the jam, and the trail led to a happy reunion.

Credit: Errol Le Cain

The most common jobs in Idealized Middle East are sultan, merchant, poor-but-pious tailor, fisherman, merchant, evil vizier, sorcerer, merchant, thief, person who gets hired to assist a sorcerer because they have the exact right astrological chart to perform some otherwise-impossible ritual, and merchant. Of these, merchant is number one. Whatever else you’re doing - sailing, stealing, using your perfect astrological chart to enter a giant glowing door in the desert mysteriously invisible to everyone else - you’re probably also dealing goods on the side. The only exceptions are Moroccans (who are all sorcerers), Zoroastrians (who are all demonic cannibals), and Jews (who are all super-double merchants scamming everyone else). Also maybe the 5 - 10% of the Middle Eastern population who witches have turned into animals at any given time.

Merchanting has a gratifyingly low barrier to entry. Often a character who comes across a little bit of money will use it to buy goods, travel a bit, then sell the goods in the marketplace of some other town at a profit. There’s a cute story where a poor man’s father dies and leaves him a small inheritance. He uses it to buy glassware, sets up a glassware stall at the market, and then gets lost in a daydream about how much money he’s going to make. People will buy his glassware at a 2x markup, and then he’ll use it to buy more glassware, and sell that at a 2x markup, and he’ll keep repeating the process until he’s the city’s most prosperous glassware merchant, and the sultan will ask him to marry his daughter, the most beautiful woman in all the land. But he’ll be so rich that this will mean nothing to him, and he’ll play hard-to-get to show just how little he cares about the Sultan’s daughter, and when she leans in to embrace him he’ll kick her like a common…and then, in his daydreaming, he kicks his stall, and all the glass falls over and breaks, and he loses everything.

The most common hobby in the Idealized Middle East is telling and listening to stories. Whenever something interesting happens in the city, the people involved are brought before the sultan to tell the story. If an especially beautiful and skilled and virtuous person is spotted in the city, they are recognized as a likely protagonist, and brought before the sultan to tell their story. Sometimes when criminals are brought to the sultan, the police will read off their ridiculous convoluted crimes, and the sultan will say “What a wondrous story!”, and the criminals will say “O Sultan, if I can tell you a story even more wondrous than that, will you pardon me?” and the sultan always says yes. The sultan is always amazed, and pardons the criminal, and states that the story should be written in letters of liquid gold for the edification of future generations. Sultans are such suckers for stories that they basically never get a chance to rule, which I assume is why government is mostly run by evil viziers.

It’s actually worse than this, because the stories usually contain other stories. You’ll be telling a story to the sultan, and the main character will encounter his sultan and start telling him a story, and the main character of that story will encounter her sultan and have to tell him a story, and so on. I think the worst offender is The Fisherman’s Tale , where Scheherazade tells a story about a fisherman and a genie, in which the genie tells the fisherman a story about a king and a vizier, in which the vizier tells the king a story about a prince and an ogre, in which the prince tells the ogre a story about his past travels. The recursion does stop there, and we eventually get to hear the end of the fisherman/genie story (the genie, the fisherman, and the sultan to whom the fisherman tells his story end up saving a prince who was turned to stone after his wife cheated on him with a black man). But it’s touch-and-go for a while, and you start to worry that one of these stories will have a branching factor > 1, and you’ll just keep getting into deeper and deeper frame stories forever. Maybe this is how the Abbasid Caliphate fell.

But this is just a small taste of the wonders of the Idealized Middle East, which also include:

Genies: These are everywhere, so much so that barren islands are sometimes described as “inhabited neither by men nor genies”. Most genies are free and want to kill you, though if you’re protagonisty enough they might be convinced to give you a break. Other genies have been trapped in jars by King Solomon. Supposedly if you let them out they grant you wishes, but this seems to be a spontaneous expression of gratitude rather than an obligation. In The Fisherman’s Tale , one genie was angry about being trapped too long, and decided to kill whoever let him out instead. Still other genies have been bound to lamps or rings by sorcerers, and are under the command of whoever owns the lamp or ring.

“Three wishes” doesn’t show up as a theme in the stories I read; either a genie is bound to you, in which case you have infinite wishes as long as it stays bound, or it’s free, in which case it does what it wants. Characters in the Nights only ask genies for very concrete things, usually riches. If you want to win the heart of the sultan’s daughter, you ask the genie for really good clothes and perfumes, so that the sultan’s daughter will fall in love with you naturally. There’s no hint of anyone wishing for world peace or eternal life or anything like that, and no suggestions that genies could or would grant it.

Credit: Errol Le Cain again

Magic: Usually practiced by sorcerers, whose natural habitat is Morocco (I don’t know where this stereotype comes from). Sorcerers cast “geomantic tables”, which tell them whatever they need to know. Usually this is that the treasure they seek can only be found by some random virtuous poor person with the right astrological chart; Disney’s Aladdin’s “diamond in the rough” plot point is very faithful here. Some sorcerers are nice to their astrological patsies and usually do well. Others try to double-cross them, and get their comeuppance. The big prize for a successful sorcerer is a ring with a genie bound to it; once you’ve got one of those, you’ve got it made.

Diversity: Including Greeks, Arabs, Persians, Indians, Moroccans (always sorcerers), suspiciously Arabic-seeming Chinese, and blacks. This last group is mostly found as slaves, which felt anachronistic until I looked it up and learned more about the massive slave trade between East Africa and the medieval Middle East. In one story, when a prince is declaring his love to a princess, he says “I am your slave, your black slave”, as a hyperbolic declaration of servitude. Of course, the author is very concerned about the excessive masculinity of black slaves, especially the fact that your wife is probably cheating on you with one. When one adulterer is late to a meeting with her slave beau, he swears “an oath by the valor and honor of blackamoor men (and don’t think that our manliness is like the poor manliness of white men)” to ignore her from then on unless she is more timely. I have no idea how much of this is filtered through the layers of translators, or what he meant by “white men” in that sentence. Elsewhere in diversity: Jews are usually doctors or merchants, but everyone’s a merchant so this isn’t so remarkable. The one time a Christian appears in the stories I read, he’s a drunkard - which wasn’t the stereotype I was expecting, but which I guess makes sense under the circumstances.

Allah: The real hero of most of the stories. If a character survives, it’s always because “Allah had not fated them to die that day”; if they make an unusually large profit, it’s because “Allah is most merciful”. The only fault one can possibly find with the Allah of the Arabian Nights is that He seems a little exploitable. If someone is trying to hurt you, you can say something like “If you spare me, Allah will certainly spare you; but if you do not spare me, Allah will not spare you”, and then they have to let you go or else be cursed to die in some kind of ironic way. Prayer to Allah is kind of a get out of jail free card, sometimes literally, and everyone who follows Allah’s ways prospers proportionally.

The only, very weak exception is poor Judar. His evil brothers scam him out of his inheritance, then beat and eject him and their mother. He makes more money, supports his aging mother, and when his brothers run low on their own funds, he forgives them, takes them in, and gives them everything they need. His brothers steal all his stuff again, beat him again, and eject him and his aging mother again. The cycle repeats three-ish times, with Judar getting richer and richer each time, the brothers getting more and more duplicitious over time, and Judar always forgiving their previous betrayals and taking them back in again. By the end of the third round, Judar has achieved the Arabian Dream - met a Moroccan sorcerer, happened to have exactly the right astrological chart, uncovered a hidden treasure, and used it to marry the Sultan’s daughter. Then his brothers kill him and take all his stuff. The moral of the story seems to be something like - Allah will bless you if you are generous and forgiving, but at some point He would also like you to develop at least some tiny shred of common sense or self-preservation.

Witchcraft: Totally different from sorcery. Sorcery is always performed by men, witchcraft by women. Sorcerers are always from Morocco, witches can be from anywhere. Sorcerers dig up genie-associated treasures, witches turn people into animals. In order to perform witchcraft, chant some spells over a jug of water, then sprinkle the water on someone and say “Turn into a [type of animal!]” In some forms of witchcraft, this only works if you can make the victim eat cursed food beforehand, so don’t eat any food prepared by suspected witches.

If you do get turned into an animal, don’t panic. Find a good witch, and bleat or bark or neigh at them until they get the message and change you back (if you don’t know where to find a good witch, don’t worry - by coincidence, the first woman you approach will probably be one). As for marrying a witch, it might sound exciting at first, but be careful: her witchcraft will open up a whole new level of cheating opportunities. One witch turned the black men she wanted to have affairs with into blackbirds. Then whenever she wanted sex, she turned herself into a bird and had sex with them, with no one the wiser.

Flying Carpets: I understand these show up somewhere in the full 30-volume edition, but there was not a single flying carpet in all 580 pages of my abridged version. Long-distance travel, when needed, was usually performed by genie. There was also a mechanical flying horse invented by a Persian sage. When you pressed a button on the right side of its head, a bag would inflate and it would fly into the air; when you pressed an identical button on the left, the bag would deflate and it would land. This sage got angry at a prince and came up with a plot to kill him; he showed the prince his flying horse and told him to try riding it by pressing the button on the right. The sage figured that the prince would press the button on the right, lift off into the heavens, and - not knowing the secret of landing - never return. Of course, it took the prince three seconds to think “maybe if the button on the right makes it go up, the one on the left will make it go down”, and it did, so the prince landed easily. The sage was put in prison for attempting to assassinate the prince, and everyone lived happily ever after, plus the prince kept the mechanical horse and went on cool adventures. I have no idea how you can be smart enough to invent a personal flying machine in 800 AD, but also dumb enough to devise an assassination scheme predicated on your victim not figuring out to press the down button.

Your other option for powered flight in the Idealized Middle East is some demon-men who live on an island in the Indian Ocean. They sometimes turn into birds and go flying, and if you ask them very nicely, they’ll take you along. Unfortunately, once you get too high, you’ll hear the angels in Heaven praising Allah, and it will sound so beautiful that you’ll be compelled to join in. This will wound the birds, who are demons and allergic to Allah’s name, and they’ll get angry and drop you. So far nobody in the Idealized Middle East has come up with a good solution to this, and the FAA currently recommends avoiding demon-bird-men and sticking with mechanical flying horses instead. Also, don’t try to tie yourself to the foot of a roc. This almost never helps.

Pessimistic realism: Western fairy tales end with “and then they all lived happily ever after”. Stories in the Arabian Nights end with “and they lived a pleasurable and delightful life, until they were visited by the Destroyer of Delights and Sunderer of Societies.”

II.

After 1001 nights of this (not 1001 stories, most stories take multiple nights), King Shahryar marries Scheherazade. The version I’d heard as a child said he’d fallen in love with her for her storytelling ability. Probably there was some of that, but the book emphasizes that they’d had three sons together by this time, and she explicitly asked the king to spare her life for the sake of the children.

But the text also hints that she was, I guess you could say, feeding him training data. The king’s wife cheated on him. What did he do? In psychiatry-speak, we call it splitting, or black-and-white thinking. He decides all women are wicked and untrustworthy. This is the kind of thing you do when you have no training data, no discrimination ability, no intuition. You have no categories that can limit the damage, tell you “this has gone badly, but things on the other side of this bright line could go well”. So you condemn the entire category, throw out the baby with the bathwater. This king probably led a sheltered life, never had anything bad happen to him before, never had anyone cross him. His psyche is a ship without bulkheads; a single leak and the whole thing is inundated. Since everything (or at least all women) stand infinitely condemned, he can’t come up with a better solution than killing everyone he sleeps with.

Scheherazade isn’t just telling him stories. She’s giving him examples to teach him to build categories. This is the non-joking reason why so many of her stories are about adultery. But also about kings, criminals, love, and betrayal. A common theme of her stories is who deserves to be forgiven and when (eg the story of poor Judar who forgave his brothers too many times and ended up getting killed by them). At the end of all this, the king has a decent model of the wide varieties of good and bad people, the nature of women (there are lots of them! they’re all different! sometimes they’ll cheat on you, but other times they won’t!), and the various situations where trusting people goes well vs. badly. Also, he knows that whenever someone tells you a good enough story, you must pardon them, then write down the story and place it in your treasury to edify future generations. We are all very grateful.

III.

Or maybe it was something more.

There’s an old Rationalist legend about the starving college student and the supercomputer. The starving college student fantasizes about being wealthy, so he gets access to the school supercomputer and runs a simulation of his life where he wins the lottery the day he graduates college. This has two unexpected results.

First, it takes much more compute than he was expecting. He investigates, and finds that simulated-him also fantasized about being wealthy, got access to the local supercomputer, and started running simulations where he wins the lottery the day he graduates college. In retrospect this was predictable - it just means the simulation is high-fidelity. In fact, the simulated simulation is also high fidelity, and the problem keeps repeating. The chain of higher-level-him simulating lower-level-him, and making lower-level-him win the lottery on the last day of college, is at least hundreds of layers deep. He can’t even trace how deep it goes.

Second, he wins the lottery on the day he graduates college. Which is pretty odd, since he doesn’t remember buying a ticket.

What happened? Well, suppose he observes the chain of simulations and finds that it’s, let’s say, 209 layers deep. Each version of him thinks it’s the real version, and has no clue that he’s living in a simulation. From a standpoint of humility, he should ask something like “In each of the 209 layers below me, the version of me thinks it’s in base-level reality, and is wrong. I am in exactly the same epistemic position as each of them. So what’s the chance I’m in base-level reality?” Phrased this way, the answer is obvious.

Suppose you’re a starving college student with access to a supercomputer, and you want to win the lottery. What if you deliberately set up this situation? I’m really not sure how to think about this, but who knows, it might work?

Okay, now suppose that you’re in 10th century Persia. There’s no such thing as supercomputers, and also you’re a teenaged girl, and also the king is going to kill you tomorrow morning. What do you do?

How high-fidelity do you have to simulate somebody for this scheme to work? What if you’re just a really good storyteller with a vivid imagination?

Instead of simulating someone simulating someone simulating someone…, you tell a story about someone telling a story about someone telling a story. At every layer, the story is suspiciously similar to your current situation. It always takes place in the Middle East. It always involves mighty sultans, beautiful women, grisly punishments, and interracial cuckoldry. It always ends with a sultan pardoning someone because they told such good stories. And they always live happily ever after (until the Destroyer of Delights etc etc).

And once you’re telling a story about a genie telling a story about a vizier telling a story about a prince, then, well, all you know is that it goes at least three levels deep. What’s the chance that you’re on the highest level?

Look, I just really like Errol Le Cain

There are two ways Scheherazade can go from here.

The first is to threaten King Shahryar. Tell him - look, there’s a pretty good chance you’re in a fable. You should start with a high prior on this, given that you’re part of a long chain of people who are in fables without realizing it. But on top of that, you’re the king of a fantastically rich but yet curiously unidentifiable sultanate, who’s being courted by a beautiful and clever noblewoman. Seems kind of fabulous to me. Also, didn’t you say that you and your brother met the king of the genies once? Isn’t that the kind of thing that happens more often in fables than in real life? Given that you’re probably in a fable, the fact that you’ve been killing a bunch of women seems really bad. Probably the sort of thing that ends up with a horrible yet ironic punishment. Your best hope is to repent your transgressions, marry me now, and treat me well forever, and then it can be a story about change and forgiveness, and we can both live happily ever after.

If I were the king, I would be convinced by that threat.

But there’s no record of Scheherazade saying this. That makes me think she took the second path and trusted in Allah - or whatever God rules the level above hers. She didn’t just try to con the king into thinking he was in a fable. She truly believed that she was in a fable. She married the king and lived happily ever after for the same reason the college student above won the lottery: because she had created a chain of universes in which that kind of thing always happened, and wasn’t the highest link in the chain.

And you, o reader, know that Scheherazade was indeed part of a fable. Are you sure the chain ends there? Remember: don’t eat food prepared by witches, be careful around Moroccans, and press the button on the left side of the mechanical horse if you need to land in a hurry. And may Allah protect you in your journeys!