📚 Year 12 WJEC Computer Science: Interdisciplinary Integrated Question Practice | 跨学科综合题型训练
Welcome to this interdisciplinary problem‑solving practice designed for Year 12 WJEC Computer Science. As the new specifications encourage learners to apply computational thinking beyond pure coding, this article presents a series of exam‑style questions that blend computer science concepts with ideas from physics, mathematics, geography, biology, and economics. Each section models how the core topics — data representation, Boolean logic, algorithms, networking, databases, and programming — can be used to solve authentic cross‑curricular problems. Work through the examples carefully; they simulate the integrated questioning style you may encounter in assessments.
欢迎来到为 Year 12 WJEC 计算机科学设计的跨学科问题解决训练。新考纲鼓励学生将计算思维应用于纯编码之外,因此本文提供了一系列融合计算机科学概念与物理、数学、地理、生物和经济学思想的考试风格题目。每个板块都展示了如何利用数据表示、布尔逻辑、算法、网络、数据库和编程等核心主题解决真实的跨学科问题。请仔细完成这些示例,它们模拟了你可能在考试中遇到的综合题型风格。
1. Boolean Algebra and Electrical Safety Systems | 布尔代数与电气安全系统
In industrial control systems, a machine must only operate when two independent safety sensors A and B are both triggered, and an emergency stop E is not active. Additionally, an override key K allows a supervisor to bypass the sensors only if a maintenance mode M is also enabled. The output O must be true for the machine to run. Write a Boolean expression for O in terms of A, B, E, K, M, then simplify it using the laws of Boolean algebra. Outline how the simplified expression could reduce the number of logic gates in the control circuit.
在工业控制系统中,只有当两个独立的安全传感器 A 和 B 均被触发且紧急停止 E 未被激活时,机器才可以运行。此外,只有当维护模式 M 也启用时,越权钥匙 K 才允许主管绕过传感器。输出 O 为真时机器运行。请用 A、B、E、K、M 写出 O 的布尔表达式,然后使用布尔代数定律加以化简,并阐述简化后的表达式如何减少控制电路中的逻辑门数量。
We begin by translating the verbal specification: (A ∧ B ∧ ¬E) ∨ (K ∧ M ∧ ¬E). Since ¬E is common to both product terms, we factor it out using the distributive law: O = ¬E ∧ ((A ∧ B) ∨ (K ∧ M)). This expression shows that the emergency stop dominates — both sensors or the key with maintenance mode. The simplified form uses one AND gate for A∧B, one AND gate for K∧M, one OR gate, and one AND gate to combine with ¬ riginal form would have needed four AND gates and one OR, plus an extra AND to incorporate ¬ ice. Thus simplification reduces gate count and power consumption in the physical circuit.
首先将文字规范转换: (A ∧ B ∧ ¬E) ∨ (K ∧ M ∧ ¬E)。由于 ¬E 在两个乘积项中共同出现,我们运用分配律将其提出:O = ¬E ∧ ((A ∧ B) ∨ (K ∧ M))。该表达式表明急停按钮具有主导权——若 E 为真,则无论其他输入为何,O 均为假。内层项要求两个传感器均触发或钥匙与维护模式同时启用。简化后的形式使用一个与门实现 A∧B、一个与门实现 K∧M、一个或门,再使用一个与门与 ¬E 结合。原始形式需要四个与门和一个或门,外加重复引入 ¬E 所需的额外与门。因此,化简减少了门数,从而降低了物理电路中的功耗。
2. Binary Arithmetic and Tidal Height Prediction | 二进制运算与潮汐高度预测
An oceanographic monitoring station stores tidal heights in an 8‑bit two’s complement representation, measuring in centimetres. One morning the sensor records a low tide of –14 cm, and six hours later a high tide of +45 cm. Calculate the 8‑bit two’s complement binary pattern for each reading, then add them using binary addition (ignoring final overflow for signed arithmetic). Convert the sum back to decimal and explain what physical quantity the sum represents in the context of the tidal cycle.
某海洋监测站利用 8 位二进制补码形式存储潮汐高度,单位为厘米。某天早晨传感器记录到低潮 –14 cm,六小时后记录到高潮 +45 cm。请计算每个读数的 8 位二进制补码位模式,然后使用二进制加法加总(若有符号运算的最终溢出可忽略)。将和转换回十进制,并解释在海潮循环背景下该和所代表的物理量。
For –14: positive 14 in 8‑bit binary is 0000 1110. Flip bits → 1111 0001, add 1 → 1111 0010 (two’s complement for – in binary is 0010 1101. Now add: 1111 0010 + 0010 1101 = (1) 0001 1111. Discard the carry‑ height relative to the mean sea level if the two readings are symmetrically placed. In a tidal model, when you average the extremes you obtain the mid‑ a negative and a positive value gives a direct indication of asymmetry in the tidal curve.
对于 –14:+14 的 8 位二进制为 0000 1110。按位取反 → 1111 0001,加 1 → 1111 0010(–14 的补码)。对于 +45:45 的二进制为 0010 1101。相加:1111 0010 + 0010 1101 = (1) 0001 1111。舍弃进位,结果为 0001 1111,即十进制 +31。和 31 cm 代表相对于低潮参考点的净位移,或者说当两个读数对称分布时,该值表示相对于平均海平面的高度。在海潮模型中,对极值求平均可得中潮位;负值与正值之和直接指示了潮汐曲线的不对称程度。
3. Graph Algorithms and City Evacuation Routing | 图算法与城市疏散路径
A civil engineering team models a seaside town as an undirected weighted graph where vertices are junctions and edges are roads labelled with evacuation capacity (vehicles per minute). They need to find the route from the central square (node S) to the emergency assembly point (node T) that maximises the minimum capacity along the path, using a modified Dijkstra algorithm. Explain why a standard shortest‑path distance metric is inappropriate here, and describe how you would adapt the algorithm’s relaxation step to solve this maximum‑bottleneck problem. Provide a small example with five nodes to illustrate your reasoning.
某土木工程团队将一个海滨小镇建模为无向加权图,顶点为道路交叉口,边为标有疏散容量(辆/分钟)的道路。他们需要找到从中央广场(节点 S)到应急集合点(节点 T)的路径,使得路径瓶颈容量(最小边权)最大化,采用改进的 Dijkstra 算法。请解释为何标准的最短路径距离度量在此处不适用,并描述你将如何修改算法的松弛步骤来解决这一最大瓶颈问题。请通过一个五节点的小例子加以说明。
In a standard shortest‑ is determined by its narrowest road. Maximising the minimum capacity is a maximin problem — imum edge weight along any path to that node. We change the distance array to hold the current best bottleneck capacity, initialised to – bottleneck[u], w). If this value is greater than bottleneck[v], we update bottleneck[v] and enqueue v. A priority queue still extracts the node with the largest current bottleneck. For example, consider nodes S, A, B, C, T with edges: S–A (10), S–B (5), A–C (8), B–C (12), C–T (7), A–T (3). Starting from S(∞), relax S–A: bottleneck[A]=10, S–B: bottleneck[B]=5. Extract A(10), relax A–C: min(10,8)=8 > –∞, so C=8; relax A–T: min(10,3)=3. Extract C(8), relax C–T: min(8,7)=7 > current T(3), update T to 7. Finally T=7. The path S–A–C–T yields bottleneck 7, which is optimal. The algorithm finds the maximin path correctly.
在标准的最短路径问题中,代价是可加的,我们力求最小化边权之和。但此处,一条路径的疏散容量取决于其最窄的道路。最大化最小容量是一个最大最小问题——即寻找瓶颈容量最高的路径。Dijkstra 算法依赖最优子结构:到达某节点的瓶颈容量等于任意到达该节点的沿途最小边权的最大值。我们将距离数组改为存储当前最佳瓶颈容量,除源点 S 初始化为 +∞(或极大值)外,其余节点初始化为 –∞。在对边 (u, v) 权重为 w 进行松弛时,新瓶颈为 min(bottleneck[u], w)。若该值大于 bottleneck[v],则更新 bottleneck[v] 并将 v 入队。优先级队列仍提取当前瓶颈最大的节点。例如,考虑节点 S, A, B, C, T,边:S–A (10), S–B (5), A–C (8), B–C (12), C–T (7), A–T (3)。从 S(∞) 开始,松弛 S–A:bottleneck[A]=10,S–B:bottleneck[B]=5。提取 A(10),松弛 A–C:min(10,8)=8 > –∞,C 设为 8;松弛 A–T:min(10,3)=3。提取 C(8),松弛 C–T:min(8,7)=7 > 当前 T(3),更新 T 为 7。最终 T=7。路径 S–A–C–T 的瓶颈为 7,这是最优解。该算法正确地找到了最大最小路径。
4. SQL Queries and Biodiversity Monitoring | SQL 查询与生物多样性监测
Ecologists record pollinator visits using a table Observations (ObsID PK, Species VARCHAR, PlantVisited VARCHAR, FlowerColour VARCHAR, VisitDate DATE, DurationSec INT). Write SQL statements to: (a) list all distinct pollinator species that visited both blue and yellow flowers on the same day; (b) find the average visit duration per plant species for all observations in 2023, displaying PlantVisited and average duration rounded to one decimal place; (c) output the top three plant species in terms of total visits in September 2023, showing the count. Discuss how the results of such queries can inform conservation planning for endangered plants.
生态学家使用一张表 Observations(ObsID 主键,Species 传粉者物种,PlantVisited 被访植物,FlowerColour 花色,VisitDate 日期,DurationSec 持续时间秒数)记录传粉者访花活动。请编写 SQL 语句完成:(a) 列出所有在同一天既访过蓝色花又访过黄色花的不同传粉者物种;(b) 计算 2023 年所有观察中每种植物平均访问时长,显示植物物种和保留一位小数的平均时长;(c) 输出 2023 年 9 月总访问次数最多的前三种植物物种,显示计数值。讨论此类查询结果如何为濒危植物保护规划提供信息。
ions o2 ON o1.Species = o2.Species AND o1.VisitDate = o2.VisitDate WHERE o1.FlowerColour = 'blue' AND o2.FlowerColour = 'yellow' (c) SELECT PlantVisited, COUNT(*) AS TotalVisits FROM Observations WHERE VisitDate BETWEEN '2023‑09‑01' AND '2023‑09‑30' nces, which are likely key generalists that support many plant species. Average visit durations highlight which plants retain pollinators longer, potentially increasing pollen transfer. The top‑three most‑visited plants in September indicate critical floral resources during late‑season foraging. When combined with endangered‑ pollinators, ensuring that rare plants also receive visits during their flowering periods.
ions o2 ON o1.Species = o2.Species AND o1.VisitDate = o2.VisitDate WHERE o1.FlowerColour = 'blue' AND o2.FlowerColour = 'yellow' (c) SELECT PlantVisited, COUNT(*) AS TotalVisits FROM Observations WHERE VisitDate BETWEEN '2023‑09‑01' AND '2023‑09‑30' GROUP BY PlantVisited ORDER BY TotalVisits DESC LIMIT 3; 这些查询使生态学家能够识别具广泛颜色偏好的传粉者物种,它们通常是支持多种植物生存的关键泛性传粉者。平均访问时长可突出哪些植物将传粉者留住更久,从而可能增加花粉传递。九月访问量前三的植物则指示晚季觅食期间的关键花蜜资源。结合濒危植物状态数据后,保护规划者可以优先建立包含泛性传粉者偏好植物的栖息地廊道,确保珍稀植物在其花期内也能获得传粉者光顾。
5. Floating‑Point Representation and Seismology Error Analysis | 浮点表示与地震学误差分析
A seismograph stores ground acceleration values in a simplified 12‑bit floating‑point format: 5‑bit mantissa (normalised, with an implicit leading 1) and 7‑bit exponent in excess‑32 notation. The first bit of the mantissa field is the sign. The value 0.15625 (decimal) is captured. Convert this value into the given format, showing the sign, biased exponent, and mantissa bits. Then analyse the absolute and relative representation error introduced by the limited mantissa precision when the actual acceleration is 0.15600. Discuss why such rounding errors can matter when integrating acceleration to obtain velocity in earthquake engineering.
某地震仪采用简化的 12 位浮点格式存储地表加速度值:5 位尾数(已规格化,隐含前导 1)和 7 位以移码-32 表示的指数。尾数字段的第一个位为符号位。捕获到的值为 0.15625(十进制)。请将该值转换为给定格式,显示符号位、带偏指数的指数及尾数位。随后分析当实际加速度为 0.15600 时,因有限的尾数精度引入的绝对误差和相对误差。讨论为何在地震工程中由加速度积分得到速度时,这种舍入误差会至关重要。
= 1/8 + 1/32 = 0.00101₂. Normalise: 1.01₂ × 2⁻³. Sign bit = 0 (positive). True exponent = –3. Excess‑32 biased exponent = – 101 (7 bits). The implicit leading 1 is removed; mantissa field stores the fractional bits "01" padded with zeros to 5 bits: 01000. So the 12‑bit pattern: sign(1) | exponent(7) | ext smaller normalised float would be 1.00₂ × 2⁻³ = 0.125, leaving a gap. Absolute error = |0.15625 – 0.15600| = 0.00025. Relative error = 0.00025 / 0.15600 ≈ 0.00160 or 0.16% nt amplifies initial rounding errors significantly, leading to unrealistic baseline shifts. Engineers apply correction filters precisely because low‑ and quantisation errors cause integrated traces to drift, masking the true ground motion.
首先将 0.15625 转为二进制:0.15625 = 1/8 + 1/32 = 0.00101₂。规格化:1.01₂ × 2⁻³。符号位 = 0(正数)。真指数 = –3。移码-32 偏指数 = –3 + 32 = 29,二进制 0011101(7 位)。隐含前导 1 被移除;尾数字段存储小数位“01”并补零至 5 位:01000。因此 12 位模式为:符号(1) | 指数(7) | 尾数(5) = 0 0011101 01000。对于实际值 0.15600,最接近的可表示数仍是 0.15625,因为下一个更小的规格化浮点数为 1.00₂ × 2⁻³ = 0.125,中间存在间隙。绝对误差 = |0.15625 – 0.15600| = 0.00025。相对误差 ≈ 0.16%。虽然微小,对加速度的数值积分会引入累积漂移。在地震记录中,双重积分到位移会将初始舍入误差显著放大,导致不真实的基线偏移。正是因为低频噪声和量化误差导致积分波形漂移、掩盖真实地面运动,工程师才必须采用校正滤波器。
6. Sorting Algorithms and Periodic Table Organisation | 排序算法与元素周期表组织
A chemistry education app loads the first 20 elements with atomic numbers, symbols, and electron configurations into an array of records. It then sorts them by electron affinity (a numerical value) using an insertion sort. Trace the insertion sort pass‑by‑pass for the following electron affinity values (in kJ/mol) of five elements: Li (–60), Be (0), B (–27), C (–122), N (7). Write down the array state after each insertion. Explain why insertion sort is a suitable choice for a nearly‑sorted dataset, and discuss how pre‑sorting by atomic number creates a near‑ordered sequence in electron affinity for certain groups.
某化学教育应用将前 20 号元素的原子序数、符号和电子排布加载到一个记录数组中,然后使用插入排序按电子亲和势(数值)进行排序。请对五个元素的以下电子亲和势值(单位 kJ/mol)逐步追踪插入排序:Li (–60), Be (0), B (–27), C (–122), N (7)。写出每次插入后的数组状态。解释为何插入排序对于近有序数据集是合适的选择,并讨论按原子序数预排序如何使特定族元素的电子亲和势序列接近有序。
Initial array (order of elements given): Li –60, Be 0, B –27, C –122, N 7. Pass 1 (index 1, Be 0): compare with Li –60, 0 > –60, no shift. State: (Li –60, Be 0, B –27, C –122, N 7). Pass 2 (B –27): compare with Be 0: –27 < 0, shift Be right; compare with Li –60: –27 > –60, insert. State: (Li –60, B –27, Be 0, C –122, N 7). Pass 3 (C –122): compare with Be 0, shift right; B –27, shift right; Li –60, compare –122 < –60, shift Li right; insert at front. State: (C –122, Li –60, B –27, Be 0, N 7). Pass 4 (N 7): compare with Be 0, shift right; B –27: 7 > –27, insert after B. Final: (C –122, Li –60, B –27, Be 0, N 7). Insertion sort runs in O(n²) worst‑case but O(n) when the array is nearly sorted, thanks to minimal shifting. In the periodic table, electron affinity generally becomes more negative across a period as nuclear charge increases, so the order by atomic number already yields a rough monotonic trend. Deviations caused by filled and half‑filled subshells create small local inversions, making insertion sort very efficient — it only swaps a few adjacent elements.
初始数组(按元素给定顺序):Li –60, Be 0, B –27, C –122, N 7。第 1 趟(索引 1,Be 0):与 Li –60 比较,0 > –60,不移位。状态:(Li –60, Be 0, B –27, C –122, N 7)。第 2 趟(B –27):与 Be 0 比较,–27 < 0,Be 右移;与 Li –60 比较,–27 > –60,插入。状态:(Li –60, B –27, Be 0, C –122, N 7)。第 3 趟(C –122):依次与 Be 0、B –27、Li –60 比较,均小于,全部右移,插入最前。状态:(C –122, Li –60, B –27, Be 0, N 7)。第 4 趟(N 7):与 Be 0 比较,7 > 0,不移位,但与 Be 比较后插入 Be 之左?详细:从右向左,先 compare with Be 0: 7 > 0? 不,7 > 0 则为真,但排序要求升序(更负的在前)。升序即递增,最负值在前。所以 C –122 最负,然后 Li –60,B –27,Be 0,N 7。所以当插入 N 7 时,从末尾 Be 0 开始比较,7 > 0 且 Be 0 已比 7 小,所以位置正确,无移位。最终状态:(C –122, Li –60, B –27, Be 0, N 7)。插入排序最坏情况 O(n²),但在数组近有序时为 O(n),得益于极少移位。在元素周期表中,电子亲和势通常随周期内核电荷增加而变得更负,所以按原子序数排序已呈大致单调趋势。由满壳层和半满壳层引起的偏差仅造成局部小幅倒置,这使得插入排序极为高效——它只需交换相邻的少数几个元素。
7. Network Protocols and Satellite Communication Latency | 网络协议与卫星通信延时
ation communicates with a geostationary satellite at an altitude of 35,786 km using a stop‑and‑ Mbps, and frame size is 1000 bytes. The speed of light is 3 × 10⁸ m/s. Calculate the round‑ ng window) to improve utilisation, and compute the minimum window size needed to achieve 100% utilisation, ignoring processing delays.
某地面站使用停止等待 ARQ 协议与高度 35,786 km 的对地静止卫星通信。数据速率为 1 Mbps,帧大小为 1000 字节。光速为 3 × 10⁸ m/s。计算往返时间 (RTT),并证明信道利用率(效率)极低。然后建议如何修改协议(例如滑动窗口)以提高利用率,并计算在忽略处理延迟的情况下,实现 100% 利用率所需的最小窗口尺寸。
6 ms. Transmission time for one frame: frame size 1000 bytes = 8000 bits. Time = 8000 / 1×10⁶ = 0.008 s = 8 ms. With stop‑and‑ ansmission time) / (Total cycle time) = 8 ms / (8 + 238.6) ms ≈ 8 / 246.6 ≈ 0.0324 or 3.24%. This is extremely wasteful. To improve, a sliding‑indow protocol allows multiple frames to be sent before waiting for the first ACK. For 100% ow size W must satisfy: W × transmission time ≥ RTT + transmission time. Thus W ≥ (RTT + Tframe) / Tframe 30.825. So at least 31 frames must be in the pipeline. In practice, selective repeat or go‑back‑ is used with appropriate sequence numbers. Geostationary links almost always employ window‑based flow control to overcome the high latency.
单程距离 = 35,786 km = 35,786,000 m。单程传播延时 = 距离/光速 = 35,786,000 / 3×10⁸ ≈ 0.1193 s。RTT ≈ 0.2386 s = 238.6 ms。一帧传输时间:1000 字节 = 8000 比特,时间 = 8000 / 1×10⁶ = 0.008 s = 8 ms。采用停止等待协议时,发送方发送一帧并等待 ACK,整个周期为 RTT + 传输时间。利用率 U = 8 / (8+238.6) ≈ 3.24%,极低。为改进,滑动窗口协议允许在等待首个 ACK 前发送多个帧。要实现 100% 利用率,窗口大小 W 需满足:W × 传输时间 ≥ RTT + 传输时间,因此 W ≥ (246.6 / 8) ≈ 30.825。所以管道中至少需 31 帧。实际中多使用选择重传或退 N 步协议并配备适当的序号。对地静止链路几乎总是采用基于窗口的流量控制来克服高延迟。
8. Regular Expressions and Palaeography Manuscript Markup | 正则表达式与古文字手稿标记
A digital humanities project aims to extract all abbreviations of the form “c. 1250” (century abbreviation) from a medieval Latin text corpus. The pattern starts with "c." followed by an optional space, then one to four digits, and may end with “–” and another set of digits. Write a regular expression that matches these century abbreviations supporting Unicode characters. Test it against the string “Written c.1245–1270 and later c. 1300.” Explain each metacharacter used and discuss why regular expressions are preferred over manual string searching in large historical archives.
某数字人文项目计划从中世纪拉丁语文集中提取所有形如“c. 1250”(世纪缩写)的缩写。该模式以“c.”开头,后跟可选空格,接着是一至四位数字,可能以“–”及另一组数字结尾。请编写一个匹配此类世纪缩写并支持 Unicode 字符的正则表达式,并使用字符串“Written c.1245–1270 and later c. 1300.”进行测试。解释所用到的每个元字符,并讨论为何在大型历史档案中正则表达式优于手动字符串搜索。
Pattern: \bc\.\s?\d{1,4}(?:–\d{1,4})?\b. Breakdown: \b asserts a word boundary so that "c." is not part of a larger word. c\. matches literal "c." (the dot is escaped). \s? matches an optional whitespace character (space, tab). \d{1,4} matches one to four digits. (?: ... )? is an optional non‑capturing group for the optional dash‑digits part: – matches a hyphen (En dash also possible, but here dash), then \d{1,4} again. The final \b ensures the number ends at a word boundary. Applied to test string: it matches "c.1245–1270" and "c. 1300". Regular expressions provide a declarative, compact way to describe patterns; they are processed by efficient finite‑state machines. In an archive of millions of manuscripts, regex engines scan texts far faster than nested loops with substring checks, and they handle variations (optional spaces, different dash styles) gracefully. They also integrate into programming languages and document tools (e.g., Python ‘re’ module, XQuery), enabling batch extraction and metadata enrichment for scholarly research.
模式:\bc\.\s?\d{1,4}(?:–\d{1,4})?\b。分解:\b 声明单词边界,确保“c.”不是更长词的一部分;c\. 匹配字面量“c.”(点号被转义);\s? 匹配可选的空白符;\d{1,4} 匹配一至四位数字;(?: ... )? 是一个可选的非捕获组,用于可选的破折号—数字部分:– 匹配连字符(也可能是全角破折号),然后再次 \d{1,4};末尾 \b 确保数字结尾为单词边界。应用于测试串时,匹配到“c.1245–1270”和“c. 1300”。正则表达式提供一种声明式、紧凑的模式描述方式,由高效的有穷自动机处理。在包含数百万手稿的档案中,正则引擎扫描文本的速度远超嵌套循环和子串检查,且能优雅地处理变体(可选空格、不同破折号样式)。它们还能集成到编程语言和文档工具(如 Python ‘re’ 模块、XQuery)中,实现批量提取和元数据充实,以供学术研究使用。
9. Algorithm Complexity and Financial Time‑Series Analysis | 算法复杂度与金融时间序列分析
A stock‑trading algorithm needs to compute the maximum subarray sum (gain) over consecutive daily prices to decide buy/sell points. Given an array of integer daily changes in pence, propose Kadane’s algorithm (linear‑time) and trace it on the sequence: {–2, 5, –1, 7, –3, 4}. At each step record current max ending here and global max. Then discuss what would happen if a brute‑force O(n²) approach were used for a one‑minute chart with 3,600 data points, and explain why understanding algorithmic complexity is essential when processing real‑time financial feeds.
某股票交易算法需要计算连续每日价格的最大子数组和(收益)以决定买卖点。给定一个以便士为单位的每日涨跌整数数组,请提出 Kadane 算法(线性时间),并在序列 {–
Published by TutorHao | Year 12 Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图