Relation Between Information and Data
Data Interpretation
Every file, message and variable inside a computer is stored as bits, long rows of 0s and 1s. A row of bits on its own does not say whether it is a number, a letter, a colour or part of a song. This lesson shows how stored bits become meaningful only when a program reads them with a rule, and why the same bits can mean different things in different contexts.
Data and information
Data is the raw values a computer stores and moves: bits, bytes and the symbols built from them. Information is the meaning a person or program gets when it reads data using a known rule and context. You can summarise the relationship as
Example: The characters 23 in a weather log are data. Once you know the column means temperature in degrees Celsius at noon, the same characters become information you can act on, such as deciding not to wear a coat.
The rule for reading data often travels with it as metadata: a file header, a file extension, a column heading or the declared type of a variable in a program. Without that context, even simple data is ambiguous. The text 07/04 is July 4 to a reader in the United States and April 7 to a reader in the United Kingdom.
One byte, many meanings
A byte is 8 bits. Consider the byte 01000001 and three rules a program might apply to it. The second rule uses ASCII, a character code that pairs numbers with characters.
Interpretation rule | How the bits are read | Meaning of 01000001 |
|---|---|---|
Unsigned integer | Add the place values of the 1 bits | 64 + 1 = 65 |
ASCII character | Look up the number in the character table | the capital letter A |
Greyscale pixel | 0 is black and 255 is white | dark grey, 65/255 ≈ 25.5% of full brightness |
All three readings are correct under their own rule. The computer does not "know" which one is intended; the bits themselves do not record which rule to use. The program that wrote the data and the program that reads it must agree on the rule.
How many things can n bits tell apart?
The interpretation rule decides what each pattern means. The number of bits decides how many different patterns exist to give meanings to. Each extra bit doubles the count, so with n bits
where N is the number of distinct patterns. A byte has 28 = 256 patterns, which is why a greyscale byte runs from 0 to 255 and why one byte can hold any of the 128 ASCII codes.
To give each of k items its own code, choose the smallest n with 2n≥k.
Example: To code the 26 lowercase letters, 4 bits give only 16 patterns, which is too few. Five bits give 32 patterns, which is enough, with 6 patterns left unused.
What to remember
- Data is stored values; information is data read with a rule and context.
- The same bits can be a number, a character or a colour; the bits do not say which.
- The rule comes from context: file formats and headers, extensions, variable types and labels.
- With n bits there are 2n patterns; k items need the smallest n with 2n≥k.
Example: Reading three bytes from an unlabelled file
A classmate sends you a file with no extension and no header. Inside are exactly three bytes:
Use this excerpt of the ASCII table where you need it.
Code | Character | Code | Character |
|---|---|---|---|
33 | ! | 72 | H |
63 | ? | 73 | I |
104 | h | 105 | i |
a) Interpret each byte as an unsigned integer.
The place values of a byte, from left to right, are 128, 64, 32, 16, 8, 4, 2 and 1. Add the place values wherever the bit is 1.
In 01001000 the 1 bits are worth 64 and 8, which add to 72.
In 01101001 the 1 bits are worth 64, ________, 8 and 1. Adding the four place values gives 105.
In 00100001 the 1 bits are worth 32 and 1, which add to 33.
As unsigned integers, the three bytes are 72, 105 and 33.
b) Interpret the bytes as ASCII text.
Use the unsigned values from part a) as character codes and look each one up in the table.
Code 72 is the capital letter ________.
Code 105 is the lowercase letter ________; the capital I is code 73, so case matters here.
Code 33 is the exclamation mark.
Read as ASCII, the file holds the text Hi! (three characters).
c) Suppose a drawing program instead reads the bytes as three greyscale pixels, where 0 is black and 255 is white. Find each pixel's brightness as a percentage of white, to one decimal place.
The largest value a byte can hold is ________, and that value means full white, so brightness is the stored value divided by 255, times 100%.
For the first pixel, 72 ÷ 255 = ________, which is 28.2%.
For the second pixel, 105 ÷ 255 = 0.412, which is 41.2%.
For the third pixel, 33 ÷ 255 = ________, which is 12.9%.
Read as greyscale pixels, the bytes are 28.2%, 41.2% and 12.9% of full brightness: three dark-to-medium greys.
d) Your classmate tells you the file is a short text message. Which interpretation gives the intended information, and what role does the classmate's statement play?
The bits never changed in parts a) to c); only the rule did. Each byte has 28 = ________ possible patterns, and every rule simply assigns a meaning to whichever pattern is present, so all three readings are valid under their own rules.
The classmate's statement supplies the context the file was missing. It works like metadata: it names the rule to apply. With that context, the ASCII reading from part b) is the intended information, and the file says Hi!.
Two school dashboards display electricity-use values of 240 and 180. Before comparing them, you investigate what each number describes. Complete each sentence using a different phrase from this list: units, time period, population.
Determining whether a value is measured in kilowatt-hours or megajoules establishes its .
Determining whether a value covers one day or one week establishes its .
Determining whether a value covers all school buildings or only classrooms establishes its .
A student opens a photo file named beach.jpg in a plain text editor. The screen fills with a jumble of unusual symbols and a few scattered letters. The same file still opens normally in a photo viewer afterwards. Which explanation is best?