Okay, well, I don't really have pictures of the aliens. But I could have them, in theory.
Close to a year ago, on a BBS I hang out on, someone made the following suggestion. It was suggested that a computer image is just a set of data. And even though it's an image, as far as the computer's concerned, it's nothing special. Just a set of bytes. So, the theory continued, would it be possible to generate all possible images for a given image size? If you're just going through and generating all possible combinations, you'd eventually hit everything that could be displayed in that picture.
Sure, you'd have an awful lot of junk. An entirely black screen. And entirely black screen with one red pixel. An entirely black screen with two red pixels. An entirely black screen with one red pixel and one blue pixel. And so on. Tons of junk.
But, you'd also generate photographs of everything that exists, has existed, or could exist (so long as it could be displayed within the boundaries of your image, of course).
Think about it. Say you have a 100x100 pixel image. If you go through and try out every single combination of pixels (say at 8 bit color, 255 colors per pixel), you'd eventually generate every possible image that could exist and be rendered in that resolution.
And I mean everything.
You'd generate photos of yourself from every angle from every second of every point in your life. You'd generate pictures of your parents when they were young. You'd generate pictures of your boss punching in his ATM code. You'd generate smiling photographs from aliens that live on planets we've never heard of in galaxies we haven't discovered.
As long as it could fit in a 100x100 photo @ 256 colors, it would be in there.
Of course, the original intentions were less than noble. I seem to recall his original goal being a photograph of himself in an intimate pose with a particular supermodel.
And such a picture does exist somewhere in all of the combinations. And it's an utterly flawless picture - not something that photographic experts could look at and identify as a fraud, because there are no signs of a fraud. It's a 100% legitimate photo that just happened to be generated.
Perhaps a demonstration is easier. So I wrote this program to generate combinations of pixels. It's very very small (since I don't want to overload my site), but you can display all possible combinations of images up to 3x2 at up to 3 possible colors. So you can actually see all of the ways that the images would combine. Obviously, this is a very very very small scale, and there's no way to get a photo of yourself with president lincoln out of the web interface.
The more computer savvy of you may be interested in downloading the source code. There are links on the page. There's a perl version, which I wrote first. It's nice and it runs and it's adequate. But I spent most of today porting it to C. I'm a rather green C programmer, and I figured the practice would do me good. Probably less than ideal technique, but it's wicked fast (MUCH faster than the perl) so if you have the resources, that's the one to use.
After playing around with my program there for a few minutes, you've probably got a better handle on what I'm talking about, and maybe your mind is already racing with the possibilities of generating photos of long lost relatives or exploring the cosmos. Or, perhaps you're paranoid and are worried about someone generating an utterly flawless photo of you naked as a jaybird. It is, after all, theoretically possible.
Well, now that I've gotten your hopes up by explaining the concept of such things, it's time to dash them utterly with some incomprehensible mathematics.
First of all, let me explain how many combinations there are for a given width, height, and number of colors. It's actually quite easy. The formula is:
p = c w * hwhere p is the number possible
c is the number of colors
w is the width
and h is the height
So, for example, if you have a 2x2 image with 2 possible colors, there are 22 * 2 == 2 4 == 16 possible combinations. The graphing program will demonstrate all of them to you.
But it quickly and rapidly gets very out of control. Say you go to a 3x2 image at 2 colors. That's suddenly 64 combinations. What about a 3x2 at 3 colors? That's 729 combinations Let's jump ahead a little. How about a 4x4 image with 4 colors? There are now 4,294,967,296 different combinations. That's more than 4 billion. And we're only up to a 4x4 pixel image. The icons on your computer screen are probably 32x32.
Okay, let's take a look at some other really big numbers for perspective.
Since the dawn of time, there have probably been about 4.1 * 1017 seconds. (that is, 410,000,000,000,000,000 seconds)
It is estimated that there are 1020 grains of sand on the earth.
It is also estimated that there are 1022 stars in the universe.
A human weighing 150lbs would contain approximately 7 * 1027 atoms. Another way of putting that is 7 billion billion billion.
The entire Earth and everything on it is estimated to contain 3.6 * 1051 atoms.
Okay, let's keep getting bigger. The sun is estimated to contain 1.2 * 1057 atoms.
Further, we now have the number of stars in the universe and the number of atoms in a star (on average). So from that, we can estimate that the universe has approximately 6 * 1079 atoms in it.
Finally, we'll include the famous famous big numbers. The googol is defined as 10100 and then the googolplex is 1010100(that is 10googol)
But, it's possible that you're not too familiar with scientific notation. So let's write things differently.
Okay, we'll start off easily. You probably have 10 fingers.
There are roughly 120,000 hairs on your head.
Approximately 8,000,000 people live in New York City.
There are roughly 6,000,000,000 people in the world.
Bill Gates is worth somewhere in the neighborhood of 30,000,000,000.
Okay, now to the numbers we just looked at.
There are 100,000,000,000,000,000,000 grains of sand on the earth.
A human weighing 150lbs would contain approximately 1,000,000,000,000,000,000,000,000,000 atoms.
And, jumping to the end, this is a googol:
10, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000.
Boy, Mr. Gates' fortune sure doesn't seem that big any more, does it?
I'd happily show you a googolplex, but I can't. It's too big to display. You see that big number up there? The googol? A googolplex is a 1 followed by that many zeroes. The googol tells you how many zeroes are in the googolplex. It's like saying 3 tells you how many zeroes are in one thousand (3 of them - 1,000) or 6 tells you how many zeroes are in one million (6 of them - 1,000,000). So there are 10, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000, 000 zeroes in a googolplex. It's just mindnumbingly large.
Again, to give you the size of just a googol, we can see from our number lists up there that it's estimated that there are less than a googol atoms in the universe. So if you gave every atom in the universe a number, you'd never get to a googol, let alone come anywhere close to a googolplex.
But, it seems that I've strayed from my original topic - image generation. Writing a program to generate all possible images of a given size. So what was my little diversion into big numbers all about? It probably served one of two purposes. Either (1) the total number of possible images is relatively small, and I wanted to demonstrate that while it seems big, in the grand scheme of things it's not that huge or (2) the total number of possible images is really really big.
Can you guess which one it is?
Go on guess.
Okay, I'll just tell you. It's the latter.
So, let's try some calculations. We'll start small and easy. A 10x10 pixel image. And we'll allow 10 possible colors. Remember - the icons on your computer are probably 32x32 and allow 256 possible colors at least. So we're starting off with an image 1/9th the size of an icon on your computer, with 1/25th the amount of colors in it. Here, this is a 10x10 pixel image. (
). Actual size. It's the little blue square. That's all we're dealing with.
Well, using our formula, the number of combinations = 10 10 * 10, which is to say 10100. Hey! I recognize that number. That's a googol Yes, that's right. a googol. A 10x10 pixel image using only 10 colors has more possible image combination than there are atoms in the universe.
Okay, let's go a little larger. Let's take your desktop icons as an example. Same formula, we have the number of combinations = 25632 * 32, or 2561024. Now, I don't know about you, but I don't have a calculator that can go nearly that high, so I'll have to estimate a little.
Bear with me a bit. But 2561024 = 28192. So that's good. Now let's estimate a bit. First of all, we'll round that down slightly. I don't want anyone to look at this and think that I'm over-inflating the numbers. I want everyone to remember that my estimates are below the actual numbers. That said, we'll round down and say that it's actually 28190. That we'll turn into 210819. Still not quite manageable, but we're getting there. 210 = 1,024, but that number is a bit awkward to work with, so we'll round it down to 1,000. So we have 1,000819 1,000 = 103, so we'll re-write it as 103819. And, recombining the exponents, we have approximately 102,457!
So, for an icon, 32x32 with 256 colors, there are approximately 102,457 different combinations that exist. It seems that the icon creators won't be going out of business any time soon.
Still, that's really too small for a decent sized photograph of George Washington, myself, and an alien in front of Mount Rushmore. So let's bump it up a lot. A low resolution photo would probably be 640x480. We'll stick with 256 colors, which means that there are 256640 * 480 = 256204,800 combinations. We'll follow the same tricks and estimating we did last time. 256204,800 = 21638400 = 210163840. Now, replacing and rounding, that becomes 1000163840 = 103163840 = 10 491,520! Yes, that is a 1 followed by a half a million zeroes. It would take you 500K on disk just to store the number estimating the number of possible combinations. Again, remember, that the number of atoms in the universe is only a 1 followed by 77 zeroes.
And, as one final gasp, let's take a look at a higher quality photo. Most people would be quite happy with a 1024x768 image with 16 bit color. To date, we've been using 8bit color, which is pretty lousy for a photo. 16 bit is the way to go. So how many combinations are there now? Well, it's
655361024 * 768 = 65536786,432 = 212,582,912 We'll round it down slightly to 212,582,910 and turn it into 2101,258,291 re-writing and rounding, we get 1,0001,258,291 or 1031,258,291 and finally 103,774,873 A 1 followed by 3.7 million zeroes. Again, in terms of data size, that's 3.7 megabytes on your hard drive.
Of course, you'll note that we're no where near a googolplex. The highest we've gotten is 10106 (roughly, of course, we're rounding down to 1,000,000 zeroes instead of 4 million) whereas a googolplex is 1010100 So we're no where close to that number. But, rest assured, that we have long long long ago since left the realm of possibility, and there is no chance of a naked photo of you being generated by a dedicated hacker who's written a program to do such a thing. You would have one the lottery several billion billion billion billion billion billion times (and a few more billion billion billions than that) before he'd even come close. In fact, I dare say that if all of the computing power that has ever existed, and ever shall exist, at any time, anywhere in the universe was all harnessed together for this one task, it would still never be accomplished. Assuming a finite universe, of course. But that's a topic for another entry.
Until such time, you may rest assured that any naked photos of yourself floating around on the internet are undoubtably real.