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


information=data+interpretation\text{information} = \text{data} + \text{interpretation}


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


A byte 01000001 at the top with arrows to three boxes that read it as the integer 65, the letter A and a dark grey pixel.


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 nn bits


N=2nN = 2^{n}


where NN 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 kk items its own code, choose the smallest nn with 2n≥k2^n \ge 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 nn bits there are 2n2^n patterns; kk items need the smallest nn with 2n≥k2^n \ge 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:


01001000011010010010000101001000 \quad 01101001 \quad 00100001


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

Match each term about how computers store and interpret values with the description that fits it best. Each description is used exactly once.

Match each term
A.

Values that describe other stored values, such as a file type or a column unit

B.

Meaning obtained when stored values are read with a known rule and context

C.

Raw stored values, such as bits and bytes, before any rule gives them meaning

D.

A single binary digit, 0 or 1, the smallest unit a computer stores

E.

A character code that pairs the numbers 0 to 127 with letters, digits and symbols

Bit

ASCII

Data

Information

Metadata

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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 .

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice