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 1 Comment

Sometimes I want to browse not search

January 4, 2013 at 5:05 pm (internet, moan) (, , , , )

There is an annoying trend at present when you buy things online and that is the assumption that you are happy to let the ‘system’ choose what is best for you based on some criteria you fill in before hand.

I’ve seen this when buying tickets for cinema and theatre – it asks what show, roughly where you want to be and will then present you with some specific results for where to sit. Of course what I often want to do is look at seat availability across a few different time slots to trade off when I can attend with the best seats available. I might be happy to change nights and wait a few extra days for a better seat. In many cases that is almost impossible without toing and froing between different checkout actions and rerunning searches for each different time slot.

Trains are another example. If you have a single regular journey with no options, it’s fine to just enter the time to travel and view the trains around that time. But if you are unsure and are thinking about options of driving to different stations, again it’s very hard to get an overview of your general route options. Is it worth driving down the road to join a different line rather than go in and out of london? Quite likely but you won’t get that from a ‘we know best’ search. And don’t get me started on journeys where two separate tickets are cheaper than booking one journey with a train change. Maybe one day the world would support a fully integrated travel system, but I doubt it will ever really know what your aims are above the simple information you’ve entered into the site.

Holidays seem to be falling into the same trap. Ideally when booking you want an ‘at a glance’ overview of availability. When it asks when you want to go on holiday, you want to say ‘any time during school holidays, that doesn’t clash with exam results, isn’t stupidly priced and ideally will have the sun pre-booked’ (or words to that effect). If you have to go through all accommodation options for each week individually (and some sites make you do this) then you lose track of what you are trying to achieve very quickly and that is before you start adding in different options.

So, to all super intelligent search and decision making engines – just remember, sometimes I just want to browse and given a suitably organised representational overview, and when presented with the facts I need, I am still better at deciding what I’d like to do than you are. For the moment at least.


Permalink 1 Comment