📚 Common Mistakes and Correction Methods in Year 13 CAIE Computer Science | Year 13 CAIE 计算机常见误区与纠正方法
In Year 13 CAIE Computer Science, students tackle advanced topics that often expose subtle but critical misunderstandings. These mistakes can cost marks in Paper 3 and Paper 4 despite a solid grasp of the basics. This article highlights ten common misconceptions across the syllabus, from floating-point bias to A* heuristics, and provides clear, exam-focused correction methods to strengthen your revision.
在 Year 13 CAIE 计算机科学中,同学们面对的高级主题常常暴露出一些细微但致命的误解。尽管基础扎实,这些错误仍可能在 Paper 3 和 Paper 4 中丢分。本文梳理了整个考纲中十个常见误区,涵盖浮点偏置、A*启发式等,并提供清晰的、面向考试的纠正方法,助力你的复习。
1. Misreading the Exponent Bias in Floating-Point | 误读浮点数指数偏置
Many learners treat the stored exponent in IEEE 754 as a signed integer, attempting to interpret it using two’s complement. This leads to wildly incorrect actual exponents and mangled decimal conversions.
许多学生把 IEEE 754 中存储的指数当作带符号整数,尝试用补码去解读,导致实际指数严重错误,十进制转换一塌糊涂。
The correct method is to remember that single precision uses a bias of 127, and double precision uses 1023. The stored bit pattern is an unsigned integer from which you subtract the bias.
正确方法是记住单精度使用 127 偏置,双精度使用 1023 偏置。存储的位模式是一个无符号整数,减去偏置即得实际指数。
Actual Exponent = Stored Unsigned Value − Bias, where Bias = 2ᵏ⁻¹ − 1 for k exponent bits.
实际指数 = 存储的无符号值 − 偏置,其中 k 位指数的偏置 = 2ᵏ⁻¹ − 1。
For example, if the 8-bit exponent field holds 10000001 (129 in decimal), the actual exponent is 129 − 127 = 2, not some negative value. Always first write the stored bits as an unsigned number, then unbias it.
例如,若 8 位指数字段为 10000001(十进制 129),实际指数是 129 − 127 = 2,而不是某个负数。务必先将存储位视为无符号数,再去偏。
2. Confusing Subnet Mask and CIDR Notation | 混淆子网掩码与 CIDR 记法
A frequent error is misinterpreting the relationship between dotted decimal masks and CIDR prefix lengths. Students might try to convert 255.255.255.240 directly to /28 but miscalculate the number of network bits, or they confuse the number of usable hosts with the block size.
一个常见错误是曲解点分十进制掩码与 CIDR 前缀长度的关系。学生可能想把 255.255.255.240 直接转为 /28 却算错网络位数,或者将可用主机数与块大小混为一谈。
Correction: express the mask in binary. Count consecutive leading 1s to obtain the prefix length. For 255.255.255.240, the last octet is 11110000, giving 8+8+8+4 = 28 leading 1s, so /28. The number of addresses in the block is 2^(32−28) = 2⁴ = 16. Usable hosts = block size − 2 (network and broadcast addresses).
纠正:把掩码写成二进制。数出连续的前导 1 即为前缀长度。255.255.255.240 的末字节是 11110000,前导 1 共有 8+8+8+4=28,因此是 /28。块内地址数 = 2^(32−28) = 2⁴ = 16。可用主机数 = 块大小 − 2(扣掉网络地址和广播地址)。
Note that /31 and /32 are special: /31 allows point-to-point links with no broadcast, and /32 denotes a single host. Don’t blindly apply the −2 rule.
注意 /31 和 /32 的特殊性:/31 用于点对点链路,无需广播地址;/32 表示单个主机。不要机械套用 −2 规则。
3. Overlooking Pipeline Hazards in RISC | 忽视 RISC 架构中的流水线冲突
Some candidates assume that pipelining always multiplies throughput by the number of stages, ignoring data, control and structural hazards. This leads to over-optimistic performance calculations and incomplete analysis of stalls.
一些考生假定流水线总是能将吞吐量乘以级数,而忽略了数据冲突、控制冲突和结构冲突,导致性能估算过分乐观,流水线暂停分析不完整。
Data hazards occur when an instruction depends on the result of a previous instruction still in the pipeline. Use forwarding (bypass) to reduce stalls. Control hazards arise from branch instructions; predict-not-taken or flush the pipeline. Structural hazards happen when hardware resources are insufficient; add more functional units.
数据冲突发生当前指令依赖还在流水线中的前一条指令的结果时。可使用转发(旁路)来减少暂停。控制冲突由分支指令引起;可采用预测不跳转或冲刷流水线。结构冲突在硬件资源不足时出现;需增加功能单元。
When answering exam questions, always identify the type of hazard first, then explain how it can be resolved. Do not simply state ‘pipeline stalls’ without specifying the cause and remedy.
在回答考题时,务必先识别冲突类型,再解释如何解决。不要只说“流水线暂停”而不说明原因和补救措施。
4. Mishandling Recursion Base Case and Stack Growth | 递归基例与栈增长处理不当
Many Year 13 students write recursive functions with missing or unreachable base cases, resulting in infinite recursion and stack overflow. Others mistakenly believe that recursion is always slower and should be avoided, missing elegant solutions for tree and graph problems.
许多 Year 13 同学编写的递归函数缺少或无法到达基例,导致无限递归与栈溢出。另一些同学错误地认为递归总是慢而应避免,从而错失了树、图问题的优雅解法。
Correction: every recursive routine must have a clearly defined base case that is reached after a finite number of steps. Each recursive call must reduce the problem size (e.g., n → n−1, or moving into a subtree). Think of recursion as a stack-based problem-solving tool, not just a loop alternative.
纠正:每个递归例程必须有定义清晰的基例,且经过有限步后必然到达。每次递归调用必须缩小问题规模(如 n → n−1,或进入子树)。要把递归视为基于栈的解题工具,而不仅是循环的替代品。
Example factorial: base case is n = 0 returning 1; recursive case returns n × factorial(n−1). Without the base case, calls continue indefinitely, filling the call stack.
以阶乘为例:基例是 n = 0 返回 1;递归情况返回 n × factorial(n−1)。缺失基例则调用无限进行,填满调用栈。
5. Incorrect Deletion from a Binary Search Tree | 二叉搜索树删除操作错误
Deleting a node with two children is a topic where even strong students slip. A common mistake is to replace the node with the right child directly instead of finding the in-order successor (or predecessor). This destroys the BST property.
删除有两个子节点的结点是连优秀学生也会犯错的主题。一个常见错误是直接用右子节点替代,而不是寻找中序后继(或前驱),这会破坏 BST 性质。
The correct procedure: locate the node to delete. If it has two children, find its in-order successor (the leftmost node in the right subtree). Copy the successor’s value into the current node, then recursively delete the successor (which has at most one child).
正确步骤:定位待删结点。若其有两个子结点,则找出它的中序后继(右子树中最左的结点)。把后继的值复制到当前结点,然后递归删除该后继(它最多只有一个子结点)。
-
Case 1: leaf node — remove directly.
情况一:叶结点 — 直接删除。
-
Case 2: one child — bypass node by linking parent to child.
情况二:一个子结点 — 让父结点绕过该结点,与子结点连接。
-
Case 3: two children — as above, use in-order successor.
情况三:两个子结点 — 如上所述,使用中序后继。
Practise drawing trees and stepping through deletion to cement the algorithm.
多练习画树并逐步执行删除操作,以巩固算法。
6. Misapplying Heuristic Admissibility in A* | A* 算法中启发式可容性的误用
A typical exam pitfall is assuming that any heuristic that speeds up A* is admissible. Students often design overestimating heuristics and then wonder why A* fails to find the shortest path.
考试中一个典型陷阱是认为任何能加速 A* 的启发式都是可容的。学生们常设计出高估的启发式,然后纳闷为何 A* 找不到最短路径。
A heuristic h(n) is admissible only if it never overestimates the true remaining cost to the goal: h(n) ≤ h*(n) for all nodes n. An admissible heuristic guarantees that A* will find an optimal path if one exists. Overestimating can prune promising nodes and lead to suboptimal solutions.
启发式 h(n) 可容的充要条件是它永不高估到达目标的实际剩余代价:对所有节点 n 满足 h(n) ≤ h*(n)。可容的启发式能保证 A* 在存在最优路径时找到它。高估则会剪掉有希望的节点,导致次优解。
Examples: straight-line distance is admissible for road maps; Manhattan distance is admissible for grid movement without diagonal shortcuts. To verify admissibility, calculate h* for a few nodes and check h(n) ≤ h*.
示例:直线距离对于道路地图是可容的;曼哈顿距离对于不允许对角线捷径的网格移动是可容的。要验证可容性,可计算几个节点的 h* 并检查是否 h(n) ≤ h*。
7. Errors in Normalisation to Third Normal Form | 第三范式规范化中的错误
Students frequently declare a relation in 3NF when partial or transitive dependencies still exist. They confuse the definitions of 2NF and 3NF, or they misidentify candidate keys.
学生们经常在有部分依赖或传递依赖的情况下仍宣称关系属于 3NF。他们混淆了 2NF 与 3NF 的定义,或错误地识别了候选键。
A relation is in 2NF if it is in 1NF and every non-prime attribute is fully functionally dependent on the entire candidate key (no partial dependencies). It is in 3NF if it is in 2NF and all non-prime attributes are non-transitively dependent on every candidate key (no non-key dependency on another non-key attribute).
一个关系属于 2NF,当它满足 1NF 且每个非主属性完全函数依赖于整个候选键(无部分依赖)。属于 3NF,则在 2NF 基础上,所有非主属性非传递依赖于每一个候选键(无非键属性依赖另一个非键属性)。
| Normal Form | Condition | Common Error |
|---|---|---|
| 2NF | No partial dependencies | Overlooking a composite key that causes partial dependency |
| 3NF | No transitive dependencies | Missing transitive link A→B and B→C, then erroneously claiming 3NF |
Normal form conditions and typical oversights
范式条件与常见疏忽
8. Misunderstanding Page Fault Handling in Virtual Memory | 虚拟内存中页故障处理误解
Some learners treat a page fault as a catastrophic error, confusing it with a segmentation fault. In reality, a page fault is a normal operating system mechanism to load a demanded page from disk into main memory.
有些学生把页故障当作灾难性错误,与段错误混为一谈。实际上,页故障是操作系统把所需页面从磁盘载入主存的常规机制。
When a process references a virtual page not currently in RAM, the MMU raises a page fault exception. The OS then locates the page on backing store, selects a frame (possibly evicting a page using a replacement algorithm like LRU), loads the page, updates the page table, and resumes the instruction.
当进程引用一个当前不在 RAM 中的虚拟页时,MMU 触发页故障异常。操作系统随后在辅存中找到该页,选择一个帧(可能用 LRU 等替换算法淘汰一个旧页),载入页面,更新页表,然后恢复指令执行。
Thrashing occurs when the system spends more time swapping pages than executing processes, often due to too many active processes or insufficient memory. It is not the same as a single page fault.
系统颠簸(thrashing)是指系统花在页面交换上的时间超过进程执行时间,通常因活动进程太多或内存不足。它不等于单次页故障。
9. SQL JOIN Types and Unintended Duplicates | SQL 连接类型与意外重复行
A common mistake in database questions is using the wrong JOIN type or forgetting that joins can produce duplicate rows when matching conditions are not unique. Candidates sometimes receive full marks for structure but lose marks on output rows.
数据库题目中,常见的错误是使用了错误的连接类型,或忘记了当匹配条件不唯一时连接会产生重复行。考生可能结构得满分,却因输出行数出错而丢分。
INNER JOIN returns rows where there is a match in both tables. LEFT JOIN retains all rows from the left table and fills with NULLs where no match exists in the right table. If a foreign key in the right table repeats, an INNER JOIN will multiply rows from the left.
内连接 INNER JOIN 返回两个表中匹配的行。左连接 LEFT JOIN 保留左表所有行,并在右表无匹配处填充 NULL。若右表外键重复,内连接会使左表的行被复制多次。
Always consider cardinality. If a customer has three orders, joining Customers with Orders on customer_id will produce three rows for that customer. Use DISTINCT or aggregation if you need one row per customer, or accept the multiplicity in summary queries.
始终要考虑基数。若某客户有三份订单,按 customer_id 连接 Customers 和 Orders 会为该客户生成三行。若需要每位客户一行,使用 DISTINCT 或聚合;或在汇总查询中接受重复。
10. Neglecting Exception Handling in OOP | 面向对象编程中忽略异常处理
When writing or analysing object-oriented code, many students focus on class design but ignore exception handling, leading to runtime crashes in scenario-based questions. They fail to use try-catch blocks or misuse the finally clause.
在编写或分析面向对象代码时,许多学生专注类设计而忽略异常处理,导致场景题中的运行时崩溃。他们要么没有使用 try-catch 块,要么误用了 finally 子句。
Key concepts you must apply: use try to enclose code that might throw an exception. Use catch to handle specific exception types (e.g., IOException, NullPointerException). The finally block always executes, whether an exception occurs or not, making it ideal for closing files or releasing resources.
你必须掌握的关键概念:用 try 包围可能抛出异常的代码;用 catch 处理特定的异常类型(如 IOException、NullPointerException);finally 块总是执行,无论是否发生异常,非常适合关闭文件或释放资源。
A common error is placing resource cleanup outside a finally block, which leaks resources when an exception is thrown. Another error is catching a superclass exception before a subclass, making the subclass catch unreachable.
一个常见错误是把资源清理放在 finally 块之外,一旦抛出异常就会造成资源泄漏。另一个错误是超类异常捕获放在了子类异常之前,导致子类捕获不可达。
Also remember that unhandled checked exceptions must be declared in the method signature with the throws keyword, or they cause compile-time errors in Java-like pseudocode assessed in CAIE.
还要记住,未被处理的受检异常必须用 throws 关键字在方法签名中声明,否则在 CAIE 考查的类 Java 伪代码中会引发编译期错误。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导