📚 Year 11 OCR Computer Science: Interdisciplinary Comprehensive Question Training | Year 11 OCR 计算机:跨学科综合题型训练
In the OCR GCSE Computer Science course, students are increasingly expected to apply computational thinking across disciplines. This article provides a rigorous set of interdisciplinary problem-solving exercises that connect computer science with mathematics, science, logic, and real-world contexts. Each section targets a different syllabus area while integrating knowledge from other subjects, helping you build the flexible mindset required for top marks.
在 OCR GCSE 计算机科学课程中,学生越来越需要将计算思维应用到跨学科情景中。本文提供了一系列严格的跨学科问题解决练习,将计算机科学与数学、科学、逻辑以及真实世界场景联系起来。每一节都针对不同的考纲领域,同时融入了其他学科的知识,帮助你培养取得高分所需的灵活思维方式。
1. Binary Arithmetic and Mathematical Foundations | 二进制算术与数学基础
Binary number systems form the bedrock of all computing, and their operations directly mirror those in base‑10 mathematics. You will often be asked to perform addition, subtraction, or multiplication on binary numbers, then interpret the result in a real‑world context such as memory addresses or pixel colours.
二进制数制是所有计算的基础,其运算与十进制数学直接对应。考试中常要求对二进制数进行加法、减法或乘法运算,然后在诸如内存地址或像素颜色等真实场景中解读运算结果。
Example question: A computer stores the coordinates of a sprite using two 8‑bit unsigned integers. The x‑coordinate is 01101001₂ and the y‑coordinate is 00011011₂. Calculate the sum of the coordinates and express it as a binary number and a decimal integer. If the sprite moves 5 pixels to the right, show the new x‑coordinate in binary using two's complement representation. Explain how overflow might occur if the coordinate exceeds 127.
例题: 一台计算机用两个 8 位无符号整数存储精灵的坐标。x 坐标是 01101001₂,y 坐标是 00011011₂。计算坐标之和,并用二进制数和十进制整数表示。若精灵向右移动 5 个像素,请用二进制补码表示新的 x 坐标。解释当坐标超过 127 时为何会发生溢出。
- 01101001₂ = 105, 00011011₂ = 27 → sum = 132 (10000100₂) – this exceeds 127, so overflow occurs in an 8‑bit unsigned register.
- New x = 105 + 5 = 110 = 01101110₂; as a signed two's complement, it remains positive if the MSB is 0.
- Overflow: In an 8‑bit signed system, 132 would give 10000100₂, which is −124 if interpreted as two's complement, causing logical errors in positioning.
- 01101001₂ = 105,00011011₂ = 27 → 和为 132 (10000100₂) — 这超过了 127,在 8 位无符号寄存器中会发生溢出。
- 新 x 坐标 = 105 + 5 = 110 = 01101110₂;作为有符号二进制补码,若最高有效位为 0 则仍表示正数。
- 溢出:在 8 位有符号系统中,132 会给出 10000100₂,若解释为二进制补码则为 -124,导致定位出现逻辑错误。
2. Boolean Logic and Circuit Design | 布尔逻辑与电路设计
Boolean algebra links computer science directly with discrete mathematics and electronics. Typical cross‑disciplinary tasks involve drawing truth tables for logic expressions, simplifying them using algebraic laws, and then implementing the circuit with specific logic gates.
布尔代数将计算机科学与离散数学及电子学直接联系起来。典型的跨学科任务包括为逻辑表达式绘制真值表、使用代数定律化简表达式,然后用具体的逻辑门实现电路。
Scenario: n (Q=1) or motion is detected (R=1), but not both. Derive the Boolean expression, draw the truth table, and design the logic circuit using only NAND gates.
场景: 一个报警系统使用三个传感器:P(门)、Q(窗)、R(移动)。当门关闭 (P=0) 且窗户开启 (Q=1) 或检测到移动 (R=1) 但两者不同时发生时,报警器应响起。推导布尔表达式,绘制真值表,并仅用与非门设计逻辑电路。
- Condition: NOT P AND (Q XOR R). Expression: (¬P) ∧ (Q ⊕ R) or (P'.(Q XOR R))
- Truth table: P=0, Q=0, R=1 → 1; P=0, Q=1, R=0 → 1; others 0.
- Using NAND-only: XOR can be built from four NAND gates; AND from two NANDs; NOT from NAND tied together. Combine as NAND(NAND(P',XOR(Q,R)), NAND(P',XOR(Q,R))) to get AND after double negation.
- 条件:非 P 且 (Q 异或 R)。表达式:(¬P) ∧ (Q ⊕ R) 或 (P'·(Q ⊕ R))。
- 真值表:P=0, Q=0, R=1 → 1;P=0, Q=1, R=0 → 1;其他输出为 0。
- 仅用与非门:异或门可由四个与非门构成;与门由两个与非门构成;非门用与非门对接法。组合后可实现所需逻辑。
3. Algorithms and Mathematical Problem Solving | 算法与数学问题求解
Writing algorithms to solve numerical problems is a core skill. You need to translate mathematical procedures (finding HCF, sorting, searching) into pseudocode or flowcharts, analysing complexity and tracing variables.
编写解决数值问题的算法是一项核心技能。需要将数学过程(求最大公因数、排序、搜索)转化为伪代码或流程图,分析复杂度并追踪变量。
Task: Design an algorithm that inputs two positive integers and outputs their highest common factor (HCF) using the Euclidean algorithm. Use pseudocode, then trace it for inputs 252 and 105. Explain how the time complexity compares with a trial‑division method.
任务: 设计一个算法,输入两个正整数,使用欧几里得算法输出它们的最大公因数 (HCF)。使用伪代码,然后对输入 252 和 105 进行追踪。解释时间复杂度如何与试除法比较。
WHILE b ≠ 0
temp ← b
b ← a MOD b
a ← temp
ENDWHILE
OUTPUT a
- Trace: 252, 105 → 105, 42 → 42, 21 → 21, 0 → output 21.
- Euclidean algorithm has O(log n) complexity, whereas trial division is O(√n), much slower for large numbers.
- 追踪:252, 105 → 105, 42 → 42, 21 → 21, 0 → 输出 21。
- 欧几里得算法的时间复杂度为 O(log n),而试除法为 O(√n),对于大数来说慢得多。
4. Data Representation in Scientific Contexts | 科学背景下的数据表示
Hexadecimal and floating-point representations are used extensively in scientific computing to handle colour depths, memory dumps, and very large or very small measurements. This topic requires confident conversion between number systems and understanding precision limits.
十六进制和浮点表示在科学计算中被广泛用于处理色彩深度、内存转储以及极大或极小的测量值。本主题要求能熟练地在数制间转换,并理解精度限制。
Biology crossover: A DNA sequencer outputs data as a hexadecimal stream: 4F 6E 65 20 67 65 6E 65. Decode this into ASCII text. Then, if each hex pair represents a nucleotide read quality score (8‑bit unsigned), convert 4F to decimal and state whether the quality is above the threshold of 70.
生物学交叉: 一台 DNA 测序仪以十六进制流输出数据:4F 6E 65 20 67 65 6E 65。将其解码为 ASCII 文本。然后,如果每对十六进制表示一个核苷酸读取质量得分(8 位无符号),将 4F 转换为十进制,并判断质量是否高于阈值 70。
- ASCII: 4F='O', 6E='n', 65='e', 20=' ', 67='g', 65='e', 6E='n', 65='e' → "One gene".
- 4F₁₆ = 4×16+15 = 79 > 70, so quality is sufficient.
- ASCII:4F='O', 6E='n', 65='e', 20='空格', 67='g', 65='e', 6E='n', 65='e' → "One gene"(一个基因)。
- 4F₁₆ = 4×16+15 = 79 > 70,因此质量足够。
5. Networking and Subnet Mathematics | 网络与子网数学
IP addressing and subnetting involve binary masking and Boolean AND operations, necessitating a solid grasp of bitwise logic. Cross‑disciplinary problems often ask you to determine whether two devices are on the same subnet or to calculate the number of hosts.
IP 地址与子网划分涉及二进制掩码和布尔 AND 运算,要求牢固掌握按位逻辑。跨学科问题常要求判断两个设备是否在同一子网,或计算主机数量。
Scenario: Device A: IP 192.168.1.25 / 24, Device B: IP 192.168.2.10 / 24. Show the ANDing process and explain why they cannot communicate without a router. Then extend: if the subnet mask changes to 255.255.254.0, do they become reachable? Provide the network addresses for both masks.
场景: 设备 A:IP 192.168.1.25 / 24,设备 B:IP 192.168.2.10 / 24。展示 AND 运算过程,并解释为何它们在没有路由器的情况下无法通信。然后扩展:如果子网掩码变为 255.255.254.0,它们是否可互访?给出两种掩码下的网络地址。
- 255.255.255.0: A network = 192.168.1.0, B network = 192.168.2.0 → different → need router.
- 192.168.1.25 AND 255.255.254.0 → 192.168.0.0; B: 192.168.2.10 AND same mask → 192.168.2.0? 5 = 11000000.10101000.00000001.00011001, 254 in third octet = 11111110, subnet 192.168.0.0? Actually, let' , 2 AND 254 = 2, network = 192.168.2.0. Still different. They remain on different subnets.
- /24 掩码 = 255.255.255.0:A 网络 = 192.168.1.0,B 网络 = 192.168.2.0 → 不同 → 需要路由器。
- 掩码 255.255.254.0:A 的 IP 与掩码 AND 后为 192.168.0.0,B 为 192.168.2.0,网络地址仍不同,无法直接通信。
6. Encryption and Modular Arithmetic | 加密与模运算
Encryption methods rely heavily on mathematical transformations. The Caesar cipher uses simple modular addition, while the more modern RSA algorithm (conceptual at GCSE) involves prime factorisation. Understanding these ties cryptography to pure mathematics.
加密方法大量依赖数学变换。凯撒密码使用简单的模加法,而更现代的 RSA 算法(GCSE 层面为概念性了解)涉及质因数分解。理解这些将密码学与纯数学联系起来。
Task: Encrypt the word "COMPUTER" with a Caesar shift of +5 modulo 26. Write the ciphertext. Then, if an attacker intercepts "XYWNTS", apply the inverse shift to recover the plaintext. Explain why shifting by the key's complement restores the original.
任务: 将单词 "COMPUTER" 用凯撒移位 +5(模 26)加密。写出密文。然后,如果攻击者截获 "XYWNTS",应用逆移位恢复明文。解释为何用密钥的补数移位能恢复原文。
- C→H, O→T, M→R, P→U, U→Z, T→Y, E→J, R→W → "HTRUZYJW".
- Decrypt "XYWNTS" with shift -5 (or +21): X→S, Y→T, W→R, N→I, T→O, S→N → "STRION"? 3) -5 = 18(S), Y(24) -5=19(T), W(22)-5=17(R), N(13)-5=8(I), T(19)-5=14(O), S(18)-5=13(N) → "STRION". This might be a name or code; process is correct.
- The inverse shift is (26 - 5) = 21 forward, which added to the original shift gives 26 ≡ 0 mod 26, reversing the operation.
- C→H, O→T, M→R, P→U, U→Z, T→Y, E→J, R→W → 密文为 "HTRUZYJW"。
- 解密 "XYWNTS" 用 -5 移位(或 +21):X→S, Y→T, W→R, N→I, T→O, S→N → "STRION"。
- 逆移位是 (26-5)=21 的正向移位,与原移位相加得 26 ≡ 0 mod 26,从而逆转操作。
7. Programming and Physics Simulations | 编程与物理模拟
Writing code to simulate physical systems demonstrates the power of computational models. This area requires translating formulas into code, handling inputs/outputs, and testing boundary conditions.
编写模拟物理系统的代码展示了计算模型的威力。该领域要求将公式转化为代码、处理输入/输出并测试边界条件。
Problem: v = u + a × t. Include input validation so that time cannot be negative. Then extend the program to calculate displacement s using s = u × t + 0.5 × a × t². Test with u=0, a=9.8, t=2.
问题: 编写一个 Python 程序,利用匀加速运动公式 v = u + a × t 计算物体的末速度,给定初速度 u、加速度 a 和时间 t。包含输入验证,确保时间不能为负。然后扩展程序,使用 s = u × t + 0.5 × a × t² 计算位移。用 u=0, a=9.8, t=2 进行测试。
u = float(input("Initial velocity: "))
a = float(input("Acceleration: "))
t = float(input("Time: "))
if t < 0: print("Time must be non‑negative")
else:
v = u + a * t
s = u * t + 0.5 * a * t**2
print("Final velocity:", v)
print("Displacement:", s)
- Test with 0, 9.8, 2: v = 19.6, s = 19.6, matches physics.
- 测试:u=0, a=9.8, t=2 → v=19.6, s=19.6,符合物理规律。
8. Databases and Statistical Data Analysis | 数据库与统计数据分析
Structured query language (SQL) is used to extract and manipulate data held in relational databases. Combining this with statistical queries (average, count) links computing to data handling in science and geography.
结构化查询语言 (SQL) 用于提取和操作关系型数据库中的数据。将它与统计查询(平均值、计数)结合起来,将计算机科学与科学和地理中的数据处理联系起来。
Scenario: A table 'WeatherData' contains fields: City, Country, Temperature, Rainfall. Write SQL to find the average temperature for cities in 'France'. Then write a query to list the city with the highest rainfall in the whole table. Explain how indexing on Country would speed up the first query.
场景: 表 'WeatherData' 包含字段:City, Country, Temperature, Rainfall。编写 SQL 查找 'France' 中所有城市的平均气温。然后编写查询列出整个表中降雨量最高的城市。解释在 Country 字段上建立索引为何能加速第一个查询。
- SELECT AVG(Temperature) FROM WeatherData WHERE Country = 'France';
- SELECT City FROM WeatherData WHERE Rainfall = (SELECT MAX(Rainfall) FROM WeatherData);
- Index on Country allows the DBMS to quickly locate rows with 'France' without scanning the whole table (binary search or B‑tree).
- SELECT AVG(Temperature) FROM WeatherData WHERE Country = 'France';
- SELECT City FROM WeatherData WHERE Rainfall = (SELECT MAX(Rainfall) FROM WeatherData);
- 在 Country 列上的索引使 DBMS 能快速定位含 'France' 的行,无需扫描整张表(二分搜索或 B 树)。
9. System Architecture and Electronics Integration | 系统架构与电子学集成
The fetch-decode-execute cycle and the role of the CPU can be represented using digital electronics. Flip‑flops, registers, and the ALU are built from logic gates, demonstrating deep links between computer architecture and physics/electronics.
取指-解码-执行循环以及 CPU 的角色可以用数字电子学来表示。触发器、寄存器和算术逻辑单元都是由逻辑门构建的,体现了计算机体系结构与物理/电子学之间的深层联系。
Question: Explain how a D‑type flip‑flop can be used as a 1‑bit memory in a register. Then describe, with a diagram (in words), how four D‑type flip‑flops can store a 4‑bit number and how an ALU adds two such numbers using full adders.
问题: 解释 D 型触发器如何用作寄存器中的 1 位存储器。然后,用文字描述(配图)四个 D 型触发器如何存储一个 4 位数,以及 ALU 如何使用全加器将两个这样的数相加。
- A D‑type flip‑flop captures the input D at a clock edge and holds it at Q, thus storing one bit until the next clock edge.
- Four flip‑flops in parallel form a 4‑bit register. To add two registers, connect their outputs to a 4‑bit ripple carry adder constructed from four full adders. Each full adder takes corresponding bits and a carry in, producing a sum bit and carry out to the next stage.
- D 型触发器在时钟边沿捕获输入 D 并保持在 Q 端,从而存储一位数据直到下一个时钟边沿。
- 四个触发器并排构成 4 位寄存器。将两个寄存器的输出连接到一个由四个全加器构成的 4 位行波进位加法器。每个全加器接收对应位和进位输入,产生和位及进位输出至下一级。
10. Ethical, Legal and Environmental Cross‑curricular Cases | 伦理、法律与环境的跨学科案例
Computer science does not exist in a vacuum. Debates around data privacy, AI bias, and e‑waste draw upon geography, citizenship, and law. You must be able to evaluate technological impact from multiple perspectives.
计算机科学并非存在于真空中。围绕数据隐私、人工智能偏见和电子垃圾的讨论涉及地理学、公民教育和法律。你必须能从多个角度评估技术影响。
Case Study: A city installs smart bins with sensors that report fill levels to optimize collection routes. Discuss two environmental benefits and one privacy concern. Link each point to specific legislation (e.g., GDPR, Environmental Protection Act) and explain the trade‑off between efficiency and citizen privacy.
案例研究: 一座城市安装了带有传感器的智能垃圾桶,可报告填充程度以优化收集路线。讨论两个环境效益和一个隐私问题。将每一点与具体立法(如 GDPR、《环境保护法》)联系起来,并解释效率与市民隐私之间的权衡。
- Environmental benefits: reduced fuel consumption (lower CO₂ emissions) due to optimized routes; fewer overflowing bins reducing litter. Both support the Environmental Protection Act’s waste management principles.
- Privacy concern: sensors might detect nearby mobile device MAC addresses to infer pedestrian flow, potentially identifying individuals' patterns. This falls under GDPR as personal data collection without explicit consent.
- Trade‑off: efficiency gains may be undermined if citizens reject the system due to surveillance fears, highlighting the need for privacy‑by‑design.
- 环境效益:优化路线减少燃油消耗(降低 CO₂ 排放);减少垃圾溢出,降低垃圾散落。这两点都支持《环境保护法》的废物管理原则。
- 隐私问题:传感器可能检测附近移动设备的 MAC 地址以推断行人流量,这可能识别个体行为模式。这属于 GDPR 管辖的个人数据收集,需明确同意。
- 权衡:如果市民因监控担忧而抵制系统,效率提升将受损,突显了隐私设计的重要性。
11. Computational Thinking in Biology and Medicine | 计算思维在生物学和医学中的应用
Modelling biological processes and analysing genetic data are growing fields. Here we apply sequence matching algorithms and pattern recognition to DNA strings, reinforcing string manipulation and search techniques.
生物过程建模和基因数据分析是不断发展的领域。这里我们将序列匹配算法和模式识别应用于 DNA 字符串,巩固字符串操作和搜索技术。
Task: A DNA strand is represented as a string, e.g. "ATGCCGTAAG". Write pseudocode that implements a linear search to find if a specific codon (three‑letter substring) exists. Then modify it to return all starting indices of that codon. Analyse the worst‑case time complexity in Big O notation.
任务: 一条 DNA 链表示为字符串,例如 "ATGCCGTAAG"。编写伪代码实现线性搜索,判断特定的密码子(三字母子串)是否存在。然后修改它,返回该密码子的所有起始索引。用大 O 表示法分析最坏情况下的时间复杂度。
FUNCTION FindCodon(strand, codon):
positions ← empty list
FOR i ← 0 TO LEN(strand) - 3:
IF MID(strand, i, 3) = codon THEN
APPEND positions, i
ENDIF
ENDFOR
RETURN positions
- Worst‑case: scanning whole string → O(n) where n is strand length.
- 最坏情况:扫描整个字符串 → O(n),其中 n 是链长。
12. Integrated Problem: Smart Home Ecosystem | 综合题:智能家居生态
This final exercise pulls together programming, logic, data representation, networking, and ethics. You must think holistically, just as in a real‑world system.
最后一道练习将编程、逻辑、数据表示、网络和伦理结合在一起。你必须像对待真实系统一样进行全面思考。
Scenario: A smart thermostat system uses sensors to read temperature (in binary, from an 8‑bit ADC), compares with a user‑set threshold, and sends encrypted status over Wi‑Fi to a server. Design an algorithm for the thermostat control, write a truth table for the decision logic, convert a sample reading (10101100₂) to decimal, and evaluate the risk of a hacker intercepting the temperature data if no encryption is used.
场景: 一个智能恒温器系统使用传感器读取温度(来自 8 位 ADC 的二进制值),与用户设定的阈值比较,并通过 Wi‑Fi 将加密状态发送到服务器。为恒温器控制设计算法,绘制决策逻辑的真值表,将样本读数 (10101100₂) 转换为十进制,并评估若未加密,黑客截获温度数据的风险。
- Algorithm: repeat every minute: read sensor, convert binary to decimal, if reading > threshold, turn heating off; else turn heating on, send status to server.
- Truth table: A=threshold_reached? w) depends on comparison. Simpler: decision is just a comparator, not combinational logic.
- Conversion: 10101100₂ = 128+32+8+4 = 172? 00 = 1×128 + 0×64 + 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 0×1 = 128+32+8+4 = 172. If ADC range 0‑255 maps to 0‑50°C, 172 corresponds to (172/255)×50 ≈ 33.7°C.
- Risk: Without encryption, data is plaintext, could reveal occupancy patterns, enabling burglary. Violates confidentiality under GDPR.
- 算法:每分钟重复:读取传感器,二进制转十进制,若读数 > 阈值,关闭加热;否则开启加热,发送状态至服务器。
- 真值表:决策是简单的比较器,输出两个状态。
- 转换:10101100₂ = 128+32+8+4 = 172。若 ADC 范围 0-255 对应 0-50°C,172 相当于约 33.7°C。
- 风险:若无加密,数据为明文,可透露居住模式,导致入室盗窃。违反 GDPR 的保密性要求。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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