Edexcel IGCSE · Thinka-original Practice Paper

2025 Edexcel IGCSE Computer Science Practice Paper with Answers

Thinka Jun 2025 Cambridge International A Level-Style Mock — Computer Science

80 marks120 mins2025
An original Thinka practice paper modelled on the structure and difficulty of the Jun 2025 Cambridge International A Level Computer Science paper. Not affiliated with or reproduced from Cambridge.

Section Principles of Computer Science

Answer all questions. Write your answers in the spaces provided. You must not use a calculator. You may use the provided Pseudocode Command Set.
38 Question · 88 marks
Question 1 · multiple-choice
1 marks
Which of the following statements correctly describes a characteristic of a star network topology compared to a bus network topology?
  1. A.If the central switch fails, only the node connected directly to it will lose network access.
  2. B.It requires less cabling to install, making it much cheaper to implement in large buildings.
  3. C.If a single cable connecting a workstation to the central switch is damaged, other workstations can still communicate.
  4. D.It does not require a central device such as a hub or switch to route traffic between computers.
Show answer & marking scheme

Worked solution

In a star network topology, each workstation is connected via its own cable to a central switch/hub. If one workstation's cable is damaged, only that workstation is disconnected, while the rest of the network continues to function normally. In contrast, in a bus network, a break in the main cable can disable the entire network.

Marking scheme

Award 1 mark for the correct answer (c). Reject any other options.
Question 2 · multiple-choice
1 marks
An attacker intercepts data packets as they travel across an unencrypted wireless network to capture sensitive details such as passwords. Which of the following security threats describes this activity?
  1. A.Phishing
  2. B.Denial of Service (DoS)
  3. C.Eavesdropping / Packet sniffing
  4. D.SQL Injection
Show answer & marking scheme

Worked solution

Eavesdropping (or packet sniffing) involves capturing and analyzing network packets as they transit across a network. Phishing involves deceptive emails/websites; DoS is a Denial of Service attack to crash a system; SQL Injection target databases via inputs.

Marking scheme

Award 1 mark for identifying the threat as eavesdropping/packet sniffing (c). Reject all other options.
Question 3 · multiple-choice
1 marks
A computer performs a logical shift left by 2 places on the 8-bit binary pattern \(00111010\). What is the resulting 8-bit binary pattern?
  1. A.\(11101000\)
  2. B.\(00001110\)
  3. C.\(11101011\)
  4. D.\(11101010\)
Show answer & marking scheme

Worked solution

Shifting \(00111010\) left by 1 place results in \(01110100\). Shifting left by a second place results in \(11101000\). Vacuum positions on the right are filled with 0s.

Marking scheme

Award 1 mark for the correct binary pattern (a). Reject other choices.
Question 4 · multiple-choice
1 marks
During the Fetch-Decode-Execute cycle, which CPU register is responsible for holding the memory address of the next instruction to be fetched?
  1. A.Memory Data Register (MDR)
  2. B.Accumulator (ACC)
  3. C.Program Counter (PC)
  4. D.Memory Address Register (MAR)
Show answer & marking scheme

Worked solution

The Program Counter (PC) keeps track of the memory address of the next instruction to be fetched. The MAR holds the address of the current memory location being accessed; the MDR holds the actual data; and the Accumulator stores the results of calculations.

Marking scheme

Award 1 mark for identifying the Program Counter (c). Reject other options.
Question 5 · multiple-choice
1 marks
Run-Length Encoding (RLE) is a lossless compression technique. Which of the following raw data sequences would achieve the highest compression ratio using RLE?
  1. A.\(A B C D A B C D A B C D\)
  2. B.\(A A A A A A B B B B C C\)
  3. C.\(A B B C C C D D D D E E\)
  4. D.\(A B A B A B A B A B A B\)
Show answer & marking scheme

Worked solution

Run-length encoding works by replacing consecutive repeated data values with a single value and a count. Sequence B (\(AAAAAABBBBCC\)) has long consecutive runs (6 A's, 4 B's, 2 C's) which can be represented compactly as 6A4B2C. The other sequences have frequent character changes, which do not compress as efficiently.

Marking scheme

Award 1 mark for selecting the correct sequence (b). Reject others.
Question 6 · multiple-choice
1 marks
An engineer passes inputs \(A\) and \(B\) through an XOR gate, then passes the output of that gate directly through a NOT gate. Which single logic gate produces the same final output?
  1. A.XNOR
  2. B.NAND
  3. C.NOR
  4. D.AND
Show answer & marking scheme

Worked solution

The combination of an Exclusive-OR (XOR) gate followed by a NOT gate is equivalent to an Exclusive-NOR (XNOR) gate, which outputs 1 when both inputs are equal and 0 when they are different.

Marking scheme

Award 1 mark for the XNOR gate (a). Reject other options.
Question 7 · Short Answer
2 marks
Perform a logical right shift of 2 places on the 8-bit binary pattern 11001000. Give the result as an 8-bit binary pattern.
Show answer & marking scheme

Worked solution

A logical right shift moves all bits to the right by the specified number of places. Shifting 11001000 right by 1 place gives 01100100. Shifting right by a second place gives 00110010. The empty positions on the left are filled with 0s.

Marking scheme

1 mark for shifting the bits to the right with 0s padded on the left. 1 mark for the correct final pattern: 00110010.
Question 8 · Short Answer
2 marks
State two advantages of using lossy compression instead of lossless compression for storing images on a smartphone.
Show answer & marking scheme

Worked solution

Lossy compression permanently discards unnecessary data, resulting in a much larger reduction in file size compared to lossless compression. This allows more images to be stored on the device and enables faster transmission of files over mobile networks.

Marking scheme

1 mark for stating that lossy compression produces significantly smaller file sizes (saving storage space). 1 mark for stating that it allows for faster upload, download, or sharing times.
Question 9 · Short Answer
2 marks
Explain how a firewall protects a local area network (LAN) from unauthorized access.
Show answer & marking scheme

Worked solution

A firewall acts as a barrier between a trusted local network and untrusted external networks. It inspects all incoming and outgoing data packets and blocks or permits them based on configured security criteria.

Marking scheme

1 mark for explaining that it inspects/monitors incoming and/or outgoing network traffic. 1 mark for explaining that it blocks packets that do not meet pre-defined security rules.
Question 10 · Short Answer
2 marks
State the purpose of the Program Counter (PC) in the Von Neumann CPU architecture.
Show answer & marking scheme

Worked solution

The Program Counter (PC) is a CPU register that tracks instruction execution. It holds the address of the next instruction in memory, and once that instruction is fetched, the PC is updated to point to the following instruction.

Marking scheme

1 mark for stating it holds the address of the next instruction to be fetched. 1 mark for stating that it increments or updates to point to the next instruction in sequence.
Question 11 · Short Answer
2 marks
An expression is written as: \(Q = \text{NOT } (A \text{ AND } B)\). Give the output states of \(Q\) for the input combinations of \(A\) and \(B\) starting from inputs \(A=0, B=0\) to \(A=1, B=1\) in standard binary order.
Show answer & marking scheme

Worked solution

This is a NAND operation. For inputs (0,0), (0,1), and (1,0), the output of the AND gate is 0, so the NOT gate changes it to 1. For inputs (1,1), the output of the AND gate is 1, so the NOT gate changes it to 0. Thus, the sequence of outputs is 1, 1, 1, 0.

Marking scheme

1 mark for identifying at least two correct outputs in the sequence. 1 mark for providing the fully correct sequence: 1, 1, 1, 0.
Question 12 · Short Answer
2 marks
State two environmental issues associated with the disposal of old computer hardware in landfills.
Show answer & marking scheme

Worked solution

Electronic waste contains hazardous heavy metals like lead, mercury, and cadmium. In landfills, these can seep into ground soil and contaminate local water supplies. Additionally, throwing away devices wastes scarce raw materials that could otherwise be reclaimed.

Marking scheme

1 mark for describing the release of toxic substances/heavy metals into the ground/water. 1 mark for describing the waste of finite raw materials or land space issues.
Question 13 · Short Answer
2 marks
Explain the relationship between the sample rate of an analogue audio signal and the final file size of the digital recording.
Show answer & marking scheme

Worked solution

The sample rate defines how many times the amplitude of the analogue wave is measured per second. Raising the sample rate means more data points are recorded each second, directly increasing the total storage size of the resulting audio file.

Marking scheme

1 mark for explaining that a higher sample rate means more samples/measurements are taken per second. 1 mark for linking this directly to producing more data and thus a larger overall file size.
Question 14 · Short Answer
2 marks
State the main difference between symmetric encryption and asymmetric encryption.
Show answer & marking scheme

Worked solution

Symmetric encryption relies on a single shared key that both sender and receiver must keep secret. Asymmetric encryption uses a mathematically linked pair of keys: a public key that can be shared with anyone to encrypt data, and a private key kept secret by the owner to decrypt it.

Marking scheme

1 mark for stating that symmetric encryption uses one single key for both processes. 1 mark for stating that asymmetric encryption uses two different keys (a public key and a private key).
Question 15 · Short Recall & Calculations
2 marks
Perform a logical shift right of two places on the 8-bit binary pattern 11011000. State the resulting 8-bit binary pattern and state the mathematical effect of this shift.
Show answer & marking scheme

Worked solution

1. Performing a logical shift right of two places on 11011000 shifts all bits two positions to the right, filling the vacant spaces on the left with 0s. This results in: 00110110. 2. Shifting right by two places is mathematically equivalent to dividing the binary integer value by 4 (integer division, discarding any remainder).

Marking scheme

1 mark for the correct 8-bit binary pattern: 00110110. 1 mark for identifying the mathematical effect: division by 4 (accept integer division by 4).
Question 16 · Short Recall & Calculations
2 marks
A file of size 1.5 megabytes (MB) is to be transmitted over a network with a transfer speed of 12 megabits per second (Mbps). Calculate the transmission time in seconds. Show your working.
Show answer & marking scheme

Worked solution

Convert 1.5 megabytes (MB) to megabits (Mb): \(1.5 \times 8 = 12\) Mb. Calculate the transmission time: \(\text{Time} = \frac{\text{Size}}{\text{Speed}} = \frac{12\text{ Mb}}{12\text{ Mbps}} = 1.0\) second.

Marking scheme

1 mark for converting megabytes to megabits (12 Mb) or setting up the correct division. 1 mark for the correct final answer of 1 second.
Question 17 · Short Recall & Calculations
2 marks
State two advantages of representing an image as a vector graphic rather than a bitmap image.
Show answer & marking scheme

Worked solution

1. Vector graphics are mathematically defined, meaning they can be scaled/resized infinitely without losing quality or becoming pixelated. 2. Vector files typically have smaller file sizes than high-resolution bitmaps for simple geometric drawings because they only store instructions/formulas rather than individual pixel values.

Marking scheme

1 mark for identifying scalability/no loss of quality when resized. 1 mark for identifying smaller file size (for simple/geometric images).
Question 18 · Short Recall & Calculations
2 marks
A sequence of characters is represented as: AAAAABBBCCCCCCDD. Show how this sequence would be compressed using Run-Length Encoding (RLE) and calculate the percentage reduction in the number of characters.
Show answer & marking scheme

Worked solution

1. Run-Length Encoding counts consecutive identical characters. AAAAABBBCCCCCCDD becomes 5A3B6C2D. 2. Original character count is 16. Compressed character count is 8. Percentage reduction = \(((16 - 8) / 16) \times 100 = 50\%\).

Marking scheme

1 mark for the correct compressed RLE string: 5A3B6C2D (accept alternative formats like A5B3C6D2). 1 mark for the correct calculation of 50% reduction.
Question 19 · Short Recall & Calculations
2 marks
Consider the Boolean expression: Q = NOT (A AND B) OR C. Calculate the value of Q when A = 1, B = 1, and C = 0. Show your working.
Show answer & marking scheme

Worked solution

Evaluate the expression step-by-step: 1. \(A \text{ AND } B\) becomes \(1 \text{ AND } 1 = 1\). 2. \(\text{NOT}(1) = 0\). 3. \(0 \text{ OR } C\) becomes \(0 \text{ OR } 0 = 0\). Thus, \(Q = 0\).

Marking scheme

1 mark for correct intermediate evaluation (e.g., evaluating NOT (A AND B) as 0, or demonstrating step-by-step logic). 1 mark for the correct final output of 0 (or False).
Question 20 · Short Recall & Calculations
2 marks
Explain the role of the Program Counter (PC) register during the fetch stage of the Fetch-Decode-Execute cycle.
Show answer & marking scheme

Worked solution

The Program Counter (PC) stores the memory address of the next instruction to be fetched from RAM. During the fetch stage, this address is passed to the Memory Address Register (MAR) to retrieve the instruction, and the PC is then incremented by 1 to point to the next instruction in sequence.

Marking scheme

1 mark for stating that the PC holds the memory address of the next instruction to be fetched. 1 mark for stating that the PC is incremented (by 1) to point to the next instruction.
Question 21 · Short Recall & Calculations
2 marks
Describe the difference between an active network attack and a passive network attack.
Show answer & marking scheme

Worked solution

An active attack involves the attacker interacting with, modifying, or deleting data or system resources (e.g., malware or denial-of-service). A passive attack involves intercepting, monitoring, or eavesdropping on transmitted data without altering any of the system resources (e.g., packet sniffing).

Marking scheme

1 mark for explaining active attacks (involves altering/interfering with data or systems). 1 mark for explaining passive attacks (involves eavesdropping/intercepting traffic without alteration).
Question 22 · Short Recall & Calculations
2 marks
Explain why asymmetric encryption is considered more secure for transmitting data over the internet than symmetric encryption.
Show answer & marking scheme

Worked solution

Asymmetric encryption uses two mathematically linked keys: a public key for encryption and a private key for decryption. Because the private key never needs to be shared or transmitted over the internet, there is no risk of it being intercepted. In contrast, symmetric encryption uses a single shared key that must be exchanged between parties, creating a potential point of interception.

Marking scheme

1 mark for explaining that in asymmetric encryption, the decryption key (private key) does not need to be transmitted or shared. 1 mark for contrasting this with symmetric encryption where the shared key must be transmitted, exposing it to interception risk.
Question 23 · Short Recall & Calculations
2 marks
Convert the denary number 109 into an 8-bit binary number. Show your working.
Show answer & marking scheme

Worked solution

To convert 109 to 8-bit binary, find the place values that sum to 109:
\(109 = 64 + 32 + 8 + 4 + 1\)
Placing 1s under these values in an 8-bit table (128, 64, 32, 16, 8, 4, 2, 1) gives:
- 128: 0
- 64: 1
- 32: 1
- 16: 0
- 8: 1
- 4: 1
- 2: 0
- 1: 1
Result: \(01101101\)

Marking scheme

Award 1 mark for showing correct working (e.g., decomposing the number as \(64 + 32 + 8 + 4 + 1\) or demonstrating successive division by 2 with remainders).
Award 1 mark for the correct 8-bit binary value: 01101101.
Question 24 · Short Recall & Calculations
2 marks
An uncompressed image has a resolution of \(400 \times 300\) pixels. It uses a colour depth of 8 bits per pixel. Calculate the file size of the image in kilobytes (KB). Show your working. (Note: \(1\text{ KB} = 1000\text{ bytes}\))
Show answer & marking scheme

Worked solution

1. Calculate total number of pixels: \(400 \times 300 = 120,000\) pixels.
2. Since the colour depth is 8 bits (which equals 1 byte), the file size in bytes is: \(120,000 \times 1\text{ byte} = 120,000\text{ bytes}\).
3. Convert bytes to kilobytes (KB) by dividing by 1000: \(120,000 / 1000 = 120\text{ KB}\).

Marking scheme

Award 1 mark for showing correct working (e.g., calculating 120,000 bytes, or writing the formula \(\frac{400 \times 300 \times 8}{8 \times 1000}\)).
Award 1 mark for the correct final numerical answer: 120 (KB is already specified in the question).
Question 25 · Short Recall & Calculations
2 marks
A file with a size of 15 megabytes (MB) is to be downloaded over a network with a stable transmission speed of 24 megabits per second (Mbps). Calculate the time, in seconds, required to complete this download. Show your working.
Show answer & marking scheme

Worked solution

1. Convert the file size from megabytes to megabits: \(15\text{ MB} \times 8 = 120\text{ megabits (Mb)}\).
2. Calculate the download time: \(\text{Time} = \frac{\text{File size in Mb}}{\text{Transmission speed in Mbps}} = \frac{120}{24} = 5\text{ seconds}\).

Marking scheme

Award 1 mark for showing the conversion of MB to megabits (e.g., \(15 \times 8 = 120\)), or demonstrating a mathematically equivalent expression like \(\frac{15 \times 8}{24}\).
Award 1 mark for the correct final answer of 5 (seconds).
Question 26 · Short Recall & Calculations
2 marks
Consider a logic circuit where the output \(Q\) is defined by the Boolean expression:
\(Q = (\text{NOT } A) \text{ AND } (B \text{ OR } C)\)

Determine the value of \(Q\) when \(A = 0\), \(B = 0\), and \(C = 1\). State the output of each sub-expression as part of your working.
Show answer & marking scheme

Worked solution

1. Evaluate the first sub-expression: \(\text{NOT } A = \text{NOT } 0 = 1\).
2. Evaluate the second sub-expression: \(B \text{ OR } C = 0 \text{ OR } 1 = 1\).
3. Evaluate the final expression: \(Q = 1 \text{ AND } 1 = 1\) (or True).

Marking scheme

Award 1 mark for correctly evaluating both intermediate sub-expressions (\(\text{NOT } A = 1\) AND \(B \text{ OR } C = 1\)).
Award 1 mark for the correct final output value of 1 (accept 'True').
Question 27 · Short Recall & Calculations
2 marks
Explain the difference between the roles of the Program Counter (PC) and the Memory Address Register (MAR) during the fetch stage of the Fetch-Decode-Execute cycle.
Show answer & marking scheme

Worked solution

During the fetch stage, the CPU needs to retrieve the next instruction from memory. The Program Counter (PC) keeps track of the sequence of execution by holding the memory address of the next instruction. This address is then copied to the Memory Address Register (MAR), which physically interfaces with the address bus to locate and read the instruction from RAM.

Marking scheme

Award 1 mark for describing the role of the Program Counter (e.g., it stores/holds the address of the next instruction to be fetched).
Award 1 mark for describing the role of the Memory Address Register (e.g., it holds the address of the specific location in memory currently being accessed/read).
Question 28 · Short Recall & Calculations
2 marks
Explain one environmental benefit of virtualisation in large-scale data centres.
Show answer & marking scheme

Worked solution

Virtualisation allows a single physical server to host multiple virtual machines (VMs) running separate operating systems and services. This drastically increases the utilisation rate of hardware, meaning fewer physical servers need to be manufactured, powered, and cooled. Consequently, the data centre consumes much less electrical power and produces less electronic waste (e-waste) over time.

Marking scheme

Award 1 mark for identifying that virtualisation reduces the need for physical hardware/servers by consolidatng them onto fewer machines.
Award 1 mark for connecting this reduction to a clear environmental benefit (e.g., lower power consumption for running/cooling hardware, or reduced carbon emissions/e-waste).
Question 29 · Medium Explanatory & Interpretive Tasks
3 marks
Explain how a packet-filtering firewall determines whether to allow or block incoming network traffic.
Show answer & marking scheme

Worked solution

A packet-filtering firewall works by analyzing packet headers (IP, ports, protocols). It compares these headers to access control lists (rules). Finally, it allows or drops the packet.

Marking scheme

1 mark for identifying that it inspects/analyzes packet headers (containing IP addresses or port numbers). 1 mark for explaining that it compares this information against a pre-defined set of rules / access control list (ACL). 1 mark for stating that it either permits (forwards) or blocks (drops) the packet based on the outcome of the rule comparison.
Question 30 · Medium Explanatory & Interpretive Tasks
3 marks
A programmer has a list of names that is unsorted. Explain why a binary search algorithm cannot be used to find a target name in this list, and what must be done first if they wish to use it.
Show answer & marking scheme

Worked solution

A binary search works by comparing the middle element and deciding whether to search the left or right sub-list. This decision is based on order (e.g. alphabetical or numerical). If the list is unsorted, this logical elimination is impossible. The programmer must first sort the list using a sorting algorithm.

Marking scheme

1 mark for explaining that binary search works by comparing the target with the midpoint and discarding half the items. 1 mark for stating that if the list is unsorted, the comparison cannot determine which half of the list contains the target (rendering the elimination step useless). 1 mark for stating that the list must first be sorted (e.g., using a merge or bubble sort) before the binary search can be applied.
Question 31 · Medium Explanatory & Interpretive Tasks
3 marks
Explain the relationship between the Program Counter (PC) and the Memory Address Register (MAR) during the fetch stage of the instruction cycle.
Show answer & marking scheme

Worked solution

During fetch, the PC holds the memory location of the current instruction. It sends this address to the MAR. Once copied, the PC increments by 1.

Marking scheme

1 mark for stating that the PC holds the address of the next instruction to be executed. 1 mark for stating that this address is copied/transferred to the MAR (so the bus can retrieve the instruction). 1 mark for explaining that the PC is then incremented (by one/to point to the next instruction) so it is ready for the next cycle.
Question 32 · Medium Explanatory & Interpretive Tasks
3 marks
Run-Length Encoding (RLE) is a form of lossless data compression. Explain one scenario where RLE would be highly effective at reducing file size, and one scenario where it would be ineffective or could even increase file size.
Show answer & marking scheme

Worked solution

RLE compresses consecutive identical elements. Large uniform areas compress well; highly diverse non-repeating data compresses poorly.

Marking scheme

1 mark for explaining that RLE is effective with data containing long sequences of repeating/identical values (e.g., simple icons, black-and-white images). 1 mark for explaining that RLE is ineffective when adjacent data values rarely repeat (e.g., natural photographs, complex texts). 1 mark for explaining that in the ineffective scenario, storing the frequency count alongside every single unique byte/character would actually increase the total file size (or cause data expansion).
Question 33 · Medium Explanatory & Interpretive Tasks
3 marks
The growth of cloud storage has led to an increase in the number of large-scale data centres globally. Explain two environmental concerns associated with the operation of these data centres.
Show answer & marking scheme

Worked solution

Data centres require massive power for computation and cooling, and generate significant electronic waste when upgraded.

Marking scheme

1 mark for identifying one valid environmental concern (e.g., high electricity consumption, water usage for cooling, or carbon emissions from fossil-fuel-powered grids). 1 mark for explaining the impact of this concern (e.g., high power use leads to increased carbon footprint/global warming, or heavy water usage depletes local reservoirs). 1 mark for identifying/explaining a second distinct concern (e.g., electronic waste / e-waste generated when servers are frequently upgraded/replaced, which may contain toxic chemicals that pollute landfills).
Question 34 · Medium Explanatory & Interpretive Tasks
3 marks
Explain the difference between the behavior of a 2-input OR gate and a 2-input XOR (Exclusive OR) gate. Your explanation must refer to their respective truth outputs for all possible input combinations.
Show answer & marking scheme

Worked solution

For inputs (0,0), both give 0. For inputs (1,0) or (0,1), both give 1. For inputs (1,1), OR gives 1 and XOR gives 0.

Marking scheme

1 mark for stating that both gates output 0 when both inputs are 0 (or that both output 1 when only one input is 1). 1 mark for stating that the OR gate outputs 1 when both inputs are 1. 1 mark for stating that the XOR gate outputs 0 when both inputs are 1.
Question 35 · Complex Expression or Diagram construction
4 marks
A logic circuit has three inputs: A, B, and C.
The circuit behaves as follows:
- Input A and Input B are combined using an AND gate.
- Input B is inverted using a NOT gate, and the result is combined with Input C using an AND gate.
- The outputs of both AND gates are combined using an OR gate to produce the final output Q.

(a) Construct the Boolean expression for the output Q.
(b) Calculate the output state (0 or 1) of Q when the inputs are A = 1, B = 0, C = 1. Show your working.
Show answer & marking scheme

Worked solution

(a)
- First part: Input A and Input B combined with AND gives: \(A \text{ AND } B\).
- Second part: Input B is inverted with NOT (\(\text{NOT } B\)) and combined with C using AND gives: \((\text{NOT } B) \text{ AND } C\).
- Third part: Both intermediate outputs are combined with OR, resulting in: \(Q = (A \text{ AND } B) \text{ OR } (\text{NOT } B \text{ AND } C)\).

(b) Substituting the values A = 1, B = 0, C = 1 into the expression:
- \(A \text{ AND } B = 1 \text{ AND } 0 = 0\)
- \(\text{NOT } B = \text{NOT } 0 = 1\)
- \(\text{NOT } B \text{ AND } C = 1 \text{ AND } 1 = 1\)
- \(Q = 0 \text{ OR } 1 = 1\)

Marking scheme

Award up to 4 marks:
- 1 mark for the correct first term: \(A \text{ AND } B\) (accept equivalent notation like \(A \cdot B\)).
- 1 mark for the correct second term: \(\text{NOT } B \text{ AND } C\) (accept equivalent notation like \(\bar{B} \cdot C\)).
- 1 mark for combining both terms correctly with an OR operator to form the complete expression for Q.
- 1 mark for the correct final output of 1 with supporting substitution working.
Question 36 · Complex Expression or Diagram construction
4 marks
A Huffman tree is constructed for a dataset using the following rules:
- Left branches represent '0' and right branches represent '1'.
- To build the tree:
1. Combine 'C' (frequency 3) and 'D' (frequency 3) into a parent node 'CD'. Place 'C' on the left branch (0) and 'D' on the right branch (1).
2. Combine 'CD' (frequency 6) and 'B' (frequency 6) into a parent node 'CDB'. Place 'CD' on the left branch (0) and 'B' on the right branch (1).
3. Combine 'A' (frequency 12) and 'CDB' (frequency 12) into the root node. Place 'A' on the left branch (0) and 'CDB' on the right branch (1).

(a) Construct the unique Huffman codes for each of the four characters: A, B, C, and D.
(b) Calculate the total number of bits needed to encode the message 'AABBCD' using these codes. Show your working.
Show answer & marking scheme

Worked solution

(a) Following the rules of the tree construction:
- 'A' is on the left branch from the root: Code = 0 (1 bit)
- To reach 'B': Root -> right (1) -> right (1): Code = 11 (2 bits)
- To reach 'C': Root -> right (1) -> left (0) -> left (0): Code = 100 (3 bits)
- To reach 'D': Root -> right (1) -> left (0) -> right (1): Code = 101 (3 bits)

(b) To encode the message 'AABBCD':
- 'A' occurs 2 times: \(2 \times 1 \text{ bit} = 2 \text{ bits}\)
- 'B' occurs 2 times: \(2 \times 2 \text{ bits} = 4 \text{ bits}\)
- 'C' occurs 1 time: \(1 \times 3 \text{ bits} = 3 \text{ bits}\)
- 'D' occurs 1 time: \(1 \times 3 \text{ bits} = 3 \text{ bits}\)
Total bits = \(2 + 4 + 3 + 3 = 12 \text{ bits}\).

Marking scheme

Award up to 4 marks:
- 1 mark for correctly identifying the codes for 'A' (0) and 'B' (11).
- 1 mark for correctly identifying the codes for 'C' (100) and 'D' (101).
- 1 mark for showing correct working for the bit calculation of the message 'AABBCD' (multiplying frequencies by code lengths).
- 1 mark for the correct total of 12 bits.
Question 37 · 6-Mark Extended Response
6 marks
A secondary school is planning to replace 30 of its old desktop computers with newer, more powerful models to support advanced programming classes.

Discuss the environmental and ethical issues associated with the disposal of these old computers.

In your answer, you should suggest ways the school can minimize these impacts.
Show answer & marking scheme

Worked solution

To achieve 5-6 marks, the candidate must produce a well-structured response that covers environmental issues, ethical issues, and realistic ways to minimize these impacts, linking them to the context of the school.

**Example Answer:**
Replacing 30 computers creates significant environmental and ethical challenges. Environmentally, if the school sends these computers to a landfill, toxic chemicals such as lead and mercury can leach into local ecosystems, poisoning soil and water. This also contributes to the rising global volume of e-waste. Ethically, exporting this waste to developing nations often exposes vulnerable workers to health hazards during unsafe salvage processes. Furthermore, discarding functioning machines worsens the digital divide, as poorer communities are deprived of technology.

To minimize this impact, the school should first consider if upgrading components, such as RAM or storage, would make the current machines usable. If they must be replaced, the school can donate them to local charities or lower-income schools to bridge the digital divide. Finally, any completely unusable machines should be sent to a certified e-waste recycler that guarantees safe extraction of materials, rather than dumping them.

Marking scheme

**Level 1 (1–2 marks):**
* The response identifies basic environmental or ethical issues (e.g., "landfills get full" or "it is bad for the environment").
* Suggests simple ways to minimize impact with little or no explanation.
* The response lacks structure and computer science terminology is used loosely.

**Level 2 (3–4 marks):**
* The response explains some environmental and/or ethical issues, showing an understanding of e-waste or recycling risks.
* Suggests practical ways to minimize impact (e.g., donating, recycling safely).
* The response is mostly structured, and some computer science terminology is used appropriately.

**Level 3 (5–6 marks):**
* The response provides a balanced and detailed discussion of both environmental and ethical issues.
* Offers a range of realistic solutions tailored to a school scenario (e.g., donation, upgrade, certified recycling).
* The response is well-structured, coherent, and uses precise terminology throughout.
Question 38 · 6-Mark Extended Response
6 marks
A software developer needs to sort a large list containing 1,000,000 customer names in alphabetical order.

Discuss whether the developer should choose a bubble sort or a merge sort algorithm for this task.

Your discussion should compare the two algorithms in terms of time efficiency, space efficiency, and suitability for this dataset.
Show answer & marking scheme

Worked solution

To achieve 5-6 marks, the candidate must compare both algorithms across all three aspects (time, space, and dataset suitability) and provide a justified final recommendation.

**Example Answer:**
The developer should definitely choose merge sort over bubble sort. In terms of time efficiency, bubble sort has an average and worst-case time complexity of \( O(n^2) \). For 1,000,000 names, this would take hundreds of billions of operations, making it extremely slow and completely impractical. In contrast, merge sort is a divide-and-conquer algorithm with a time complexity of \( O(n \log n) \), meaning it can sort the names in seconds.

When considering space efficiency, bubble sort is superior because it sorts in-place, requiring \( O(1) \) auxiliary memory. Merge sort requires \( O(n) \) auxiliary memory to hold temporary lists as they are split and merged. However, 1,000,000 names would only occupy a few megabytes of RAM, which modern computers can easily handle. Therefore, the time saving of merge sort far outweighs the memory drawback, making merge sort the only viable option for this dataset.

Marking scheme

**Level 1 (1–2 marks):**
* Identifies simple facts about bubble sort (e.g., "it swaps adjacent items") and/or merge sort (e.g., "it splits lists in half").
* Makes a simple recommendation with basic or no justification.

**Level 2 (3–4 marks):**
* Explains the difference in time efficiency (e.g., mentioning that merge sort is faster or referencing algorithmic complexity like \( O(n^2) \) vs \( O(n \log n) \)).
* Mentions space efficiency or memory usage for at least one of the algorithms.
* Provides a logical recommendation based on one of these factors.

**Level 3 (5–6 marks):**
* Provides a detailed, balanced comparison of both algorithms covering time efficiency, space complexity, and dataset size suitability.
* Uses correct terminology (e.g., in-place, divide-and-conquer, auxiliary memory, Big O notation).
* Reaches a fully justified conclusion pointing out why merge sort is chosen despite its higher memory usage.

Wondering how well you actually know this?

Thinka is an AI practice app for DSE students — unlimited questions, instant auto-marking, and detailed step-by-step solutions. 100,000+ students use it to confirm they actually know it, not just think they do.

Want more questions like this? Practice unlimited on Thinka — instant answers included.

Start Practising Free