📚 Year 11 WJEC Computer Science: Formula & Theorem Quick Reference Handbook | Year 11 WJEC 计算机公式定理速查手册
This handbook collects all the essential formulas, theorems, and algorithm complexities you need for the WJEC GCSE Computer Science exam. Every formula is paired with a worked example to help you revise quickly and confidently.
这本速查手册汇集了WJEC GCSE计算机科学考试所需的所有基本公式、定理和算法复杂度。每个公式都配有示例解析,帮助你快速自信地复习。
1. Data Storage Units and Conversions | 数据存储单位与换算
bits. For larger units, 1 KB = 1024 bytes, 1 MB = 1024 KB, 1 GB = 1024 MB, 1 TB = 1024 GB.
最小的数据单位是比特(bit)。1 字节 = 8 比特。更大的单位:1 KB = 1024 字节,1 MB = 1024 KB,1 GB = 1024 MB,1 TB = 1024 GB。
vert between units, multiply or divide by 1024. For example, 2048 MB = 2048 ÷ 1024 = 2 GB.
单位换算时用 1024 相乘或相除。例如 2048 MB = 2048 ÷ 1024 = 2 GB。
2. Text File Size | 文本文件大小
size in bytes ≈ number of characters. Extended ASCII uses 8 bits, so 1 character = 1 byte.
文本文件大小(比特) = 字符数 × 每字符位数。若使用 7 位 ASCII,字节数约等于字符数。扩展 ASCII 使用 8 位,因此 1 字符 = 1 字节。
A file containing 500 characters encoded in 8-bit ASCII will have a size of 500 bytes, which equals 4000 bits.
一个包含 500 个 8 位 ASCII 字符的文件大小为 500 字节,即 4000 比特。
3. Image File Size | 图像文件大小
image height (px) × colour depth (bits per pixel). To get the size in bytes, divide by 8.
图像文件大小(比特) = 图像宽度(像素) × 图像高度(像素) × 颜色深度(每像素位数)。要得到以字节为单位的大小,除以 8。
4-bit colour depth. Size = 100 × 100 × 24 = 240 000 bits = 30 000 bytes (roughly 29.3 KB).
示例:一张 100×100 像素、24 位色的位图图像。大小 = 100 × 100 × 24 = 240 000 比特 = 30 000 字节(约 29.3 KB)。
This base formula does not include file headers or metadata. The actual file size on disk will be slightly larger.
基本公式不含文件头或元数据,磁盘上的实际文件尺寸会稍大一些。
4. Sound File Size | 声音文件大小
file size (bits) = sample rate (Hz) × bit depth × number of channels × duration (seconds).
声音文件大小(比特) = 采样率(赫兹) × 位深度 × 声道数 × 时长(秒)。
16-bit depth, lasting 60 seconds. Size = 44 100 × 16 × 2 × 60 = 84 672 000 bits ≈ 10.1 MB.
示例:一段立体声(2声道)录音,采样率 44.1 kHz,位深 16 位,时长 60 秒。大小 = 44 100 × 16 × 2 × 60 = 84 672 000 比特 ≈ 10.1 MB。
This is the raw uncompressed size. Real audio files such as MP3 become much smaller after compression.
这是未压缩的原始大小。MP3 等真实音频文件经压缩后会小很多。
5. Compression Ratio | 压缩比
ze ÷ compressed size. A ratio of 4:1 means the uncompressed file is four times larger than the compressed version.
压缩比 = 未压缩大小 ÷ 压缩后大小。4:1 的比率表示未压缩文件是压缩后文件的四倍大。
ple: An original file of 800 KB is reduced to 200 KB. Compression ratio = 800 ÷ 200 = 4:1.
示例:一个原始文件为 800 KB,压缩至 200 KB。压缩比 = 800 ÷ 200 = 4:1。
Space saving (%) = (1 – 1/ratio) × 100%. For a 4:1 ratio, space saved = (1 – 1/4) × 100% = 75%.
空间节省率(%)= (1 – 1/比率) × 100%。对于 4:1 的比率,节省的空间 = (1 – 1/4) × 100% = 75%。
6. Number Systems and Conversions | 数制与转换
o top. Binary to denary: sum of (bit × 2^position), where the rightmost bit is position 0.
十进制转二进制:反复除以 2,从下往上读余数。二进制转十进制:各位数值(位值 × 2的位权)之和,最右边位的位置为 0。
osition and add the results. Denary to hex: repeatedly divide by 16 and record remainders.
十六进制转十进制:每个十六进制位乘以 16 的位权然后相加。十进制转十六进制:反复除以 16 并记录余数。
ht, then convert each nibble into the corresponding hex digit. Example: 1101 0011₂ = D3₁₆.
二进制转十六进制:从右向左将二进制每 4 位分为一组(半字节),然后转换为对应的十六进制数字。示例:1101 0011₂ = D3₁₆。
7. Binary Arithmetic and Overflow | 二进制运算与溢出
n a carry is generated past the most significant bit in a fixed-width representation, an overflow error occurs.
二进制加法规则:0+0=0,0+1=1,1+0=1,1+1=0 进1 (1+1=10₂)。在固定宽度中,若进位超出最高有效位,则发生溢出错误。
₂ (9) + 1000₂ (8) = 1 0001₂ (17), but the 4-bit result stores only 0001, causing overflow.
示例:在一个 4 位系统中,1001₂ (9) + 1000₂ (8) = 1 0001₂ (17),但 4 位结果只存下 0001,导致溢出。
Example: 0011₂ (3) left shift by 2 → 1100₂ (12). 1010₂ (10) right shift by 1 → 0101₂ (5).
二进制左移相当于乘以 2ⁿ(n 为移动位数)。二进制右移相当于整数除以 2ⁿ。示例:0011₂ (3) 左移 2 位 → 1100₂ (12)。1010₂ (10) 右移 1 位 → 0101₂ (5)。
8. Boolean Algebra Laws | 布尔代数定律
· 1 = A. Null law: A + 1 = 1, A · 0 = 0. Idempotent: A + A = A, A · A = A. Complement: A + ¬A = 1, A · ¬A = 0.
同一律:A + 0 = A,A · 1 = A。零律:A + 1 = 1,A · 0 = 0。幂等律:A + A = A,A · A = A。互补律:A + ¬A = 1,A · ¬A = 0。
· C = A · (B · C). Distributive: A · (B + C) = A·B + A·C, and A + B·C = (A + B) · (A + C).
交换律:A + B = B + A,A · B = B · A。结合律:(A + B) + C = A + (B + C),(A · B) · C = A · (B · C)。分配律:A · (B + C) = A·B + A·C,以及 A + B·C = (A + B) · (A + C)。
De Morgan's Theorems: ¬(A · B) = ¬A + ¬B, ¬(A + B) = ¬A · ¬B. Absorption: A + A·B = A, A · (A + B) = A.
德摩根定理:¬(A · B) = ¬A + ¬B,¬(A + B) = ¬A · ¬B。吸收律:A + A·B = A,A · (A + B) = A。
9. Logic Gate Equivalences | 逻辑门等价
Any Boolean circuit can be built using only NAND gates or only NOR gates. This means NAND and NOR are each functionally complete.
任何布尔电路都可以仅用与非门(NAND)或仅用或非门(NOR)构建。这意味着 NAND 和 NOR 各自都是功能完备的门。
together. AND is a NAND followed by a NOT (another NAND). OR requires three NAND gates: (¬A) NAND (¬B). XOR = (A AND ¬B) OR (¬A AND B), typically built with four NAND gates.
使用 NAND:将两个输入连接在一起即可构成非门。与门 = NAND 之后再接一个非门(另一个 NAND 构成)。或门需要三个 NAND 门:(¬A) NAND (¬B)。异或门 = (A 与 非B) 或 (非A 与 B),通常用四个 NAND 门实现。
10. Sorting Algorithm Complexities | 排序算法复杂度
Bubble sort: worst-case time O(n²), best-case O(n) when a flag detects no swaps, space O(1). Merge sort: always O(n log₂ n) time, space O(n). Insertion sort: worst-case O(n²), best-case O(n), space O(1).
冒泡排序:最坏情况时间复杂度 O(n²),最好情况(通过标志位检测无交换)O(n),空间复杂度 O(1)。归并排序:时间复杂度始终为 O(n log₂ n),空间 O(n)。插入排序:最坏 O(n²),最好 O(n),空间 O(1)。
Merge sort is more efficient for large datasets. Bubble and insertion sorts are simpler but become slow when n is large. Stability: merge sort and insertion sort are stable; bubble sort is stable if implemented carefully.
对于大数据集,归并排序效率更高。冒泡和插入排序更简单,但n较大时速度很慢。稳定性:归并排序和插入排序是稳定的;冒泡排序如果正确实现也是稳定的。
11. Searching Algorithm Complexities | 搜索算法复杂度
Linear search: worst-case O(n), average O(n), space O(1). Works on unsorted data. Binary search: worst-case O(log₂ n), space O(1), but the data must be sorted.
线性搜索:最坏情况 O(n),平均 O(n),空间 O(1)。可对未排序数据操作。二分搜索:最坏情况 O(log₂ n),空间 O(1),但数据必须已排序。
comparisons needed ≈ log₂(n). For a list of 1024 items, at most 10 comparisons are needed.
二分搜索每一步将搜索区间减半。所需最大比较次数 ≈ log₂(n)。对于含 1024 项的列表,最多需要 10 次比较。
12. Network Transmission Time and Performance | 网络传输时间与性能
Transmission time (seconds) = file size (bits) ÷ transmission rate (bits per second, bps).
传输时间(秒) = 文件大小(比特) ÷ 传输速率(比特每秒,bps)。
Mbit file transferred over a 2 Mbps connection: time = 10 000 000 ÷ 2 000 000 = 5 seconds.
示例:一个 10 兆比特的文件通过 2 Mbps 连接传输:时间 = 10 000 000 ÷ 2 000 000 = 5 秒。
Latency, bandwidth, and packet loss also influence real-world performance, but these do not require a fixed formula at GCSE level.
延迟、带宽和丢包也会影响实际性能,但在 GCSE 阶段不要求固定的计算公式。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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