What if you could count all pictures that a computer display could show

January 12, 2013 at 12:55 am (computers, interesting) (, , , )

I’ve been reading “what if” on the xkcd blog recently. Its a very entertaining discussion of postulating about mathematics and physics solutions to hypothetical problems.  And it made me think of something I’ve wondered about on and off, well, ever since I got involved in digital computing and that relates to the fact that a computer display is a large sequence of numbers and is basically finite.  Yet it appears to be able to display anything you can imagine (and an awful lot that you probably can’t).

Each specific display is basically a very, very, very large number – including the screen I can see right now, i.e. some background windows on the Internet, WordPress ‘edit’ window open, characters appearing and so on.  In fact every time a new character appears some digits in this very large number change.  What do I mean by this?  Well every display has a resolution.  Early PCs had small resolutions, just enough for text.  Then came things like VGA graphics providing a resolution of 480 by 640 pixels (picture elements) in the display.  That means a total of 307,200 individually referenceable items.

Now if that is a black and white display, then each of those pixels can have just one of two values – 0 (off) or 1 (on).  Like you drawing 480 dots in a line, then drawing 640 of these lines and each picture is made by colouring in black or leaving white each dot as required.  Low resolution colour graphics might have 4 bits per pixel, allowing for 16 colours to be represented – each pixel is now described not just by 0 or 1, but by a number between 0 and 15, representing a colour.  That means you’d need 307,200 times 4 bits storage to record the display on a screen, or approximately 1Mb (if I’ve got my maths correct).

Higher resolutions (such as the kind you might get on a non-smart, cheap PAYG phone these days) will need a larger number for each pixel until we get up to 24 bit colour, keeping VGA resolution, when you can have a red, green and blue value, each of between 0 and 255 for each of our 640 by 480 pixels.  Combined you get a lot of colours but at the cost of needing much more storage – in this case 640 x 480 x 24 bits, or something approaching 7Mb per “screen”.  I won’t go into more detail – as you might expect, there is a wikpedia article about the whole topic, so I refer interested readers there.

But getting back to the original point, taking the black and white 640 x 480 screen, that can be represented by a binary number containing 307,200 digits (2^307,200) or 2 times 2, 307,200 times.  So that means you take a number and double it 307,200 times.  That is the number of combinations of numbers that you’d need to count every combination that a 640×320 black and white display could possibly show.  And that really would include everything that could possibly be shown on that display.  So in the translation from an analogue photograph (for example) to a digital, 640×480 black and white image, the digitisation process takes something that has an infinite resolution down to one of a finite number of options – albeit still quite a large number of options.

Just adding in the 16 colours, we’d need a number that is 2 to the power of 1,228,800 – a binary number with over a million digits.  So, when you factor in for today’s typical resolutions, my current screen is 1024 x 1280 with “32 bit colour”.  That means a single screenshot from my computer is a number with 1024 x 1280 x 32 bits – or 2 to the power of 41,943,040.

So, how long would it take to cycle through the finite number of pictures that my computer monitor could potentially display?  Well my maths is too rusty to transfer a 40 million digit binary number over into decimal to divide by seconds, minutes, hours, days, years, centuries, millenia and so on.  But by way of some context, the Universe is something like 14bn years old (or there abouts).  That is 14,000,000,000 * 365 * 24 * 60 * 60 seconds or 43 followed by 16 zeros or so (in decimal).  In binary that would be a number of around 60 to 70 digits I think.  So we’d need to double the age of the universe over 40 million times if we were showing one screen a second, to cycle through the whole lot.

Such is the interesting power of contrasting infinite analogue resolution with finite digital resolution.  It is very large, it can display practically anything we can imagine, but actually it is still a finite number.  Just an unimaginarily large number.  But of course what is more interesting still, is that infinity is still a lot larger than that.



Permalink 2 Comments

Dark, Unexposed Corners of the Internet

October 3, 2012 at 9:50 pm (computers, interesting, internet) (, , , , , , , )

I’m almost finished reading through ‘The Geek Atlas‘, which will probably be the subject of a post of its own at some point, but for various reasons I was led to the author’s website and blog.  There were two very interesting (to my geeky side) recent posts that I found fascinating to follow up.

The first, is a recording of a recent keynote speech given by the author on the issue of ‘big data‘.  This is a bit of an IT buzzword for some reason this year (a bit like ‘cloud’ last year) but the keynote is all about the fact that you can basically pick a point in time, and big data will always mean ‘more data than I can handle with the machinery I currently have at my disposal’.  It describes the issues faced by some engineers tasked with calculating the distances between stations in the British Rail network – they had 9 months to come up with an answer – and this was in 1955.  It is a fascinating talk – I recommend it.

The other one that caught my eye, relates to the recent announcement that the body that oversees allocation of Internet address for Europe is down to its last few (few in this case being approx 16m) and we are rapidly running out.  He noticed that there are various bits of UK government that appear to be sitting on major chunks of unused address space.

Now, working in IT, I know what a major pain and effort it will be to free-up any of these already allocated addresses, so wasn’t really expecting the government to suddenly experience a £500m-£1.5bn windfall from this.  I also know that the first major call to be a ‘good Internet citizen’ and return unused addresses was actually made in 1996 (in the shape of RFC 1917):

“This document is an appeal to the Internet community to return unused address space, i.e. any block of consecutive IP prefixes, to the Internet Assigned Numbers Authority (IANA) or any of the delegated registries, for reapportionment.”

So, over 15 years later anyone easy returns would probably have happened by now.  However what has been interesting in this recent case is seeing geeky, interested, members of the public using Freedom of Information as a means to prod said gov departments to find out what these are used for.

First – the UK MOD has – the response:

“I can confirm that the IPv4 address block about which you enquire is assigned to and owned by the MOD; however, I should point out that within this block, none of the addresses or address ranges are in use on the public internet for departmental IT, communications or other functions.  To date, we estimate that around 60% of the IPv4 address block has been allocated for internal use. As I am sure you will appreciate, the volume and complexity of the Information Systems used by the Armed Forces supporting military operations and for training continues to develop and grow.    We are aware that the allocation of  IPv4 addresses are becoming exhausted, and the issue has been recognised  within the Department as a potential future IS risk.”

Then the UK DWP – – the response:

“DWP have no plans to release any of the address space for use on the public Internet. The cost and complexity of re-addressing the existing government estate is too high to make this a viable proposition. DWP are aware that the worldwide IPv4 address space is almost exhausted, but knows that in the short to medium term there are mechanisms available to ISPs that will allow continued expansion of the Internet, and believes that in the long term a transition to IPv6 will resolve address exhaustion. Note that even if DWP were able to release their address space, this would only delay IPv4 address exhaustion by a number of months.”

So no – too expensive to release them, and as stated above, it only prolongs the agony very slightly anyway.  However, I do wonder how many other corners of the Internet are actually ‘dark’ like this and will never actually be connected.

Maybe we will do better with IPv6 allocations – even a home user will get an allocation that is larger than the current Internet, but the authors of RFC 3177 make the argument that it is fully justified (especially as they have room for around 35 trillion of these):

“… based on experience with IPv4 and several other address spaces, and on extremely ambitious scaling goals for the Internet amounting to an 80 bit address space *per person*.  Even so, being acutely aware of the history of under-estimating demand, the IETF has reserved more than 85% of the address space (i.e., the bulk of the space not under the 001 Global Unicast Address prefix).  Therefore, if the analysis does one day turn out to be wrong, our successors will still have the option of imposing much more restrictive allocation policies on the remaining 85%.”

So there is quite a large margin for error, even compared to the decision back in the 1970s to allow for 4 bn addresses for the current Internet at a time when there were only a handful of computers to be connected.

As I say an interesting interplay about a topical, if geeky, infrastructure issue.

BTW – you can see both blocks in the top left hand quarter of the xkcd Internet map (labelled 25 UK MoD and 51 UK Social Security).


Permalink Leave a Comment

List of Numbers – you can help by expanding it …

May 25, 2012 at 5:35 pm (interesting, science) (, , , , , , , )

What else would you do on Towel Day, than browse Douglas Adams references on wikipedia?  Hence leading me (in true xkcd style) via the number 42 to the list of numbers page:

Yes you read that right – “This is an incomplete list, which may never be able to satisfy particular standards for completeness. You can help by expanding it with reliably sourced entries.”

It would appear to me that this might be missing a citation – infinity!

Still I was impressed by the dedication.  At the time of writing, all numbers up to ~210 seem to have their own wikipedia page … then in 10s, then 100s, then 1000s and so on.

Nice to see some named numbers (hello Graham), then some specialist numbers (primes, etc), notable integers, specialist scientific numbers, right through to numbers with no specific value.  Really.

In fact, this page would seem a shining example of the interesting number paradox in action.  In fact the same thought appears to have occurred to someone else, as the interesting number paradox page has this to say:

  • 224 (number), the smallest natural number which does not have its own Wikipedia article.

I wonder how many times the wikipedia page for 224 has been created and removed over the years!

Of course my favourite number is 2.  It’s so odd … it’s the only even prime.



Permalink 1 Comment

Map of online communities 2010

October 6, 2010 at 5:17 pm (art, internet) ()

Ok, so this is going to be copied, pasted, and posted all around the Internet, and I’m therefore as bad as everyone else out there for basking in reflected glory – but still … I, like many others, have been waiting for an upate to this map for ages!  Very glad to see it happen.


(Love the ‘plains of awkwardly public family interactions’ and ‘Breaking! Waves’)


Permalink Leave a Comment

Just Google!

January 28, 2010 at 9:54 pm (internet, music) (, , , , , , , , )

Can’t remember quite how this started, it was probably a bit like this xkcd, but after an odd series of random links and searches, I ended up googling for ‘google song’ and turned up the song ‘Just Google‘, with words about searching using google, sung to the tune of ‘Beat It, by Micheal Jackson.  Its a bit daft, but some of the lyrics are actually quite clever … “how to milk a camel, how to cut your own hair.  37 years with an electric chair and pictures of a man being killed by a bear – Just Google” …

Its certainly a lot more inspired than this other effort.  Still made me laugh but for all the opposite reasons – this one is just odd.

Of course, songs about Google are not new – take this Cookie Monster song from Seasame Street.  It was recorded some 16 years before Google as we know it came about at all!  Just goes to show, theres nothing really new at all …

Oh, and in case you are wondering, there appear to be quite a number of Facebook songs too.


Permalink Leave a Comment

Taking all the fun out of technology …

November 19, 2009 at 6:54 pm (computers) ()

Not much you can say about this, except nod sadly and acknowledge that techy things aren’t as much fun as they once were …


Some engineer out there has solved P=NP and it's locked up in an electric eggbeater calibration routine.  For every 0x5f375a86 we learn about, there are thousands we never see.

Permalink 1 Comment

You are here

September 25, 2009 at 9:09 pm (computers, internet) (, , , )

I’ve mentioned xkcd so many times already in this blog, but then it is just so good.  Sometimes very witty, sometimes very geeky, sometimes quite astute, other times quite sad actually.

Anyway, once a map of the Internet appeared in the comic, and then got mentioned all over the place, including someone printing out a real version, based on the real addresses.  Well, like all maps, it is of limited use unless you know where you are – well now you can.  This website will plot you (well, your PC) on the numerical map of the Internet.  So, just click here to see ‘you are here’.


Permalink 1 Comment

Chess on a rollercoaster

June 12, 2009 at 8:50 pm (interesting, odds) (, , , , , )

The inventiveness of Randall Munroe never ceases to amaze me, only surpassed by the determination of some of his fans.  Take this cartoon for instance, suggesting the idea of getting a picture of you playing chess whilst on a rollercoaster.

All good fun and a good cartoon.  But then follows the challenge for people to go ahead and do it for real.  Inspired.

The best entry on this page, in my opinion though, involves Jenga.  Now, don’t try this at home (or on your local ‘coaster for that matter).


Permalink Leave a Comment

Ball pit

December 18, 2007 at 10:31 pm (interesting, kids, odds) (, )

Is I’ve posted before, I really like reading xkcd.  Well, so does this guy. In fact he followed up one of the comics and created a ball pit in his living room.

Weird.  Looks like fun though.


Permalink Leave a Comment

Contact – Carl Sagan and pi

November 12, 2007 at 10:04 pm (books, science, security) (, , , , , , , , , )

My previous musings about xkcd finally let me to read their whole archive … which means that I eventually found this one, which is possibly one of my favorites.

Got me thinking about Carl Sagan‘s novel, Contact.  Loved the book.  Film was ok, but I was really disappointed that the bit about pi never made it in.

Whilst browsing wikipedia about this subject, found a link to http://www.pisearch.de.vu/ (currently unavailable though).  Struck me that this would be a good way to collect personal details about people (‘try it with your credit card number’ 🙂

Further browsing has turned up Pi-Search, which you can use to look for sequences in the first 200 million digits of pi.  Did you know that the sequence 12345678 occurs at position 186,557,266?  Well now you do.

The Feynman Point is also interesting.  Maybe one day, I’ll give both Richard Feynman and Pi an entry of their own.


Permalink Leave a Comment

Next page »