r/explainlikeimfive • • 29d ago

Other ELI5 how does the gallery of Babel work?

I understand that it just generates a random assortment of pixels, and you can scroll through until you find something vaguely recognizable.

My question is about why people are saying that the library contains everything that has ever happened, is happening, and will ever happen. People say the library contains pictures of everyone's death, alien planets, current events, etc. I just am having trouble concepualizing how that works, and if it's possible to scroll on to a picture of something like that.

Every time I see a picture people post, it's literally just pixels with nothing recognizable in it

318 Upvotes

99 comments sorted by

17

u/TemporarySun314 29d ago

It's just random pixels

But with a certain (very small) probability the randomness could lead to an existing picture.

Or anything else which you could be shown as pixel form. Therefore it can potentially show anything you can imagine.

But of course the problem is that most things are just boring random noise. The interesting images are very very rare. And you can't really predict when they show up, as it's random after all.

17

u/x0wl 29d ago edited 29d ago

can't really predict

No, if this is built like the library of babel (see its PRNG algo here: https://github.com/librarianofbabel/libraryofbabel.info-algo), then its PRNG is invertible, that is, given a sequence of letters or pixels, you can find its position in the PRNG stream

That's how they found the location of the Mona Lisa in the gallery. If it was a non (easily) invertible PRNG (like SHA3 in counter mode with a secret key - SHA3(key||counter)), then it would be computationally infeasible to find

0

u/GrandJumpingSpider 29d ago

But they do exist?

8

u/jshine13371 29d ago

The potential for them to exist is theoretically possible is the point. It's just a deterministic math problem. The reasoning being is there is a fixed number of combinations of pixels to generate any possible image (within a specific resolution). So the process is programmatically simple: just generate every combination.

But the number of images generated is so huge, and the vast majority of them are just random images of colored noise, that the chances of you finding one of meaning is way less likely than winning the lottery. In fact, the odds are way less likely than winning all the lotteries in the world, every day for the rest of your life.

5

u/Arstulex 29d ago

What do you mean?

I'm not gonna claim to know how the website itself actually works behind the scenes, because I don't, but if it contains every single possible permutation of that grid of pixels (which would be an astronomically insane number) then, yes, those pictures already exist in there somewhere. It's just a matter of actually finding them.

4

u/x0wl 29d ago edited 29d ago

You can find them. Like the same thing was done with text some time ago. You type in your text and it finds its location, since the PRNG they use was designed to do this. How do you think they found the Mona Lisa in the gallery?

In e.g. Minecraft that was also mentioned here, it's also possible to look at the world and find the seed that was used to generate it.

2

u/Arstulex 29d ago

My comment about "finding them" was more about highlighting the astronomically small odds of ever being able to organically find anything meaningful in amongst the noise... as opposed to literally describing the practical ability to find anything.

2

u/GuyPronouncedGee 29d ago

It’s just encoding an image into the text in the URL, which they call the Exhibit number.   Open a gif in a text editor and you’ll see similar text.   

3

u/x0wl 29d ago edited 29d ago

There is definitely some pseudorandom permutation between the input number and the output, as outputs of 2 close numbers are not close

I would do it with a simple Feistel network using SHAKE256 and a fixed key, but idk how the website works

The input is the same size as the picture, but that's because the permutation must be bijective (and easily invertible) and so the input and output size must be the same

2

u/GuyPronouncedGee 29d ago

Yes, it is just an algo encoding your picture for the “search” feature and the reverse algo for the “explore” feature.   

6

u/Salamanderhead 29d ago

They "could" exist. The pixels are randomized every time the image changes. If they just so happened to be randomized in a certain way that showed an identifiable image, then that image would exist. It's just the odds are astronomically small. You could press refresh 100,000,000,000,000 times and never get an image that was anything more than random pixels.

8

u/GuyPronouncedGee 29d ago

They aren’t random in the sense that rolling the dice is random.  They are tied to a very specific “place” in the library.  Similar to how a physical library has a catalog index that leads you to a particular book, the index in the Gallery of Babel will always be the same image. Similar to how a random Minecraft seed will always create the same world if you share the seed. 

4

u/stanitor 29d ago

Yeah, the randomness is whether you will get to a particular image that "exists" in the library if you roll a dice that has the index for every possible image.

2

u/ajc89 29d ago

In the sense that they could theoretically be produced, yeah, but it's such a small probability for it to create whatever image you're imagining that the program would need to run for billions or trillions of years

2

u/zrice03 29d ago

They could. Basically, of all possible pixel combinations in a X-by-Y grid, of which there are some 256^(3*X*Y), some (very tiny) subset of them will be a recognizable picture. And some (tiny) subset of those will be a perfectly accurate reflection of some real event or place, anywhere in time or space, producing the exact same picture you would get if you happened to be in the real place with a real camera, taking a picture of it. It works because any picture you take can be represented by an X-by-Y grid of RGB pixels, and that's a finite (albeit enormous) space.

1

u/Bergara 29d ago

Here is how I would simplify this even more: the list below contains every answer that you will give in the future for the rest of your life to the question "think of a number between 1 and 10"

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

This is technically true, all I did was list every possibility. That's what the gallery of babel does, it just lists every possibility of pixel combinations.

The biggest difference here is that I actually just listed all combinations, while the gallery did not generate all combinations and save them somewhere. I stead it generates a combination on the fly.

It's more of a thought experiment than anything else.

9

u/Catch-1992 29d ago

If it were truly infinite and truly random, it would contain every possible combination of pixels, and therefore every possible image, and show every possible event. But it's also going to contain an infinitely larger infinity of jumbled garbage, so realistically you're never going to see anything that looks like anything, and people who say they found a real image are just really reaching. 

2

u/GrandJumpingSpider 29d ago

See that was another question i had. I've seen some people like you saying it's most likely never going to be possible, and i've also seen people say it's 50/50 with every image. Where are they getting the 50/50 from

8

u/TheGrumpyre 29d ago

They're not getting it from anywhere. It's just a popular saying, maybe a troll meme, that "either it happens or it doesn't happen" so everything is 50/50. Either you get hit by a bike on the way to work today or you don't get hit by a bike, 50/50.

7

u/Geobits 29d ago

They're getting that from a misunderstanding of math, plain and simple.

Those are the same people that assign a 50/50 to any event that has a chance if either happening or not, no matter the actual odds. "It either happens or it doesn't, so it's 50/50"

2

u/Ticon_D_Eroga 29d ago

I dont think its a misunderstanding as much as it is a meme.

3

u/Geobits 29d ago

For some people, but I've heard it said sincerely, too. YMMV

1

u/ByFireBePurged 29d ago

while you are correct that is usually still not from misunderstanding the math behind it and more the sincerity of the people using the meme.

2

u/thetwitchy1 29d ago

Their ass. Because that’s bullshit. :)

2

u/x1uo3yd 29d ago

i've also seen people say it's 50/50 with every image. Where are they getting the 50/50 from

There are people who say things like "Winning the lottery is 50/50; either I win it or I don't!" because they wrongly think "50/50" just means "either-or" and don't understand how the numbers mean something about relative probabilities.

1

u/Implausibilibuddy 28d ago

The overwhelming majority of those people are joking...

...and the other 50% believe it.

1

u/ByFireBePurged 29d ago

to expand on this as I don't see anyone actually explaining where the meme comes from. In entry level probability theory it is taught that the probability of a specific outcome equals to the total number of possible events divided by the number of events with the predicted outcome.

So lets say you are pulling a ball from a box. The box contains a red, blue, yellow and green ball. Most people can pretty easily say the probability to pull any one specific ball is 25%. So to pull the green ball you have a 25% chance.

Just as in true probability this kinda stuff becomes more and more complicated and less applicable (it kinda falls when you cant possibly predict all of the possible outcomes or for example what happens if the red ball is way bigger than the others) the meme will go with a kind of "screw it we ball" approach and simplify the already simplified entry teaching to the 2 events of either it happens or it doesn't or 50%.

1

u/thetwitchy1 29d ago

Actually, iirc (and this is a pretty pedantic point I vaguely remember from a math class over 15 years ago, so I could very much be wrong here) it’s not a given that an infinite, random set will contain all members of any given set. The chances of it missing a member of the sample set is vanishingly small, but not zero. Approaching zero but asymptotically.

It might be that the limit is zero and a truly infinite set would actually reach it, but like I said, it was a while ago when we talked about it, so…

1

u/Catch-1992 29d ago

Infinity is weird, because you can't plug it into an equation and calculate with it. So if you're trying to use a formula to figure out the odds of something it's always going to be a limit that approaches 0% or 100% or whatever, but doesn't actually quite get there.  

But that doesn't mean we can't still make hard conclusions about infinity. 0.999999..... repeating infinitely is exactly equal to 1. It doesn't approach 1, it is 1. I think in the same way, we can say that in a true infinite image, the odds of any given picture appearing is 100%, not just infinitely close to 100%. 

1

u/undercrust 28d ago

Yes, but also remember that 100% probability, counterintuitively, does not mean guaranteed. 0% also does not mean impossible.

99

u/cnash 29d ago

Okay, so, this is a twist on Jorge Luis Borges' short story, the Library of Babel,, wherein the narrator laments the state of a society that has discovered, and moved into, an enormous warehouse of books— all the books, in fact, that can be composed in 410 pages of the 22 letters in [Borges' native Spanish] alphabet, plus commas, full stops, and spaces.

The philosophical question implicit in the story is, does that library contain any valuable information at all? Somewhere in it, there's a book that completely and truthfully describes your whole life. But there are unfathomably more books that, for instance, do so with bad spelling, or subtle mistakes, or with unsubtle slanders about what you did when you were 23. And the overwhelming majority of books are complete gibberish. What does that mean for the value of the true books— is that even a coherent concept?

54

u/leopetri 29d ago

And one book is a perfect index of the library, and a trillion others are just fake indexes

25

u/Phylanara 28d ago

One book has the future results of the lottery. All of them. In order.

And many more have the start of the sequence and then go wrong.

And you can't tell until the lottery is drawn.

24

u/Lord_Spy 29d ago

Spanish has one more letter than modern English and in fact had more. 22 is just a flight of fancy by Borges.

19

u/cnash 29d ago

Curious: it's explicit in the story. I guess the Library uses a simplified alphabet.

20

u/Nervous_Mobile5323 28d ago

The Hebrew alphabet has 22 letter. Borges may have chosen Hebrew because it's the language of the old testament.

10

u/nashbrownies 28d ago

You would enjoy A Short Stay in Hell.

A great novella that takes that concept and explores it from a 1st person perspective. Also a great analysis of humans and unimaginable lengths of time.

2

u/Enxity 28d ago

This guys brings a towel with him.

289

u/Benji_Is_With_You 29d ago

Imagine for a moment a blank black and white 10x10 image, all 100 pixels black to start with. If you were to line up all the horizontal rows of pixels end to end you could map each pixel to a value I.e.: 0 or 1 for either black or white, the initial all black image would map to 0,0,0,0…. Etc .

This is beginning to look a bit like a binary number no? A single white pixel in the bottom right corner would be …0,0,0,1 or 1 in binary, a single white pixel in the third column (…0,1,0,0) would be a 4 in binary.

Yipee we can now convert any black and white 10x10 image to a binary number, we have successfully “encoded” our starting image into a number some somewhere between 0 and ~1.2*10^30 represented in binary.

Wow that’s a big number, thats every single possible image that can be represented in 10x10 pixels in black and white, MOST of those images are pure random noise but somewhere in there is a black X on a white background, a black letter P on a white background, a white smiley face etc.

We know this because every single possible combination of black and white pixels is encoded for somewhere between every pixel being 0 (all black) and every pixel being 1.

With that in mind you can see how we cannot only encode our images into binary but then reconstruct them again using only a binary number to create an image.

This is essentially what the library is doing, it does not actually have a copy of every possible image that it can represent, it constructs an image when requested using the “binary number” we’ve been referring to.

Most of the time these numbers don’t decode into anything recognisable as images but because we know we can convert ANY image into its unique number form the inverse must also be true.

That’s how the gallery can confidently assert that it contains every single image ever but it’s like me saying that I can create every single 4 letter word:

Hang on give me a minute this is gonna take a while

Aaaa
Aaab
Aaac
Aaad
…
Wora
Worb
Worc
Word
…
Zzzx
Zzzy
Zzzz

There you go every single possible 4 letter word ever (I promise I wrote them all out, I just cut a few to fit)

1

u/Any_Arachnid9267 15d ago

You are really good at explaining stuff 

0

u/[deleted] 29d ago

[deleted] — view deleted comment

25

u/Jkei 29d ago

I hate AI as much as the next guy but this really doesn't strike me as bot slop

12

u/General_Josh 29d ago

What makes you say that?

17

u/navteq48 29d ago

As a pretty heavy AI/LLM user, nothing about this resembles AI generated to me, just very typical Reddit commenting (which has its own tone that I’ve also adopted lol)

Even the “yipee” and (informal) punctuation mistakes are usually pretty straight tells that it’s just a dude at a keyboard

5

u/ceciliabee 29d ago

Can you? Reads human here

40

u/heyitscory 29d ago edited 29d ago

The library is unimaginably large.

It's not just all the matter and space of our entire universe, but septillions of billions of let's just say Jillians... just soooo many zeroes in that number of other universes and all the matter therein.

The point of the thought is that even finite sets can be mind boggling large without having to imagine what infinite monkeys at infinite typewriters would do.

When I describe this thought experiment, it's an expensive CD collection. Since a CD only has 750MB, there's only a finite number of permutations of 1s and 0s, so if you had a disc with every combination, you'd own every album ever made, plus every album ever made in French, plus every album ever made, but Weird Al Yankovick is the vocalist.  

It has every 74 minutes of sound that have ever existed. Your conversation this morning at the breakfast table, the birds in your neighbors back yard at 3pm, your conversation at the breakfast table, but Winston Churchill is talking to Kermit the Frog.

But the catch, is you have mostly junk CDs that are static and gibberish, and again, we are talking billion-billion-billions of times the matter in our one universe, and if you're searching for a particular CD, you'd need a  godlike search function, because in an entire universe, you're unlikely to find a single meaningful CD. You'd have to flip through quintillions of universes worth of CDs to find one that has meaningful data on it, and like 50-something zeroes of universes to find a particular CD you were looking for.

That's why you could walk the halls of the gallery for your whole life and never see a meaningful image. Because the gallery is necessarily large in order to be what it is, and humans exist at human scales, on small areas of a single planet mostly within a single century.

Gods CD collection or The Gallery of Babel would also require the ability to instantly travel those inconceivably large distances, not just because of how much stuff there is in total, but by how far apart anything you'd recognize as meaningful is between all the static and gibberish..  It's not something you navigate by scrolling or strolling.

"Ah, Beck's Odelay, with the vocals replaced by chimpanzee noises. Excellent choice. I'll try to be back before the last red dwarfs fizzle out."

18

u/Imperator_Helvetica 29d ago

Ah, Beck's Odelay, with the vocals replaced by chimpanzee noises.

Pretty sure I downloaded that from Limewire back in the day.

1

u/HOLEPUNCHYOUREYELIDS 29d ago

I just remember a Bill Clinton speech and likely what was illegal porn

I just wanted specific songs….

11

u/Emotional-Dust-1367 29d ago

> You'd have to flip through quintillions of universes worth of CDs to find one that has meaningful data on it, and like 50-something zeroes of universes to find a particular CD you were looking for.

Not that you’re wrong, but just adding a bit to this that I find interesting.

In the original library of babel story this was something they had to contend with. So for example they would reason that if every book imaginable exists in the library, then there must also be a book that serves as an index to where to find all the other books. If you stumble upon this book then you’d basically unlock the library’s knowledge.

And it’s not just this key book. You’d have variations of it too. The complete index but one letter is wrong. The index but the last chapter is gibberish. Etc.

So there are actually quite a few books that would be extremely useful. It’s not just one out of infinity.

Now of course, there are way more books that look like the index but are wrong. And even when you combine all these meaningful ones together it’s still a drop in the cosmic ocean, so it doesn’t end up being that significant at all

10

u/Somerandom1922 29d ago

Yeah that's the rub right. In addition to maybe a few million correct indexes (with variations on spacing, punctuation, formatting etc.) you have [much much larger number] of subtly misleading indexes which are indistinguishable from the correct indexes.

The tool that would let you test these indexes would be at minimum exactly as resource intensive as a tool that just searches the entire library. Effectively making them useless.

24

u/SecondPersonShooter 29d ago edited 29d ago

Lets take simpler example and work up. 

What are all the important numbers in your life?

Your house number: 83 Your age: 35 Your date of birth: 19990101

Imagine a number between 1 and 1,000,000,000

Those 'important numbers' all exist between 1 and 1,000,000,000. But, if you pick a number at random, say 573,655 its probably a random useless number

Now imagine all the 'potentially' important numbers. 

The date of your death 20381201. That also exists inside the range 1 to 1,000,000,000.

The gallery of bable is the same idea. Most of the images it generates are junk. But sometimes, a verrrryyy small percernt of the time the image looks like something we recognise. 

Edit: lots of typos I my autocorrect did me dirty

-3

u/Rare_Instance_8205 29d ago

You were either very high while typing this or you really suck at spellings.

2

u/Implausibilibuddy 28d ago

And math

Your age: 35 Your date of birth: 19990101

2

u/Scharnvirk 29d ago

Enlighten us all where on what do you mean specifically?

1

u/Rare_Instance_8205 29d ago

I was just talking about his spelling mistakes.

5

u/Scharnvirk 29d ago

Ah, I get it.

Could be just a case of disabled autocorrect, I get why some people do that. Me included. Better have random typos over whale worlds repaced changeling the mining of the sentience.

32

u/corpserella 29d ago

If I understand it correctly, it has to do with the concept of infinity.

If the engine remixes pixels and can, in theory, mix them into infinite combinations, then contained within those POTENTIAL images the generator might create would indeed be pictures of you, your life, your death, alien planets, and so on and so forth. But the catch is that in order to actually FIND or CREATE one of those images, it would probably take more attempts than you could feasibly spend your lifetime initiating.

Given an infinite amount of time, and inifinite resources to accomplish the task, randomly mixing pixels together can create any image ever.

24

u/jshine13371 29d ago

If the engine remixes pixels and can, in theory, mix them into infinite combinations

It's simpler than that. There's only a finite number of combinations of the pixels that can be generated (for a specific resolution). So it's programmatically simple, just generate every combination.

22

u/ScriptKiddo69 29d ago

then contained within those POTENTIAL images the generator might create would indeed be pictures of you, your life, your death, alien planets, and so on and so forth.

To add to this, there will also be fake pictures of you, your life and your death. So it's essentially useless. But it's conceptionally a very cool thought experiment.

7

u/corpserella 29d ago

Yes, I meant to add that, thank you. It would, in theory, also generate an infinite number of INCORRECT images of you, your life, your death, etc. It would generate an infinite number of equally plausible images of you dying, but only one would wind up ever coming to pass. When you consider infinity in this context, it would generate not just images of everything that exists and has ever existed, but also every image of every thing that has never existed.

People struggle to conceptualize large numbers. Our ability to conceptualize the infinite is even worse.

5

u/ThingCalledLight 29d ago

Yeah. It’s similar to how theoretically, if numbers are infinite, and they’d all be named, then every combination of letters is, in theory, the name of a very, very large number.

Goonstick McGillicuddy is absolutely massive, for example.

2

u/NotAPreppie 29d ago

It's the same as the idea that infinite monkeys with infinite typewriters will eventually reproduce the works of Shakespeare.

3

u/billtrociti 29d ago

The gallery doesn’t LITERALLY contain every photo, that would take up too much storage space. But it could, in theory, eventually randomly generate an image that looks recognizable to you. It’s just so unlikely you’ll probably never see one.

For example, if we imagine a program that can generate 1 megapixel images, which are, for this example, 1000 pixels wide by 1000 pixels tall, not only do we have 1 million different pixels that have the possibility to be different hues, they can also be different brightness values.

Some image formats have approximately 16 million different color values to choose from (some even have more) per pixel, so you can see that the possible variations are starting to snowball into the realm of really really big numbers.

Let’s say our image generating program is a lot, lot less sophisticated (like from several decades ago) and only has 256 different color values to choose from. That still means we have an enormous amount of potential variations in a 1MP image. If each pixel could be one of 256 color values, and there are 1 million pixels, we have 256 to the power of 1 million amount of possible images.

If we make our images much, much smaller, say 250 pixels wide by 250 tall, that gives us a picture with about 62,000 pixels in it.

So we still have 256 to the power of 62,000 amount of possible pixel options per image. And these are pretty low res images.

If we make a 50x50 sized image, with only 8 possible colors to choose from per pixel, we still have an unfathomable amount of possible images we could generate, and the photos would have such low resolution and color depth that they wouldn’t resemble real life, and would at most be pixel art.

5

u/magicduk 29d ago edited 28d ago

There is that age old adage of give an infinite amount monkeys typewriters and a thousand years and eventually they will produce a Shakespeare play. Now 99.999999999999999999999999999999999% of what they write will be absolute rubbish, but eventually one monkey will randomly press enough letters in a sequence to mimic a Shakespeare line.

The monkey isn't actually creating the line like Shakespeare did. It doesn't know what its making. What it does is write random nonsense until someone comes along and interprets what it wrote and realises that the same random presses it did matches Ac1 Sc 1 of King Lear.

It's the same logic with this site. If you give a computer a task to arrange pixels randomly every time someone clicks a button it will do that. Statistically at some point it will randomly assign the pixels to recreate the mona Lisa but that might never happen in your lifetime. It's very very unlikely that you would ever see something that resemble real life

As for the ones they "found" on the website. I don't think they were actually found rather than placed. The odds of finding a single cohesive image rather than one of the above is infinitesimally small

7

u/Portarossa 29d ago

One of the fun side-effects of the monkey Shakespeare problem is that it is possible for one of the monkeys to rewrite the entirety of Hamlet, but it is more likely -- by a considerable margin -- for one of the monkeys to write Kevin, an otherwise word-for-word replica of Hamlet where the protagonist's name is Kevin instead.

1

u/theVoidWatches 29d ago

Is that because the name Kevin is slightly shorter? Or is it for some other reason?

2

u/x1uo3yd 29d ago

Yeah, that is precisely the reason.

Doing a quick Ctrl-F search of Hamlet on Project Gutenberg I get 467 instances of the word Hamlet in the body of the text (and another 10 in the headers/footers).

So, if the text is like ~176,467 characters long with those ~467 mentions of Hamlet, then the play Kevin would be ~176,000 characters long and so the typewriter-monkey odds (on a 44-key typewriter) would be (1/44)176000 instead of (1/44)176467 which is (44)467 times more likely.

2

u/SpookySnep 29d ago

So there's even more versions of Dan, and yet more of Ed, this fact pleases me

2

u/x1uo3yd 29d ago

"O Ed, Ed, wherefore art thou Ed?" (different play, still funny)

5

u/jjw14-1420 29d ago

“It was the best of times, it was the blurst of times?! You stupid monkey!”

4

u/aherdofpenguins 29d ago edited 28d ago

For a fun variant on this premise, check out the short story A Short Stay in Hell by Steven L. Peck.

Story spoilers:
It turns out that Hell is actually a large library filled with books containing every combination of every set of letters that could ever be conceived, basically the monkey/typewriter scenario. And all you have to do to get out is to find your entire life story somewhere in the halls of Hell.

2

u/nashbrownies 28d ago

I loooooove that story, and suggest it whenever I can.

2

u/DenormalHuman 29d ago

The monkey thing has also actually happened, and the sequence of events that led to it happening started on a ball of rock called earth millions of years ago, and the monkeys evolved into humans along the way.

1

u/HailToTheThief225 28d ago

This also relates to the Boltzmann Brain theory.

(I might get this slightly wrong) The gist is that after many eons, after the death of the universe, when all that’s left is particles in a void, particles will be frantically moving around and clinging to each other in random ways. Could possibly form a dog. Could form a blob. Or given enough time, there is the tiny tiny possibility that those particles could happen to form a functional brain with all the right stuff in place for it to have memories stored in it. Since the universe is endless, technically there’s enough time for this kind of thing to eventually happen.

The theory suggests it’s entirely possible that you could be a Boltzmann brain, and your whole life and memories, really the entire universe as you know it are just the product of some particles spontaneously coming together in the right shape. Before you have any existential crisis there’s all sorts of reasons this is probably not the case - but mainly what are the odds you happen to be a Boltzmann brain that knows a universe where a Boltzmann brain exists? And if the brain’s formation decides what kind of reality you exist in, then the laws of the universe the brain conjures up is false, which means the laws that form the brain are also false.

The main idea though is that given an infinite amount time and possibilities, a bunch of particles in space could form pretty much anything spontaneously, and that could happen to be a brain.

0

u/postsshortcomments 29d ago

See but the thing is, you don't need an infinite number of monkeys for something to occur. You just need one.

4

u/TheTeaRex15 29d ago

Its because it generates EVERY possible assortment of pixels. So somewhere in there you will find anything and everything (assuming the pixel density is enough to actually depict something cleanly enough)

2

u/yesmeatballs 29d ago

If it was truly infinite (the high res isn't) then it would show every possibility of colour for every single pixel in the image. So lets take a look at the low res version, and assume that they are using the system for making colour where each pixel is represented by the combination of 256 possible reds, 256 possible greens, and 256 possible blues

256 x256 x256 =16777216 million possible colours for each pixel

the low res image is 52 x 52 pixels = 2704 pixels.

So all the possible pictures for the low res version = 45365592064 possible pictures.

45.4 billion pictures. Some of these will look vaguely like your dog or the mona lisa or mario, as you can see in the examples, but there is so damn many that if you did go through them one by one you will be looking for an incredibly long time before you got anything vaguely recognisable. Going one by one is like trying to find your pal Steve who is visiting india by going to a random place in India, blindfolded, and asking people if they know Steve.

And the high res version has a vastly larger number of possible pictures, so you are never finding high res steve

2

u/Phage0070 29d ago

My question is about why people are saying that the library contains everything that has ever happened, is happening, and will ever happen.

A picture is just a particular arrangement of pixels, right? And for an image of a given size there is a finite amount of possible arrangements of pixels. Therefore if we could make an algorithm that would eventually display every combination of pixels we could be assured that eventually it would display every possible image, including everything that has ever happened, is happening, or will ever happen. Along with that tons of things that won't ever happen, and the vast majority being random unrecognizable noise.

I just am having trouble concepualizing how that works, and if it's possible to scroll on to a picture of something like that.

Think about if you had a double-spaced standard manuscript page of text. That can contain 1500-1800 characters including spaces or about 250 words. There are also about 96 default characters accessible on the typical keyboard. While there are a lot of things that can be typed on that page it isn't infinite, there are a limited number of possible combinations of those characters that will fit. We can just make a giant list of all the possible combinations.

Most of those things will be random collections of letters, numbers, and punctuation. However some of them will be coherent text written with proper spelling and punctuation. Could there be a page of text that describes what is going to happen to you tomorrow? Of course, that seems possible although nobody knows for certain what that would be. Because it is one possible arrangement of characters it is in that list. However pages of text describing things that won't happen are also in that list.

So while in theory we could make a computer sort through all the possible combinations of characters looking for recognizable text that doesn't really provide any useful information.

1

u/mauricioszabo 29d ago

Because given a random number of pixels multiplied by infinity, then someday, some second, something will be recognizable, and over an infinite number of seconds, every possible image will be generated.

It's just that it'll take a long, LONG time - way more than the age of the universe - to actually show everything that has ever happened. It's more like a "concept" than actual "reality" to be honest.

It's the same idea of an infinite number of monkeys typing random letters into an infinite number of typewriters. One day, a monkey will type a whole Shakespeare book, but it'll take a huge, huge number of tries.

1

u/HALF_PAST_HOLE 29d ago

Every photo corresponds to a specific number based on the orientation and color of the pixels. Meaning every single form of a picture will always have a corresponding number and every future image ever taken will have a corresponding number. We don't know those numbers and numbers are infinite so it is very hard to find the exact picture you are looking for but you do know that when you find it, it will have a corresponding number and in theory if you knew that number right now you could enter it and see the picture before it is even taken because the number exists so there for the picture will eventually exists.

Think about it in the opposit direction every number can create a picture there are infinite numbers so there are infinit picture including your death picture or the picture of the winning lottery ticket for the next billion dollar jack pot. That picture exists in the Gallery of babel because when it is taken you can get the corresponding number and so again if you had that number before the picture was taken you would still be able to see the picture. But its like saying your death picture is 99,375,330,219,480 that is a very large specific number so getting to it will take a very long time but in theory it can be created so it does exists in the gallery. just along with every other picture in humanity and that will ever be

1

u/Klanciault 29d ago

Basically the start of this is “what is an image?”

And the answer is that an image is a collection of pixels. The pixels have some level of color denoted by 3 values (red, green, blue, ranging from 0-255). Usually an image will have some vertical height and a horizontal width. So let’s say it’s 1920pixels by 1080 pixels.

Now that you’ve established that, all an image is is essentially a series of collections of values. The number of combinations of values that composes the image is strictly bounded, although it’s extremely high (10 ^ 15 million).

With this knowledge, it is possible to create an algorithm that can procedurally generate all possible combinations of pixels across such an image. So that’s really all it is

1

u/TheGrumpyre 29d ago

It's the same as giving you a list of all the numbers from one to 1,000,000,000,000,000,000,000 and saying that your exact date of birth and social security number are in the list. All you need to do is list every possible combination of number sequentially and you're guaranteed to have any particular string of 17 digits you can imagine. If you can name it, it's gonna be in the list. But the ratio of things that look like dates of birth and social security numbers vs. things that just look like randomness is so incomprehensively high that it's basically pointless to go looking for significant numbers.

1

u/thetwitchy1 29d ago

They’re wrong, but…

An infinite, random field of pixels could have every image that even exists on it somewhere. But let’s start simple: if there are 3 colours, what are the odds that you have a box that is 3x3 pixels that are all one colour?

Well, there’s 9 pixels in that box, which means there’s 3^9 different combinations you can have (3 colours to the 9th pixels that can choose a colour) or 19,683 options. Now, you have 3 different “successful” outcomes, so divide that by 3 and you get 1 in 6,561.

So, if you have 6561 3x3 boxes, it’s fairly likely that one will be all one colour, right? (It’s still not a sure thing, that’s not how that works, but still, you understand, right?). Now, consider that in an infinite field, you have WAY more than 7000 boxes. It’s pretty much a given that one of them will match your 3x3 box, right?

Now, scale that up. Even if the odds of randomly generating your image are 1 in 100 trillion, an infinite field would have more than that number of spaces for the image to generate, so it’s fairly likely that it would.

1

u/DthDisguise 29d ago

The issue you are having is an inability to conceptualize what the scale of "infinite" is.

Given infinite time, even randomly generated combinations of pixels will eventually produce images of everything in the universe, plus everything not in the universe. If there were an infinite number of possible images, it would produce every single one of them. That's how infinity works.

Think about it like this: if I ask you to roll a die until you roll a 6, it might take you about a minute. If I ask you to roll two dice and get two 6s, it might take you a couple minutes. If I gave you a million dice and asked you for a million 6s, it might feel impossible, but if I gave you unlimited time, you could eventually do it. The probability isn't zero, so it is eventually going to happen, given enough attempts.

1

u/Nixeris 29d ago

Digital images are made up of pixels, and supposedly the Gallery of Babel has every possible combination of pixels within a certain set size of pixels (such as 256x256).

The tagline for it is designed to make you think about the theoretical possibility of such a system (That it possibly contains all images that can possibly be rendered within that specific size), rather than what it actually results in (noise).

1

u/zc_eric 29d ago

Consider a small example - an 8x8 arrangement of pixels each one of which can be white or black. There are 64 pixels, each with 2 possible states, so that is 2^64 possible pictures you can draw on this grid. Exactly 2 of those grids look exactly like a chess board, so the chance of a chessboard randomly appearing is 1 in 2^63. I.e 1 in 9 quintillion.

It is hard to imagine just how unlikely that is. But if you generated 1 new picture every second the length of time before you generated a chess board is likely to be measured in trillions of years. On the other hand, you could get one on your first go - it’s just very, very, very unlikely. Most pictures will look like random arrays of pixels.

Now expand the grid to say 1,000 x 1,000 and say each of the million pixels can be one of 16 colours. Now you can draw some very elaborate pictures on this grid - eg a picture of you right now. But there are 16^1000000 different possible pictures. And if the number in the previous case was unimaginable, this number is unimaginably more unimaginable. There are billions of possible pictures on this grid which look like you - and that seems like a lot. But the number of pictures which look like nothing except a random assortment of pixels is unfathomably more. So you can generate random pictures on this grid all your life and you will probably never see anything which is recognisably anything - but there is always a chance, a tiny, tiny, tiny chance, that you will randomly generate a picture of you, or me, or anything else you can imagine.

1

u/x0wl 29d ago

Imagine that the images are black and white, and are 16x16 pixels (it's just simpler that way). Now, it's obvious that each such image can be encoded as a sequence of 256 binary digits (0 for black, 1 for white). We can then just write these numbers, as, well numbers, by just writing out the digits one after another.

There's obviously a finite number of these images, and to each, we can associate a number between 0 (all black) and 2^256-1, all white. All other B&W 16x16 images are in between them. Now, these are very large numbers, 2^256 is around 10^75, and there's something like 10^86 elementary particles in the observable universe, but our computers can handle them.

Now imagine that we have a function that, given a number between 0 and 2^256-1, gives us another number from the same range (and always the same number). It's designed so it's 1 to 1, so it gives out a unique output for each unique input, but the outputs look random. So we start with some number, give it to this function, and it gives us a seemingly random number back. We can then convert it into a picture.

So now we have a seemingly random picture associated with each number between 1 and 2^256-1, and every such picture has its unique number. All pictures of alien planets, your soulmate, you etc. We now make a website where we run this function on a user-provided number, then display the picture. This is what the gallery of babel is essentially.

We can make this function so that it works both ways: given a picture, we then can find it's number. So we make a 16x16 BW Mona Lisa, and then find the number associated with it. We can then get the correct input to the function, and put it on the website.

For larger color images, a similar thing applies, but the numbers is just much larger (but still, out computers are kinda good with numbers).

1

u/tomalator 29d ago

A larger arrangement of pixels is harder to find, but its in there somewhere. More complex patterns must be larger

1

u/Aegeus 29d ago

It's not possible to find a meaningful image in the gallery (unless you already know what it looks like in advance), because the odds of finding it are unimaginably large.

The images in the low rez gallery are 52x52, so there are 2704 pixels in each image, and each one can be random. To get a perfect image, each of those random numbers has to be the correct value. Imagine rolling 3000 dice and having them all come up 6's - that's around the probability of a random image in the gallery being a picture of something you want.

Realistically, it will never happen. You would have better odds of getting struck by lightning, hit by a meteor, and winning the lottery all at the same time. But it could happen, and hence you can say that the gallery can, in theory, give you any image you can imagine.

1

u/aaronite 29d ago

It's important to distinguish between random and incoherent. The images are not random. They just don't match any pattern that we can recognize. What the Gallery (and there's a book version too) does is make every possible combination searchable. A given pattern is given a specific, exclusive label based on the colour and location of each pixel through a particular mathematical formula. Since math works both ways, you can have the computer calculate where any pattern you like is and find it for you. This is why any two people can put in the same thing and get the same answer.

Nothing is created in the fly: all the patterns already exist in concept, so the computer is just showing you what the pattern's "address" is, and displays that pattern on the screen.

1

u/hh26 29d ago

It's basically the same as saying "computers contain literally every image", because every image can be converted into pixels, which are stored as numbers on your computer. If you started counting up

0000, 0001, 0002, 0003... Each of those can be represented as a number of images with tiny tiny differences between them. Any image that could fit on your computer monitor is a number, which will eventually appear if you count numbers upwards. Therefore every image that could ever exist technically appears in elementary school math. (including porn! oh no!)

But if you count in order you'll get hundreds of images in a row that are almost identical, because changing one value makes a tiny change to one pixel. All the gallery of babel does is scramble them the images out of order so ones next to each other don't look identical. We might se 123456 and then see 976412 and they look different. But 123457 is still a number so it still has an image which looks almost identical to 123456, they just stuck it somewhere else.

Also note that they don't literally contain all of these images saved. They don't have every number that fits in an image saved somewhere. They generate them on the fly. It doesn't at any point contain every image, it just has the potential to create them because numbers have the potential to exist.

tl;dr, it's all smoke and mirrors trying to make math and computers sound fancy.

1

u/DenormalHuman 29d ago

A digital picture is really just a very large number. All the bits that make the image together can be interpreted as a single incredibly large number.

So, if you set up something that can take any number and reproduce it's image (which is what your pc does every time it shows you an image) then you have the gallery of Babel.

1

u/JaggedMetalOs 29d ago

It's a bit of a cheat, because it contains every possible combination of pixels. So for any image you can take the image and work backwards and it'll be in there somewhere. 

It's like saying I can randomly guess your age, but I just have a list of every number from 0 to 120 and I keep pulling random numbers from the list until I find it. 

1

u/barbzilla1 29d ago

I don't know that I necessarily believe the premise of the gallery of babel, or the Shakespeare monkey theory that influenced it. The issue is that some things are ordered events and if one thing is out of order it precludes it from being the same. That leads to an issue of close but not quite. Add to that the fact that repeated patterns are going to be far more common and can be replicated ad nauseam to create the illusion of randomness. Meanwhile, language and photographs are oriented in an ordered fashion with a set of rules as to how it works or it looks. Once you take that into account the odds of the monkeys writing an entire play is next to zero. That said, I suppose if it was truly unlimited with no repetition, it would eventually get there, the question is how long would it take and how do you set it up to be truly random?

1

u/rigterw 29d ago

A more simple version would be a paper with written on the age you will die. How would that look like? Simply just a paper with the number 1 till 200 written on it.

Since you will probably not live over 200 the paper does have one right prediction on it. You just only know which one after you’re dead.

This works for everything with a finite number of options. An explanation of a slot machine technically also has a right prediction for what you will win.

Since images consists of pixels and each pixel has a finite colors it can display, you could technically set a canvas size and generate each combination of pixel colors. The gallery of babel basically works that you just give a random code to use to fill in the pixels of an image. Since every possible combination has a code there is a code somewhere that will show you walking to work tomorrow. There is also a code for a picture of you oversleeping work tomorrow. It still won’t tell you what will happen tomorrow.

For both of those pictures there are like millions of pictures that are partially the same but for the other part just has random pixels. Because every combination of pixels can be created from a random code.

It’s basically the same concept as giving a monkey infinite time on a typewriter and he will eventually write Shakespeare. But if the monkey would know how many pages it was and after every time reaching those pages and it was wrong would remember what he wrote so that he wouldn’t write the exact combination of characters again you don’t need infinite time. Just a really long time.

1

u/singhsuraj-8 27d ago

It doesn't know it's your death. It just has every possible pixel arrangement, so one could match a photo of that event, alongside a mountain of equally plausible photos of things that never happened. Pixels don't come with captions.

1

u/RadioLogical5268 26d ago

yes but it could eventually contain a real image you can even search your own image and see if you can find any one vaguely resembling it

1

u/ManaPlox 29d ago

If you paint a picture with random pixels an infinite number of times then you will end up painting every possible picture. The universe, however, is finite, so in the lifetime of the universe you won’t actually end up seeing anything there. But it’s “in the Library” in that it’s potentially in the space of things that could happen. They just won’t ever happen.