Here is a quick quiz of three questions that you will get wrong. Don’t worry, everyone gets them wrong. But try to be the least amount of wrong possible, and write down your gut estimations:



• How long is a million seconds, and how much longer is a billion seconds?

• How much per person did the UK banks’ bailouts cost?

• If 100 people in Britain were picked at random, how many of them will be immigrants?

The vast majority of people will get all of these questions wrong. This is because we are humans. Our brains are not great at understanding statistics with any kind of natural intuition; our gut feelings are based on our immediate experiences and these rarely match what is going on at a wider level.

Last week, the Ipsos Mori Social Research Institute released the results of a survey showing how well people in the UK can estimate statistics. The average guess of how many people per 100 are immigrants was 24, when in reality it is only 13. People think the UK has twice as many immigrants as it really does. We also think that one in six teenage girls give birth each year (it’s actually one in 33) and that 24% of working-age people are unemployed (actually only 7%).

It’s not just statistics – our brains are also not good with large numbers. One million seconds is just over 11 days, whereas a billion seconds is more than 31 years. It is hard to grasp the massive chasm between a million and a billion when they are used almost interchangeably in the media. If a sold-out West End theatre show had a millionaire in every seat, they would have the same net worth as one or two billionaires sitting alone in the front row.

This is before we have to start combining numbers. The £133bn given by the government to banks works out at about £2,000 per person living in the UK. A decent chunk of money each. But if there is some scandal and the government spends millions on something (for example, the alleged £7 million guarding Julian Assange), that’s only going to be around 10p per person wasted. The coverage and outrage never seems proportional to the actual amounts involved.

It is unfortunate that our gut estimates of the numbers behind politics are so routinely incorrect because people vote based on their gut reactions. But the numbers are out there. You can easily look up and find out what the true statistics are in a political debate. It is a shame so few people do.

There are many more numbers that hold our modern society together that most people have no idea about. All around us, there are number patterns that make modern technology work. Without these unseen numbers, everything from smartphones to digital television would stop working. Thankfully, it does not matter if people remain blissfully ignorant about what these numbers are, or what they are doing. But to sate your curiosity, here are some of them.

All around us, there are number patterns that make modern technology work. Here are some of them.

Bank cards

Photograph: Alamy

Take out a bank card and find the 16-digit number that appears on the front. Now, email that number to me, along with your date of birth and your mother’s maiden name. Alternatively, if you’re slightly more security-conscious, just write the 16 digits on a piece of paper that only you can see. Next, cross out the first digit and every alternate number; double each of these numbers and write the new digits above. If doubling a digit gives a two-digit answer, add those two digits together. If you then add the doubled numbers and the remaining eight numbers, I guarantee that the total will be a multiple of 10.

This pattern is applied deliberately to all bank card numbers so they are easy to spot. If you had blindly followed my instructions and emailed me your bank card number, and had done so at work, there’s a chance the email would not have left the building. In a large company, every now and then someone will fall for a phishing email and send off their – or a company – credit card number. As such, some companies scan every series of 16 digits in outgoing email traffic and look for this pattern to flag up possible bank card numbers.

Barcodes

Photograph: Leon Neal/AFP/Getty Images

A similar pattern appears in barcodes: you start with the second digit, not the first, then multiply every second digit by three (but don’t add the digits together) to get a multiple of 10. However, the purpose is not theft prevention, but rather error detection.

This is how a supermarket checkout can tell instantaneously if an item has been scanned correctly; it performs this calculation. If the answer is not a multiple of 10, it knows the barcode was incorrectly scanned and it does not add the item to your total. It would be very expensive to build lasers and electronics to ensure that barcodes are always scanned correctly; now, they only need to be good enough.

The patterns in bankcards and barcodes trace back to a 1960 patent for a ‘“computer for verifying numbers” by American inventor Hans Peter Luhn. Pre-dating portable electronic computers, this hand-held mechanical device could calculate these patterns using cogs. In the patent, Luhn explained why he added the extra step of multiplying every second digit. When numbers are copied out by hand, “it often happens that an error occurs by transposing two of the digits”. Because every second digit is multiplied, accidentally moving the digits around change the total.

The next time you are entering your bank card details online, you can test this by swapping two digits around. The website will instantly know you made a mistake. It hasn’t had to check with a bank somewhere to see if it is correct; it has simply performed that calculation. Swapping two adjacent digits means the answer is no longer a multiple of 10, so the site knows you haven’t entered a valid bank card number.

VAT numbers

Photograph: Alamy

These patterns are put into numbers by adding extra digits at the end, so-called “check digits”. In bank cards and barcodes, it is the final digit and the pattern is straightforward. But this is not always the case.

HMRC hid a check system into VAT numbers, which goes like this: multiply the first digit by eight, the second by seven, the third by six, all the way down to multiplying the seventh digit by two. Then, take the sum, add 55 to help obfuscate the process, add the final two digits as a two-digit number and the grand total will always be a multiple of 97. The idea was that no one would notice this pattern, but HMRC could use it to quickly identify anyone who included fake receipts in their tax return. However, it became public knowledge and is now on Wikipedia. That said, most people are still oblivious to the pattern, and fraudulent tax claims are easily spotted by HMRC’s forensic accountants.

Text messages



Photograph: Alamy

These methods merely detect mistakes, but text messages use the same patterns to actually correct errors. Before your phone sends a text message, it turns your message into numbers, puts those numbers in a grid and adds some extra check digits to include three different overlapping patterns in the digits. There is one pattern for the rows, one for the columns and a third for sections within the grid. Effectively, your phone turns your text message into a suduko.

If you have ever solved a sudoku, you have done some data error correction in your leisure time. If you are given a sudoku with loads of the numbers missing, you can calculate the missing numbers because of the mathematical patterns; you are filling in data that has gone missing. Your phone does the same thing if it receives an incomplete text message.

People send a text message on their phone without having any idea this is happening in the background; they assume it will arrive at the recipient’s phone, anywhere else on the planet, without any words getting lost. In reality, given the number of phone masts and systems your message has to go through, mistakes occur. But, thanks to the mathematical patterns, these mistakes can be fixed. It is an illusion that text messages work so well – there is just a lot of maths fixing the errors before the user even notices.



Digital TV

Photograph: Peter Mukherjee/Getty Images

Since the switchover to digital TV was completed in 2012, all the images seen on TVs in the UK have been sent as numbers. Each pixel is a list of three numbers, ranging from 0 to 255, which represent the amount of red, green and blue in that pixel’s colour. It is even possible to open the numbers from a digital image in a spreadsheet and recreate the colours using conditional formatting.

Because television signals are sent as numbers, extra check digits can be added and your TV can use error correction if it loses any signal. Gone are the days of fuzzy and static TV pictures: now your image stays crisp and clear even if a storm is blowing your antenna around. Unless, of course, your TV loses too much signal at once and, like you with a hyper-hard sudoku with insufficient clues, can’t calculate all the missing information. This is what happens when your screen goes all “blocky” – your TV is trying to guess what the picture should look like.

The modern error correction behind TV signals began one weekend in 1947. The mathematician Richard Hamming set one of the world’s first computers running on Friday night so it could complete some important calculations before Monday. But, almost as soon as he left it alone, the machine made a single mistake, rendering everything that followed useless. While preparing to break the bad news to his colleagues at Bell Labs on Monday morning, Hamming started thinking about how to avoid this problem in the future. By 1950, he had finished his seminal paper, Error Detecting and Error Correcting Codes, in which he outlined a way that computers could detect and fix their own mistakes.

Thanks to Luhn, Hamming and hundreds of mathematicians around the world today, most people remain blissfully unaware that they live in a sea of numbers.

• Matt Parker’s book, Things to Make and Do in the Fourth Dimension, is published by Particular Books. To buy for £14.44 (RRP £16.99) go to bookshop.theguardian.com or call 0330 333 6846.