📚 PDF资源导航

IGCSE AQA Maths: Algorithms – Key Points Revision | IGCSE AQA 数学:算法考点精讲

📚 IGCSE AQA Maths: Algorithms – Key Points Revision | IGCSE AQA 数学:算法考点精讲

Algorithms are step-by-step procedures or sets of rules for solving mathematical problems. In the IGCSE AQA Mathematics specification, understanding algorithms is essential for tackling problems in number theory, iterative methods, and logical reasoning. This revision guide covers key algorithmic concepts you need to master, from Euclid’s algorithm to sorting and searching techniques, and provides exam-focused insights to boost your performance.

算法是解决数学问题的逐步过程或规则集。在 IGCSE AQA 数学课程中,理解算法对于处理数论、迭代方法和逻辑推理问题至关重要。本复习指南涵盖你需要掌握的关键算法概念,从欧几里得算法到排序和搜索技术,并提供面向考试的要点,以提升你的表现。


1. What is an Algorithm? | 什么是算法?

An algorithm is a precisely defined sequence of instructions designed to solve a problem or perform a computation. In mathematics, we express algorithms using natural language, flowcharts, pseudocode, or even computer code. To be valid, an algorithm must be unambiguous, finite, and effective—every step must be clear, it must terminate after a finite number of steps, and it must produce the correct result for all valid inputs. A simple example is the column addition algorithm we use to add two large numbers digit by digit.

算法是精确定义的指令序列,旨在解决问题或执行计算。在数学中,我们用自然语言、流程图、伪代码甚至计算机代码来表达算法。一个有效的算法必须明确、有限且有效——每一步都清晰无误,必须在有限步后终止,并且对所有有效输入都能产生正确结果。一个简单的例子就是我们用来逐位相加两个大数的列加法算法。


2. Flowcharts and Pseudocode | 流程图与伪代码

Flowcharts use standard symbols to represent algorithmic steps visually. An oval shows the start or end, a rectangle represents a process or calculation, a diamond indicates a decision or conditional, and arrows define the flow of execution. Being able to interpret and draw simple flowcharts is a key skill in AQA IGCSE exams. For instance, a flowchart for adding two numbers and displaying the sum would contain start, input, process, output, and end symbols.

流程图使用标准符号将算法步骤可视化。椭圆形表示开始或结束,矩形表示处理或计算,菱形表示判断或条件,箭头定义执行流程。能够解读和绘制简单的流程图是 AQA IGCSE 考试中的关键技能。例如,一个将两数相加并显示总和的流程图会包含开始、输入、处理、输出和结束符号。

Pseudocode offers a text-based, informal way to describe algorithms using plain English and common programming constructs like IF…THEN…ELSE, WHILE loops, and INPUT/OUTPUT. It is not tied to any specific programming language, making it ideal for explaining logic. A pseudocode example to find the maximum of two numbers could be: INPUT A, B; IF A > B THEN OUTPUT A ELSE OUTPUT B.

伪代码提供了一种基于文本的非正式方式,用简单的英语和常见的编程结构(如 IF…THEN…ELSE、WHILE 循环和 INPUT/OUTPUT)来描述算法。它不依赖于任何特定的编程语言,因此非常适合解释逻辑。一个求两个数最大值的伪代码示例可以是:INPUT A, B; IF A > B THEN OUTPUT A ELSE OUTPUT B。


3. Euclid’s Algorithm for HCF/GCD | 欧几里得算法求最大公因数

Euclid’s algorithm is an elegant and efficient method for finding the highest common factor (HCF), also known as the greatest common divisor (GCD), of two positive integers. It is based on the principle that the HCF of two numbers divides their difference, and it uses repeated division. The process is as follows:

欧几里得算法是一种优雅而高效的求两个正整数最大公因数(HCF,也称最大公约数 GCD)的方法。它基于两个数的最大公因数也能整除它们之差这一原理,并使用反复除法。其过程如下:

Step 1: Given two positive integers a and b with a > b, divide a by b. Write the division statement as a = bq + r, where q is the quotient and r is the remainder, with 0 ≤ r < b.

步骤 1:给定两个正整数 a 和 b 且 a > b,用 a 除以 b。可将除法语句写作 a = bq + r,其中 q 是商,r 是余数,且 0 ≤ r < b。

a = bq + r, 0 ≤ r < b

Step 2: If r = 0, then the HCF is b. If r ≠ 0, replace a with b and b with r, and repeat the division step. Continue until the remainder is zero. The last non-zero remainder is the HCF.

步骤 2:如果 r = 0,则 HCF 为 b。如果 r ≠ 0,则将 a 替换为 b,b 替换为 r,并重复除法步骤。继续直到余数为零。最后一个非零余数就是 HCF。

Example: Find the HCF of 252 and 105.

示例:求 252 和 105 的 HCF。

252 = 105 × 2 + 42
105 = 42 × 2 + 21
42 = 21 × 2 + 0

The last non-zero remainder is 21, so HCF(252, 105) = 21. This method is particularly useful when numbers are large and prime factorisation would be extremely time-consuming.

最后一个非零余数是 21,因此 HCF(252, 105) = 21。当数字很大且质因数分解将极为耗时时,这种方法特别有用。


4. Iterative Methods: Trial and Improvement | 迭代法:试位法

In IGCSE maths, iterative methods are used to find approximate solutions to equations that cannot be solved algebraically. The trial and improvement (or trial and error) method involves using an initial guess, evaluating the equation, and then systematically refining the guess based on whether the result is too high or too low. An algorithm for solving x³ + x = 20 might begin:

在 IGCSE 数学中,迭代法用于寻找无法用代数方法求解的方程的近似解。试位法(或称试错法)包括使用初始猜测值,计算方程的值,然后根据结果是偏大还是偏小系统地调整猜测值。求解 x³ + x = 20 的算法可以这样开始:

Step 1: Choose two starting values where the left-hand side (LHS) lies on either side of 20. For example, try x = 2: LHS = 2³ + 2 = 10 (too low). Try x = 3: LHS = 3³ + 3 = 30 (too high). So the solution is between 2 and 3.

步骤 1:选取两个初始值,使得方程左侧的值分别位于 20 的两侧。例如,试 x = 2:LHS = 2³ + 2 = 10(太小)。试 x = 3:LHS = 3³ + 3 = 30(太大)。因此解在 2 和 3 之间。

Step 2: Try the midpoint or a more refined value, say x = 2.5: LHS = 2.5³ + 2.5 = 15.625 + 2.5 = 18.125 (still too low). Adjust to x = 2.7: LHS = 19.683 + 2.7 = 22.383 (too high). Repeat until the desired accuracy (e.g., to 1 decimal place) is reached. This systematic approach is algorithmic in nature.

步骤 2:尝试中点或更精细的值,例如 x = 2.5:LHS = 2.5³ + 2.5 = 15.625 + 2.5 = 18.125(仍然太小)。调整到 x = 2.7:LHS = 19.683 + 2.7 = 22.383(太大)。重复直到达到所需精度(例如,精确到小数点后一位)。这种系统化的方法本质上就是算法化的。


5. Sorting Algorithms: Bubble Sort | 排序算法:冒泡排序

Sorting is a fundamental algorithmic task, and the bubble sort is one of the simplest methods to understand. It works by repeatedly stepping through a list, comparing adjacent pairs of items and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, indicating the list is sorted. For exam purposes, you must be able to perform a bubble sort on a small list and track each pass.

排序是一项基本的算法任务,冒泡排序是最简单易懂的方法之一。它通过反复遍历列表,比较相邻的一对元素,并在它们顺序错误时交换位置。遍历会不断重复,直到不需要任何交换,表明列表已排好序。为了应对考试,你必须能够对一个短列表执行冒泡排序并跟踪每一趟的过程。

Example: Sort the list [5, 2, 8, 1] into ascending order.

示例:将列表 [5, 2, 8, 1] 按升序排列。

Pass Comparisons & Actions Resulting List
1 5>2? swap → 2,5,8,1; 5<8? no swap; 8>1? swap → 2,5,1,8 [2, 5, 1, 8]
2 2<5? no swap; 5>1? swap → 2,1,5,8; 5<8? no swap [2, 1, 5, 8]
3 2>1? swap → 1,2,5,8; remaining comparisons no swaps [1, 2, 5, 8]

After Pass 3 the list is fully sorted. Notice that the largest element ‘bubbles’ to its correct position at the end of each pass, reducing the need for later comparisons.

经过第 3 趟后,列表已完全排序。请注意,最大的元素会像气泡一样“浮”到每趟末尾的正确位置,从而减少了后续的比较次数。


6. Searching Algorithms: Linear Search | 搜索算法:线性搜索

A linear search (or sequential search) is the most straightforward searching algorithm. It inspects each element of a list one by one, from the beginning, until the target value is found or the end of the list is reached. This method works on both sorted and unsorted lists but is inefficient for large data sets.

线性搜索(或称顺序搜索)是最直接的搜索算法。它从头开始逐一检查列表中的每个元素,直到找到目标值或到达列表末尾。这种方法既适用于已排序列表,也适用于未排序列表,但对于大数据集效率较低。

Example: Search for the number 7 in the list [4, 9, 2, 7, 5].

示例:在列表 [4, 9, 2, 7, 5] 中搜索数字 7。

Check index 1: 4 ≠ 7
Check index 2: 9 ≠ 7
Check index 3: 2 ≠ 7
Check index 4: 7 = 7 → found at position 4.

检查索引 1:4 ≠ 7
检查索引 2:9 ≠ 7
检查索引 3:2 ≠ 7
检查索引 4:7 = 7 → 在位置 4 找到。

If the target were not present, the algorithm would inspect every element and then report ‘not found’. In the worst case, a linear search requires as many comparisons as there are elements, so its complexity is O(n).

如果目标不在列表中,该算法会检查每个元素,然后报告“未找到”。在最坏的情况下,线性搜索需要的比较次数与元素数量相同,因此其复杂度为 O(n)。


7. Binary Search | 二分搜索

Binary search is a highly efficient algorithm for finding an item in a sorted list. It repeatedly divides the search interval in half by comparing the target value with the middle element. If the target matches the middle element, the search is successful. If the target is less than the middle, the search continues in the lower half; if greater, in the upper half. This process repeats until the element is found or the subarray size becomes zero.

二分搜索是一种在已排序列表中查找元素的高效算法。它通过将目标值与中间元素进行比较,反复将搜索区间减半。如果目标与中间元素匹配,则搜索成功。如果目标小于中间元素,则继续在下半部分搜索;如果大于,则在上半部分搜索。这一过程不断重复,直到找到元素或子数组大小变为零。

Example: Find 9 in the sorted list [2, 4, 5, 7, 9, 12, 15].

示例:在已排序列表 [2, 4, 5, 7, 9, 12, 15] 中查找 9。

Step List Segment Middle Index Middle Value Action
1 [2,4,5,7,9,12,15] 4 7 9>7 → search upper half
2 [9,12,15] 2 12 9<12 → search lower half
3 [9] 1 9 Match! Found.

Binary search eliminates half of the remaining elements with each comparison, giving it a logarithmic complexity of O(log n). This makes it dramatically faster than linear search for large sorted lists.

二分搜索每次比较都会排除剩余元素的一半,因此其复杂度为对数级 O(log n)。这使得它在处理大型已排序列表时比线性搜索快得多。


8. Algorithm Efficiency and Complexity | 算法效率与复杂度

Understanding how ‘costly’ an algorithm is helps us choose the right one. Two common measures are the number of comparisons (for searching/sorting) and the number of arithmetic operations (for number algorithms). We often describe the worst-case efficiency using Big O notation. Here is a comparison of the algorithms covered:

了解算法的“代价”有助于我们选择合适的算法。两个常用的衡量标准是比较次数(用于搜索/排序)和算术运算次数(用于数值算法)。我们通常使用大 O 表示法来描述最坏情况下的效率。下面是所涉及算法的比较:

Algorithm Worst-case Time Complexity Comments
Bubble Sort O(n²) Inefficient for large lists, but easy to code
Linear Search O(n) Works on unsorted data; checks each element
Binary Search O(log n) Requires sorted list; very fast
Euclid’s Algorithm O(log min(a,b)) Extremely efficient for HCF

In IGCSE questions, you are generally not asked to derive complexities, but you should recognise that binary search is far quicker than linear search when the list is sorted, and that bubble sort becomes very slow as the list length grows.

在 IGCSE 考题中,通常不要求推导复杂度,但你应该认识到,当列表已排序时,二分搜索比线性搜索快得多,而随着列表长度增加,冒泡排序会变得非常缓慢。


9. Applications in Typical IGCSE Problems | 典型 IGCSE 问题中的应用

IGCSE AQA exam questions often embed algorithms within real-world or abstract contexts. You might be given a flowchart and asked to complete a trace table, showing the values of variables after each step. Alternatively, you could be asked to write a pseudocode outline for a simple problem such as finding the sum of all even numbers up to a given limit, or to apply Euclid’s algorithm to find the HCF of two numbers as part of a larger number theory question.

IGCSE AQA 考试题常常将算法嵌入到现实或抽象情境中。你可能会看到一个流程图,并被要求完成一个追踪表,显示每一步后变量的值。或者,你可能需要为一个简单问题写出伪代码大纲,例如求某一给定限值以内的所有偶数之和,或者作为一道更大型数论问题的一部分,应用欧几里得算法求两个数的 HCF。

A classic problem style gives you a sequence of operations: start with x, multiply by three, subtract two, repeat until the value exceeds 100. You must record the sequence and answer related questions. These exercises test your ability to follow an algorithm precisely, recognising that missing a step or misinterpreting a condition entirely changes the outcome.

一种经典题型会给出一个操作序列:从 x 开始,乘以三,减去二,重复直到值超过 100。你必须记录序列并回答相关问题。这些练习测试你精确遵循算法的能力,因为漏掉一步或误解一个条件都可能完全改变结果。


10. Exam Tips for Algorithm Questions | 算法题的考试技巧

1. Read the algorithm carefully, whether it is presented as a flowchart, pseudocode, or written instructions. Underline key decision points and termination conditions.

1. 仔细阅读算法,无论是流程图、伪代码还是文字说明。在关键决策点和终止条件下划线。

2. Always create a trace table in rough work when stepping through a loop. List the values of all variables at each iteration to avoid confusion.

2. 在对循环进行逐步跟踪时,一定要在草稿纸上制作追踪表。在每次迭代中列出所有变量的值,避免混淆。

3. For flowchart questions, use the correct symbols. An oval for Start/End, a rectangle for processes, a diamond for decisions. Marks are often awarded for shape accuracy.

3. 对于流程图题目,要使用正确的符号。开始/结束用椭圆,处理过程用矩形,判断用菱形。符号的准确性常常可以得分。

4. When asked to write or complete an algorithm, be explicit. Use clear keywords such as INPUT, OUTPUT, IF…THEN…ELSE, WHILE…DO, and FOR…NEXT, even in simple English descriptions.

4. 当被要求编写或补全算法时,要明确清晰。即使在简单的英文描述中,也要使用如 INPUT、OUTPUT、IF…THEN…ELSE、WHILE…DO 和 FOR…NEXT 等清晰的关键词。

5. Practise common algorithms like Euclid’s method, bubble sort, and binary search so that you can reproduce them quickly and accurately under time pressure. Familiarity saves precious time.

5. 练习常见算法,如欧几里得方法、冒泡排序和二分搜索,这样你就能在时间压力下快速准确地重现它们。熟练可以节省宝贵时间。

6. Check termination conditions carefully. An algorithm that fails to stop or stops too early loses all method marks. Always verify with a couple of simple test cases.

6. 仔细检查终止条件。一个无法停止或过早停止的算法会失去所有方法分。始终用一两个简单的测试案例进行验证。


Published by TutorHao | Mathematics Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading