Computer Science
Automated Systems, Robotics and AI
- 1.
An automated greenhouse turns irrigation on when soil moisture is below a stored threshold. Explain the roles of a sensor, microprocessor and actuator, then explain why the system must keep taking readings after the pump starts.
[4 marks] · no calculatorWorked explanation
- Measurement, decision and physical action are distinct: the sensor supplies data, the processor applies a comparison rule and the actuator changes water flow.
- The environment changes after watering begins. Continuing the loop lets the processor revise its output; one reading at startup cannot tell it when watering has become sufficient.
Common mistake: Saying the sensor turns the water on skips the programmed decision and actuator needed to change the physical system.
Marking points
- A moisture sensor measures the soil condition and supplies readings.
- The microprocessor compares the reading with the stored threshold.
- An actuator switches or opens the water pump/valve in response to the processor's output.
- Repeated readings provide feedback so irrigation can stop when sufficient moisture is reached.
Examiner tip: Saying the sensor turns the water on skips the programmed decision and actuator needed to change the physical system.
- 2.
A warehouse proposes automated lighting controlled by movement sensors. Explain two benefits specific to this scenario, one disadvantage if sensor readings fail, and a practical mitigation that preserves safe access.
[4 marks] · no calculatorWorked explanation
- Judge benefits against actual warehouse use: empty aisles need less lighting while staff carrying goods need not stop to find switches.
- Automation depends on valid inputs. A sensor failure can defeat the decision rule even if the code works, so a manual override or independent safety lighting addresses that specific failure.
Common mistake: Claiming automation can never fail confuses repeatable programmed operation with reliable sensors and power.
Marking points
- Lights can switch off in unoccupied aisles, reducing wasted electrical energy.
- Automatic switching avoids requiring staff to operate each aisle's switch; accept a distinct relevant benefit such as consistent operation.
- A failed sensor could leave an occupied aisle dark, creating collision or trip risk.
- Provide a manual override and/or independent emergency lighting with fault reporting and maintenance.
Examiner tip: Claiming automation can never fail confuses repeatable programmed operation with reliable sensors and power.
- 3.
A programmable mobile warehouse robot has a frame, distance sensors, a microprocessor and motor-driven wheels. Explain why it is a robot by linking three stated features to robot characteristics. Explain one advantage over a worker entering a hazardous aisle and one limitation requiring a safe fallback.
[5 marks] · no calculatorWorked explanation
- Robot classification follows the combination of mechanical structure, electrical components and programmability; having a human-like body is unnecessary.
- Remote operation can reduce human exposure, but autonomy is not infallibility. A safe stop on uncertain obstacle information is preferable to continuing into an unseen obstruction.
Common mistake: Requiring a robot to look human excludes industrial and mobile robots that satisfy the functional characteristics.
Marking points
- The frame and wheels form a mechanical structure.
- Sensors, microprocessor and motors provide electronic sensing, processing and actuation.
- Its behaviour is programmable rather than determined solely by a fixed manual action.
- It can move goods without exposing a person to the hazardous aisle.
- A blocked or faulty sensor can cause unsafe movement; stop safely and request human assistance, or give another linked limitation and fallback.
Examiner tip: Requiring a robot to look human excludes industrial and mobile robots that satisfy the functional characteristics.
- 4.
A hypothetical greenhouse expert system stores plant facts and rules: IF leaves are wilted AND soil is dry THEN suggest watering; IF leaves are wilted AND soil is wet THEN suggest checking roots. A user enters 'wilted' and 'wet'. Identify the recommendation and explain the roles of the knowledge base, rule base, inference engine and user interface.
[5 marks] · no calculatorWorked explanation
- Wet soil makes the watering rule's dry-soil condition false. The second rule matches both supplied observations, so the recommendation is to check roots.
- Facts and rules are stored components, inference is the matching/reasoning process, and the interface is how information enters and leaves. The recommendation is hypothetical, not a verified diagnosis.
Common mistake: Selecting watering from 'wilted' alone ignores the AND condition and the supplied wet-soil fact.
Marking points
- Recommend checking roots, not watering.
- The knowledge base stores relevant plant/domain facts.
- The rule base stores the two conditional rules.
- The inference engine matches the entered facts to the applicable rule to derive the recommendation.
- The interface collects user observations and presents the recommendation.
Examiner tip: Selecting watering from 'wilted' alone ignores the AND condition and the supplied wet-soil fact.
- 5.
A hypothetical machine-learning system sorts pictures of recyclable objects after training on labelled pictures of glass and plastic. Explain how training differs from manually writing a rule for every picture. Describe how additional representative labelled examples could improve adaptation, and explain why testing on the training pictures alone is inadequate.
[4 marks] · no calculatorWorked explanation
- The learner receives examples with known labels and adjusts a model, whereas a fixed rule system applies rules already specified by its author.
- More examples are useful only if they address relevant variation and have reliable labels. Held-out pictures test whether the learned behaviour transfers beyond the examples used for adjustment.
Common mistake: Treating perfect training accuracy as guaranteed real-world accuracy overlooks memorisation and unrepresented image conditions.
Marking points
- Training uses labelled examples to adjust patterns or parameters relating image features to classes.
- The program can classify new pictures using learned patterns rather than a human explicitly coding each picture's outcome.
- Additional varied, correctly labelled examples can adjust the model to underrepresented conditions.
- Separate unseen test pictures are needed because success on memorised training examples does not establish performance on new objects.
Examiner tip: Treating perfect training accuracy as guaranteed real-world accuracy overlooks memorisation and unrepresented image conditions.
- 6.
Compare two hypothetical route helpers. System A follows a stored set of expert rules using road-closure facts. System B adjusts predictions from new labelled travel-time records. Identify the expert-system and machine-learning approaches, explain how each uses data to produce an output, and explain why 'all AI must learn continuously' is incorrect.
[4 marks] · no calculatorWorked explanation
- The defining distinction is how decision behaviour is obtained: A reasons using an authored rule base, while B changes a predictive model using examples.
- Both use data, but data use alone does not imply learning. A rule-based expert system can make an inference with unchanged rules, and even a trained learning model need not update during every use.
Common mistake: Calling every data-processing program machine learning ignores whether the program actually adapts a learned model.
Marking points
- A is an expert-system approach using explicit facts and rules.
- B is a machine-learning approach that adapts its predictive model from labelled examples.
- A infers a route recommendation by matching road facts to rules, whereas B applies learned patterns to predict travel time.
- AI can simulate intelligent reasoning through fixed expert rules; continuous learning is not necessary for every AI system.
Examiner tip: Calling every data-processing program machine learning ignores whether the program actually adapts a learned model.
- 7.
A greenhouse controller records two sensor messages in a text file named Readings.txt. The file exists and contains exactly two lines, in order: 'moisture low' and 'moisture normal'. Write Cambridge-style pseudocode that opens this file for reading, reads both lines one at a time and writes each unchanged to a new file named Audit.txt, then closes both files. Declare a suitable variable and use a two-iteration loop. Explain why the controller keeps a file instead of retaining these messages only in RAM, and state what opening an existing Audit.txt FOR WRITE would do to its old contents. Do not control any real equipment.
[6 marks] · no calculatorSyllabus placement evidence: Cambridge IGCSE Computer Science 0478, 2026-2028 version 6, 8.3 File handling and Details of the assessment: file-handling pseudocode. No inspected task used OPENFILE, READFILE, WRITEFILE or CLOSEFILE. The controller-log scenario fits the existing automated-systems topic while applying prescribed programming/file-handling skills; it does not introduce a new topic slug, claim AI is necessary, or claim to be the full Paper 2 scenario.
Worked explanation
- One valid answer: DECLARE LineOfText : STRING DECLARE Index : INTEGER OPENFILE "Readings.txt" FOR READ OPENFILE "Audit.txt" FOR WRITE FOR Index <- 1 TO 2 READFILE "Readings.txt", LineOfText WRITEFILE "Audit.txt", LineOfText NEXT Index CLOSEFILE "Readings.txt" CLOSEFILE "Audit.txt"
- On the first iteration LineOfText is 'moisture low' and the first output line is identical. On the second it is 'moisture normal', written as the second line. Reading outside the loop and writing the same variable twice would incorrectly duplicate the first message.
- File storage makes the observation history available after shutdown for checking the controller's past inputs. The specified WRITE mode is destructive to an existing output file, so this copying exercise is not an append-only audit system. The guaranteed two-line input avoids assuming an unspecified end-of-file operation.
Common mistake: Opening the input file FOR WRITE can destroy the readings before they are read; reading requires READ mode.
Marking points
- Declares a STRING variable for each line and opens Readings.txt FOR READ and Audit.txt FOR WRITE.
- Uses a loop for exactly two iterations and READFILE Readings.txt into the line variable on each iteration, retaining appropriate quoted file identifiers.
- Uses WRITEFILE Audit.txt with that variable inside the loop so both messages are copied unchanged in order.
- Closes both files after the loop with CLOSEFILE.
- A file retains a retrievable record after the program stops or power is removed, unlike ordinary volatile RAM alone.
- Opening Audit.txt FOR WRITE replaces its existing contents; it does not append to the old log.
Examiner tip: Opening the input file FOR WRITE can destroy the readings before they are read; reading requires READ mode.
- 8.
An automated-robot logic tester applies the input pairs A,B in the order 00,01,10,11. Create a complete table with one row per pair and output columns A AND B, A OR B, A NAND B, A NOR B, A XOR B and NOT A. Give every output as 0 or 1; NOT A depends only on A even though the tester varies B. The tester is checking gate functions, not authorising a real robot to move.
[6 marks] · no calculatorSyllabus placement evidence: Cambridge IGCSE Computer Science 0478, 2026-2028 version 6, 10 Boolean logic: NOT, AND, OR, NAND, NOR, XOR and all input combinations. The original inventory checked isolated AND/OR/NOT cases but not complete NAND/NOR/XOR tables. A robot-logic test fits the supplementary automation topic; these exhaustive columns add a concrete missing skill, not six new authored questions or a complete logic-circuit course.
Worked explanation
- Complete table in the requested column order: A B | AND OR NAND NOR XOR NOT_A 0 0 | 0 0 1 1 0 1 0 1 | 0 1 1 0 1 1 1 0 | 0 1 1 0 1 0 1 1 | 1 1 0 0 0 0
- AND requires both high; OR requires at least one high. NAND and NOR invert the respective complete gate output, not an arbitrarily chosen input.
- XOR requires exactly one high and therefore differs from inclusive OR on the 11 row. The NOT A column repeats when only B changes, since NOT has a single input. Listing all pairs systematically exposes errors hidden by checking only one test input.
Common mistake: XOR is not inclusive OR: when both inputs are 1, XOR outputs 0 while OR outputs 1.
Marking points
- For row order 00,01,10,11, AND outputs are 0,0,0,1.
- In the same row order, OR outputs are 0,1,1,1.
- NAND outputs are 1,1,1,0.
- NOR outputs are 1,0,0,0.
- XOR outputs are 0,1,1,0.
- NOT A outputs are 1,1,0,0.
Examiner tip: XOR is not inclusive OR: when both inputs are 1, XOR outputs 0 while OR outputs 1.
- 9.
A robot transmits seven data bits 1011001 with one even-parity bit appended on the right. Determine the parity bit and transmitted eight-bit word. A receiver gets 10110110; decide whether parity detects an error. A different corrupted word from the same transmission is 10010000; explain why parity accepts it despite the changed data. Describe how an ARQ protocol uses positive/negative acknowledgements and a timeout to request or trigger retransmission, and explain why ARQ does not make this parity check able to detect every corruption.
[6 marks] · no calculatorSyllabus placement evidence: Cambridge IGCSE Computer Science 0478, 2026-2028 version 6, 2.2 Methods of error detection: parity and automatic repeat query with acknowledgements and timeout. The inspected inventory lacked parity/ARQ practice, despite discussing TCP as enrichment. This robot-telemetry task directly assesses prescribed error handling; it does not require TCP-specific protocol mechanics or claim that parity guarantees error-free data.
Worked explanation
- Count ones before adding the bit: 1+0+1+1+0+0+1=4, already even, so append 0. Compare the receiver's count of five ones with the even requirement; the check detects inconsistency but does not locate or repair the bad bit by itself.
- The second corrupted word differs from 10110010 at the third and seventh positions counted from the left. Both changes remove a one, leaving two ones: even parity is unchanged. Passing parity is therefore not proof of unchanged data.
- ARQ adds feedback and retry behaviour: accepted frames receive an ACK, detected failures can receive a NACK, and a lost frame or lost ACK can lead to timeout and retry. A real implementation also manages duplicate retries, but that detail is not required here. Retransmission logic cannot recover an error it was never told or able to detect.
Common mistake: An even-parity pass means only that the total number of ones is even, not that every transmitted data bit arrived correctly.
Marking points
- The seven data bits contain four ones, so parity bit=0 and transmitted word=10110010.
- Received 10110110 contains five ones, so even parity fails and an error is detected.
- Corrupted word 10010000 contains two ones, so it passes even parity despite differing from the original data.
- Two bits that were 1 changed to 0, preserving evenness; an even number of bit flips can evade a single parity-bit check.
- A receiver can send a positive acknowledgement for an accepted frame or a negative acknowledgement for a detected error; a negative acknowledgement requests retransmission.
- If an expected acknowledgement does not arrive before timeout, the sender retransmits. ARQ reacts to missing acknowledgements/detected errors, but undetected parity corruption can be positively acknowledged.
Examiner tip: An even-parity pass means only that the total number of ones is even, not that every transmitted data bit arrived correctly.
- 10.
A simplified word-addressed Von Neumann processor in an automated controller has PC=120 and ACC=5. Memory address 120 contains the single-word instruction ADD 350, meaning add the value stored at address 350 to ACC. Memory address 350 contains 7. There is no branch, and each instruction occupies one word. Describe the fetch-decode-execute sequence, tracing PC, MAR, MDR, CIR and ACC where relevant. Explain how the address, data and control buses are used, and give the final PC and ACC. The symbolic instruction is supplied; no machine-code encoding is required.
[6 marks] · no calculatorSyllabus placement evidence: Cambridge IGCSE Computer Science 0478, 2026-2028 version 6, 3.1 Computer architecture: Von Neumann components, registers, buses and fetch-decode-execute. The inspected bank described PC but did not trace MAR/MDR/CIR/ACC and all three buses together. The automated-controller context fits the existing supplementary topic; the symbolic single-word ISA is specified so no unprescribed opcode recall is needed.
Worked explanation
- Instruction fetch uses an address, not the instruction's numerical meaning: MAR=120 identifies the memory word, the control bus requests a read, and MDR receives ADD 350. CIR holds that current instruction while PC advances by one word.
- Decode separates the operation ADD from the address 350. The operand fetch then sets MAR=350 and MDR=7; 350 is an address, not the number to add.
- The ALU computes 5+7 and ACC becomes 12. Since ADD is not a branch, PC remains 121 for the next fetch. This abstract trace does not claim every physical processor updates internal registers in an identical clock-by-clock order.
Common mistake: ADD 350 in this supplied model adds memory[350], which is 7; it does not add the address 350 or jump PC to 350.
Marking points
- Copies the next instruction address 120 from PC to MAR and sends that address to memory on the address bus.
- The control unit issues a memory-read signal on the control bus; the instruction at 120 returns on the data bus into MDR.
- Copies the fetched instruction ADD 350 into CIR and updates PC to the next instruction address 121; an equivalent valid timing order is acceptable.
- The control unit decodes ADD and its operand address 350 from CIR.
- For execution, MAR supplies address 350 and a memory-read signal fetches operand 7 on the data bus into MDR.
- The ALU adds the operand to ACC: 5+7=12. Final ACC=12 and PC=121, not 350.
Examiner tip: ADD 350 in this supplied model adds memory[350], which is 7; it does not add the address 350 or jump PC to 350.
- 11.
A hypothetical fleet of warehouse robots pays for charging using a digital currency that exists only electronically. Its specified blockchain protocol stores time-stamped transaction records in blocks; each new block contains a hash link to the preceding block, and multiple participating nodes keep copies and validate proposed histories under shared rules. Explain what makes the payment a digital-currency transaction, how the ledger records transfers, and how hash links and shared validation make an attempted change to an older transfer evident and harder to accept. Explain why this does not guarantee that an original charge-meter reading or payment recipient was correct. No real transaction is requested.
[5 marks] · no calculatorSyllabus placement evidence: Cambridge IGCSE Computer Science 0478, 2026-2028 version 6, 5.2 Digital currency: concept and blockchain transaction tracking. Digital currency and blockchain were absent from the inspected inventory. The robot-charging scenario makes the task compatible with automated systems; protocol details are supplied application information, not a demand to recall a particular cryptocurrency, consensus algorithm or investment fact.
Worked explanation
- The electronic currency is the transferred value; the blockchain is the specified ledger mechanism used to track those transfers. A digital currency need not always use a blockchain, but this hypothetical system does.
- Hash links connect each accepted block to its predecessor. Tampering changes the older block's hash and invalidates the next link; merely editing a robot's local ledger is not the same as persuading the validating network to accept a rewritten history.
- Shared validation makes the simple local edit detectable and harder to adopt under the stated rules. It is not an absolute impossibility theorem: the strength depends on the protocol and participants, and a validly recorded bad sensor input remains bad data. No currency purchase, investment advice or real payment is involved.
Common mistake: A tamper-evident transaction history does not establish that the sensor reading which prompted a payment was accurate.
Marking points
- Digital currency exists electronically and is used here to transfer value for charging rather than handing over physical notes or coins.
- The ledger records time-stamped transfers between identified sending and receiving addresses/accounts so the accepted transaction history can be tracked.
- Changing an older block changes its hash, breaking the stored link from its successor unless affected links are recomputed.
- Other nodes validate proposed histories under the protocol rather than accepting one altered local copy; an inconsistent history can be rejected, making simple unilateral rewriting ineffective.
- A consistently recorded transfer can still rely on an incorrect meter input or mistaken recipient. Ledger integrity does not verify the physical truth of every input or guarantee that attacks are impossible.
Examiner tip: A tamper-evident transaction history does not establish that the sensor reading which prompted a payment was accurate.
- 12.
Write one complete algorithm in Cambridge-style pseudocode or a high-level programming language for this hypothetical controller audit. It must not operate real equipment. Input an integer N, the number of stations, and re-input until 1<=N<=20. For each station in input order, input a nonempty name (re-input an empty name) and exactly three numeric temperature readings; re-input each reading until it lies in 0..100 inclusive. Input is already of the stated integer/numeric type, so text parsing is not required. Store names in a one-dimensional array and all valid temperatures in a two-dimensional array. Calculate and store each station's mean in a one-dimensional array. A station has status ALERT if at least two of its three readings are >=70 OR any one reading is >=90; otherwise its status is NORMAL. Output each station's name, mean and labelled status. Count stations with ALERT once per station, not once per reading. Finally output that count and the name and mean of the station with the highest mean; retain the first input station if means tie. Declare suitable data structures and initialise totals and flags. Arrays can be sized for 20 stations. This original 15-mark practice scenario has an indicative analytic scheme, not an official board mark award.
[15 marks] · no calculatorSyllabus placement evidence: Cambridge IGCSE Computer Science 0478, 2026-2028 version 6, Topics 7-8 algorithm design, validation, programming and arrays; Details of the assessment, Paper 2 scenario question. Adds a complete original scenario spanning several prescribed programming skills rather than another isolated loop exercise. The official Paper 2 has a 15-mark scenario, but this is an uncalibrated original analytic practice scheme, not an official question or a claim to complete all scenario/Topics 7-10 coverage. A controller audit fits the existing automation topic.
Worked explanation
- One complete pseudocode solution: DECLARE N, Station, Reading, HighCount, AlertCount, HottestIndex : INTEGER DECLARE Value, Total : REAL DECLARE AnyCritical, Alert : BOOLEAN DECLARE Names : ARRAY[1:20] OF STRING DECLARE Temperatures : ARRAY[1:20,1:3] OF REAL DECLARE Means : ARRAY[1:20] OF REAL REPEAT INPUT N UNTIL N >= 1 AND N <= 20 AlertCount <- 0 HottestIndex <- 1 FOR Station <- 1 TO N REPEAT INPUT Names[Station] UNTIL LENGTH(Names[Station]) > 0 Total <- 0 HighCount <- 0 AnyCritical <- FALSE FOR Reading <- 1 TO 3 REPEAT INPUT Value UNTIL Value >= 0 AND Value <= 100 Temperatures[Station,Reading] <- Value Total <- Total + Value IF Value >= 70 THEN HighCount <- HighCount + 1 ENDIF IF Value >= 90 THEN AnyCritical <- TRUE ENDIF NEXT Reading Means[Station] <- Total / 3 Alert <- (HighCount >= 2) OR AnyCritical IF Alert THEN OUTPUT Names[Station], Means[Station], "ALERT" AlertCount <- AlertCount + 1 ELSE OUTPUT Names[Station], Means[Station], "NORMAL" ENDIF IF Station = 1 THEN HottestIndex <- 1 ELSE IF Means[Station] > Means[HottestIndex] THEN HottestIndex <- Station ENDIF ENDIF NEXT Station OUTPUT "ALERT stations", AlertCount OUTPUT "Highest mean", Names[HottestIndex], Means[HottestIndex]
- Trace two stations: Alpha with [69,70,70] has mean 209/3=69.666... and two readings at least 70, so ALERT. Beta with [90,20,20] has mean 130/3=43.333... and one critical reading, so ALERT even though it lacks two high readings. The final ALERT count is 2 and Alpha has the highest mean.
- Reset Total, HighCount and AnyCritical inside the outer loop, but keep AlertCount outside. Invalid attempts must neither enter the arrays nor affect totals. A true critical flag must remain true for the rest of that station, even after a later normal reading.
- Check N=1 and N=20; reject 0 and 21. For temperatures, accept 0 and 100, reject -1 and 101. [70,70,0] alerts, [89,0,0] does not, and [90,0,0] alerts. Equal means use strict >, so the earliest station remains selected. All required means exist before comparison; no uninitialised later array element is read.
Common mistake: Counting every high reading as an ALERT station overcounts, and requiring both the two-high and critical conditions misimplements the specified OR.
Marking points
- Declares or clearly establishes suitable names, 2D readings and mean arrays, with appropriate variable types or their valid language equivalents.
- Inputs N and repeats input until 1<=N<=20, under the stipulated integer-input assumption.
- Initialises the overall ALERT station count to zero before processing stations.
- Uses an outer loop for exactly N stations and obtains a nonempty name for each, repeating an empty input.
- Processes exactly three readings per station using iteration or equivalent unrolled logic, with fresh per-station accumulators or derived state where needed; does not require the exemplar's named counters or flags.
- Re-inputs each numeric temperature until 0<=value<=100, accepting both endpoints.
- Stores each accepted reading in the correct station/reading element of the two-dimensional array.
- Accumulates the three accepted values and stores the correct arithmetic mean for the station.
- Correctly determines whether at least two readings are >=70, including exactly 70; accepts a count comparison, pairwise Boolean conditions, a suitable ordered-value comparison or equivalent logic without a high-reading counter.
- Correctly determines whether any reading is >=90, including exactly 90; accepts a direct OR of comparisons, a maximum comparison or a persistent flag, without allowing a later lower reading to erase earlier critical evidence.
- Combines the semantic conditions correctly: at least two readings are >=70 OR any reading is >=90; accepts equivalent logic without requiring a counter or critical flag, and does not require both conditions.
- Outputs each station's name, mean and correct ALERT/NORMAL label.
- Increments the overall ALERT count at most once for each station whose combined condition is true.
- Finds the highest mean and corresponding station with safe initialisation and earliest-input tie handling; accepts forward scanning with strict >, reverse scanning with >=, a suitable separate selection pass or any equivalent correct method, without prescribing an update operator or scan order.
- After all stations, outputs the ALERT count and the highest-mean station's name and mean. Accepts logically equivalent complete algorithms; does not demand the exemplar's exact variable names or layout.
Examiner tip: Counting every high reading as an ALERT station overcounts, and requiring both the two-high and critical conditions misimplements the specified OR.