Can Digital Computers Think? (1951)——Alan Turing 轮AI

媒体把一个概念炒热以后,AI的概念就脏掉了,把很多幻想的东西当现实。很多年前大佬接受BBC采访。所以这个文本一开始就是说给麻瓜听的,但是又是开创行业的大佬,所以足够浅显、通俗、犀利、深刻。


Digital computers have often been described as mechanical brains. Most scientists probably regard this description as a mere newspaper stunt, but some do not. One mathematician has expressed the opposite point of view to me rather forcefully in the words ‘It is commonly said that these machines are not brains, but you and I know that they are.’ In this talk I shall try to explain the ideas behind the various possible points of view, though not altogether impartially. I shall give most attention to the view which I hold myself, that it is not altogether unreasonable to describe digital computers as brains. A different point of view has already been put by Professor Hartree.

First we may consider the naive point of view of the man in the street. He hears amazing accounts of what these machines can do: most of them apparently involve intellectual feats of which he would be quite incapable. He can only explain it by supposing that the machine is a sort of brain, though he may prefer simply to disbelieve what he has heard.

The majority of scientists are contemptuous of this almost superstitious attitude. They know something of the principles on which the machines are constructed and of the way in which they are used. Their outlook was well summed up by Lady Lovelace over a hundred years ago, speaking of Babbage’s Analytical Engine. She said, as Hartree has already quoted, ‘The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform.’ This very well describes the way in which digital computers are actually used at the present time, and in which they will probably mainly be used for many years to come. For any one calculation the whole procedure that the machine is to go through is planned out in advance by a mathematician. The less doubt there is about what is going to happen the better the mathematician is pleased. It is like planning a military operation. Under these circumstances it is fair to say that the machine doesn’t originate anything.

There is however a third point of view, which I hold myself. I agree with Lady Lovelace’s dictum as far as it goes, but I believe that its validity depends on considering how digital computers are used rather than how they could be used. In fact I believe that they could be used in such a manner that they could appropriately be described as brains. I should also say that ‘If any machine can appropriately be described as a brain, then any digital computer can be so described.’

This last statement needs some explanation. It may appear rather startling, but with some reservations it appears to be an inescapable fact. It can be shown to follow from a characteristic property of digital computers, which I will call their universality. A digital computer is a universal machine in the sense that it can be made to replace any machine of a certain very wide class. It will not replace a bulldozer or a steam-engine or a telescope, but it will replace any rival design of calculating machine, that is to say any machine into which one can feed data and which will later print out results. In order to arrange for our computer to imitate a given machine it is only necessary to programme the computer to calculate what the machine in question would do under given circumstances, and in particular what answers it would print out. The computer can then be made to print out the same answers.

If now some particular machine can be described as a brain we have only to programme our digital computer to imitate it and it will also be a brain. If it is accepted that real brains, as found in animals, and in particular in men, are a sort of machine it will follow that our digital computer, suitably programmed, will behave like a brain.

This argument involves several assumptions which can quite reasonably be challenged. I have already explained that the machine to be imitated must be more like a calculator than a bulldozer. This is merely a reflection of the fact that we are speaking of mechanical analogues of brains, rather than of feet or jaws. It was also necessary that this machine should be of the sort whose behaviour is in principle predictable by calculation. We certainly do not know how any such calculation should be done, and it was even argued by Sir Arthur Eddington that on account of the indeterminacy principle in quantum mechanics no such prediction is even theoretically possible.

Another assumption was that the storage capacity of the computer used should be sufficient to carry out the prediction of the behaviour of the machine to be imitated. It should also have sufficient speed. Our present computers probably have not got the necessary storage capacity, though they may well have the speed. This means in effect that if we wish to imitate anything so complicated as the human brain we need a very much larger machine than any of the computers at present available. We probably need something at least a hundred times as large as the Manchester Computer. Alternatively of course a machine of equal size or smaller would do if sufficient progress were made in the technique of storing information.

It should be noticed that there is no need for there to be any increase in the complexity of the computers used. If we try to imitate ever more complicated machines or brains we must use larger and larger computers to do it. We do not need to use successively more complicated ones. This may appear paradoxical, but the explanation is not difficult. The imitation of a machine by a computer requires not only that we should have made the computer, but that we should have programmed it appropriately. The more complicated the machine to be imitated the more complicated must the programme be.

This may perhaps be made clearer by an analogy. Suppose two men both wanted to write their autobiographies, and that one had had an eventful life, but very little had happened to the other. There would be two difficulties troubling the man with the more eventful life more seriously than the other. He would have to spend more on paper and he would have to take more trouble over thinking what to say. The supply of paper would not be likely to be a serious difficulty, unless for instance he were on a desert island, and in any case it could only be a technical or a financial problem. The other difficulty would be more fundamental and would become more serious still if he were not writing his life but a work on something he knew nothing about, let us say about family life on Mars. Our problem of programming a computer to behave like a brain is something like trying to write this treatise on a desert island. We cannot get the storage capacity we need: in other words we cannot get enough paper to write the treatise on, and in any case we don’t know what we should write down if we had it. This is a poor state of affairs, but, to continue the analogy, it is something to know how to write, and to appreciate the fact that most knowledge can be embodied in books.

In view of this it seems that the wisest ground on which to criticise the description of digital computers as ‘mechanical brains’ or ‘electronic brains’ is that, although they might be programmed to behave like brains, we do not at present know how this should be done. With this outlook I am in full agreement. It leaves open the question as to whether we will or will not eventually succeed in finding such a programme. I, personally, am inclined to believe that such a programme will be found. I think it is probable for instance that at the end of the century it will be possible to programme a machine to answer questions in such a way that it will be extremely difficult to guess whether the answers are being given by a man or by the machine. I am imagining something like a viva-voce examination, but with the questions and answers all typewritten in order that we need not consider such irrelevant matters as the faithfulness with which the human voice can be imitated. This only represents my opinion; there is plenty of room for others.

There are still some difficulties. To behave like a brain seems to involve free will, but the behaviour of a digital computer, when it has been programmed, is completely determined. These two facts must somehow be reconciled, but to do so seems to involve us in an age-old controversy, that of ‘free will and determinism’. There are two ways out. It may be that the feeling of free will which we all have is an illusion. Or it may be that we really have got free will, but yet there is no way of telling from our behaviour that this is so. In the latter case, however well a machine imitates a man’s behaviour it is to be regarded as a mere sham. I do not know how we can ever decide between these alternatives but whichever is the correct one it is certain that a machine which is to imitate a brain must appear to behave as if it had free will, and it may well be asked how this is to be achieved. One possibility is to make its behaviour depend on something like a roulette wheel or a supply of radium. The behaviour of these may perhaps be predictable, but if so, we do not know how to do the prediction.

It is, however, not really even necessary to do this. It is not difficult to design machines whose behaviour appears quite random to anyone who does not know the details of their construction. Naturally enough the inclusion of this random element, whichever technique is used, does not solve our main problem, how to programme a machine to imitate a brain, or as we might say more briefly, if less accurately, to think. But it gives us some indication of what the process will be like. We must not always expect to know what the computer is going to do. We should be pleased when the machine surprises us, in rather the same way as one is pleased when a pupil does something which he had not been explicitly taught to do.

Let us now reconsider Lady Lovelace’s dictum. ‘The machine can do whatever we know how to order it to perform.’ The sense of the rest of the passage is such that one is tempted to say that the machine can only do what we know how to order it to perform. But I think this would not be true. Certainly the machine can only do what we do order it to perform, anything else would be a mechanical fault. But there is no need to suppose that, when we give it its orders we know what we are doing, what the consequences of these orders are going to be. One does not need to be able to understand how these orders lead to the machine’s subsequent behaviour, any more than one needs to understand the mechanism of germination when one puts a seed in the ground. The plant comes up whether one understands or not. If we give the machine a programme which results in its doing something interesting which we had not anticipated I should be inclined to say that the machine had originated something, rather than to claim that its behaviour was implicit in the programme, and therefore that the originality lies entirely with us.

I will not attempt to say much about how this process of ‘programming a machine to think’ is to be done. The fact is that we know very little about it, and very little research has yet been done. There are plentiful ideas, but we do not yet know which of them are of importance. As in the detective stories, at the beginning of the investigation any trifle may be of importance to the investigator. When the problem has been solved, only the essential facts need to be told to the jury. But at present we have nothing worth putting before a jury. I will only say this, that I believe the process should bear a close relation of that of teaching.

I have tried to explain what are the main rational arguments for and against the theory that machines could be made to think, but something should also be said about the irrational arguments. Many people are extremely opposed to the idea of a machine that thinks, but I do not believe that it is for any of the reasons that I have given, or any other rational reason, but simply because they do not like the idea. One can see many features which make it unpleasant. If a machine can think, it might think more intelligently than we do, and then where should we be? Even if we could keep the machines in a subservient position, for instance by turning off the power at strategic moments, we should, as a species, feel greatly humbled. A similar danger and humiliation threatens us from the possibility that we might be superseded by the pig or the rat. This is a theoretical possibility which is hardly controversial, but we have lived with pigs and rats for so long without their intelligence much increasing, that we no longer trouble ourselves about this possibility. We feel that if it is to happen at all it will not be for several million years to come. But this new danger is much closer. If it comes at all it will almost certainly be within the next millennium. It is remote but not astronomically remote, and is certainly something which can give us anxiety.

It is customary, in a talk or article on this subject, to offer a grain of comfort, in the form of a statement that some particularly human characteristic could never be imitated by a machine. It might for instance be said that no machine could write good English, or that it could not be influenced by sex-appeal or smoke a pipe. I cannot offer any such comfort, for I believe that no such bounds can be set. But I certainly hope and believe that no great efforts will be put into making machines with the most distinctively human, but non-intellectual characteristics such as the shape of the human body; it appears to me to be quite futile to make such attempts and their results would have something like the unpleasant quality of artificial flowers. Attempts to produce a thinking machine seem to me to be in a different category. The whole thinking process is still rather mysterious to us, but I believe that the attempt to make a thinking machine will help us greatly in finding out how we think ourselves.


n5321 | 2025年6月30日 00:01

Add 404 and 500 page

404 page 是页面不存在

500 page 是你的后台代码或模板中出现了运行时错误,而你没有处理它,Django 默认就返回了一个“服务器内部错误”的页面。

控制是通过setting.py 中的debug=false or true

实现形式:

  1. 准备404page and 500 page

  2. settings.py 中

    1. X  DEBUG = True 静态语句改动态语句 
    2. DEBUG = os.environ.get('DJANGO_DEBUG', '') != 'False'
    3. 设置environment值。

    4. bash复制编辑# Linux/macOS
      export DJANGO_DEBUG=False
      python manage.py runserver

      # Windows CMD
      set DJANGO_DEBUG=False
      python manage.py runserver

      # Windows PowerShell
      $env:DJANGO_DEBUG = "False"
      python manage.py runserver
    5. windows内以上设置OK。ubuntu需要改gunicorn 配置文件。

      1. 编辑 Gunicorn 的 systemd 服务文件

      2. 找到 [Service] 部分,添加:Environment="DJANGO_DEBUG=False"

    6. project directory添加views.py , 添加

      1. from django.shortcuts import render

        def custom_404(request, exception):
          return render(request, 'home/page_error_404.html', status=404)
    7. project urls.py 中添加语句:

      1. handler404 = 'mysite.views.custom_404'
    8. 500page的做法更加单。page命名为500.html ,直接放在template directory下面。(系统自动搜索)


最终效果



n5321 | 2025年6月27日 16:52

Accounts App

rethinking multiuser site

试用了一下以前写的signup page。全是surprise

1. 注册不成功!换了几个注册名,最后终于搞了一个成功了。

2.注册成功之后需要通过邮箱激活。最后终于通过邮箱激活了。but。中间细节的logic几乎全部都忘了。

激活mail看上去还是漂亮的:

multuser的问题稍微排到后面一点去解决!

test driven design的问题倒是可以先好好想一想!




n5321 | 2025年6月26日 16:09

temp0626

git 问题

背景:

为了track request,对db做了一个拆分。把tracking user request项的东西拆到另外一个db,命名track.sqlite3里面。

然后再gitignore把这个db添加进去。目的是在开发环境和生产环境都有track.sqlite3的db,但是数据不sync.

因为这个db原来是track 过的,现在突然不track了!所以remove cache,可是不记得那个step有delte 这个cache的步骤。

总之在原来动作的时候,又把它恢复过来了!

现在为了添加新的homepage,然后想要try git branch

就新添了一个branch newHome

在site上面增删了一些东西。

感觉意义不大。想要回到master,merge newHome。merge以后就问题出来了!

track.sqlte3找不到了!

为什么?!

它中间delete track.sqlite3一次,就没辙了!


n5321 | 2025年6月26日 00:53

fix db manage bug

暂时用的sqlite

pycharm下面有plugin——Database Tools and SQL。

之前一直挺好用。突然有一天db打不开了,持续报警!

Driver class 'org.slf4j.LoggerFactory' not found

莫名其妙!

Project A里面是好的,Project B就不行!

尝试了大半天,搞清楚logic!

“Database Tools and SQL” 插件通过 JDBC 管理数据库连接。里面三个选项,DB source Drivers and DDL Mappings

在Data Sources 的general tab,可以选择driver

Drivers里面可以配置。 配置了SQLite

问题出在Drivers Files之中。

它需要添加Custorm jars and library path

Driver class 'org.slf4j.LoggerFactory' not found需要缺jar包的问题。实际就要求添加jar包:

slf4j-api-2.0.9.jar and slf4j-simple-2.0.9.jar包

原来的try fix 过一次,添加的slf4j-api-2.0.9.jar,但是把它当做了library path。结果就是在“Database Tools and SQL”不能manage db!

OK 版本!

img


2023版的pycharm,为什么一关掉就提示closing project,而且等好久窗口都还在?

pycharm 主页 Help -> Find Action -> 输入 Registry -> 禁用ide.await.scope.completion


n5321 | 2025年6月24日 22:59

Nginx Log

goaccess can track request.

但是记录的ip地址不知道是哪里的。

尝试方式一:命令行加 --enable-geoip--enable-geo-resolver

安装:

sudo apt install geoip-bin geoip-database

无效。

用nano写script

#!/bin/bash
echo "🔍 正在检查 GoAccess 是否安装..."
if ! command -v goaccess &> /dev/null; then
  echo "❌ 未检测到 GoAccess,正在安装旧版本..."
  sudo apt update
  sudo apt install -y goaccess
fi
echo "✅ GoAccess 已安装,检测版本和 GeoIP 支持情况..."
goaccess --version | grep -q "GeoIP2 support"
if [ $? -eq 0 ]; then
  echo "🎉 当前 GoAccess 已支持 GeoIP2,无需修复。"
  exit 0
else
  echo "⚠️ 当前 GoAccess 未启用 GeoIP 支持,准备自动编译带 GeoIP2 的版本..."
fi
# 安装编译依赖
echo "📦 安装依赖中..."
sudo apt update
sudo apt install -y build-essential libncursesw5-dev libgeoip-dev \
  libmaxminddb-dev libtokyocabinet-dev git autotools-dev automake
# 克隆源码
echo "📥 下载 GoAccess 最新源代码..."
cd ~
rm -rf goaccess  # 避免旧版本冲突
git clone https://github.com/allinurl/goaccess.git
cd goaccess
echo "🔧 开始编译 GoAccess with GeoIP2 支持..."
autoreconf -fi
./configure --enable-utf8 --enable-geoip=mmdb
make -j$(nproc)
sudo make install
# 检查是否成功
echo "✅ 编译完成,检查 GeoIP2 支持:"
goaccess --version | grep GeoIP2 && echo "✅ 成功安装带 GeoIP2 支持的 GoAccess!" || echo "❌ 安装失败,请手动检查"
# 提示用户数据库位置
echo ""
echo "📍 你需要下载 MaxMind 的 GeoLite2-City.mmdb 数据库:"
echo "1. 访问:https://dev.maxmind.com/geoip/geolite2/"
echo "2. 注册账号,下载 GeoLite2-City.mmdb"
echo "3. 保存到例如:/usr/local/share/GeoIP/GeoLite2-City.mmdb"
echo ""
echo "📊 之后你可以这样运行 goaccess:"
echo "  zcat /var/log/nginx/access.log.*.gz | goaccess \\"
echo "    --log-format=COMBINED \\"
echo "    --geoip-database /usr/local/share/GeoIP/GeoLite2-City.mmdb \\"
echo "    -o report.html"

download  GeoLite2-City.mmdb 

sudo mkdir -p /usr/local/share/GeoIP
sudo cp GeoLite2-City.mmdb /usr/local/share/GeoIP/
sudo chmod 644 /usr/local/share/GeoIP/GeoLite2-City.mmdb

搞定

14天的hits!




n5321 | 2025年6月11日 23:52

Books App

目的是提供一个平台,可以分享一些对工程师来说有足够价值的书籍,工具等等。

技术框架是django,然后加了几个第三方工具。关键的工具是filer

  1. 前端问题,应该在电机图片之后进入detail page not 显示图片!
  2. django filer里面有若干项配置需要更改
  3. 目前model里3个class,Category,Document, and Note


n5321 | 2025年5月20日 22:04

面包屑

books里面的面包屑工作正常

考虑在tutorials里面也添加一个,自己也记不清怎么添加的。改动的时候发现了若干个问题

1. pycharm打不开db.sqlite, 怎么搞都打不开。不清楚原因。单独找了个管理器看了一下,文件是好的,对于这个project来说,就是打不开。maybe 那天重新clone一下了。不习惯的地方容易打断思路。

2.添加一个面包屑居然还有一点技术含量。因为logic跟books是一样的。最后从里到外都动了一下,从model里面添加mptt,view里面改类方法。

      问题是class里面有一个小bug,暂时没搞清楚。logic清晰,不work,work版的code影响效率。shit!

明天再弄了!



n5321 | 2025年5月19日 22:17

Index Page

AutoEM做了简单的refactoring

考虑做一个homepage。站长之家里面挑了一个漂亮的template,然后做改装。简单代码的地方容易改,可是在内容的地方,要保持完整与重点突出还是有挑战性。

AutoEM online版需要用的功能也都可以代码出来,不确定性更多的是match user demand!思路上应该做一个调整。

  1. 一个产品没有完成就只是零件,零件本身是没有价值的,做太多的零件本质上相当于没有产出。现在有的几个东西都需要进一步完善。完善需要时间!
  2. site的内容做成什么样子需要interact,必须要有user的,应该要fail quick,还是需要去获得反馈。
  3. as an organic being, 必定需要的是evolve,evolve 是过程的核心!dance with dragon就不应该是solo了。
  4. debug,当前的几个部分。把AutoEM and video的部分publish and 找业务!


待update内容

1:所有的filter后面的翻页内容都不属于filter里面的
2:移动版的headline 动态显示的方式有问题。动态显示的内容形成了duplicate code





n5321 | 2025年5月11日 08:20

matlab的问题

matlab作为深入学习的第一个programming language,在thinking上面确实是有很多方便的地方。

语法跟自然语言很像。

toobox里有很多很好用的algorithm

编辑的界面总是让人很清楚自己的state。

但是缺framework!

在dependency 上面全部要靠自己来平衡确实是有一点烦。跟git and powershell的integrate好像也不如python。

原来用matlab写的东西,确实是有想要换到python 平台的想法了!matlab确实是在make thinking clear上有价值,只是做project也确实是烦啊!

在很多细节问题的处理上,matlab确实可控性不够。他可能还是只适合做一个script、thinking工具!

后续改python!

give up frontend 上面的update!

自己多年前写的毫无章法的code确实生猛!简直就是个天才!

refactoring AutoEM,内部的逻辑结构比一个blog、tutorial这种复杂多了!需要深入思考!


所以 MATLAB 更擅长干嘛?

MATLAB 超适合:

  • 快速搭建算法原型

  • 做仿真、控制系统、信号处理

  • 写论文/科研用的验证脚本

和 Simulink 联动搞模型


    这就看你目的是什么:

            写大型系统、长期维护的代码 → ❌ 不推荐用 MATLAB,建议用 Python、C++、Java 等更通用的语言

              封装一个可复用的分析工具模块 → ✅ OOP 在 MATLAB 还是值得用的

                教学/科研,做一些结构清晰的小项目 → ✅ OOP 可以帮助你理清模块划分

                改Python!


                n5321 | 2025年4月18日 23:53

                About Us

                普通电机工程师!
                从前只想做最好的电机设计,现在修理电机设计工具。
                希望可以帮你解释电磁概念,项目救火,定制ANSYS Maxwell。

                了解更多