Educerie
Level
Mocks: in the future, hold tight!

Educerie · IB Diploma · Computer Science

Theme A — Worked examples

Four examples. In this subject the marks are in the terminology, so read the answers for the words as much as for the ideas.


Example 1 — Denary to binary to hexadecimal

Convert the denary number 173 to 8-bit binary, then to hexadecimal.

Method 1 — repeated division by 2. Read the remainders upwards:

173 ÷ 2 = 86 r 1   ↑
 86 ÷ 2 = 43 r 0   |
 43 ÷ 2 = 21 r 1   |
 21 ÷ 2 = 10 r 1   |   read
 10 ÷ 2 =  5 r 0   |   this
  5 ÷ 2 =  2 r 1   |   way
  2 ÷ 2 =  1 r 0   |
  1 ÷ 2 =  0 r 1   |

Giving 10101101.

Method 2 — place values. Take the largest place value that fits and subtract:

128 64 32 16  8  4  2  1
  1  0  1  0  1  1  0  1     128 + 32 + 8 + 4 + 1 = 173 ✓

To hexadecimal, split into two nibbles of four bits:

1010 = 10 = A
1101 = 13 = D

173 = 10101101₂ = AD₁₆.

Use method 2 to check method 1, every time. Reading remainders downwards gives 10110101, which is 181 — a wrong answer that looks entirely plausible. Adding the place values back up catches it immediately.


Example 2 — Describing the fetch–decode–execute cycle

Describe the fetch–decode–execute cycle. [4]

The address of the next instruction is copied from the program counter (PC) into the memory address register (MAR). ✓ The instruction at that address is fetched from memory into the memory data register (MDR), and the PC is incremented to point at the following instruction. ✓ The control unit decodes the instruction to determine which operation is required. ✓ The ALU executes the instruction, with any result placed in the accumulator; the cycle then repeats. ✓

4/4.

Two things earn these marks and both are easy to drop. The order must be correct — a cycle described out of sequence is not the cycle. And the register names must be there: "the address goes to memory" describes the right event in the wrong vocabulary and scores nothing. Note also the PC increment, which candidates omit more often than any other step, and which is what makes it a cycle rather than a single instruction.


Example 3 — "Distinguish", written as a comparison

Distinguish between TCP and UDP. [3]

A weak answer that scores 1:

TCP is reliable and used for web pages. UDP is fast and used for video streaming.

A full answer:

TCP is connection-oriented, establishing a connection before sending, whereas UDP is connectionless and simply transmits. ✓ TCP guarantees delivery and ordering by acknowledging packets and retransmitting lost ones, whereas UDP provides no such guarantee. ✓ TCP therefore has greater overhead and higher latency, whereas UDP is faster, which is why UDP suits live streaming and TCP suits file transfer. ✓

3/3.

The weak answer contains true statements and almost no marks. "Reliable" and "fast" are conclusions; the scheme wants the mechanisms that produce them — acknowledgement, retransmission, connection setup, overhead. And distinguish requires the two set against each other, which is what "whereas" does.


Example 4 — Explaining overfitting

A machine learning model achieves 99 % accuracy on its training data but only 62 % on the test data. Explain what has happened and suggest one way to address it. [4]

The model has overfitted the training data. ✓ It has learned the noise and specific detail of the training examples rather than the underlying general pattern, so it effectively memorises rather than generalises. ✓ When shown the unseen test data it cannot apply what it learned, so accuracy falls sharply. ✓ This could be addressed by training on a larger and more varied dataset, by simplifying the model to reduce its capacity to memorise, or by using cross-validation to detect the problem earlier. ✓

4/4.

Note what the gap between the two figures is telling you. A model performing badly on both sets is underfitting — too simple to capture the pattern. Excellent on training and poor on test is the signature of overfitting, and naming which one it is, from the numbers, is the first mark. An answer that says only "the model is inaccurate" has missed that the training accuracy is the diagnostic clue.


Educerie · original worked examples written against the published IB syllabus structure for Computer Science Theme A, first assessment 2027. All scenarios and values are our own. Last reviewed 5 September 2026.