📚 Year 11 WJEC Computer Science: Interdisciplinary Question Practice | 跨学科综合题型训练
Interdisciplinary questions in WJEC Computer Science blend core computing concepts with mathematics, physics, electronics, and information theory. Mastering them means you can apply binary logic to circuit design, analyse algorithm efficiency using functions, and calculate file sizes from physical measurements. This revision guide walks you through nine key integrated topic areas, each with a worked example and bilingual commentary to sharpen your problem‑solving skills.
WJEC 计算机科学中的跨学科题目将核心计算概念与数学、物理、电子和信息理论相融合。掌握这些题目意味着你可以将二进制逻辑应用到电路设计中,用函数分析算法效率,以及从物理测量中计算文件大小。本复习指南带你走过九个关键的整合主题领域,每个主题都配有一个例题和双语讲解,以磨练你的问题解决能力。
1. Binary Arithmetic & Boolean Algebra | 二进制运算与布尔代数
A security system for a laboratory uses four sensors (A, B, C, D), each outputting 1 when triggered. The alarm must sound if at least two sensors are activated, or if sensor A is triggered and exactly one other sensor is active. You are asked to produce the Boolean expression that controls the alarm, minimise it, and draw the corresponding logic gate circuit.
一个实验室的安全系统使用四个传感器(A, B, C, D),每个触发时输出 1。如果至少有两个传感器被激活,或者传感器 A 被触发且恰好另外只有一个传感器激活,报警器必须响起。请你写出控制报警器的布尔表达式、对其进行化简,并画出相应的逻辑门电路。
Step‑by‑step solution: We begin by building the truth table for F(A,B,C,D). Then we extract the minterms and apply Boolean algebra or a Karnaugh map to simplify.
分步解答:我们先构建 F(A,B,C,D) 的真值表,然后提取最小项并应用布尔代数或卡诺图进行化简。
| A B C D | F |
| 0 0 0 0 | 0 |
| 0 0 0 1 | 0 |
| 0 0 1 0 | 0 |
| 0 0 1 1 | 1 |
| 0 1 0 0 | 0 |
| 0 1 0 1 | 1 |
| 0 1 1 0 | 1 |
| 0 1 1 1 | 1 |
| 1 0 0 0 | 0 |
| 1 0 0 1 | 1 |
| 1 0 1 0 | 1 |
| 1 0 1 1 | 1 |
| 1 1 0 0 | 1 |
| 1 1 0 1 | 1 |
| 1 1 1 0 | 1 |
| 1 1 1 1 | 1 |
From the truth table, the unsimplified sum of minterms is: F = ¬A¬BCD + ¬AB¬CD + ¬ABC¬D + ¬ABCD + A¬B¬CD + A¬BC¬D + A¬BCD + AB¬C¬D + AB¬CD + ABC¬D + ABCD. After grouping with a Karnaugh map we find F = AB + AC + AD + BCD. This translates directly into two‑level logic: a combination of AND and OR gates.
根据真值表,未化简的最小项之和为:F = ¬A¬BCD + ¬AB¬CD + ¬ABC¬D + ¬ABCD + A¬B¬CD + A¬BC¬D + A¬BCD + AB¬C¬D + AB¬CD + ABC¬D + ABCD。经过卡诺图化简后我们得到 F = AB + AC + AD + BCD。这可以直接转换为两级逻辑:与门和或门的组合。
2. Logic Gates & Electronic Circuits | 逻辑门与电子电路
A factory uses two normally‑open push buttons (S₁, S₂) and a key switch (S₃). The conveyor belt motor (M) should run only when either both push buttons are pressed simultaneously, or the key switch is activated regardless of the push buttons. Express the motor control as a Boolean equation using the logic states of the switches, then implement the simplest gate circuit.
一家工厂使用两个常开按钮 (S₁, S₂) 和一个钥匙开关 (S₃)。传送带电机 (M) 只应在两个按钮被同时按下时,或者无论按钮状态如何只要钥匙开关激活时运行。用开关的逻辑状态表达电机控制的布尔方程,然后实现最简单的门电路。
Assume switch closed = logic 1. Motor M = (S₁ ∧ S₂) ∨ S₃. We combine an AND gate for S₁·S₂ and an OR gate to add S₃. The Boolean expression is already minimal; a circuit diagram would show signals from S₁ and S₂ feeding into a two‑input AND, the output of that AND entering a two‑input OR together with S₃, and the OR driving the motor relay.
假设开关闭合 = 逻辑 1。电机 M = (S₁ ∧ S₂) ∨ S₃。我们将一个与门用于 S₁·S₂,再用一个或门加上 S₃。布尔表达式已经是最简形式;电路图会显示 S₁ 和 S₂ 的信号输入一个两输入与门,该与门的输出与 S₃ 一同进入一个两输入或门,最后由或门驱动电机继电器。
3. Data Representation & Physical Measurements | 数据表示与物理度量
A biologist scans a microscope slide photograph at 600 dpi. The original area captured is 2.5 inches by 1.5 inches, and the image is saved with a 24‑bit colour depth. Calculate the file size in megabytes. This requires you to convert physical dimensions into pixels and then into bits.
一位生物学家以 600 dpi 扫描一张显微镜载玻片照片。原始区域为 2.5 英寸 × 1.5 英寸,图像以 24 位色深保存。计算文件大小,以兆字节为单位。这需要你将物理尺寸转换为像素数,再转换为比特数。
Number of pixels = (2.5 × 600) × (1.5 × 600) = 1500 × 900 = 1,350,000 pixels. Total bits = 1,350,000 × 24 = 32,400,000 bits. Divide by 8 to get bytes: 4,050,000 bytes. Then divide by 1,048,576 to get MB: approximately 3.86 MB. So the uncompressed image requires about 3.86 MB of storage.
像素总数 = (2.5 × 600) × (1.5 × 600) = 1500 × 900 = 1,350,000 像素。总比特数 = 1,350,000 × 24 = 32,400,000 比特。除以 8 得到字节数:4,050,000 字节。再除以 1,048,576 得到 MB:约 3.86 MB。因此未压缩图像需要约 3.86 MB 存储空间。
4. Compression & Information Theory | 数据压缩与信息论基础
Given the message “MISSISSIPPI”, create a Huffman coding tree using the frequency of each character. Compare the average bit‑length per character with a fixed 8‑bit ASCII encoding. This blends tree‑building algorithms with probability and coding theory.
给定消息 “MISSISSIPPI”,使用每个字符的频率创建霍夫曼编码树。比较每个字符的平均比特长度与固定 8 位 ASCII 编码。这融合了树构建算法与概率和编码理论。
Frequencies: M=1, I=4, S=4, P=2. Build the Huffman tree by repeatedly merging the two lowest frequencies. The resulting code lengths are: M(3 bits), P(3 bits), I(2 bits), S(2 bits). Average bits per symbol = (1×3 + 4×2 + 4×2 + 2×3) / 11 = (3+8+8+6)/11 = 25/11 ≈ 2.27 bits per character, versus 8 bits per character in ASCII. The compression ratio here is roughly 3.5 : 1.
频率:M=1, I=4, S=4, P=2。通过反复合并两个最低频率构建霍夫曼树。得到的码长分别为:M(3 bit), P(3 bit), I(2 bit), S(2 bit)。平均每符号比特数 = (1×3 + 4×2 + 4×2 + 2×3) / 11 = (3+8+8+6)/11 = 25/11 ≈ 2.27 比特每字符,而 ASCII 编码每字符 8 比特。这里的压缩比约为 3.5 : 1。
5. Error Detection & Parity Mathematics | 错误检测与奇偶校验数学
A 7‑bit ASCII character ‘G’ (1000111) is transmitted with even parity. What is the full 8‑bit string? After transmission, the receiver re‑calculates parity and suspects an error if bits 2 and 5 have flipped. Show mathematically how rectifying parity works and why it cannot detect all double‑bit errors.
一个 7 位 ASCII 字符 ‘G’(1000111)使用偶校验传输。完整的 8 位串是什么?传输后,接收方重新计算奇偶校验并且怀疑第二和第五位发生了翻转。用数学方法展示奇偶校验的修正原理,并说明为什么它无法检测所有的双位错误。
Even parity means the number of 1s must be even. In 1000111 there are four 1s — already even — so parity bit is 0, giving 01000111. If two bits flip, the number of 1s changes by 0, +2, or −2, remaining even; the parity check would pass, hiding the error. This is because parity is a modulo‑2 sum: any even number of flips yields the same parity. Hence, parity is only guaranteed to detect odd numbers of bit flips.
偶校验意味着 1 的个数必须为偶数。1000111 中有四个 1 ——已经是偶数 ——所以校验位是 0,得到 01000111。如果有两个位翻转,1 的个数变化为 0、+2 或 −2,保持偶数;奇偶校验会通过,隐藏了错误。这是因为奇偶校验是模 2 和:任意偶数个翻转产生相同的奇偶性。因此,奇偶校验仅能保证检测到奇数个位的翻转。
6. Sorting Algorithms & Mathematical Efficiency | 排序算法与数学效率
You are asked to compare the worst‑case number of comparisons for bubble sort and merge sort on a list of n elements. For bubble sort the formula is n(n−1)/2; for merge sort it is n⋅log₂(n) − n + 1. Using n = 1024, compute both values precisely and explain how growth rates affect algorithm choice for real‑world data sets.
要求你比较冒泡排序和归并排序在最坏情况下对 n 个元素的比较次数。冒泡排序的公式是 n(n−1)/2;归并排序的公式是 n·log₂(n) − n + 1。使用 n = 1024,精确计算这两个值,并解释增长率如何影响针对真实世界数据集的算法选择。
For n = 1024, bubble‑sort comparisons = 1024 × 1023 / 2 = 523,776. Merge‑sort comparisons = 1024 × 10 − 1024 + 1 = 10,240 − 1024 + 1 = 9,217. Bubble sort is O(n²) while merge sort is O(n log n). The 56‑fold difference for just 1024 items becomes astronomical for millions of records, illustrating why quadratic algorithms become impractical for large inputs.
对于 n = 1024,冒泡排序比较次数 = 1024 × 1023 / 2 = 523,776。归并排序比较次数 = 1024 × 10 − 1024 + 1 = 10,240 − 1024 + 1 = 9,217。冒泡排序是 O(n²) 而归并排序是 O(n log n)。仅 1024 项就有 56 倍的差距,对于百万级记录这一差距会变成天文数字,这说明了为什么平方阶算法对于大输入不可行。
7. Programming & Mathematical Recursion | 编程与数学递归
Write a pseudocode function ‘fibonacci(n)’ that returns the nth Fibonacci number, defined as Fib(0)=0, Fib(1)=1, and Fib(k)=Fib(k−1)+Fib(k−2). Use a recursive approach and then a loop‑based iterative version. Discuss the difference in time complexity between the two implementations.
编写一个伪代码函数 ‘fibonacci(n)’,返回第 n 个斐波那契数,定义 Fib(0)=0, Fib(1)=1,且 Fib(k)=Fib(k−1)+Fib(k−2)。分别使用递归方法和基于循环的迭代版本。讨论两种实现在时间复杂度上的差异。
Recursive version: FUNCTION fib(n) IF n ≤ 1 RETURN n ELSE RETURN fib(n‑1) + fib(n‑2). This has exponential time O(2ⁿ) because it recalculates the same sub‑problems many times. Iterative version: a ← 0, b ← 1, FOR i FROM 2 TO n, temp ← a + b, a ← b, b ← temp, RETURN b. This runs in O(n) time and spatial efficiency O(1), demonstrating how algorithmic thinking transforms a mathematical definition into a practical program.
递归版本:FUNCTION fib(n) IF n ≤ 1 RETURN n ELSE RETURN fib(n‑1) + fib(n‑2)。这具有指数时间 O(2ⁿ),因为它多次重复计算相同的子问题。迭代版本:a ← 0, b ← 1, FOR i FROM 2 TO n, temp ← a + b, a ← b, b ← temp, RETURN b。这以 O(n) 时间和 O(1) 空间运行,展示了算法思维如何把一个数学定义转化为实用的程序。
8. Networking & Transmission Physics | 网络与传输物理
A 50 MB file is uploaded to a server over a 100 Mbps fibre‑optic connection that spans 80 km. The speed of light in the fibre is 2 × 10⁸ m/s. Calculate the total delivery time, taking both propagation delay and transmission time into account. Express your answer in milliseconds.
一个 50 MB 的文件通过一条跨越 80 km 的 100 Mbps 光纤连接上传到服务器。光纤中的光速为 2 × 10⁸ m/s。计算总传输时间,同时考虑传播延迟和发送时间。以毫秒为单位给出答案。
First, transmission time = (file size in bits) / data rate = (50 × 8 × 2²⁰ bits) / (100 × 10⁶ bps). Carefully: 50 MB = 50 × 2²⁰ bytes = 50 × 2²⁰ × 8 bits = 419,430,400 bits. Rate = 100 × 10⁶ = 10⁸ bps. Transmission time = 419,430,400 / 100,000,000 = 4.194304 seconds = 4194.304 ms. Propagation delay = distance / speed = 80,000 m / 2×10⁸ m/s = 0.0004 s = 0.4 ms. Total ≈ 4194.704 ms. The transmission time dominates completely over propagation delay.
首先,发送时间 = (文件大小比特数) / 数据速率 = (50 × 8 × 2²⁰ bit) / (100 × 10⁶ bps)。仔细计算:50 MB = 50 × 2²⁰ 字节 = 50 × 2²⁰ × 8 比特 = 419,430,400 比特。速率 = 100 × 10⁶ = 10⁸ bps。发送时间 = 419,430,400 / 100,000,000 = 4.194304 秒 = 4194.304 ms。传播延迟 = 距离 / 速度 = 80,000 m / 2×10⁸ m/s = 0.0004 s = 0.4 ms。总时间 ≈ 4194.704 ms。发送时间完全主导了传播延迟。
9. Sensors & Digital Data Acquisition | 传感器与数字数据采集
A temperature sensor outputs 0 V at 0 °C and 5 V at 100 °C. An 8‑bit analogue‑to‑digital converter (ADC) is used to digitise the voltage over the whole 0–5 V range. What is the temperature resolution? Calculate the digital code for a reading of 32.5 °C and discuss quantisation error with respect to physical measurement.
一个温度传感器在 0 °C 输出 0 V,在 100 °C 输出 5 V。使用一个 8 位模数转换器 (ADC) 将整个 0–5 V 范围的电压数字化。温度分辨率是多少?计算 32.5 °C 读数对应的数字编码,并讨论相对于物理测量的量化误差。
ADC resolution in volts = 5 V / 2⁸ = 5 / 256 = 0.01953125 V per step. Temperature coefficient = 100 °C / 5 V = 20 °C/V. So temperature resolution = 0.01953125 V × 20 °C/V = 0.390625 °C per step. For 32.5 °C, voltage = (32.5 / 100) × 5 = 1.625 V. Digital code = floor(1.625 / 0.01953125) = floor(83.2) = 83 (decimal). The quantisation error means actual measured temperature can be off by up to ±0.195 °C, which is inherent to the ADC’s finite bit‑depth.
ADC 电压分辨率 = 5 V / 2⁸ = 5 / 256 = 0.01953125 V 每步。温度系数 = 100 °C / 5 V = 20 °C/V。因此温度分辨率 = 0.01953125 V × 20 °C/V = 0.390625 °C 每步。对于 32.5 °C,电压 = (32.5 / 100) × 5 = 1.625 V。数字编码 = floor(1.625 / 0.01953125) = floor(83.2) = 83(十进制)。量化误差意味着实际测得的温度可能偏差达 ±0.195 °C,这是 ADC 有限比特深度所固有的。
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课程辅导,国外大学本科硕士研究生博士课程论文辅导