注:本文为 “算法 | 起源 / 演变” 相关合辑。
英文引文,机翻未校。
不同文章部分内容重复,未整理去重。
如有内容异常,请看原文。
Evolution of Algorithm – Origin and History
算法的演变——起源与历史
by codecrucks
Published 05/09/2021
Updated 12/09/2022
Evolution of algorithms has taken a long time. It is an ancient notion. We utilize algorithms all the time, whether we realize it or not. You may think of them as an inseparable element of each activity we take in our daily lives. Algorithms are not only fascinating to study, but they are also critical to the functioning of our modern, digital world.
算法的演变历经漫长岁月,是一个古老的概念。无论是否察觉,我们始终在使用算法。你可以将其视为日常生活中每项活动不可或缺的组成部分。算法不仅具有研究吸引力,对现代数字世界的运转也至关重要。
Algorithms, as you may be aware, are frequently employed in mathematics and computer science. However, you may be shocked to find that you yourself utilize them on a daily basis. An algorithm is a recipe for any food dish. Planning a tour and fixing routes is also a potential algorithm. Planning family functions is also an algorithmic process.
正如你所知,算法常用于数学和计算机科学领域。但你可能会惊讶地发现,自己在日常生活中也在使用算法:任何一道菜的食谱都是一种算法;规划旅行、确定路线也可能是一种算法;筹备家庭活动同样属于算法流程。
Algorithms are utilized in current applications such as mathematical determinations, data processing, and automated reasoning, to mention a few. Simply said, without them, the modern world would function quite differently.
在当前应用中,算法被用于数学计算、数据处理、自动推理等场景(仅举几例)。简而言之,没有算法,现代世界的运转方式将截然不同。
In this article, we will look at the interesting and extensive history of algorithms in a nutshell. We’ll look at the history of algorithms, including their etymology (origin of the word), and then look at some of the most significant ones. We’ll also take you on a brief tour of some of their contemporary applications.
本文将简要梳理算法有趣且丰富的历史。我们会探讨算法的发展历程(包括其词源),介绍一些最重要的算法,并简要带你了解它们在当代的部分应用。
Etymology of the Word “Algorithm”
“算法(Algorithm)”一词的词源
We will discuss the evolution of algorithms from etymology to evolution to recent trends in algorithms.
我们将从词源、演变到最新趋势,全面探讨算法的发展。
There is an interesting history behind the name “Algorithm“. Muhammad Ibn Musa al-Khwarizmi, a 9th-century scholar, astronomer, geographer, and mathematician, became well-known for his contributions to the study of algebra.
“Algorithm” 一词背后有着有趣的历史。9 世纪的学者、天文学家、地理学家及数学家穆罕默德·伊本·穆萨·花拉子米(Muhammad Ibn Musa al-Khwarizmi),因对代数学研究的贡献而闻名。
Al-Khwarizmi authored a book about Hindu-Arabic numbers in Arabic, which was eventually translated into Latin. Later, this book was translated in Latin with the title “Algoritmi de numero Indorum”. After then, the Latin word ‘algoritmi’ was translated into English as ‘algorithm’.
花拉子米用阿拉伯语撰写了一本关于印度-阿拉伯数字的著作,该书最终被译为拉丁语,标题为《Algoritmi de numero Indorum》(《花拉子米论印度数字》)。此后,拉丁语词汇 “algoritmi” 被译为英语 “algorithm”。
Some refer to Al-Khwarizmi as “the Father of Algebra,” and he is largely regarded as the scholar who introduced advanced mathematics to the West following the fall of Rome.
有人称花拉子米为“代数学之父”,他也被广泛认为是罗马帝国灭亡后,将高等数学引入西方的学者。
Surprisingly, Al-Khwarizmi appears to have built on the work of an older Indian polymath known as Brahmagupta.
有趣的是,花拉子米的研究似乎借鉴了更早的印度博学家婆罗摩笈多(Brahmagupta)的成果。
The term “algorithm” is now used to refer to any technique of computing. This is especially true since the mid-twentieth century when it was frequently employed with respect to computing.
如今,“算法”一词泛指任何计算方法。尤其自 20 世纪中期以来,该术语在计算领域的使用愈发频繁。
The term “algorithm” was coined by the Persian mathematician al-Khwarizmi in the ninth century.
“algorithm” 一词由波斯数学家花拉子米在 9 世纪创造。

Muhammad al-Khwarizmi
穆罕默德·花拉子米
Image Source: https://www.bbc.co.uk/ideas/videos/why-algorithms-are-called-algorithms/p07gdlwf
Evolution of Algorithm
算法的演变
According to historical documents and archaeological evidence, the Babylonians may have constructed the first identifiable algorithm about 1600 BC. These algorithms, which were recorded on clay tablets in a form of cuniform, were used for factorization and determining square roots, among other things, and were quite simple by today’s standards. This could be stated as the first step in the evolution of the algorithm.
根据历史文献和考古证据,巴比伦人可能在公元前 1600 年左右创建了首个可识别的算法。这些算法以楔形文字形式记录在泥板上,用于因数分解、求平方根等,以当今标准来看十分简单。这可被视为算法演变的第一步。
In approximately 300 BC, the great Euclid created his renowned “Euclidean algorithm,” which was followed by Eratosthenes in 200 BC with his so-called “Sieve of Eratosthenes.” Lui Hui described Gaussian elimination in 263 AD, while Brahmagupta created Chakravala in 628 AD.
约公元前 300 年,伟大的欧几里得(Euclid)创建了著名的“欧几里得算法”;公元前 200 年,埃拉托斯特尼(Eratosthenes)提出了“埃拉托斯特尼筛法”;公元 263 年,刘徽描述了高斯消元法;公元 628 年,婆罗摩笈多创建了“循环法”(Chakravala)。
The contemporary algorithm saw significant development throughout the mid-to-late industrial revolution. During this period, George Boole famously created binary algebra, which served as the foundation for modern computer coding.
在工业革命中后期,现代算法取得了重大发展。期间,乔治·布尔(George Boole)创建了著名的二元代数,为现代计算机编码奠定了基础。
With his iconic Turing machine, Alan Turing formalized the idea of the algorithm for the first time in 1936. The world of computation has been totally changed since then.
1936 年,艾伦·图灵(Alan Turing)通过其标志性的“图灵机”,首次将算法概念形式化。此后,计算领域发生了彻底变革。
The first-ever algorithm was proposed by an unknown Indian mathematician who used the concept of zero and decimal position of numbers. This algorithm provided a basis for many basic arithmetic operations, such as square roots, and cube roots.
首个算法由一位不知名的印度数学家提出,他运用了“零”和“数字十进制位”的概念。该算法为平方根、立方根等众多基本算术运算奠定了基础。
During the 1940s and 1950s, research was oriented toward building efficient computer systems, so that they could be used in scientific, commercial, and engineering problems.
20 世纪 40 至 50 年代,研究方向聚焦于构建高效计算机系统,以应用于科学、商业和工程问题。
Structural programming came into existence after Alan Turing introduced the idea of Effective Procedure in 1936.
1936 年艾伦·图灵提出“有效过程”(Effective Procedure)概念后,结构化编程应运而生。
People realize that effective programming is as important as hardware resources.
人们逐渐认识到,高效编程与硬件资源同等重要。
The application of computers in diverse fields has led to the search for more efficient algorithms and the study of tractable and non-tractable problems.
计算机在各领域的应用,推动了对更高效算法的探索,以及对“易处理问题”和“难处理问题”的研究。
Turing’s algorithm logic also laid the basis for variable-based operations. The calculation of the preceding symbols determines the value of the following symbol. Progressive algorithms are born as a result of this. “We may now design a machine to do the task of this computer,” Turing stated in his hypothesis.
图灵的算法逻辑还为“基于变量的运算”奠定了基础:前一个符号的计算结果决定后一个符号的值,由此催生了“渐进式算法”。图灵在其假设中表示:“我们现在可以设计一台机器,来完成这台计算机的任务。”
Donald Knuth – Father of Algorithms
唐纳德·克努特——算法之父
Donald Ervin Knuth is an American author. is an American computer scientist, and mathematician, and was a professor at Stanford University. He received the ACM Turing Award in 1974, which is regarded as the “Nobel Prize” in computer science. Knuth has been named the “Father of Algorithm Analysis.”
唐纳德·欧文·克努特(Donald Ervin Knuth)是美国作家、计算机科学家、数学家,曾担任斯坦福大学教授。1974 年,他获得了被视为“计算机科学诺贝尔奖”的 ACM 图灵奖,并被称为“算法分析之父”。

Donald Knuth – Father of Algorithms
唐纳德·克努特——算法之父
Image Source: https://www.frontiersofknowledgeawards-fbbva.es/galardonados/donald-e-knuth-2/
Knuth authored the seminal “The Art of Computer Programming” as an associate professor at Caltech, a seven-volume collection that rapidly became a go-to book for anybody interested in the how’s and why’s of computer programming.
作为加州理工学院副教授,克努特撰写了开创性著作《计算机程序设计艺术》(The Art of Computer Programming)。这套七卷本著作迅速成为所有对“计算机编程原理与原因”感兴趣的人的必备书籍。
Analysis of Algorithm
算法分析
The branch of the study of tractable and non-tractable problems is known as complexity theory. Algorithms are being analyzed on various bounds. The focus of researchers was on minimizing the lower bound running time of algorithms.
研究“易处理问题”和“难处理问题”的分支被称为复杂度理论。算法会从多个边界维度进行分析,研究人员的核心目标是最小化算法的运行时间下界。
Later, they developed formal methods of specification, which describe the precise nature of input to verify the correctness of the algorithm.
随后,研究人员提出了“形式化规范方法”——通过描述输入的精确属性,验证算法的正确性。
Typically, algorithms are designed to solve specific problems only, so they are bound to operate on specific inputs only. No algorithm works on every input. So, with the development of algorithms, it has been essential to specify the limits of input and expected output of the algorithm.
通常,算法仅为解决特定问题而设计,因此仅适用于特定输入——没有任何算法能处理所有输入。因此,随着算法的发展,明确“输入范围”和“预期输出”变得至关重要。
The study and development of efficient algorithms led to another aspect called the time-space trade-off. This opens up the study of problems that are both tractable in time and tractable in space. Tractable problems are those which can be solved in a reasonably acceptable time.
高效算法的研究与开发催生了“时空权衡”(time-space trade-off)概念,进而推动了对“时间易处理”且“空间易处理”问题的研究。其中,“易处理问题”指可在合理可接受时间内解决的问题。
Approximation algorithms came into the picture to provide an approximate solution to non-tractable problems in a reasonably acceptable time.
为了在合理时间内为“难处理问题”提供近似解,“近似算法”(approximation algorithms)应运而生。
Randomized algorithms have given a new direction for solving many time-consuming problems. Randomness can be thought of as an integral part of many algorithmic strategies, like simulated annealing and genetic algorithms.
“随机算法”(randomized algorithms)为解决诸多耗时问题提供了新方向。随机性被视为许多算法策略的核心组成部分,例如模拟退火算法(simulated annealing)和遗传算法(genetic algorithms)。
Quicksort is sufficient to explain the importance of randomness. Quicksort runs in quadratic time for sorted data, but with randomized pivot selection, it can be reduced to
n
log
2
n
n \log_2 n
nlog2n.
快速排序(Quicksort)足以说明随机性的重要性:对于已排序数据,快速排序的时间复杂度为二次方;但通过“随机选择基准元素”,其时间复杂度可降至
n
log
2
n
n \log_2 n
nlog2n。
Algorithms in Daily Routine
日常生活中的算法
Even if computers did not exist, it is probable that algorithms of some type would still play a significant part in your daily life.
即便没有计算机,某种形式的算法仍可能在你的日常生活中发挥重要作用。
We utilize algorithms in our everyday routine, whether we realize it or not. Any task, from simple to complicated, may be seen as a potential algorithm.
无论是否察觉,我们在日常生活中都在使用算法。从简单到复杂的任何任务,都可视为一种潜在算法。
Having stated that, below are some examples of algorithms in use in everyday life.
以下是日常生活中算法应用的几个例子:
Planning a Tour
规划旅行
Before you start on your journey, you will undoubtedly consider a lot of factors, including location, the best time to visit the location, method of transportation, nearby tourist attractions, accommodation, and so on. This action sequence is referred to as an algorithm.
出发前,你必然会考虑诸多因素:目的地、最佳出行时间、交通方式、周边景点、住宿等。这个行动序列可被视为一种算法。
Solving an Assignment
完成作业
When a student needs to solve an assignment, he must follow a specific sequence of steps. For example, if he receives an assignment from his professor, he must find the right book or resources to answer the question. Students may use Google or ask their friends for assistance before completing the task. As a result, the entire procedure is an algorithm.
学生完成作业时,需遵循特定步骤:例如,收到教授布置的作业后,需找到正确的书籍或资料,可能会通过谷歌搜索或询问朋友,最终完成任务。整个流程就是一种算法。
Organizing functions
筹备活动
It’s your birthday next week, and you’ve decided to treat your pals. What are your plans? You consider the ideal venue, you will confer with someone about the theme of the party, the menu of the party, which cake should be excellent, the order of events, timings, and so on. Everything is meticulously planned by you. You go through your plans several times to ensure that they are as effective as possible. This process of ensuring desired output is nothing but an algorithm
下周是你的生日,你决定请朋友吃饭。你的计划是什么?你会考虑理想场地、与他人商议派对主题、菜单、蛋糕选择、活动流程、时间安排等,并反复检查计划以确保效果最佳。这个“确保达成预期结果”的过程,本质就是一种算法。
Basic Arithmetic operation
基本算术运算
You get milk bottles from the milkman every day, and you have to pay him the whole sum at the end of the month. So you’ll take the number of milk bottles you purchased over the past month and multiply it by the cost of each individual bottle. This will give you the entire amount you spent on milk over the course of a month.
你每天从送奶工那里订牛奶,月底结算费用。此时,你会用“当月订奶总瓶数”乘以“单瓶价格”,得出当月牛奶总花费。
When you go to a party with friends, and after dinner, when you compute the portion of each member from the overall cost, that method also follows the algorithm.
与朋友聚餐后,计算每个人需分摊的费用,这种方法同样遵循算法逻辑。
Thus, the evolution of algorithms has taken a shape from cuniform to digital computers.
由此可见,算法的演变已从楔形文字记录的简单形式,发展到适用于数字计算机的复杂形态。
Short Questions on Evolution of Algorithms
算法演变相关简答题
Q: Who is the pioneer of the study of Algorithms?
问:算法研究的先驱是谁?
Muhammad Ibn Musa al-Khwarizmi, a 9th-century scholar, astronomer, geographer, and mathematician, became well-known for his contributions to the study of algebra.
9 世纪的学者、天文学家、地理学家及数学家穆罕默德·伊本·穆萨·花拉子米,因对代数学研究的贡献而成为算法研究的先驱。
Q: Who is known as the father of linear algebra?
问:谁被称为“线性代数之父”?
Muhammad Ibn Musa al-Khwarizmi is known as the father of linear algebra.
穆罕默德·伊本·穆萨·花拉子米被称为“线性代数之父”。
Q: Who is known as the father of algorithms?
问:谁被称为“算法之父”?
Donald Ervin Knuth is an American author an American computer scientist, a mathematician, and a professor at Stanford University professor is known as the father of algorithms.
美国作家、计算机科学家、数学家及斯坦福大学前教授唐纳德·欧文·克努特,被称为“算法之父”。
Q: Name the famous book of Donald Knuth
问:唐纳德·克努特的著名著作是什么?
“The Art of Computer Programming” is a well-known book written by Donald Knuth.
唐纳德·克努特的著名著作是《计算机程序设计艺术》(The Art of Computer Programming)。
Q: Enlist a few daily routine activities that can be described as an algorithmic process
问:列举几项可描述为“算法流程”的日常活动
Any routine work takes predefined steps, we can consider them all as an algorithmic processes such as,
所有遵循预设步骤的日常工作,都可视为算法流程,例如:
- Making a tea/coffee
泡茶/冲咖啡 - Prepare food
做饭 - Be ready to go to the office
准备上班 - Clearing the examinations
备考并通过考试 - Go on tour with friends
与朋友旅行 - Attend/arrange functions
参加/筹备活动
What is Algorithm? – Nutshell Explanation
算法简明解释
by codecrucks
Published 05/09/2021
Updated 27/03/2023
What is Algorithm?
什么是算法?
The algorithm is a set of rules defined in specific order to do certain computation and carry out some predefined task. It is a step by step procedure to solve the problem.
算法是按特定顺序定义的一组规则,用于执行特定计算和完成预设任务,是解决问题的逐步流程。
Evolution of algorithm has gone through lone way. The term Algorithm was coined by the Persian mathematician Al-Khwarizmi in the ninth century.
算法的演变历经漫长道路。“Algorithm” 一词由波斯数学家花拉子米在 9 世纪创造。
Given the algorithm, it is easy to program the solution. It bridges the gap between natural language description of the solution and syntax of programming language. It is a set of rules which are used to solve real-life problems. It provides a loose form of a solution in a pseudo-programming language. We can treat it as a set of finite instructions which solves a particular problem when applied it is applied to that problem with legal inputs.
有了算法,就能轻松编写解决方案的代码——它填补了“解决方案的自然语言描述”与“编程语言语法”之间的空白。算法是解决现实问题的一组规则,以“伪编程语言”的形式提供灵活的解决方案框架。我们可将其视为“有限指令集”:当输入合法时,应用这些指令即可解决特定问题。
The first-ever algorithm was developed by Babylonians for factorization of a number and to find roots of the equation. Euclid had proposed a famous algorithm for finding Greatest Common Divisor (GCD) of two numbers.
首个算法由巴比伦人开发,用于数字的因数分解和方程求根。欧几里得则提出了著名的“最大公约数(GCD)算法”,用于计算两个数的最大公约数。
Initially, the solution to the problem is thought as a natural language description, whose syntax is too far from the programming language. Before the actual problem solved in a programming language, natural language description of the solution is first represented as an algorithm. It is then converted to programming syntax. The process of solving a problem is depicted in following figure
起初,问题的解决方案以自然语言描述,但这种描述的语法与编程语言差异极大。因此,在使用编程语言解决问题前,需先将“解决方案的自然语言描述”转化为算法,再将算法转化为编程语言语法。问题解决流程如下图所示:

Problem Solving using Algorithm
使用算法解决问题
If the algorithm is correct, then the program should produce correct output on valid input, otherwise, it should produce an appropriate error message. For example, to find the division
A
/
B
A/B
A/B, correctly written program would return value of
A
/
B
A/B
A/B for
B
>
0
B > 0
B>0, and it would show the error message like “Invalid divisor” for
B
=
0
B = 0
B=0.
若算法正确,程序在“输入合法”时应输出正确结果,在“输入非法”时应输出恰当的错误提示。例如,计算除法
A
/
B
A/B
A/B 时:若
B
>
0
B > 0
B>0,正确的程序会返回
A
/
B
A/B
A/B 的结果;若
B
=
0
B = 0
B=0,则会显示“无效除数(Invalid divisor)”的错误提示。
Properties of Algorithm
算法的性质
A good algorithm should have the following properties/characteristics:
一个优秀的算法应具备以下性质/特征:

Input: The algorithm may take zero or more input arguments. Depending on the problem, the input may be a scalar, vector, array, tree, graph or some other data structures
输入:算法可接收零个或多个输入参数。根据问题不同,输入类型可包括标量、向量、数组、树、图或其他数据结构。
Output: The algorithm reads input, processes it and produces at least one output. Depending on the problem being solved, the output may of the form scalar, vector, array, tree, graph or some other data structures.
输出:算法读取输入并处理,最终生成至少一个输出。根据问题不同,输出类型可包括标量、向量、数组、树、图或其他数据结构。
Definiteness: All instructions should be unambiguous and simple to interpret. There should not be multiple ways to interpret the same instruction. Each instruction should be precise and concise
确定性:所有指令应无歧义、易于理解,同一指令不应有多种解读方式,且每条指令需精准简洁。
Finiteness: Every algorithm must terminate after a finite number of steps. If the algorithm contains a loop, the upper bound of the loop must be finite. Recursive calls should have a well-defined base case for the termination
有穷性:算法必须在有限步骤后终止。若包含循环,循环的上界必须有限;若包含递归调用,需有明确的“终止基准条件”。
Effectiveness: The algorithm should be written with a basic set of instructions. The operations should be basic enough to perform exactly using a basic set, just like one can perform them with pen and paper. Complex operations should be performed using a combination of basic instruction. For example, multiplication should be performed using loop and addition, sorting should be carried out using looping, comparison, swapping etc.
有效性:算法应基于“基本指令集”编写,所有操作需简单到可通过基本指令精准执行(如用笔和纸即可完成)。复杂操作需通过组合基本指令实现,例如:乘法可通过“循环+加法”实现,排序可通过“循环+比较+交换”实现。
Types of Algorithmic Complexities
算法复杂度的类型
Algorithms are analyzed using two types of complexities
算法分析主要关注两种复杂度:

Time complexity: It is the amount of time taken by the algorithm to solve the given problem.
时间复杂度:算法解决给定问题所需的时间。
Space complexity: It is the amount of memory required by the algorithm to solve the given problem.
空间复杂度:算法解决给定问题所需的内存。
Problems Solved by Algorithms
算法可解决的问题
Algorithms are not developed just to solve problems like sorting, factorial, GCD etc. The scope of the algorithm is much wider than that. Few of the real-life problems are listed here for which the design of an efficient algorithm matters a lot
算法的开发并非仅为解决“排序、阶乘、最大公约数”等基础问题,其应用范围远不止于此。以下是部分“高效算法设计至关重要”的现实问题:
Such problems may not be solved effectively using traditional approaches and even if they are solvable, the answer may not be optimal or it may take a too long time. Various class of algorithms are :
这些问题难以通过传统方法有效解决——即便可解,结果也可能非最优,或耗时过长。对应的算法类别包括:
- String matching algorithms: Can be useful in text search, editors, compilers etc.
字符串匹配算法:适用于文本搜索、编辑器、编译器等场景。 - Number theory and numerical algorithms: Useful in the statistical analysis of data.
数论与数值算法:适用于数据统计分析。 - Divide and conquer: Used to solve sorting, convex hull, min-max problem.
分治法:用于解决排序、凸包、最值问题。 - Linear programming: Can be useful in solving many optimization problems.
线性规划:适用于解决多种优化问题。 - Dynamic programming: Solves the optimization problems like subsequence, super sequence, assembly line scheduling, cruise scheduling etc.
动态规划:用于解决子序列、超序列、装配线调度、邮轮调度等优化问题。 - Greedy methods: Provides a suboptimal solution to the problems like make a change, minimum spanning tree, Huffman code, job sequencing etc.
贪心算法:为“找零、最小生成树、霍夫曼编码、作业排序”等问题提供次优解。 - Sorting: Useful to sort numerical or string data.
排序算法:用于对数值或字符串数据进行排序。
However, the list is far more exhaustive, but we listed here a few of the most common problems appear in real life.
当然,算法可解决的问题远不止这些,以上仅列举了现实生活中最常见的几类。
How to Write Algorithm?
如何编写算法?
The algorithm consists of two parts: Head and body. Head part consists of name, description of the problem being solved, input to the problem and expected output. It may also include the explanation of the input argument and output variable. The description provides a clear idea to the user about the functionality of the algorithm.
算法由两部分组成:头部(Head)和主体(Body)。头部包含“算法名称、待解决问题描述、输入、预期输出”,可能还包括“输入参数说明、输出变量说明”,其作用是让使用者清晰了解算法的功能。
Body part includes a logical sequence of statements involving various constructs like conditional statements, expressions, loops, breaks, function calls etc.
主体包含“逻辑有序的语句”,涉及条件语句、表达式、循环、中断、函数调用等多种结构。

Structure of Algorithm
算法的结构
An algorithm is a lucid form of program and it does not have rigid restrictions on the syntax. One can write it using his own terminology and syntax
算法是程序的“清晰表达形式”,语法无严格限制,使用者可根据自身习惯选择术语和语法。
However, some of the common rules followed for writing algorithms, which are stated below :
但以下是编写算法时常用的规则:
-
The algorithm should start with the keyword Algorithm, followed by its name, followed by a list of arguments to be passed.
算法应以关键字 Algorithm 开头,后跟“算法名称”及“待传入的参数列表”。Algorithm FIND_SUM(A, B) -
Comments start with // sign. In the very next line, we should specify the description and input-output.
注释以 // 开头,注释后需指定“问题描述、输入输出”。// Problem Description : Add two integer numbers. // 问题描述:计算两个整数的和。 // Input: Two numbers A and B on which sum is to be performed. // 输入:待求和的两个整数 A 和 B。 // Output: Sum of given two numbers. // 输出:两个输入数的和。 -
Next comes the body part, which contains various logical statements in the proper sequence. These statements may contain control statements, loops, expressions etc.
接下来是主体部分,包含“逻辑有序的语句”,可能涉及控制语句、循环、表达式等。 -
Compound statements are enclosed within the opening and closing curly brace i.e. { … }
复合语句用大括号 { … } 包裹。 -
Use the left arrow for assignment
赋值操作使用左箭头 ←。C ← A + B -
Array index usually starts with index 0 or 1.
数组索引通常从 0 或 1 开始。 -
Relational operations are performed using relational operators like <, >, ==, !=, ?= and <=
关系运算使用 <、>、==、!=、?=、<= 等关系运算符。 -
Logical operations are performed using logical operators like and or and not
逻辑运算使用 and(与)、or(或)、not(非)等逻辑运算符。 -
Input and output are performed using read and write a statement.
输入和输出分别使用 read(读)和 write/print(写/打印)语句。read (A) / read “A” // 读取 A 的值 write (A) / write “A” // 输出 A 的值 print (A) / print “A” // 打印 A 的值 -
Control statements are written as follows :
控制语句的写法如下:if (condition) then Statements // 语句 end if (condition) then Statements // 语句 else Statements // 语句 end -
Multiple statements are enclosed within { … }
多条语句用大括号 { … } 包裹。 -
While loop is written as follows :
While 循环的写法如下:while (condition) do { Do some work // 执行操作 } -
Sometimes curly braces are omitted and a block is closed with the end keyword
有时可省略大括号,用关键字 end 结束代码块:while (condition) do Do some work // 执行操作 end -
For loop is written as follows:
For 循环的写法如下:for index ← FirstIndex to LastIndex do { Do some work // 执行操作 } -
Sometimes curly braces are omitted and a block is closed with the end keyword
有时可省略大括号,用关键字 end 结束代码块:for index ← FirstIndex to LastIndex do Do some work // 执行操作 end
Examples:
示例:
Write an algorithm for finding the factorial of number n.
编写计算数字 n 阶乘的算法。
Algorithm FACTORIAL(n)
// Description: Find factorial of a given number
// 描述:计算给定数字的阶乘
// Input: Number n whose factorial is to be computed
// 输入:待计算阶乘的数字 n
// Output : Factorial of n = n x (n – 1) x … x 2 x 1
// 输出:n 的阶乘,即 n × (n–1) × … × 2 × 1
if (n == 1) then
return 1
else
return n * FACTORIAL(n – 1)
end
Write an algorithm to perform matrix multiplication
编写矩阵乘法的算法
Algorithm MATRIX_MULTIPLICATION(A, B)
// Description: Perform matrix multiplication of two matrices.
// 描述:计算两个矩阵的乘积
// Input : Two matrices A and B of size n x n.
// 输入:两个 n×n 大小的矩阵 A 和 B
// Output : Resultant matrix containing multiplication of A and B
// 输出:矩阵 A 和 B 的乘积矩阵 C
for i ← 1 to n do
for j ← 1 to n do
C[i][j] ← 0
for k ← 1 to n do
C[i][j] ← C[i][j] + A[i][k] * B[k][j]
end
end
end
However, there is no strict rule to follow these standards. Its syntax may vary from person to person.
但上述标准并非强制规则,算法的语法可因人而异。
Short Questions:
简答题:
Define the term: Algorithm
定义“算法”一词
The algorithm is a set of rules defined in specific order to do certain computation and carry out some predefined task. It is a step by step procedure to solve the problem
算法是按特定顺序定义的一组规则,用于执行特定计算和完成预设任务,是解决问题的逐步流程。
State the properties of Algorithm
简述算法的性质
Following are the properties of algorithm:
算法的性质如下:
- Input
输入 - Output
输出 - Definiteness
确定性 - Finiteness
有穷性 - Effectiveness
有效性
Define the term: Time Complexity
定义“时间复杂度”一词
The amount of time required to solve the given problem is called the time complexity of that algorithm
算法解决给定问题所需的时间,称为该算法的时间复杂度。
Define the term: Space Complexity
定义“空间复杂度”一词
The amount of memory required to solve the given problem is called the space complexity of that algorithm
算法解决给定问题所需的内存,称为该算法的空间复杂度。
Enlist few problem solving strategies
列举几种问题解决策略
Following are some of the popular problem solving strategies:
以下是几种常用的问题解决策略:
- String matching algorithms
字符串匹配算法 - Number theory and numerical algorithms
数论与数值算法 - Divide and conquer
分治法 - Linear programming
线性规划 - Dynamic programming
动态规划 - Greedy methods
贪心算法 - Sorting
排序算法
Why are algorithms called algorithms?
为什么“算法”被称为“Algorithms”?
We think of an algorithm as something new, but the term actually dates back about 900 years. The word algorithm comes from the name of a Persian mathematical genius, Muhammad ibn Musa al-Khwarizmi. He was born around 780 AD in the region now known as Uzbekistan…
我们总以为“算法”是个新兴概念,但实际上这个术语已存在约 900 年。“Algorithm” 一词源自波斯数学天才穆罕默德·伊本·穆萨·花拉子米(Muhammad ibn Musa al-Khwarizmi)的名字。他约公元 780 年出生于如今的乌兹别克斯坦地区……

Muhammad Al-Khwarizmi pursued interests in astronomy, geography, and mathematics. The word algebra, from the Arabic word al-jabr—”jebr being derived from the verb jabara, to reunite, and muqabala, from gabala, to make equal”—is from the Persian scholar’s writings. Learn about Al-Khwarizmi with this BBC Ideas video. Plus, from Story of Mathematics:
穆罕默德·花拉子米对天文学、地理学和数学均有研究。“代数(Algebra)”一词源自阿拉伯语“al-jabr”——“jebr” 源于动词“jabara”(意为“重组”),“muqabala” 源于“gabala”(意为“平衡”)——该词正是出自这位波斯学者的著作。
Perhaps his most important contribution to mathematics was his strong advocacy of the Hindu numerical system, which Al-Khwarizmi recognized as having the power and efficiency needed to revolutionize Islamic and Western mathematics. The Hindu numerals 1 – 9 and 0 – which have since become known as Hindu-Arabic numerals – were soon adopted by the entire Islamic world. Later, with translations of Al-Khwarizmi’s work into Latin by Adelard of Bath and others in the 12th Century, and with the influence of Fibonacci’s “Liber Abaci” they would be adopted throughout Europe as well.
花拉子米对数学最重要的贡献,或许是他大力推广“印度数字系统”——他认识到该系统具备革新伊斯兰及西方数学的潜力与效率。印度数字(1-9 及 0,后被称为“印度-阿拉伯数字”)很快被整个伊斯兰世界采用。12 世纪,巴斯的阿德拉德(Adelard of Bath)等人将花拉子米的著作译为拉丁语,再加上斐波那契(Fibonacci)《算盘全书》(Liber Abaci)的影响,这套数字系统也逐渐在欧洲普及。
The History of the Algorithm: From Ancient Origins to Digital Dominance
算法发展史:从古代起源到数字 “霸权”
Kyler
Dec 27, 2024
Algorithms Shape The Modern World
算法塑造现代世界
Algorithms shape the modern world, powering everything from search engines to financial systems. Yet, their story begins long before the age of silicon and software. The history of algorithms spans millennia, weaving through mathematics, philosophy, and technology to become the cornerstone of our digital age. This article explores the fascinating journey of algorithms, from their ancient roots to their pivotal role in contemporary life.
算法塑造了现代世界,为从搜索引擎到金融系统的一切提供动力。然而,它们的故事早在硅和软件时代之前就已开始。算法的历史跨越数千年,贯穿数学、哲学和技术领域,最终成为我们数字时代的基石。本文将探讨算法从古代起源到在当代生活中扮演关键角色的精彩历程。
The Origins: Ancient Foundations
起源:古代基础
The term “algorithm” derives from the name of Muhammad ibn Musa al-Khwarizmi, a 9th-century Persian mathematician whose work in Baghdad laid the foundation for algebra and arithmetic. His treatise, Al-Kitab al-Mukhtasar fi Hisab al-Jabr wal-Muqabala, introduced systematic approaches to solving linear and quadratic equations. The Latin translation of his name, “Algoritmi,” later evolved into the word “algorithm.”
“算法”(algorithm)一词源自穆罕默德·伊本·穆萨·花拉子米(Muhammad ibn Musa al-Khwarizmi)的名字。他是 9 世纪的波斯数学家,在巴格达的研究为代数学和算术学奠定了基础。他的论著《代数学》(Al-Kitab al-Mukhtasar fi Hisab al-Jabr wal-Muqabala)提出了求解一次方程和二次方程的系统方法。他名字的拉丁语翻译“Algoritmi”后来演变成了“algorithm”(算法)一词。
Long before al-Khwarizmi, early civilizations relied on algorithmic thinking, albeit without formal recognition:
在花拉子米之前很久,早期文明就已运用算法思维,尽管当时尚未得到正式认可:
- Babylonian Mathematics: Around 1800 BCE, Babylonian tablets detailed procedures for solving quadratic equations and performing geometric calculations.
巴比伦数学:约公元前 1800 年,巴比伦的泥板文书详细记载了求解二次方程和进行几何计算的步骤。 - Euclid’s Algorithm: In ancient Greece, Euclid’s Elements (circa 300 BCE) described a method for finding the greatest common divisor of two numbers — a procedure still taught today as “Euclid’s Algorithm.”
欧几里得算法:在古希腊,欧几里得的《几何原本》(约公元前 300 年)描述了一种求两个数最大公约数的方法,这一方法至今仍被称为“欧几里得算法”并在教学中使用。 - Indian Contributions: The mathematician Brahmagupta (7th century CE) outlined methods for solving indeterminate equations, further advancing algorithmic reasoning.
印度的贡献:7 世纪的数学家婆罗摩笈多(Brahmagupta)提出了求解不定方程的方法,进一步推动了算法推理的发展。
Medieval Advancements & The Birth of Systematic Logic
中世纪的发展与系统逻辑的诞生
During the medieval period, scholars in the Islamic Golden Age expanded on algorithmic ideas. Al-Khwarizmi’s work reached Europe through translations, profoundly influencing Western mathematics.
在中世纪,伊斯兰黄金时代的学者们进一步发展了算法思想。花拉子米的著作通过翻译传入欧洲,对西方数学产生了深远影响。
- Arabic Numerals: The adoption of the Hindu-Arabic numeral system facilitated more efficient calculations, enabling the spread of algorithmic techniques.
阿拉伯数字:印度-阿拉伯数字系统的采用使计算更加高效,推动了算法技术的传播。 - Fibonacci’s Liber Abaci (1202): This Italian mathematician introduced Arabic numerals and algorithms for arithmetic to Europe, accelerating the use of algorithmic methods in commerce and science.
斐波那契的《算盘书》(1202 年):这位意大利数学家将阿拉伯数字和算术算法引入欧洲,加速了算法方法在商业和科学领域的应用。
Concurrently, philosophers such as Ramon Llull in the 13th century explored mechanical reasoning, envisioning early forms of logic machines that foreshadowed algorithmic logic.
与此同时,13 世纪的拉蒙·柳利(Ramon Llull)等哲学家探索了机械推理,构想了早期形式的逻辑机器,为算法逻辑埋下了伏笔。
The Enlightenment: Algorithms and the Dawn of Computation
启蒙运动:算法与计算的开端
The Renaissance and Enlightenment periods saw profound developments in the formalization of logic and computation:
文艺复兴和启蒙运动时期,逻辑和计算的形式化取得了重大进展:
- Descartes and Algebra: René Descartes’ introduction of analytical geometry provided a framework for describing algorithms as sequences of logical steps.
笛卡尔与代数:勒内·笛卡尔(René Descartes)创立的解析几何,为将算法描述为一系列逻辑步骤提供了框架。 - Leibniz’s Calculating Machines: Gottfried Wilhelm Leibniz developed one of the first mechanical calculators in the 17th century, capable of performing basic arithmetic — a precursor to algorithmic automation.
莱布尼茨的计算机械:17 世纪,戈特弗里德·威廉·莱布尼茨(Gottfried Wilhelm Leibniz)发明了最早的机械计算器之一,能够进行基本算术运算,成为算法自动化的前身。
The 18th century brought advances in algorithmic processes through probability and calculus. Mathematicians like Pierre-Simon Laplace applied algorithmic reasoning to problems in astronomy, physics, and statistics.
18 世纪,借助概率论和微积分,算法流程得到了进一步发展。皮埃尔-西蒙·拉普拉斯(Pierre-Simon Laplace)等数学家将算法推理应用于天文学、物理学和统计学领域的问题求解。
The 19th Century: Mechanization and Formalization
19 世纪:机械化与形式化
The Industrial Revolution sparked a surge in mechanization, and algorithms followed suit:
工业革命引发了机械化的浪潮,算法也随之向机械化方向发展:
- Charles Babbage and Ada Lovelace: In the 1830s, Charles Babbage designed the Analytical Engine, the first general-purpose computing machine. Ada Lovelace, often called the first computer programmer, devised algorithms for the machine to perform calculations, anticipating the concept of programmable software.
查尔斯·巴贝奇与埃达·洛夫莱斯:19 世纪 30 年代,查尔斯·巴贝奇(Charles Babbage)设计了“分析机”(Analytical Engine),这是第一台通用计算机器。常被称为“第一位计算机程序员”的埃达·洛夫莱斯(Ada Lovelace)为这台机器设计了用于计算的算法,预见了可编程软件的概念。 - Boolean Algebra: George Boole’s The Laws of Thought (1854) introduced Boolean logic, a system of true/false values that underpins modern computing.
布尔代数:1854 年,乔治·布尔(George Boole)在《思维规律》(The Laws of Thought)中提出了布尔逻辑。这种基于“真/假”值的系统,成为现代计算的基础。
These developments marked the transition of algorithms from theoretical constructs to tools of computation.
这些发展标志着算法从理论概念转变为计算工具。
The 20th Century: From Theory to Technology
20 世纪:从理论到技术
The 20th century transformed algorithms into the backbone of the digital revolution:
20 世纪,算法转变为数字革命的核心支柱:
- Alan Turing and the Turing Machine: In 1936, Alan Turing’s paper On Computable Numbers described a theoretical machine capable of performing any computation through a sequence of logical steps. The “Turing Machine” remains a foundational model in computer science.
艾伦·图灵与图灵机:1936 年,艾伦·图灵(Alan Turing)在论文《论可计算数》(On Computable Numbers)中描述了一种理论机器。这种机器能够通过一系列逻辑步骤执行任何计算,“图灵机”至今仍是计算机科学的基础模型。 - John von Neumann: The 1940s saw the advent of stored-program computers, inspired by von Neumann’s architecture. Algorithms became the means by which these machines executed tasks.
约翰·冯·诺依曼:20 世纪 40 年代,受冯·诺依曼体系结构的启发,存储程序计算机问世。算法成为这些机器执行任务的核心方式。 - Shannon’s Information Theory: Claude Shannon’s work in the 1940s formalized data transmission and storage, providing the basis for algorithmic data processing.
香农的信息论:20 世纪 40 年代,克劳德·香农(Claude Shannon)的研究使数据传输和存储形式化,为算法数据处理奠定了基础。
By mid-century, algorithms powered the development of early programming languages like FORTRAN and COBOL, ushering in the age of software.
到 20 世纪中期,算法推动了 FORTRAN、COBOL 等早期编程语言的发展,开启了软件时代。
The Digital Age: Ubiquity and Complexity
数字时代:普及与复杂
The rise of digital computing in the late 20th and early 21st centuries elevated algorithms to a central role in daily life:
20 世纪末至 21 世纪初,数字计算的兴起使算法在日常生活中占据核心地位:
- Search Algorithms: Google’s PageRank algorithm revolutionized information retrieval on the web, enabling precise search results.
搜索算法:谷歌的 PageRank 算法彻底改变了网络信息检索方式,实现了精准的搜索结果。 - Machine Learning and AI: Algorithms now train artificial intelligence models to recognize patterns, make predictions, and adapt autonomously.
机器学习与人工智能:如今,算法可用于训练人工智能模型,使其具备模式识别、预测和自主适应的能力。 - Blockchain: Algorithms govern decentralized systems like blockchain, ensuring security and transparency in digital transactions.
区块链:算法管理着区块链等去中心化系统,确保数字交易的安全性和透明度。
Today, algorithms power everything from social media feeds to genome sequencing, illustrating their immense range and impact.
如今,算法为从社交媒体信息流到基因组测序的一切提供支持,彰显了其广泛的应用范围和巨大影响力。
Ethical and Societal Implications
伦理与社会影响
As algorithms grow more influential, their ethical dimensions come under scrutiny. Issues like algorithmic bias, data privacy, and transparency challenge developers and policymakers to ensure that these tools serve society equitably.
随着算法影响力的增强,其伦理层面的问题受到密切关注。算法偏见、数据隐私和透明度等问题,对开发者和政策制定者提出了挑战,要求他们确保这些工具能公平地服务于社会。
As algorithms increasingly dictate the systems that shape our lives, their ethical and societal dimensions demand critical examination. From powering social media to guiding judicial decisions, algorithms influence public opinion, economic structures, and individual opportunities. However, their rise brings with it a host of ethical concerns that challenge developers, businesses, and policymakers alike. Below, we delve deeper into the key issues of algorithmic bias, data privacy, transparency, and their broader societal implications.
随着算法在塑造我们生活的系统中发挥越来越重要的作用,其伦理和社会层面的问题亟待深入审视。从驱动社交媒体到指导司法判决,算法影响着公众舆论、经济结构和个人机遇。然而,算法的崛起也带来了一系列伦理问题,对开发者、企业和政策制定者均构成挑战。下文将深入探讨算法偏见、数据隐私、透明度等关键问题及其更广泛的社会影响。
1. Algorithmic Bias: Prejudice in Code
1. 算法偏见:代码中的歧视
Algorithms are often considered impartial, but their neutrality depends on the data they are fed and the objectives they are designed to achieve. Unfortunately, biases — whether unintentional or systemic — can seep into algorithms, perpetuating inequalities and amplifying societal prejudices.
算法通常被认为是公正的,但其中立性取决于所输入的数据和设计目标。遗憾的是,无论是无意的还是系统性的偏见,都可能渗入算法中,加剧不平等现象并放大社会偏见。
Sources of Algorithmic Bias:
算法偏见的来源:
- Data Bias: If the training data used to develop an algorithm is unrepresentative or reflects societal biases, the algorithm will replicate those biases. For example, facial recognition systems have been shown to perform less accurately for darker skin tones because the datasets used to train them lack diversity.
数据偏见:若用于开发算法的训练数据不具代表性或反映了社会偏见,算法就会复制这些偏见。例如,面部识别系统对深色皮肤人群的识别准确率较低,原因是用于训练该系统的数据集缺乏多样性。 - Design Choices: Algorithms reflect the priorities of their creators. A hiring algorithm, for example, may prioritize efficiency over fairness, inadvertently discriminating against candidates with unconventional career paths.
设计选择偏见:算法体现了开发者的优先考量。例如,招聘算法可能更注重效率而非公平,从而无意中歧视那些职业经历非常规的求职者。 - Feedback Loops: Many algorithms learn and adapt over time, which can unintentionally reinforce biased outcomes. For example, predictive policing systems may disproportionately target certain communities based on historical arrest data, creating a cycle of over-policing.
反馈循环偏见:许多算法会随时间推移不断学习和调整,这可能无意中强化有偏见的结果。例如,预测性警务系统可能会根据历史逮捕数据,对某些社区进行过度监控,形成“过度执法循环”。
Consequences of Bias:
偏见的后果:
- Discrimination: Algorithmic bias can lead to unfair treatment in critical areas such as hiring, lending, healthcare, and criminal justice. A biased hiring algorithm might unfairly reject women for technical roles, while a biased credit-scoring algorithm might deny loans to minority groups.
歧视:算法偏见可能导致在招聘、贷款、医疗和司法等关键领域出现不公平待遇。例如,有偏见的招聘算法可能会不公平地拒绝女性应聘技术岗位,而有偏见的信用评分算法可能会拒绝向少数群体提供贷款。 - Loss of Trust: Public trust erodes when algorithms are perceived as unfair or discriminatory. This can lead to resistance against adopting beneficial technologies and exacerbate divisions within society.
信任丧失:当公众认为算法不公平或具有歧视性时,对算法的信任会逐渐瓦解。这可能导致人们抵制有益的技术,并加剧社会内部的分裂。
2. Data Privacy: Who Owns Your Information?
2. 数据隐私:谁拥有你的信息?
Modern algorithms thrive on data, using it to train models, make predictions, and offer personalized services. However, this hunger for data raises significant privacy concerns.
现代算法依赖数据运行,通过数据训练模型、进行预测并提供个性化服务。然而,这种对数据的“渴求”引发了严重的隐私问题。
Key Privacy Issues:
核心隐私问题:
- Surveillance and Consent: Algorithms often collect data without users’ explicit consent. Social media platforms and apps track user behavior to target ads, while governments deploy surveillance technologies to monitor citizens.
监控与同意:算法常常在未获得用户明确同意的情况下收集数据。社交媒体平台和应用程序会追踪用户行为以精准投放广告,而政府则会部署监控技术以监控公民。 - Data Breaches: Centralized storage of vast amounts of sensitive data creates lucrative targets for hackers. Breaches can expose individuals to identity theft and other risks.
数据泄露:大量敏感数据的集中存储使黑客将其视为高价值目标。数据泄露可能导致个人身份被盗用,并面临其他风险。 - Data Monetization: Companies often profit from user data without compensating users. This raises questions about ownership and fair compensation for personal information.
数据商业化:企业常常利用用户数据获利,却不向用户提供补偿。这引发了关于个人信息所有权和公平补偿的争议。
Balancing Act:
平衡举措:
The challenge lies in balancing innovation with privacy. Stricter regulations, such as the General Data Protection Regulation (GDPR) in the European Union, attempt to provide users with greater control over their data. However, implementing these rules without stifling technological progress remains a complex issue.
当前的挑战在于平衡创新与隐私保护。更严格的法规(如欧盟的《通用数据保护条例》(GDPR))试图让用户对自己的数据拥有更大控制权。然而,如何在执行这些规则的同时不阻碍技术进步,仍是一个复杂的问题。
3. Transparency: The Black Box Problem
3. 透明度:黑箱问题
Algorithms often operate as “black boxes,” making decisions without offering clear explanations of how or why they arrived at their conclusions. This lack of transparency can have severe implications.
算法的运行往往如同“黑箱”,在做出决策时无法清晰解释其决策过程和依据。这种透明度的缺失可能带来严重影响。
Why Transparency Matters:
透明度的重要性:
- Accountability: When algorithms make mistakes, such as denying someone a loan or misclassifying medical conditions, it is crucial to understand what went wrong. Without transparency, holding creators accountable is nearly impossible.
问责制:当算法出错(如拒绝向某人提供贷款或错误分类医疗状况)时,了解问题根源至关重要。若缺乏透明度,几乎无法追究开发者的责任。 - Trust and Adoption: Transparent algorithms foster public trust, making users more likely to embrace their benefits.
信任与采用:透明的算法能增强公众信任,使用户更愿意接受其带来的便利。 - Ethical Oversight: Transparency enables external stakeholders, including regulators and ethicists, to evaluate whether an algorithm aligns with societal values.
伦理监督:透明度使监管机构、伦理学家等外部相关方能够评估算法是否符合社会价值观。
Challenges in Achieving Transparency:
实现透明度的挑战:
- Complexity: Advanced algorithms, particularly those powered by machine learning and deep learning, involve layers of calculations that even their creators struggle to fully explain.
复杂性:先进的算法(尤其是基于机器学习和深度学习的算法)包含多层计算过程,即便其开发者也难以完全解释清楚。 - Proprietary Concerns: Companies often guard their algorithms as trade secrets, fearing that transparency could expose them to competition or misuse.
商业机密顾虑:企业通常将算法视为商业机密加以保护,担心透明度会使其面临竞争压力或算法被滥用。
4. Broader Societal Implications
4. 更广泛的社会影响
Beyond bias, privacy, and transparency, algorithms raise profound societal questions:
除了偏见、隐私和透明度,算法还引发了深刻的社会问题:
Economic Impact:
经济影响:
Algorithms automate tasks at unprecedented scales, creating efficiencies but also displacing jobs. This shift toward automation necessitates rethinking education, retraining, and income distribution to ensure equitable opportunities.
算法以前所未有的规模实现了任务自动化,在提高效率的同时也导致了就业岗位流失。这种向自动化的转变,要求我们重新思考教育、再培训和收入分配体系,以确保机会公平。
Manipulation and Polarization:
操纵与极化:
Social media algorithms optimize for engagement, often amplifying sensationalist content that fosters polarization and misinformation. This has far-reaching consequences for public discourse, democracy, and mental health.
社交媒体算法以“提升用户参与度”为优化目标,往往会放大煽动性内容,加剧社会极化和虚假信息传播。这对公共讨论、民主制度和心理健康都产生了深远影响。
Ethical Governance:
伦理治理:
- Global Inequities: Algorithms developed in technologically advanced countries often fail to account for the cultural and economic contexts of less developed regions, exacerbating global inequalities.
全球不平等:由技术发达国家开发的算法往往未考虑欠发达地区的文化和经济背景,加剧了全球不平等。 - Power Dynamics: Control over algorithms — and the data they rely on — grants immense power to corporations and governments, raising concerns about monopolies and authoritarianism.
权力结构:对算法及其依赖数据的控制,使企业和政府获得了巨大权力,引发了对垄断和威权主义的担忧。
5. Steps Toward Ethical Algorithm Design
5. 迈向伦理算法设计的步骤
Addressing these challenges requires a multidisciplinary approach:
应对这些挑战需要多学科协作:
- Inclusive Design: Engage diverse teams to reduce bias during algorithm development.
- 包容性设计:组建多元化团队,减少算法开发过程中的偏见。
Ethical Standards: Adopt frameworks like the European Union’s Ethics Guidelines for Trustworthy AI to guide responsible development.
伦理标准:采用欧盟《可信人工智能伦理指南》(Ethics Guidelines for Trustworthy AI)等框架,指导负责任的算法开发。 - Audits and Regulation: Mandate regular audits to identify biases and ensure compliance with ethical standards.
审计与监管:强制要求定期审计,以识别偏见并确保符合伦理标准。 - Explainability: Invest in research to make complex algorithms more interpretable without sacrificing performance.
可解释性:投入研究,在不牺牲性能的前提下提高复杂算法的可解释性。 - Empower Users: Enhance user rights, such as the ability to opt out of data collection or contest algorithmic decisions.
赋予用户权力:强化用户权利,例如允许用户选择退出数据收集,或对算法决策提出异议。
The power of algorithms is undeniable, but so too is their potential for harm. Addressing the ethical and societal implications of algorithms is not just a technological challenge — it is a moral imperative. By promoting fairness, privacy, and transparency, we can ensure that algorithms serve as tools of progress rather than instruments of inequality. In doing so, we pave the way for a future where technology uplifts humanity as a whole.
算法的力量毋庸置疑,但其潜在危害也同样不可忽视。解决算法的伦理和社会影响不仅是技术挑战,更是道德责任。通过倡导公平、隐私和透明度,我们可以确保算法成为推动进步的工具,而非加剧不平等的手段。通过这些努力,我们将为技术造福全人类的未来铺平道路。
Conclusion
结论
The power of algorithms is undeniable, but so too is their potential for harm. Addressing the ethical and societal implications of algorithms is not just a technological challenge — it is a moral imperative. By promoting fairness, privacy, and transparency, we can ensure that algorithms serve as tools of progress rather than instruments of inequality. In doing so, we pave the way for a future where technology uplifts humanity as a whole.
算法的力量毋庸置疑,但其潜在危害也同样不可忽视。解决算法的伦理和社会影响不仅是技术挑战,更是道德责任。通过倡导公平、隐私和透明度,我们可以确保算法成为推动进步的工具,而非加剧不平等的手段。通过这些努力,我们将为技术造福全人类的未来铺平道路。
The history of algorithms is a testament to humanity’s drive to solve problems, automate processes, and innovate. From ancient mathematics to modern machine learning, algorithms have evolved into powerful tools that shape how we interact with the world. As we move forward, understanding their origins and trajectory is vital for harnessing their potential responsibly in the years to come.
算法的发展史证明了人类解决问题、实现流程自动化和推动创新的不懈追求。从古代数学到现代机器学习,算法已发展成为塑造人类与世界互动方式的强大工具。展望未来,了解算法的起源和发展轨迹,对于在未来负责任地发挥其潜力至关重要。
By grounding innovation in ethical considerations, we can create systems that not only push the boundaries of possibility but also uphold the values of equity, trust, and accountability. In doing so, we honor the legacy of algorithms and ensure their transformative power remains a force for good.
将创新建立在伦理考量的基础上,我们就能构建出既突破可能性边界,又坚守公平、信任和问责制价值观的系统。通过这些努力,我们将传承算法的历史遗产,并确保其变革力量始终成为推动善举的动力。
| Time Range 时间范围 | Key Figure/Civilization 关键人物/文明 | Core Contribution 贡献 | Historical Significance 历史意义 |
|---|---|---|---|
| Circa 1800 BCE 约公元前1800年 | Babylonian Civilization 巴比伦文明 | Detailed procedures for solving quadratic equations and geometric calculations on clay tablets 在泥板文书中记载求解二次方程和几何计算的步骤 | Early practice of algorithmic thinking, laying the foundation for subsequent mathematical algorithms 早期算法思维的实践,为后续数学算法奠定基础 |
| Circa 300 BCE 约公元前300年 | Euclid (Ancient Greece) 欧几里得(古希腊) | Proposed the method for finding the greatest common divisor of two numbers (Euclid’s Algorithm) in Elements 在《几何原本》中提出求两数最大公约数的方法(欧几里得算法) | The first systematically recorded algorithm, still used in teaching and applications today 首个有明确记载的系统化算法,至今仍在教学和应用中使用 |
| 7th Century CE 7世纪 | Brahmagupta (India) 婆罗摩笈多(印度) | Outlined methods for solving indeterminate equations, advancing algorithmic reasoning 提出求解不定方程的方法,推动算法推理发展 | Expanded the application scope of algorithms and enriched the algorithmic reasoning system 拓展了算法的应用范围,丰富了算法推理体系 |
| 9th Century CE 9世纪 | Muhammad ibn Musa al-Khwarizmi (Persia) 穆罕默德·伊本·穆萨·花拉子米(波斯) | Wrote Al-Kitab al-Mukhtasar fi Hisab al-Jabr wal-Muqabala, proposing systematic methods for solving linear and quadratic equations; the term “algorithm” derives from the Latin translation of his name 撰写《代数学》,提出求解一次、二次方程的系统方法;“算法”一词源自其名字的拉丁语翻译 | Laid the foundation for algebra and arithmetic, officially initiating the naming and systematic research of algorithms 为代数学和算术学奠定基础,正式开启算法的命名与系统化研究 |
| 1202 1202年 | Fibonacci (Italy) 斐波那契(意大利) | Published Liber Abaci, introducing Arabic numerals and arithmetic algorithms to Europe 出版《算盘书》,将阿拉伯数字和算术算法引入欧洲 | Accelerated the application of algorithms in European commerce and science, promoting the development of Western mathematics 加速算法在欧洲商业和科学领域的应用,推动西方数学发展 |
| 17th Century 17世纪 | Gottfried Wilhelm Leibniz 戈特弗里德·威廉·莱布尼茨 | Invented one of the first mechanical calculators capable of performing basic arithmetic 发明早期机械计算器,可进行基本算术运算 | An important precursor to algorithmic automation, providing ideas for the development of subsequent computing devices 算法自动化的重要前身,为后续计算设备发展提供思路 |
| 1830s 19世纪30年代 | Charles Babbage, Ada Lovelace (UK) 查尔斯·巴贝奇、埃达·洛夫莱斯(英国) | Babbage designed the “Analytical Engine” (the first general-purpose computing machine); Lovelace devised algorithms for it, anticipating the concept of programmable software 巴贝奇设计“分析机”(首台通用计算机器);洛夫莱斯为其设计计算算法,预见可编程软件概念 | Marked the transition of algorithms from theory to computing tools, laying the foundation for modern computers and programming 标志算法从理论走向计算工具,为现代计算机和编程奠定基础 |
| 1854 | George Boole (UK) 乔治·布尔(英国) | Published The Laws of Thought, introducing Boolean logic (a logical system based on true/false values) 出版《思维规律》,提出布尔逻辑(基于“真/假”值的逻辑系统) | Became the core logical foundation of modern computing, supporting the design of computer hardware and software 成为现代计算的核心逻辑基础,支撑计算机硬件和软件设计 |
| 1936 | Alan Turing (UK) 艾伦·图灵(英国) | Published On Computable Numbers, proposing the theoretical model of the “Turing Machine” 发表《论可计算数》,提出“图灵机”理论模型 | A foundational model in computer science, defining the core concept of computability 计算机科学的基础模型,定义了可计算性的核心概念 |
| 1940s | John von Neumann, Claude Shannon (USA) 约翰·冯·诺依曼、克劳德·香农(美国) | Von Neumann proposed the stored-program computer architecture; Shannon founded information theory, formalizing data transmission and storage 冯·诺依曼提出存储程序计算机架构;香农创立信息论,使数据传输与存储形式化 | Promoted algorithms to become the core way for computers to execute tasks, providing a theoretical foundation for data processing algorithms 推动算法成为计算机执行任务的核心方式,为数据处理算法提供理论基础 |
| Mid to Late 20th Century 20世纪中后期 | - - | Algorithms powered the development of early programming languages like FORTRAN and COBOL, ushering in the age of software 算法推动 FORTRAN、COBOL 等早期编程语言发展,开启软件时代 | Deep integration of algorithms and software, accelerating the popularization and application of digital technology 算法与软件深度结合,加速数字技术的普及与应用 |
| 21st Century 21世纪 | - - | Google’s PageRank algorithm revolutionized web search; machine learning algorithms promoted AI development; blockchain algorithms ensured the security of digital transactions 谷歌 PageRank 算法革新网络搜索;机器学习算法推动人工智能发展;区块链算法保障数字交易安全 | Algorithms fully penetrated daily life, becoming the core driving force of the digital age 算法全面渗透日常生活,成为数字时代的核心驱动力 |
History of Algorithms with Timeline
算法发展史与时间线
The concept of algorithms has a long history, dating back to ancient civilizations. The word “algorithm” can be traced back to the 9th century when it was coined by the Persian mathematician Abdullah Muhammad bin Musa al-Khwarizmi, who is often referred to as “The Father of Algebra.”
算法的概念有着悠久的历史,可追溯至古代文明时期。“algorithm”(算法)一词源于 9 世纪,由波斯数学家 Abdullah Muhammad bin Musa al-Khwarizmi(阿布杜拉·穆罕默德·本·穆萨·花拉子米)创造,他常被称为“代数学之父”。
In the 12th century, one of al-Khwarizmi’s books was translated into Latin, and his name was rendered as “Algorithmi.” However, the idea of algorithms existed long before this time, as various cultures and civilizations developed methods and techniques for solving problems and making calculations. Let’s have a look:
12 世纪,花拉子米的一本著作被翻译成拉丁文,他的名字被译为“Algorithmi”。但算法的思想在此之前早已存在,因为不同文化和文明都曾研发出解决问题与进行计算的方法和技巧。以下为具体示例:
- Euclid’s algorithm for finding the greatest common divisor of two numbers, developed 2,000 years ago.
2000 年前提出的 欧几里得算法(Euclid’s algorithm),用于求解两个数的最大公约数。 - The Urdhva Tiryakbhyam algorithm, used by Vedic mathematicians for fast integer multiplication.
吠陀数学家使用的 十字相乘算法(Urdhva Tiryakbhyam algorithm),用于快速整数乘法运算。 - Arithmetic algorithms used by the Babylonians and Egyptians, such as a division algorithm.
巴比伦人和埃及人使用的算术算法,例如一种除法算法。 - The Sieve of Eratosthenes, used by Greek mathematicians to find prime numbers.
希腊数学家使用的 埃拉托斯特尼筛法(Sieve of Eratosthenes),用于筛选素数。 - Cryptographic algorithms used by Arabic mathematicians for code-breaking.
阿拉伯数学家使用的密码算法,用于破译密码。 - The Chinese Remainder Theorem, discovered by Chinese mathematicians in the 3rd century AD.
公元 3 世纪中国数学家发现的 中国剩余定理(Chinese Remainder Theorem)。 - The Babylonian-Sumerian method of extracting a root, one of the first documented examples of a mathematical algorithm.
巴比伦 - 苏美尔人的开方方法,这是有记载的最早数学算法实例之一。 - Gauss’s Gaussian elimination algorithm for solving systems of linear equations.
高斯提出的 高斯消元法(Gaussian elimination algorithm),用于求解线性方程组。 - The “Chakravala” method, a cyclic algorithm developed by Brahmagupta, Bhaskara, and Jayadeva to solve indeterminate quadratic equations.
由 Brahmagupta(婆罗摩笈多)、Bhaskara(巴斯卡拉)和 Jayadeva(贾亚德瓦)研发的 “循环法”(Chakravala 方法),这是一种用于求解不定二次方程的循环算法。
Even most of the above algorithms are still relevant. Now the critical question is - Why we used the above algorithms in ancient times? Are algorithms just about computers or more than that? Think!
即便到现在,上述大部分算法仍具有实际意义。现在有一个关键问题:古代为何要使用这些算法?算法仅仅与计算机相关,还是有着更广泛的范畴?不妨思考一下!
Timeline of famous algorithms after 1500 AD!
公元 1500 年后著名算法时间线
- 1540 — method to find the roots of a quartic polynomial
1540 年 — 四次多项式求根方法 - 1545 — method for finding the roots of a cubic polynomial
1545 年 — 三次多项式求根方法 - 1614 — method for performing calculations using logarithms
1614 年 — 利用对数进行计算的方法 - 1671 — Newton–Raphson method
1671 年 — 牛顿 - 拉夫逊法(Newton–Raphson method) - 1842 — The first algorithm for a computing engine
1842 年 — 首个用于计算引擎的算法 - 1847—George Boole unified logic with calculations and formed the basis of today’s computing logic: Boolean Algebra.
1847 年 — George Boole(乔治·布尔)将逻辑与计算统一,奠定了当今计算逻辑的基础:布尔代数(Boolean Algebra)。 - 1888— Giuseppe Peano established the axiomatisation of mathematics. He used equations with symbols to obtain results that would later become rules that modern-day mathematics and algorithms are based on.
1888 年 — Giuseppe Peano(朱塞佩·皮亚诺)确立了数学公理化体系。他通过含符号的等式得出结论,这些结论后来成为现代数学与算法所依据的规则。 - 1930 — Lambda calculus. It is equivalent to a Turing machine that has provided a solid theoretical foundation for functional programming languages.
1930 年 — λ 演算(Lambda calculus)。它与图灵机等价,为函数式编程语言提供了坚实的理论基础。 - 1936 — Turing machine, an abstract machine that developed the modern notion of “algorithm.”
1936 年 — 图灵机(Turing machine),这是一种抽象机器,构建了“算法”的现代概念。 - 1942 — A fast Fourier transform algorithm
1942 年 — 一种快速傅里叶变换算法 - 1945 — Merge sort
1945 年 — 归并排序(Merge sort) - 1943—Kleene’s algorithm. It transforms a given nondeterministic finite automaton into a regular expression.
1943 年 — 克林算法(Kleene’s algorithm)。该算法可将给定的非确定有限自动机转换为正则表达式。 - 1947 — Simplex algorithm
1947 年 — 单纯形法(Simplex algorithm) - 1952 — Huffman coding
1952 年 — 霍夫曼编码(Huffman coding) - 1954 — Radix sort algorithm
1954 年 — 基数排序算法(Radix sort algorithm) - 1956 — Kruskal’s algorithm
1956 年 — 克鲁斯卡尔算法(Kruskal’s algorithm) - 1956 — Ford–Fulkerson algorithm
1956 年 — 福特 - 富尔克森算法(Ford–Fulkerson algorithm) - 1957 — Prim’s algorithm
1957 年 — 普里姆算法(Prim’s algorithm) - 1957 — Bellman-Ford algorithm
1957 年 — 贝尔曼 - 福特算法(Bellman-Ford algorithm) - 1959 — Dijkstra’s algorithm
1959 年 — 迪杰斯特拉算法(Dijkstra’s algorithm) - 1959 — Shell sort
1959 年 — 希尔排序(Shell sort) - 1960 — Karatsuba multiplication
1960 年 — 卡拉祖巴乘法(Karatsuba multiplication) - 1962 — AVL trees
1962 年 — AVL 树(AVL trees) - 1962 — Quicksort
1962 年 — 快速排序(Quicksort) - 1962 — Stable-marriage algorithm
1962 年 — 稳定婚姻算法(Stable-marriage algorithm) - 1964 — Heapsort
1964 年 — 堆排序(Heapsort) - 1965 — Cooley–Tukey algorithm
1965 年 — 库利 - 图基算法(Cooley–Tukey algorithm) - 1965 — Levenshtein distance
1965 年 — 莱文斯坦距离(Levenshtein distance) - 1965 — LR parsers
1965 年 — LR 分析器(LR parsers) - 1967 — Viterbi algorithm
1967 年 — 维特比算法(Viterbi algorithm) - 1968 — A* graph search algorithm
1968 年 — A 图搜索算法*(A* graph search algorithm) - 1969 — Strassen algorithm for matrix multiplication
1969 年 — 施特拉森矩阵乘法算法(Strassen algorithm for matrix multiplication) - 1972 — Graham scan
1972 年 — 格雷厄姆扫描法(Graham scan) - 1972 — Red-black trees and B-trees
1972 年 — 红黑树(Red-black trees)与 B 树(B-trees) - 1973 — RSA encryption algorithm
1973 年 — RSA 加密算法(RSA encryption algorithm) - 1973 — Jarvis march algorithm
1973 年 — 贾维斯步进法(Jarvis march algorithm) - 1973 — Hopcroft–Karp algorithm
1973 年 — 霍普克罗夫特 - 卡普算法(Hopcroft–Karp algorithm) - 1974 — Quadtree developed
1974 年 — 四叉树(Quadtree)研发成功 - 1976 — Knuth–Morris–Pratt algorithm
1976 年 — 克努特 - 莫里斯 - 普拉特算法(Knuth–Morris–Pratt algorithm) - 1977 — Boyer–Moore string search algorithm for searching the occurrence of a string into another string.
1977 年 — 博耶 - 穆尔字符串搜索算法(Boyer–Moore string search algorithm),用于在一个字符串中查找另一个字符串的出现位置。 - 1980 — Brent’s Algorithm for cycle detection
1980 年 — 用于环路检测的 布伦特算法(Brent’s Algorithm) - 1983 — Classification and regression tree algorithm
1983 年 — 分类与回归树算法(Classification and regression tree algorithm) - 1984 — Karmarkar’s interior-point algorithm
1984 年 — 卡马卡内点算法(Karmarkar’s interior-point algorithm) - 1985 — Splay trees
1985 年 — 伸展树(Splay trees) - 1986 — Push relabel maximum flow algorithm
1986 年 — 推送重贴标签最大流算法(Push relabel maximum flow algorithm) - 1991 — Wait-free synchronization
1991 年 — 无等待同步(Wait-free synchronization) - 1993 — Apriori algorithm
1993 年 — 关联规则学习算法(Apriori algorithm) - 1993 — Algorithm to compute the minimum cut of a connected graph
1993 年 — 用于计算连通图最小割的算法 - 1998 — PageRank algorithm
1998 年 — 佩奇排序算法(PageRank algorithm) - 2001 — Distributed hash table
2001 年 — 分布式哈希表(Distributed hash table) - 2001 — BitTorrent, the first fully decentralized peer-to-peer file distribution system, is published
2001 年 — 比特流(BitTorrent)发布,这是首个完全去中心化的对等文件分发系统 - 2009 — Bitcoin, a first trust-less decentralized cryptocurrency system, is published
2009 年 — 比特币(Bitcoin)发布,这是首个无需信任的去中心化加密货币系统
Conclusion
结论
As computing power has increased, algorithms have become more complex. Today, we are on the verge of a new era of artificial intelligence and quantum computing, and algorithms are evolving at every stage of technological innovation. However, despite the changes and advances, the basic principles of algorithms remain the same as they have been throughout history.
随着计算能力的提升,算法变得愈发复杂。如今,我们正处于人工智能与量子计算新时代的边缘,在技术创新的每个阶段,算法都在不断发展。但无论如何变革与进步,算法的基本原理始终与历史上保持一致。
Algorithms are present in every generation and can be found in various forms and applications from ancient times to the present day. Algorithms are an integral part of our daily lives and will continue to play a vital role as technology advances. Enjoy learning, enjoy algorithms!
从古代到现代,算法存在于每一个时代,并以多种形式和应用场景呈现。算法是我们日常生活中不可或缺的一部分,随着技术的进步,它将继续发挥重要作用。享受学习,享受算法!
via:
- Evolution of Algorithm – Origin and History
https://codecrucks.com/evolution-of-algorithm-origin-and-history - What is Algorithm? – Nutshell Explanation
https://codecrucks.com/what-is-algorithm-nutshell-explanation - The History of the Algorithm: From Ancient Origins to Digital Dominance
https://rememberer.medium.com/the-history-of-the-algorithm-from-ancient-origins-to-digital-dominance-675163919e96 - History of Algorithms
https://www.enjoyalgorithms.com/blog/history-of-algorithms - Why are algorithms called algorithms?
https://thekidshouldseethis.com/post/algorithms-word-origin-al-khwarizmi

42

被折叠的 条评论
为什么被折叠?



