search
I have pictures of the aliens!
By Jim Thomason
From Jim's Journal
Copyright and © 07/10/2003, published on 07/10/2003

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 * h

where 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.

Writings
> Horror
> Itty Bitty Horror
> Jim's Journal
03/13/2010 Mother Goose at the Library
10/08/2009 Story Time
08/02/2009 Soda free is the way to be
05/17/2009 We failed
03/05/2009 Alex's Development
02/21/2009 Nice parenting
01/15/2009 I got something
11/24/2008 A month with the G1
11/04/2008 A week with the G1
10/25/2008 Alex walks about
10/20/2008 Alex on the slide
10/01/2008 Alex crawls about
07/11/2008 Product Endorsement Corner
07/02/2008 Beware of special deals
04/29/2008 10,000 miles!
04/25/2008 I just don't get marriage
04/11/2008 My thyroid (again)
04/02/2008 My thyroid
03/22/2008 Guitar Hero; or why I hated marching band
02/21/2008 This is me
02/17/2008 Good bye, Clark; Hello, Kent
02/08/2008 Koka's famous
02/07/2008 Artificially what?
02/05/2008 Product Endorsement Corner
12/18/2007 Jim sent in from his phone...
10/12/2007 Router dust collection
10/08/2007 Yo Ronald! WTF?
09/19/2007 I think I fixed our plumbing
08/22/2007 James Alexander Thomason
08/17/2007 I conquered the roof
07/17/2007 Historical tidbit
07/14/2007 Well worth the cost
07/10/2007 The Visit, Fall 1994
07/10/2007 PiPs, Spring 1995
07/10/2007 The Beggar, Fall 1994
06/28/2007 Fun In Florida
06/01/2007 Mountain Don't
05/09/2007 Product Endorsement Corner
05/07/2007 Things I have burned myself on
03/29/2007 Basset Hound Town
03/28/2007 Technology is awesome
02/22/2007 New glasses
02/17/2007 Hooray for the government
02/02/2007 My flying machine
01/13/2007 Where'd it go wrong, Sailor Jack?
01/05/2007 My god it's full of stars
12/14/2006 Cartoons I've liked
11/17/2006 Vote for Stan
11/15/2006 T-Mobile lost points with me
11/11/2006 Memory exchange
11/01/2006 Election turnout
10/24/2006 They listened!
09/28/2006 I want to work for google.
09/23/2006 The accidental fractal
09/13/2006 I don't think I like Charlie Chaplin
09/12/2006 My web presence over the years
09/06/2006 So very sad
09/01/2006 House work
07/31/2006 Puppy dogs
07/27/2006 My letter to Best Buy
07/03/2006 Look at all the content
06/25/2006 Stuff I like
06/06/2006 Thanks a lot, Mr. Cheney
05/28/2006 Hot Time Tonight
05/15/2006 A link to some website
05/04/2006 George Lucas is a jackass
05/02/2006 Look! Up in the sky!
05/02/2006 I am so outta touch
04/26/2006 The re-pipe
04/21/2006 Stuff I miss
04/19/2006 Another site upgrade
04/16/2006 I'm quite the handy man, part 2
04/13/2006 Simply Awesome
04/06/2006 Lego Inflation
03/27/2006 Keep in sync with RSS
03/19/2006 I'm quite the handy man.
03/15/2006 How computers store numbers
03/02/2006 Already? Dammit.
03/01/2006 This is why I hate intelligence tests
02/28/2006 We're homeowners!
02/26/2006 Almost outta here
01/12/2006 I must be getting old.
12/29/2005 Wow
12/12/2005 Cheap bastards
11/20/2005 An analysis of the strength of paper clip chains
11/19/2005 So whaddaya think?
11/15/2005 Good luck, Ms. Eckerson
11/07/2005 Use harder passwords
11/01/2005 Buyer Beware
10/31/2005 Happy Halloween
10/19/2005 It ain't easy
10/05/2005 Murphy's House, Pt. 2
10/05/2005 Murphy's House
08/03/2005 For the postgres geeks
07/26/2005 Yuck for aspartame
07/20/2005 CS Students? Where?
07/02/2005 End of an era
06/28/2005 War of the Worlds
06/13/2005 Wow. I'm impressed
05/31/2005 Some iTunes tidbits
03/31/2005 My poor phone
03/21/2005 How to write more secure software
03/20/2005 Wonderfalls
03/05/2005 In the name of science
03/02/2005 Koka on her birthday
02/14/2005 I want to build a park
01/12/2005 I'm a convert
01/10/2005 How many was that?
01/03/2005 A missed marketing opportunity
12/29/2004 My new book
12/15/2004 The Music Box
12/10/2004 Camera, Part 2
12/07/2004 The new camera
11/01/2004 The Cabbie
10/25/2004 Bad marketing
10/14/2004 No more wisdom teeth
10/13/2004 Time to get bigger?
10/04/2004 It's harder to write
10/01/2004 Not with a bang, but a whimper
09/21/2004 What are your goals?
08/23/2004 Writing what lasts
08/13/2004 The future of Basset
08/10/2004 Faster faster faster
08/01/2004 The Big Race
07/23/2004 Poppycock
07/21/2004 Defeated!
06/08/2004 I want to ride my bicycle
05/24/2004 I fixed the dryer!
05/10/2004 An unwelcome visitor
05/04/2004 Viva Las Vegas
04/22/2004 Behold. Basset.
04/18/2004 Now officially basset powered
03/25/2004 I should switch games
03/12/2004 DirecTV is not for me
02/27/2004 So...freakin'....cool....
02/18/2004 Perl: There's only one way to do it.
02/17/2004 A great day in the history of war
01/20/2004 Why open source sucks
01/14/2004 Marketing the future
12/30/2003 Scary Cartoons
12/18/2003 You're not really special
12/07/2003 Product Endorsement Corner
12/01/2003 Our First Thanksgiving
11/22/2003 Just like riding a bike
11/19/2003 Tax Status B for me
11/18/2003 Work ethic, or rather the lack thereof
11/01/2003 Really big news
10/26/2003 Traumatic events from my youth
10/25/2003 17 years late, but here
10/23/2003 Change is good
10/22/2003 Product Advertisement Corner
10/21/2003 I need to branch out a bit
10/20/2003 Design Philosophy, Part 2
10/19/2003 Film has been good to me.
10/18/2003 When I win the lottery
10/17/2003 Our way or the highway
10/16/2003 A golden opportunity
10/15/2003 Life in 5 dimensions.
10/12/2003 And now...the middle...
10/11/2003 One less yellowjacket
10/10/2003 Why do I like what I do?
10/09/2003 Tip your barber!
10/08/2003 We continue to be lucky.
10/07/2003 Violating philosophy already
10/06/2003 Picky about unusual things
10/05/2003 Design Philosophy
10/04/2003 Sure to be interesting
10/03/2003 Priorities are outta whack
10/02/2003 On egomania and not being a jerk.
10/02/2003 I need to write more.
08/27/2003 And justice is served
07/29/2003 Another exciting bike ride!
07/19/2003 My 4 hours in jail
07/10/2003 I have pictures of the aliens!
07/08/2003 A very fine port
06/22/2003 Stay away from that house
05/28/2003 Interesting ride...
05/22/2003 Defending the house (updated 06/08/2003)
05/18/2003 I invented it first, dammit!
05/17/2003 All moved in (updated)
05/14/2003 Biking Log overhaul
04/26/2003 Adventures in moving!
03/22/2003 What a fun day!
03/22/2003 I just love a mystery, part 2
03/01/2003 I just love a mystery!
02/22/2003 Happy Birthday, Koka
02/19/2003 Adventures in driving
02/11/2003 Stupid fireplace
02/03/2003 Programmers shouldn't be creative
11/16/2002 What's in a year?
11/11/2002 Not as much fun as when I was a kid!
10/30/2002 I can drive! I can drive!
10/18/2002 Superman's cape
10/10/2002 twice in a lifetime
09/25/2002 Go ahead and laugh
09/01/2002 things that affect us.
08/27/2002 stupid, stupid toy
08/25/2002 Dangit!
08/22/2002 mean old dentist
08/19/2002 donating blood
08/19/2002 Lucky Us
08/18/2002 3 years and 2 months
08/16/2002 Planet Jim
08/15/2002 New toy for me
08/13/2002 Major site re-vamp
08/08/2002 haircut hassles
08/07/2002 coding, coding, coding
08/03/2002 The big race
08/02/2002 Signs
08/01/2002 toys toys toys toys
07/31/2002 Stayin' at home
07/28/2002 Goldmember
07/28/2002 Botcon!
07/25/2002 New homepage!
07/25/2002 First from jimandkoka.com
07/25/2002 My very first journal entry
> Koka's Journal
> Poetry
> Prose