科学网

 找回密码
  注册

tag 标签: 编码

相关帖子

版块 作者 回复/查看 最后发表

没有相关内容

相关日志

互连目标编号算法(四)
grating 2013-6-4 08:06
个人分类: 翻译|3305 次阅读|0 个评论
互连目标编号算法(三)
grating 2013-5-31 10:47
个人分类: 翻译|3009 次阅读|0 个评论
互连目标编号算法(二)
grating 2013-5-30 08:39
翻译自 Steve Eddins 的 matlab 博客 http://blogs.mathworks.com/steve/category/connected-components/ 第一节 Matlab 图像处理工具箱中有一个bwlabel函数,用来对互连目标进行编号,有时称作泡编号。那么什么叫做互连目标呢?对其编号又是什么意思呢? 我们从一个简单的二值化图像开始: bw = imread('http://blogs.mathworks.com/images/steve/119/binary.png'); imshow(bw) 在matlab中,该图像用一个简单的矩阵表示,它有74536个元素,其中17871个元素值为1,其它值为0。 showPixelValues(bw, ) 我们如何从这17871个前景元素中得到4个目标呢?显然一些前景像素是连接在一起的,我们要想办法把把互连的像素归类为不同的组,这个过程就叫做互连目标编号。 后续的几节中,我将介绍几种发现互连目标的方法,其中包括matlab的bwlabel函数使用的算法。我也将解释像素邻居的不同定义如何影响编号的结果。
个人分类: 翻译|3140 次阅读|0 个评论
互连目标编号算法(一)
grating 2013-5-30 08:32
近来编写目标定位算法,发现matlab中的bwlabel很好,但是不了解其原理,四处寻找,发现了这篇博文,翻译后转过来,希望所帮助。 这篇博文主要包括七讲,我将分别贴出,另外把我写的相关程序也贴出来。
个人分类: 翻译|2499 次阅读|0 个评论
哥德尔定理的证明——3哥德尔编码
热度 11 xying 2013-5-27 07:05
公理系统的不可判定命题、相容性和完备性问题是相联的。系统里的命题,如果既不可能证明它成立,也不可能证明与之相反的成立,这便是个不可判定的命题。相容的系统,不可能证明相反的一对命题同时成立。完备的系统,必须能够证明任何一对相反命题,必有一个成立。所以具有不可判定命题的系统,如果是相容的必定是不完备的。 如果在 PM 里,能构造出这样一个自相矛盾的命题:若证明它成立,等同于证明相反的命题也成立。它就是个不可判定的命题。就证明了“哥德尔不可判定定理”,或者根据上面简单的推论就有“哥德尔不完备性定理”。 “这个命题是不可证明的”这句话,如果能放在 PM 里,它便在证明时自相矛盾。但这句话是元数学的命题。我们必须用一个映射,将这命题变换成 PM 里自涉的( self-referent )算术命题。歌德尔先用编码将 PM 里的公式一一映射成自然数(哥德尔数),这个数就好比是身份证的号码,唯一代表着那个公式,从公式角度来看这个数就是它自己。这个公式里如果包含了这个数和它的含义,就能够谈论自己。这一篇介绍这个哥德尔编码。 前面说过,形式公理系统里的公式是由一组原始字符,按照形成规则构成的字符串,编码就是将字符串一一映射成一个自然数,称为哥德尔数。我们来看哥德尔是怎么编码的(这基本按哥德尔 1931 年论文的版本)。 包含着皮亚诺算术公理的形式公理系统 PM ,有 12 个固定符号,分别对应着哥德尔数如下: 符号 ~ V → ∃ = 0 S ( ) , + · 编码 1 2 3 4 5 6 7 8 9 10 11 12 含义 非 或 得出 存在 等于 零 后继 标点 标点 标点 加 乘 公式在表中符号的含义解释下,具有逻辑和数学命题的含义,哥德尔“对应引理”证明了 PM 中原本只具有形式的定理,对应着其数学含义下的数论真理。不难看出,如果不再定义数字符号, n 个 S 的字符串 SSS…SSS0 的含义是自然数 n ,这字符串称为数 n 在 PM 的表达。 继续说编码的规则。自然数变量 x , y , z , … 的哥德尔数分别是 13 , 17 , 19 , … 依序对应着大于 12 的质数。命题变量 p , q , r , … 的哥德尔数是 13 2 , 17 2 , 19 2 , … 依序对应着大于 12 的质数的平方。谓词变量 P , Q , R ,…的哥德尔数是 13 3 , 17 3 , 19 3 ,…依序对应着大于 12 的质数的立方。 公式的编码是一组质数幂的乘积,这组质数的个数与公式中的字符数相等,从 2 开始依序列出前几个的质数,它的指数对应着相应位置上公式符号的哥德尔数。举例来说: 公式“ ∃x(x=Sy) ”这里 8 个字符对应的哥德尔数依序是 4 , 13 , 8 , 13 , 5 , 7 , 17 , 9 ,这公式的哥德尔数按照编码规则便是 2 4 3 13 5 8 7 13 11 5 13 7 17 17 19 9 ,它是一个很大的自然数。 形式证明是由几个公式组成的序列,序列中每一个公式如果不是公理或已知的定理,都必须是由序列里前面的公式按变换规则生成的,证明的结果是序列中最后一个公式。形式证明的编码也与公式的编码规则类似,只不过其指数是对应着次序上公式的哥德尔数,举例来说: 从“每个数有个后继数”用替换规则证明“零有一个后继数”,可以表示为两个公式的序列:“ ∃x(x=Sy) ; ∃x(x=S0) ”第一个公式的哥德尔数为 m ,第二个为 n 时,这个形式证明的哥德尔数是: 2 m 3 n ,也是一个自然数。更细致的解释见内格尔和纽曼《哥德尔证明》【 1 】。 按照这样的编码,每一个公式或证明对应着一个哥德尔数。根据算术基本定理,每一个自然数可以分解成唯一的质数幂的乘积,依照质数指定的位置和其指数对应的字符或公式,哥德尔数可以解码出对应的公式或证明。这个编码规则建立起公式或证明,与(一部分)自然数的一一映射。每个哥德尔数通过这个一一映射,拥有它所对应字符串的信息。 既然公式和证明的所有信息都在对应的哥德尔数上,那么讨论公式和证明,这些谈论字符串性质的元数学问题,便是一个数论的命题,就可能把它用公式表达出来【 2 】。比如一个元数学的命题说:“ ~(0=S0) ”是个否定式的命题。也就是判断它的第一个符号是“ ~ ”。这是个用自然语言表达的元数学命题,首先把它转化成数论的命题,然后用 PM 里的公式来表达。 这个公式的哥德尔数是 2 1 3 8 5 6 7 5 11 7 13 6 17 9 ,符号“ ~ ”的哥德尔数是 1 ,公式的第一个符号是“ ~ ”,对应着公式的哥德尔数是 2 的 1 次方的因子。记这个数为 a ,那么这个元数学命题对应的数论命题是:“ a 整除于 2 ,且 a 不能整除于 4 。”前面说到,自然数 a 在 PM 里表达是有 a 个 S 的字符串“ SSS…SSS0 ”,“ a 整除于 2 ”等价于“存在着一个数 x ,有 a=2 · x ”,可以表示为: ∃ x(SSS…SSS0=x · SS0) ,这个数论命题不难用 PM 里的公式表示为: ~(~ ∃ x(SSS…SSS0=x · SS0)V( ∃ x)(SSS…SSS0=× · SSSS0)) ; 这个直观的例子显示元数学上的命题,是怎样映射成 PM 里的公式。 现在考虑证明中要用到的一个重要元数学命题:“公式序列 X 证明了公式 Z ”。我们知道在形式证明的公式序列里的公式有个的顺序规则,与公理、已知的定理、变换规则及被证明公式的对应有关。所谓的“证明”就是有限次地从前面的公式递推出后面的公式,这叫做递归。将公式对应成数后,“证明”就是这些数间的递归函数。假定公式序列 X 的哥德尔数是 x ,公式 Z 的哥德尔数是 z 。从这些关系不难想象出自然数 x 和 z 之间的算术关系,将这个算术关系记为“ dem(x, z) ”。 哥德尔在论文中用了极大的努力证明了这个 dem(x,z) 是数 x 和 z 之间的“原始递归关系”,所以它可以形式地表示成一个 PM 的公式【 2 】,记为“ Dem(x, z) ”。我们已经将元数学的命题“ X 证明了 Z ”,映射成 PM 的公式 Dem(x, z) 。这完成了这一篇文章的目标。 学习计算机的读者可能疑惑,为什么要这么麻烦地编码?这质疑有道理。哥德尔证明这个定理时在 1931 年,那时候还没有计算机,哥德尔在编码、递归函数、可表达性等问题上都做了开创性的贡献。这里介绍哥德尔编码,是沿着哥德尔原来证明的轨迹,了解这个经常会被人们提及的内容。现代的计算机实践经验,已经在人们头脑里形成了新的直观,对计算机理论有更多了解的,更能落实到这些直观背后充分的理论根据。有了这些直观,理解这些就很容易了。 PM 里的公式和证明,可以用任何一种编码(比如说 Unicode )变成 0 和 1 的字符串,也就是一个自然数了。这个自然数也可以通过解码得出原来的公式和证明。这就建立起一一映射。这时候同样可以通过递归函数理论,将上述的“证明”语句表达为 PM 里的公式 Dem(x, z) 。也可以想象写一个程序,解码自然数 x 得出一个公式序列来,然后验证这序列是可以递推出自然数 z 解码所得的公式,把这个程序用 PM 里形式语言写出来,便是个 PM 里的公式。 总之,我们可以把“ X 证明了 Z ”,映射成 PM 的公式 Dem(x, z) 。注意,表示式“ Dem(x,z) ”实际上不是 PM 里的式子,它只是一个方便的记号,联系了两个哥德尔数的变量x和z在一个公式里,我们用来代表 PM 里那个非常长的公式。 怎么在这个 Dem(x, z) 代表的 公式里做到自我纠缠,这个技巧将在下一篇的核心证明里介绍。 (待续) 【参考资料】 【 1 】 内格尔和纽曼《哥德尔证明》(中文版下载,谢谢徐晓) http://bbs.sciencenet.cn/home.php?mod=attachmentid=32962 【 2 】数论中有不可数多的命题,而 PM 只能有可数个式子,所以并非所有的数论命题都能表达成 PM 里的公式。哥德尔证明了原始递归函数可以表达成 PM 里的公式。
个人分类: 科普|16539 次阅读|24 个评论
语音的特点与编码方案
热度 1 augustwang 2013-3-30 11:23
一般地,语音信号的频率是在200Hz~3.4KHz,在无线、有线传输语音信号时,根据奈奎斯特(Nyquist)采样定律,采样率大于2倍信号带宽时,可以无失真地恢复出原信号,因此,语音采样率采取8K,每一个采样点采取8bits进行编码,即,语音信号的编码速率为64Kbits/s。 重要的是,语音信号有3个明显的特征: (1)概率密度函数PDF:在幅度接近0处的概率比较高,在幅度很高处概率比较低,在这两个极端之间单调递减; (2)自相关函数:一个语音的相邻采样值之间存在很大的相关性,这就表明对每一个语音采样,有很大成分能够从以前的采样值中预测; (3)功率谱函数密度PSD:非平坦特性,因此能在频域内采用明显的压缩编码技术。典型语音的长时间平均PSD,表明高频部分对整个语音能量的作用很小,这说明在不同的频段上分别编码,可以产生明显的编码增益,虽然高频部分对能量的作用不是很明显,但是它也携带了语音信息,因此也需在编码中充分体现出来。
个人分类: 学习|2609 次阅读|1 个评论
关于语义信息, 看我怎样反击一个自已为是的老外
热度 1 lcguang 2012-2-18 05:39
http://natureorgod.lefora.com/2012/01/28/a-information-measure-bridging-shannon-and-popper/ 翻译几句: Richw9090: 你说的都是自相矛盾的。 计算机中编码, 每个字符都是一样长, 8bits, 说信息反应编码长度, 那么我们数字符, 再*8就行了。不需要那些信息公式。 Lcguang(我):信息论中讲的编码长度是平均最优编码长度, 比如E 经常发生, 用较短码, X较少发生, 用较长码, 这样平均码长就较短。电报Morse码就是这样。语义信息和Shannon信息也是大小不同的。 如果说Shannon信息是成本,语义信息就是效用, 前者是后者的上限。(附推广R(D)函数得到的R(G)函数, 用以说明两种信息之间的关系) Richw9090: 你说的那些都是垃圾,你都不懂一个语句的信息内容,他们在不同的地方是不同的,和编码长度不是一回事。 Lcguang: 我从没有没有说我用数学公式度量不同语句中不同信息内容。我只是度量所有语句共有的东西--信息量,它是减少的不确定性, 或者是被反映的特殊性。 试图度量不同信息内容是愚蠢的, 就像用重量或热量度量所有食物的营养一样。 不同营养只能具体叙说。不要判断太早, 你不懂的东西太多了。
个人分类: 色觉问题和分析哲学|4398 次阅读|10 个评论
关于Python中的中文编码问题
yaozongzhuan 2011-8-2 22:05
建议统一采取 UTF-8 进行编码, 不建议使用gbk或gb2312 在Eclipse中更改程序文件的编码格式为UTF-8, 如下操作. Windows-Preferences-Workspace-Text file encoding-Other:-UTF-8 注意在程序脚本.py文件第一行写上文本的编码方式 # -*- coding: utf-8 -*- 或 # coding=utf-8 这里需要注意的是, 采用UTF-8编码后, 每个中文字占有3个字符位置. 详细参见博客 http://blog.csdn.net/kernelspirit/article/details/2650696 和 http://dustin.iteye.com/blog/77565
个人分类: Python|4581 次阅读|0 个评论
解决linux下从文本文件乱码问题
elitelcf 2011-5-17 11:24
由于一些历史原因,linux下的中文编码大多使用UTF-8变字节编码作为中文显示的默认编码。 而windows则不然,中文字符界面非常混乱,既有使用UTF-8编码,也使用GBK,GBK2312,GBK18030等。 而网络上大部分的文本文件都是在windows下创建的,所以给linux下显示中文造成了很大的麻烦。 好在微软给出了一种混合的字节编码解决方案MBCS http://msdn.microsoft.com/zh-cn/library/5z097dxa(v=vs.80).aspx 在linux命令行下; gconf-editor-apps-gedit2-preferences-encodings 在auto_detected一栏中双击,添加MBCS然后将其移动至第一位,ok,现在用gedit打开文件,完美显示中文。
个人分类: Linux|5925 次阅读|0 个评论
[转载]8B/10B编码 详解
zhangjunjie 2010-8-20 11:20
8B/10B编码详解zz (2009-01-23 14:30:29) var $tag='it'; var $tag_code='4873d17ee035ceed8fd49f2d158e20a6'; var $r_quote_bligid='3e28c8a50100bq2b'; var $worldcup='0'; var $worldcupball='0'; 标签: it 分类: 电子通信   8B/10B,也叫做8字节/10字节或8B10B。8B/10B方式最初由IBM公司于1983年发明并应用于ESCON(200M互连系统),由Al Widmer和Peter Franaszek在IBM的刊物研究与开发上描述。   8b/10b编码的特性之一是保证DC 平衡,采用8b/10b编码方式,可使得发送的0、1数量保持基本一致,连续的1或0不超过5位,即每5个连续的1或0后必须插入一位0或1,从而保证信号DC平衡,它就是说,在链路超时时不致发生DC失调。通过8b/10b编码,可以保证传输的数据串在接收端能够被正确复原,除此之外,利用一些特殊的代码( 在PCI-Express总线中为K码) ,可以帮助接收端进行还原的工作,并且可以在早期发现数据位的传输错误,抑制错误继续发生。   8b/10b编码是将一组连续的8位数据分解成两组数据,一组3位,一组5位,经过编码后分别成为一组4位的代码和一组6位的代码,从而组成一组10位的数据发送出去。相反,解码是将1组10位的输入数据经过变换得到8位数据位。数据值可以统一的表示为DX.Y或KX.Y,其中D表示为数据代码,K表示为特殊的命令代码,X表示输入的原始数据的低5位EDCBA,Y 表示输入的原始数据的高3位HGF。   8b/10b编码是目前许多高速串行总线采用的编码机制,如 USB3.0、1394b、Serial ATA、PCI Express、Infini-band、Fiber Channel、RapidIO等总线或网络等。 8B/10B编码是目前高速串行通信中经常用到的一种编码方式。直观的理解就是把8bit数据编码成10bit来传输,为什么要引入这种机制呢?其根本目的是直流平衡(DC Balance)。当高速串行流的逻辑1或逻辑0有多个位没有产生变化时,信号的转换就会因为电压位阶的关系而造成信号错误,直流平衡的最大好处便是可以克服以上问题。 将8bit编码成10bit后,10B中0和1的位数只可能出现3种情况: 1.有5个0和5个1 2.有6个0和4个1 3.有4个0和6个1 这样引出了一个新术语不均等性(Disparity),就是1的位数和0的位数的差值,根据上面3种情况就有对应的3个Disparity 0、-2、+2。 工作原理 8bit原始数据会分成两部分,其低5位会进行5B/6B编码,高3位则进行3B/4B编码,这两种映射关系在当时已经成为了一个标准化的表格。人们喜欢把8bit数据表示成Dx.y的形式,其x=5LSB(least significant bit最低有效位),y=3MSB(most significant bit最高有效位)。 例如一个8bit数据101 10101,x=10101(21) y=101(5),现在我们就把这8bit数据写成D21.5,明白了吧! Dx.y形式在进行5B/6B和3B/4B编码中表示更直观,下面我们来看看两张编码表: 对于8bit数据,它在表中的位序为HGFEDCBA,即H为最高位,A为最低位,EDCBA经过5B/6B编码为abcdei,HGF经过3B/4B编码为fghj。传送10bit编码的顺序为abcdeifghj。 3B/4B使用K.x.7 对于D.x.7,当和5B/6B组合时D.x.P7和D.x.A7编码必须选择一个来避免连续的5个0或1。遇上连续5个0或1的情况下使用逗号码来进行校准。D.x.A7用在x=17 x=18 x=20当RD=-1时,x=11 x=13 x=14 当RD=+1时。当x=23 x=27 x=29 x=30时,使用K.x.7进行编码。其他情况下x.A7码不能被使用,他将会导致和其他逗号序列产生冲突。 候补编码K.x.y允许K.28.1 K.28.5 K.28.7作为逗号码来保证数据流中的唯一性。 你们也许注意到了表中有个RD标志,它是Running Disparity的缩写,它的目的就是保持8B/10B编码中的直流平衡。它跟上面提到的Disparity其实是一样的意思,+1用来表示1比0多,-1用来表示0比1多,-1是它的初始化状态。下面我们来看一张表来加深理解: 上面我们提到的逗号码和逗号序列,其实都是当初在规划8B/10B编码机制的时候,所谓的控制代码(Control Characters)的其中之一。8B/10B标准中使用了12个特殊的控制代码,他们能在数据中被发送,还可以组合成各种原语。 在控制代码中,K.28.1 K.28.5 K.28.7 是逗号序列,逗号序列是用来校准用的,如果K.28.7没有被使用,序列0011111 或者 1100000 是不会出现在任何编码中的。 在实际编码中如果K.28.7可以被使用,一种更复杂的校准规范需要被使用,它们能组合成各种原语,在任何情况下多个K.28.7序列不允许被同时使用,它将导致不可探测的逗号序列。 转 http://blog.sina.com.cn/s/blog_3e28c8a50100bq2b.html
个人分类: C8051|3173 次阅读|0 个评论
jsp中文乱码解决方案(1)
chengdong166 2010-6-11 18:41
一、按照POST方式,解决乱码:request.setCharacterEncoding(UTF-8)但是这只对POST提交方式 有效,而对于get或者multipart/form-data无效。 %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd % request.setCharacterEncoding(UTF-8); % html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 title中文处理/title /head body form action=ConvertTo_01.jsp method=post div 用户名:input type=text name=namebr input type=submit value=submit /div /form /body /html %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% %@ taglib prefix=s uri=/struts-tags% !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd %request.setCharacterEncoding(UTF-8); % html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 title中文乱码解决方案/title /head body %=request.getParameter(name)% /body /html
个人分类: 生活点滴|4600 次阅读|0 个评论
大脑皮层编码理论
wangwd301 2010-4-14 22:36
您想了解大脑中的信息、知识、结构、规则是如何存在的吗?想了解感觉、学习、意识在大脑中如何完成的吗? 请看附件,可是原创哦。 大脑皮层的神经编码理论
个人分类: 生活点滴|4054 次阅读|1 个评论
美国牛人换工作的理由
chrujun 2009-10-18 18:03
美国著名计算机科学家Richard Hamming在一次著名演讲中介绍了他换工作的理由: The moment that physics table lost the best people, I left. The moment I saw that the same was true of the chemistry table, I left. I tried to go with people who had great ability so I could learn from them and who would expect great results out of me. 翻译如下: 当物理学餐桌(工作餐时物理学家坐的餐桌)流失了最好的人才时,我离开了。我看见化学餐桌也发生同样事情时,我离开了。我试图和有伟大能力的人在一起,因此我可以向他们学习;我也试图和期待我有伟大成果的人在一起。 由此可以看出,这个牛人换工作的原因有两点:一是可以和其他牛人一起工作,通过向他人学习提高自己水平;二是与伯乐一起工作,自己的能力可以得到最大发挥和认可。 哈明演讲与答问附件
个人分类: 哲学与科学|6764 次阅读|4 个评论
著名演讲《你和你的研究》原文-ZZ
chrujun 2009-10-18 01:43
可 真老师转载了著名计算机科学家Richard Hamming发表的著名演讲《你和你的研究》中文翻译版。我在网上找到了英文全文,连接地址如下: http://www.paulgraham.com/hamming.html 附件为演讲全文的PDF文件,感兴趣的朋友可以下载 演讲全文如下: Talk at Bellcore, 7 March 1986 The title of my talk is, ``You and Your Research.'' It is not about managing research, it is about how you individually do your research. I could give a talk on the other subject-- but it's not, it's about you. I'm not talking about ordinary run-of-the-mill research; I'm talking about great research. And for the sake of describing great research I'll occasionally say Nobel-Prize type of work. It doesn't have to gain the Nobel Prize, but I mean those kinds of things which we perceive are significant things. Relativity, if you want, Shannon's information theory, any number of outstanding theories-- that's the kind of thing I'm talking about. Now, how did I come to do this study? At Los Alamos I was brought in to run the computing machines which other people had got going, so those scientists and physicists could get back to business. I saw I was a stooge. I saw that although physically I was the same, they were different. And to put the thing bluntly, I was envious. I wanted to know why they were so different from me. I saw Feynman up close. I saw Fermi and Teller. I saw Oppenheimer. I saw Hans Bethe: he was my boss. I saw quite a few very capable people. I became very interested in the difference between those who do and those who might have done. When I came to Bell Labs, I came into a very productive department. Bode was the department head at the time; Shannon was there, and there were other people. I continued examining the questions, ``Why?'' and ``What is the difference?'' I continued subsequently by reading biographies, autobiographies, asking people questions such as: ``How did you come to do this?'' I tried to find out what are the differences. And that's what this talk is about. Now, why is this talk important? I think it is important because, as far as I know, each of you has one life to live. Even if you believe in reincarnation it doesn't do you any good from one life to the next! Why shouldn't you do significant things in this one life, however you define significant? I'm not going to define it - you know what I mean. I will talk mainly about science because that is what I have studied. But so far as I know, and I've been told by others, much of what I say applies to many fields. Outstanding work is characterized very much the same way in most fields, but I will confine myself to science. In order to get at you individually, I must talk in the first person. I have to get you to drop modesty and say to yourself, ``Yes, I would like to do first-class work.'' Our society frowns on people who set out to do really good work. You're not supposed to; luck is supposed to descend on you and you do great things by chance. Well, that's a kind of dumb thing to say. I say, why shouldn't you set out to do something significant. You don't have to tell other people, but shouldn't you say to yourself, ``Yes, I would like to do something significant.'' In order to get to the second stage, I have to drop modesty and talk in the first person about what I've seen, what I've done, and what I've heard. I'm going to talk about people, some of whom you know, and I trust that when we leave, you won't quote me as saying some of the things I said. Let me start not logically, but psychologically. I find that the major objection is that people think great science is done by luck. It's all a matter of luck. Well, consider Einstein. Note how many different things he did that were good. Was it all luck? Wasn't it a little too repetitive? Consider Shannon. He didn't do just information theory. Several years before, he did some other good things and some which are still locked up in the security of cryptography. He did many good things. You see again and again, that it is more than one thing from a good person. Once in a while a person does only one thing in his whole life, and we'll talk about that later, but a lot of times there is repetition. I claim that luck will not cover everything. And I will cite Pasteur who said, ``Luck favors the prepared mind.'' And I think that says it the way I believe it. There is indeed an element of luck, and no, there isn't. The prepared mind sooner or later finds something important and does it. So yes, it is luck. The particular thing you do is luck, but that you do something is not. For example, when I came to Bell Labs, I shared an office for a while with Shannon. At the same time he was doing information theory, I was doing coding theory. It is suspicious that the two of us did it at the same place and at the same time - it was in the atmosphere. And you can say, ``Yes, it was luck.'' On the other hand you can say, ``But why of all the people in Bell Labs then were those the two who did it?'' Yes, it is partly luck, and partly it is the prepared mind; but `partly' is the other thing I'm going to talk about. So, although I'll come back several more times to luck, I want to dispose of this matter of luck as being the sole criterion whether you do great work or not. I claim you have some, but not total, control over it. And I will quote, finally, Newton on the matter. Newton said, ``If others would think as hard as I did, then they would get similar results.'' One of the characteristics you see, and many people have it including great scientists, is that usually when they were young they had independent thoughts and had the courage to pursue them. For example, Einstein, somewhere around 12 or 14, asked himself the question, ``What would a light wave look like if I went with the velocity of light to look at it?'' Now he knew that electromagnetic theory says you cannot have a stationary local maximum. But if he moved along with the velocity of light, he would see a local maximum. He could see a contradiction at the age of 12, 14, or somewhere around there, that everything was not right and that the velocity of light had something peculiar. Is it luck that he finally created special relativity? Early on, he had laid down some of the pieces by thinking of the fragments. Now that's the necessary but not sufficient condition. All of these items I will talk about are both luck and not luck. How about having lots of `brains?' It sounds good. Most of you in this room probably have more than enough brains to do first-class work. But great work is something else than mere brains. Brains are measured in various ways. In mathematics, theoretical physics, astrophysics, typically brains correlates to a great extent with the ability to manipulate symbols. And so the typical IQ test is apt to score them fairly high. On the other hand, in other fields it is something different. For example, Bill Pfann, the fellow who did zone melting, came into my office one day. He had this idea dimly in his mind about what he wanted and he had some equations. It was pretty clear to me that this man didn't know much mathematics and he wasn't really articulate. His problem seemed interesting so I took it home and did a little work. I finally showed him how to run computers so he could compute his own answers. I gave him the power to compute. He went ahead, with negligible recognition from his own department, but ultimately he has collected all the prizes in the field. Once he got well started, his shyness, his awkwardness, his inarticulateness, fell away and he became much more productive in many other ways. Certainly he became much more articulate. And I can cite another person in the same way. I trust he isn't in the audience, i.e. a fellow named Clogston. I met him when I was working on a problem with John Pierce's group and I didn't think he had much. I asked my friends who had been with him at school, ``Was he like that in graduate school?'' ``Yes,'' they replied. Well I would have fired the fellow, but J. R. Pierce was smart and kept him on. Clogston finally did the Clogston cable. After that there was a steady stream of good ideas. One success brought him confidence and courage. One of the characteristics of successful scientists is having courage. Once you get your courage up and believe that you can do important problems, then you can. If you think you can't, almost surely you are not going to. Courage is one of the things that Shannon had supremely. You have only to think of his major theorem. He wants to create a method of coding, but he doesn't know what to do so he makes a random code. Then he is stuck. And then he asks the impossible question, ``What would the average random code do?'' He then proves that the average code is arbitrarily good, and that therefore there must be at least one good code. Who but a man of infinite courage could have dared to think those thoughts? That is the characteristic of great scientists; they have courage. They will go forward under incredible circumstances; they think and continue to think. Age is another factor which the physicists particularly worry about. They always are saying that you have got to do it when you are young or you will never do it. Einstein did things very early, and all the quantum mechanic fellows were disgustingly young when they did their best work. Most mathematicians, theoretical physicists, and astrophysicists do what we consider their best work when they are young. It is not that they don't do good work in their old age but what we value most is often what they did early. On the other hand, in music, politics and literature, often what we consider their best work was done late. I don't know how whatever field you are in fits this scale, but age has some effect. But let me say why age seems to have the effect it does. In the first place if you do some good work you will find yourself on all kinds of committees and unable to do any more work. You may find yourself as I saw Brattain when he got a Nobel Prize. The day the prize was announced we all assembled in Arnold Auditorium; all three winners got up and made speeches. The third one, Brattain, practically with tears in his eyes, said, ``I know about this Nobel-Prize effect and I am not going to let it affect me; I am going to remain good old Walter Brattain.'' Well I said to myself, ``That is nice.'' But in a few weeks I saw it was affecting him. Now he could only work on great problems. When you are famous it is hard to work on small problems. This is what did Shannon in. After information theory, what do you do for an encore? The great scientists often make this error. They fail to continue to plant the little acorns from which the mighty oak trees grow. They try to get the big thing right off. And that isn't the way things go. So that is another reason why you find that when you get early recognition it seems to sterilize you. In fact I will give you my favorite quotation of many years. The Institute for Advanced Study in Princeton, in my opinion, has ruined more good scientists than any institution has created, judged by what they did before they came and judged by what they did after. Not that they weren't good afterwards, but they were superb before they got there and were only good afterwards. This brings up the subject, out of order perhaps, of working conditions. What most people think are the best working conditions, are not. Very clearly they are not because people are often most productive when working conditions are bad. One of the better times of the Cambridge Physical Laboratories was when they had practically shacks - they did some of the best physics ever. I give you a story from my own private life. Early on it became evident to me that Bell Laboratories was not going to give me the conventional acre of programming people to program computing machines in absolute binary. It was clear they weren't going to. But that was the way everybody did it. I could go to the West Coast and get a job with the airplane companies without any trouble, but the exciting people were at Bell Labs and the fellows out there in the airplane companies were not. I thought for a long while about, ``Did I want to go or not?'' and I wondered how I could get the best of two possible worlds. I finally said to myself, ``Hamming, you think the machines can do practically everything. Why can't you make them write programs?'' What appeared at first to me as a defect forced me into automatic programming very early. What appears to be a fault, often, by a change of viewpoint, turns out to be one of the greatest assets you can have. But you are not likely to think that when you first look the thing and say, ``Gee, I'm never going to get enough programmers, so how can I ever do any great programming?'' And there are many other stories of the same kind; Grace Hopper has similar ones. I think that if you look carefully you will see that often the great scientists, by turning the problem around a bit, changed a defect to an asset. For example, many scientists when they found they couldn't do a problem finally began to study why not. They then turned it around the other way and said, ``But of course, this is what it is'' and got an important result. So ideal working conditions are very strange. The ones you want aren't always the best ones for you. Now for the matter of drive. You observe that most great scientists have tremendous drive. I worked for ten years with John Tukey at Bell Labs. He had tremendous drive. One day about three or four years after I joined, I discovered that John Tukey was slightly younger than I was. John was a genius and I clearly was not. Well I went storming into Bode's office and said, ``How can anybody my age know as much as John Tukey does?'' He leaned back in his chair, put his hands behind his head, grinned slightly, and said, ``You would be surprised Hamming, how much you would know if you worked as hard as he did that many years.'' I simply slunk out of the office! What Bode was saying was this: ``Knowledge and productivity are like compound interest.'' Given two people of approximately the same ability and one person who works ten percent more than the other, the latter will more than twice outproduce the former. The more you know, the more you learn; the more you learn, the more you can do; the more you can do, the more the opportunity - it is very much like compound interest. I don't want to give you a rate, but it is a very high rate. Given two people with exactly the same ability, the one person who manages day in and day out to get in one more hour of thinking will be tremendously more productive over a lifetime. I took Bode's remark to heart; I spent a good deal more of my time for some years trying to work a bit harder and I found, in fact, I could get more work done. I don't like to say it in front of my wife, but I did sort of neglect her sometimes; I needed to study. You have to neglect things if you intend to get what you want done. There's no question about this. On this matter of drive Edison says, ``Genius is 99% perspiration and 1% inspiration.'' He may have been exaggerating, but the idea is that solid work, steadily applied, gets you surprisingly far. The steady application of effort with a little bit more work, intelligently applied is what does it. That's the trouble; drive, misapplied, doesn't get you anywhere. I've often wondered why so many of my good friends at Bell Labs who worked as hard or harder than I did, didn't have so much to show for it. The misapplication of effort is a very serious matter. Just hard work is not enough - it must be applied sensibly. There's another trait on the side which I want to talk about; that trait is ambiguity. It took me a while to discover its importance. Most people like to believe something is or is not true. Great scientists tolerate ambiguity very well. They believe the theory enough to go ahead; they doubt it enough to notice the errors and faults so they can step forward and create the new replacement theory. If you believe too much you'll never notice the flaws; if you doubt too much you won't get started. It requires a lovely balance. But most great scientists are well aware of why their theories are true and they are also well aware of some slight misfits which don't quite fit and they don't forget it. Darwin writes in his autobiography that he found it necessary to write down every piece of evidence which appeared to contradict his beliefs because otherwise they would disappear from his mind. When you find apparent flaws you've got to be sensitive and keep track of those things, and keep an eye out for how they can be explained or how the theory can be changed to fit them. Those are often the great contributions. Great contributions are rarely done by adding another decimal place. It comes down to an emotional commitment. Most great scientists are completely committed to their problem. Those who don't become committed seldom produce outstanding, first-class work. Now again, emotional commitment is not enough. It is a necessary condition apparently. And I think I can tell you the reason why. Everybody who has studied creativity is driven finally to saying, ``creativity comes out of your subconscious.'' Somehow, suddenly, there it is. It just appears. Well, we know very little about the subconscious; but one thing you are pretty well aware of is that your dreams also come out of your subconscious. And you're aware your dreams are, to a fair extent, a reworking of the experiences of the day. If you are deeply immersed and committed to a topic, day after day after day, your subconscious has nothing to do but work on your problem. And so you wake up one morning, or on some afternoon, and there's the answer. For those who don't get committed to their current problem, the subconscious goofs off on other things and doesn't produce the big result. So the way to manage yourself is that when you have a real important problem you don't let anything else get the center of your attention - you keep your thoughts on the problem. Keep your subconscious starved so it has to work on your problem, so you can sleep peacefully and get the answer in the morning, free. Now Alan Chynoweth mentioned that I used to eat at the physics table. I had been eating with the mathematicians and I found out that I already knew a fair amount of mathematics; in fact, I wasn't learning much. The physics table was, as he said, an exciting place, but I think he exaggerated on how much I contributed. It was very interesting to listen to Shockley, Brattain, Bardeen, J. B. Johnson, Ken McKay and other people, and I was learning a lot. But unfortunately a Nobel Prize came, and a promotion came, and what was left was the dregs. Nobody wanted what was left. Well, there was no use eating with them! Over on the other side of the dining hall was a chemistry table. I had worked with one of the fellows, Dave McCall; furthermore he was courting our secretary at the time. I went over and said, ``Do you mind if I join you?'' They can't say no, so I started eating with them for a while. And I started asking, ``What are the important problems of your field?'' And after a week or so, ``What important problems are you working on?'' And after some more time I came in one day and said, ``If what you are doing is not important, and if you don't think it is going to lead to something important, why are you at Bell Labs working on it?'' I wasn't welcomed after that; I had to find somebody else to eat with! That was in the spring. In the fall, Dave McCall stopped me in the hall and said, ``Hamming, that remark of yours got underneath my skin. I thought about it all summer, i.e. what were the important problems in my field. I haven't changed my research,'' he says, ``but I think it was well worthwhile.'' And I said, ``Thank you Dave,'' and went on. I noticed a couple of months later he was made the head of the department. I noticed the other day he was a Member of the National Academy of Engineering. I noticed he has succeeded. I have never heard the names of any of the other fellows at that table mentioned in science and scientific circles. They were unable to ask themselves, ``What are the important problems in my field?'' If you do not work on an important problem, it's unlikely you'll do important work. It's perfectly obvious. Great scientists have thought through, in a careful way, a number of important problems in their field, and they keep an eye on wondering how to attack them. Let me warn you, `important problem' must be phrased carefully. The three outstanding problems in physics, in a certain sense, were never worked on while I was at Bell Labs. By important I mean guaranteed a Nobel Prize and any sum of money you want to mention. We didn't work on (1) time travel, (2) teleportation, and (3) antigravity. They are not important problems because we do not have an attack. It's not the consequence that makes a problem important, it is that you have a reasonable attack. That is what makes a problem important. When I say that most scientists don't work on important problems, I mean it in that sense. The average scientist, so far as I can make out, spends almost all his time working on problems which he believes will not be important and he also doesn't believe that they will lead to important problems. I spoke earlier about planting acorns so that oaks will grow. You can't always know exactly where to be, but you can keep active in places where something might happen. And even if you believe that great science is a matter of luck, you can stand on a mountain top where lightning strikes; you don't have to hide in the valley where you're safe. But the average scientist does routine safe work almost all the time and so he (or she) doesn't produce much. It's that simple. If you want to do great work, you clearly must work on important problems, and you should have an idea. Along those lines at some urging from John Tukey and others, I finally adopted what I called ``Great Thoughts Time.'' When I went to lunch Friday noon, I would only discuss great thoughts after that. By great thoughts I mean ones like: ``What will be the role of computers in all of ATT?'', ``How will computers change science?'' For example, I came up with the observation at that time that nine out of ten experiments were done in the lab and one in ten on the computer. I made a remark to the vice presidents one time, that it would be reversed, i.e. nine out of ten experiments would be done on the computer and one in ten in the lab. They knew I was a crazy mathematician and had no sense of reality. I knew they were wrong and they've been proved wrong while I have been proved right. They built laboratories when they didn't need them. I saw that computers were transforming science because I spent a lot of time asking ``What will be the impact of computers on science and how can I change it?'' I asked myself, ``How is it going to change Bell Labs?'' I remarked one time, in the same address, that more than one-half of the people at Bell Labs will be interacting closely with computing machines before I leave. Well, you all have terminals now. I thought hard about where was my field going, where were the opportunities, and what were the important things to do. Let me go there so there is a chance I can do important things. Most great scientists know many important problems. They have something between 10 and 20 important problems for which they are looking for an attack. And when they see a new idea come up, one hears them say ``Well that bears on this problem.'' They drop all the other things and get after it. Now I can tell you a horror story that was told to me but I can't vouch for the truth of it. I was sitting in an airport talking to a friend of mine from Los Alamos about how it was lucky that the fission experiment occurred over in Europe when it did because that got us working on the atomic bomb here in the US. He said ``No; at Berkeley we had gathered a bunch of data; we didn't get around to reducing it because we were building some more equipment, but if we had reduced that data we would have found fission.'' They had it in their hands and they didn't pursue it. They came in second! The great scientists, when an opportunity opens up, get after it and they pursue it. They drop all other things. They get rid of other things and they get after an idea because they had already thought the thing through. Their minds are prepared; they see the opportunity and they go after it. Now of course lots of times it doesn't work out, but you don't have to hit many of them to do some great science. It's kind of easy. One of the chief tricks is to live a long time! Another trait, it took me a while to notice. I noticed the following facts about people who work with the door open or the door closed. I notice that if you have the door to your office closed, you get more work done today and tomorrow, and you are more productive than most. But 10 years later somehow you don't know quite know what problems are worth working on; all the hard work you do is sort of tangential in importance. He who works with the door open gets all kinds of interruptions, but he also occasionally gets clues as to what the world is and what might be important. Now I cannot prove the cause and effect sequence because you might say, ``The closed door is symbolic of a closed mind.'' I don't know. But I can say there is a pretty good correlation between those who work with the doors open and those who ultimately do important things, although people who work with doors closed often work harder. Somehow they seem to work on slightly the wrong thing - not much, but enough that they miss fame. I want to talk on another topic. It is based on the song which I think many of you know, ``It ain't what you do, it's the way that you do it.'' I'll start with an example of my own. I was conned into doing on a digital computer, in the absolute binary days, a problem which the best analog computers couldn't do. And I was getting an answer. When I thought carefully and said to myself, ``You know, Hamming, you're going to have to file a report on this military job; after you spend a lot of money you're going to have to account for it and every analog installation is going to want the report to see if they can't find flaws in it.'' I was doing the required integration by a rather crummy method, to say the least, but I was getting the answer. And I realized that in truth the problem was not just to get the answer; it was to demonstrate for the first time, and beyond question, that I could beat the analog computer on its own ground with a digital machine. I reworked the method of solution, created a theory which was nice and elegant, and changed the way we computed the answer; the results were no different. The published report had an elegant method which was later known for years as ``Hamming's Method of Integrating Differential Equations.'' It is somewhat obsolete now, but for a while it was a very good method. By changing the problem slightly, I did important work rather than trivial work. In the same way, when using the machine up in the attic in the early days, I was solving one problem after another after another; a fair number were successful and there were a few failures. I went home one Friday after finishing a problem, and curiously enough I wasn't happy; I was depressed. I could see life being a long sequence of one problem after another after another. After quite a while of thinking I decided, ``No, I should be in the mass production of a variable product. I should be concerned with all of next year's problems, not just the one in front of my face.'' By changing the question I still got the same kind of results or better, but I changed things and did important work. I attacked the major problem - How do I conquer machines and do all of next year's problems when I don't know what they are going to be? How do I prepare for it? How do I do this one so I'll be on top of it? How do I obey Newton's rule? He said, ``If I have seen further than others, it is because I've stood on the shoulders of giants.'' These days we stand on each other's feet! You should do your job in such a fashion that others can build on top of it, so they will indeed say, ``Yes, I've stood on so and so's shoulders and I saw further.'' The essence of science is cumulative. By changing a problem slightly you can often do great work rather than merely good work. Instead of attacking isolated problems, I made the resolution that I would never again solve an isolated problem except as characteristic of a class. Now if you are much of a mathematician you know that the effort to generalize often means that the solution is simple. Often by stopping and saying, ``This is the problem he wants but this is characteristic of so and so. Yes, I can attack the whole class with a far superior method than the particular one because I was earlier embedded in needless detail.'' The business of abstraction frequently makes things simple. Furthermore, I filed away the methods and prepared for the future problems. To end this part, I'll remind you, ``It is a poor workman who blames his tools - the good man gets on with the job, given what he's got, and gets the best answer he can.'' And I suggest that by altering the problem, by looking at the thing differently, you can make a great deal of difference in your final productivity because you can either do it in such a fashion that people can indeed build on what you've done, or you can do it in such a fashion that the next person has to essentially duplicate again what you've done. It isn't just a matter of the job, it's the way you write the report, the way you write the paper, the whole attitude. It's just as easy to do a broad, general job as one very special case. And it's much more satisfying and rewarding! I have now come down to a topic which is very distasteful; it is not sufficient to do a job, you have to sell it. `Selling' to a scientist is an awkward thing to do. It's very ugly; you shouldn't have to do it. The world is supposed to be waiting, and when you do something great, they should rush out and welcome it. But the fact is everyone is busy with their own work. You must present it so well that they will set aside what they are doing, look at what you've done, read it, and come back and say, ``Yes, that was good.'' I suggest that when you open a journal, as you turn the pages, you ask why you read some articles and not others. You had better write your report so when it is published in the Physical Review, or wherever else you want it, as the readers are turning the pages they won't just turn your pages but they will stop and read yours. If they don't stop and read it, you won't get credit. There are three things you have to do in selling. You have to learn to write clearly and well so that people will read it, you must learn to give reasonably formal talks, and you also must learn to give informal talks. We had a lot of so-called `back room scientists.' In a conference, they would keep quiet. Three weeks later after a decision was made they filed a report saying why you should do so and so. Well, it was too late. They would not stand up right in the middle of a hot conference, in the middle of activity, and say, ``We should do this for these reasons.'' You need to master that form of communication as well as prepared speeches. When I first started, I got practically physically ill while giving a speech, and I was very, very nervous. I realized I either had to learn to give speeches smoothly or I would essentially partially cripple my whole career. The first time IBM asked me to give a speech in New York one evening, I decided I was going to give a really good speech, a speech that was wanted, not a technical one but a broad one, and at the end if they liked it, I'd quietly say, ``Any time you want one I'll come in and give you one.'' As a result, I got a great deal of practice giving speeches to a limited audience and I got over being afraid. Furthermore, I could also then study what methods were effective and what were ineffective. While going to meetings I had already been studying why some papers are remembered and most are not. The technical person wants to give a highly limited technical talk. Most of the time the audience wants a broad general talk and wants much more survey and background than the speaker is willing to give. As a result, many talks are ineffective. The speaker names a topic and suddenly plunges into the details he's solved. Few people in the audience may follow. You should paint a general picture to say why it's important, and then slowly give a sketch of what was done. Then a larger number of people will say, ``Yes, Joe has done that,'' or ``Mary has done that; I really see where it is; yes, Mary really gave a good talk; I understand what Mary has done.'' The tendency is to give a highly restricted, safe talk; this is usually ineffective. Furthermore, many talks are filled with far too much information. So I say this idea of selling is obvious. Let me summarize. You've got to work on important problems. I deny that it is all luck, but I admit there is a fair element of luck. I subscribe to Pasteur's ``Luck favors the prepared mind.'' I favor heavily what I did. Friday afternoons for years - great thoughts only - means that I committed 10% of my time trying to understand the bigger problems in the field, i.e. what was and what was not important. I found in the early days I had believed `this' and yet had spent all week marching in `that' direction. It was kind of foolish. If I really believe the action is over there, why do I march in this direction? I either had to change my goal or change what I did. So I changed something I did and I marched in the direction I thought was important. It's that easy. Now you might tell me you haven't got control over what you have to work on. Well, when you first begin, you may not. But once you're moderately successful, there are more people asking for results than you can deliver and you have some power of choice, but not completely. I'll tell you a story about that, and it bears on the subject of educating your boss. I had a boss named Schelkunoff; he was, and still is, a very good friend of mine. Some military person came to me and demanded some answers by Friday. Well, I had already dedicated my computing resources to reducing data on the fly for a group of scientists; I was knee deep in short, small, important problems. This military person wanted me to solve his problem by the end of the day on Friday. I said, ``No, I'll give it to you Monday. I can work on it over the weekend. I'm not going to do it now.'' He goes down to my boss, Schelkunoff, and Schelkunoff says, ``You must run this for him; he's got to have it by Friday.'' I tell him, ``Why do I?''; he says, ``You have to.'' I said, ``Fine, Sergei, but you're sitting in your office Friday afternoon catching the late bus home to watch as this fellow walks out that door.'' I gave the military person the answers late Friday afternoon. I then went to Schelkunoff's office and sat down; as the man goes out I say, ``You see Schelkunoff, this fellow has nothing under his arm; but I gave him the answers.'' On Monday morning Schelkunoff called him up and said, ``Did you come in to work over the weekend?'' I could hear, as it were, a pause as the fellow ran through his mind of what was going to happen; but he knew he would have had to sign in, and he'd better not say he had when he hadn't, so he said he hadn't. Ever after that Schelkunoff said, ``You set your deadlines; you can change them.'' One lesson was sufficient to educate my boss as to why I didn't want to do big jobs that displaced exploratory research and why I was justified in not doing crash jobs which absorb all the research computing facilities. I wanted instead to use the facilities to compute a large number of small problems. Again, in the early days, I was limited in computing capacity and it was clear, in my area, that a ``mathematician had no use for machines.'' But I needed more machine capacity. Every time I had to tell some scientist in some other area, ``No I can't; I haven't the machine capacity,'' he complained. I said ``Go tell your Vice President that Hamming needs more computing capacity.'' After a while I could see what was happening up there at the top; many people said to my Vice President, ``Your man needs more computing capacity.'' I got it! I also did a second thing. When I loaned what little programming power we had to help in the early days of computing, I said, ``We are not getting the recognition for our programmers that they deserve. When you publish a paper you will thank that programmer or you aren't getting any more help from me. That programmer is going to be thanked by name; she's worked hard.'' I waited a couple of years. I then went through a year of BSTJ articles and counted what fraction thanked some programmer. I took it into the boss and said, ``That's the central role computing is playing in Bell Labs; if the BSTJ is important, that's how important computing is.'' He had to give in. You can educate your bosses. It's a hard job. In this talk I'm only viewing from the bottom up; I'm not viewing from the top down. But I am telling you how you can get what you want in spite of top management. You have to sell your ideas there also. Well I now come down to the topic, ``Is the effort to be a great scientist worth it?'' To answer this, you must ask people. When you get beyond their modesty, most people will say, ``Yes, doing really first-class work, and knowing it, is as good as wine, women and song put together,'' or if it's a woman she says, ``It is as good as wine, men and song put together.'' And if you look at the bosses, they tend to come back or ask for reports, trying to participate in those moments of discovery. They're always in the way. So evidently those who have done it, want to do it again. But it is a limited survey. I have never dared to go out and ask those who didn't do great work how they felt about the matter. It's a biased sample, but I still think it is worth the struggle. I think it is very definitely worth the struggle to try and do first-class work because the truth is, the value is in the struggle more than it is in the result. The struggle to make something of yourself seems to be worthwhile in itself. The success and fame are sort of dividends, in my opinion. I've told you how to do it. It is so easy, so why do so many people, with all their talents, fail? For example, my opinion, to this day, is that there are in the mathematics department at Bell Labs quite a few people far more able and far better endowed than I, but they didn't produce as much. Some of them did produce more than I did; Shannon produced more than I did, and some others produced a lot, but I was highly productive against a lot of other fellows who were better equipped. Why is it so? What happened to them? Why do so many of the people who have great promise, fail? Well, one of the reasons is drive and commitment. The people who do great work with less ability but who are committed to it, get more done that those who have great skill and dabble in it, who work during the day and go home and do other things and come back and work the next day. They don't have the deep commitment that is apparently necessary for really first-class work. They turn out lots of good work, but we were talking, remember, about first-class work. There is a difference. Good people, very talented people, almost always turn out good work. We're talking about the outstanding work, the type of work that gets the Nobel Prize and gets recognition. The second thing is, I think, the problem of personality defects. Now I'll cite a fellow whom I met out in Irvine. He had been the head of a computing center and he was temporarily on assignment as a special assistant to the president of the university. It was obvious he had a job with a great future. He took me into his office one time and showed me his method of getting letters done and how he took care of his correspondence. He pointed out how inefficient the secretary was. He kept all his letters stacked around there; he knew where everything was. And he would, on his word processor, get the letter out. He was bragging how marvelous it was and how he could get so much more work done without the secretary's interference. Well, behind his back, I talked to the secretary. The secretary said, ``Of course I can't help him; I don't get his mail. He won't give me the stuff to log in; I don't know where he puts it on the floor. Of course I can't help him.'' So I went to him and said, ``Look, if you adopt the present method and do what you can do single-handedly, you can go just that far and no farther than you can do single-handedly. If you will learn to work with the system, you can go as far as the system will support you.'' And, he never went any further. He had his personality defect of wanting total control and was not willing to recognize that you need the support of the system. You find this happening again and again; good scientists will fight the system rather than learn to work with the system and take advantage of all the system has to offer. It has a lot, if you learn how to use it. It takes patience, but you can learn how to use the system pretty well, and you can learn how to get around it. After all, if you want a decision `No', you just go to your boss and get a `No' easy. If you want to do something, don't ask, do it. Present him with an accomplished fact. Don't give him a chance to tell you `No'. But if you want a `No', it's easy to get a `No'. Another personality defect is ego assertion and I'll speak in this case of my own experience. I came from Los Alamos and in the early days I was using a machine in New York at 590 Madison Avenue where we merely rented time. I was still dressing in western clothes, big slash pockets, a bolo and all those things. I vaguely noticed that I was not getting as good service as other people. So I set out to measure. You came in and you waited for your turn; I felt I was not getting a fair deal. I said to myself, ``Why? No Vice President at IBM said, `Give Hamming a bad time'. It is the secretaries at the bottom who are doing this. When a slot appears, they'll rush to find someone to slip in, but they go out and find somebody else. Now, why? I haven't mistreated them.'' Answer, I wasn't dressing the way they felt somebody in that situation should. It came down to just that - I wasn't dressing properly. I had to make the decision - was I going to assert my ego and dress the way I wanted to and have it steadily drain my effort from my professional life, or was I going to appear to conform better? I decided I would make an effort to appear to conform properly. The moment I did, I got much better service. And now, as an old colorful character, I get better service than other people. You should dress according to the expectations of the audience spoken to. If I am going to give an address at the MIT computer center, I dress with a bolo and an old corduroy jacket or something else. I know enough not to let my clothes, my appearance, my manners get in the way of what I care about. An enormous number of scientists feel they must assert their ego and do their thing their way. They have got to be able to do this, that, or the other thing, and they pay a steady price. John Tukey almost always dressed very casually. He would go into an important office and it would take a long time before the other fellow realized that this is a first-class man and he had better listen. For a long time John has had to overcome this kind of hostility. It's wasted effort! I didn't say you should conform; I said ``The appearance of conforming gets you a long way.'' If you chose to assert your ego in any number of ways, ``I am going to do it my way,'' you pay a small steady price throughout the whole of your professional career. And this, over a whole lifetime, adds up to an enormous amount of needless trouble. By taking the trouble to tell jokes to the secretaries and being a little friendly, I got superb secretarial help. For instance, one time for some idiot reason all the reproducing services at Murray Hill were tied up. Don't ask me how, but they were. I wanted something done. My secretary called up somebody at Holmdel, hopped the company car, made the hour-long trip down and got it reproduced, and then came back. It was a payoff for the times I had made an effort to cheer her up, tell her jokes and be friendly; it was that little extra work that later paid off for me. By realizing you have to use the system and studying how to get the system to do your work, you learn how to adapt the system to your desires. Or you can fight it steadily, as a small undeclared war, for the whole of your life. And I think John Tukey paid a terrible price needlessly. He was a genius anyhow, but I think it would have been far better, and far simpler, had he been willing to conform a little bit instead of ego asserting. He is going to dress the way he wants all of the time. It applies not only to dress but to a thousand other things; people will continue to fight the system. Not that you shouldn't occasionally! When they moved the library from the middle of Murray Hill to the far end, a friend of mine put in a request for a bicycle. Well, the organization was not dumb. They waited awhile and sent back a map of the grounds saying, ``Will you please indicate on this map what paths you are going to take so we can get an insurance policy covering you.'' A few more weeks went by. They then asked, ``Where are you going to store the bicycle and how will it be locked so we can do so and so.'' He finally realized that of course he was going to be red-taped to death so he gave in. He rose to be the President of Bell Laboratories. Barney Oliver was a good man. He wrote a letter one time to the IEEE. At that time the official shelf space at Bell Labs was so much and the height of the IEEE Proceedings at that time was larger; and since you couldn't change the size of the official shelf space he wrote this letter to the IEEE Publication person saying, ``Since so many IEEE members were at Bell Labs and since the official space was so high the journal size should be changed.'' He sent it for his boss's signature. Back came a carbon with his signature, but he still doesn't know whether the original was sent or not. I am not saying you shouldn't make gestures of reform. I am saying that my study of able people is that they don't get themselves committed to that kind of warfare. They play it a little bit and drop it and get on with their work. Many a second-rate fellow gets caught up in some little twitting of the system, and carries it through to warfare. He expends his energy in a foolish project. Now you are going to tell me that somebody has to change the system. I agree; somebody's has to. Which do you want to be? The person who changes the system or the person who does first-class science? Which person is it that you want to be? Be clear, when you fight the system and struggle with it, what you are doing, how far to go out of amusement, and how much to waste your effort fighting the system. My advice is to let somebody else do it and you get on with becoming a first-class scientist. Very few of you have the ability to both reform the system and become a first-class scientist. On the other hand, we can't always give in. There are times when a certain amount of rebellion is sensible. I have observed almost all scientists enjoy a certain amount of twitting the system for the sheer love of it. What it comes down to basically is that you cannot be original in one area without having originality in others. Originality is being different. You can't be an original scientist without having some other original characteristics. But many a scientist has let his quirks in other places make him pay a far higher price than is necessary for the ego satisfaction he or she gets. I'm not against all ego assertion; I'm against some. Another fault is anger. Often a scientist becomes angry, and this is no way to handle things. Amusement, yes, anger, no. Anger is misdirected. You should follow and cooperate rather than struggle against the system all the time. Another thing you should look for is the positive side of things instead of the negative. I have already given you several examples, and there are many, many more; how, given the situation, by changing the way I looked at it, I converted what was apparently a defect to an asset. I'll give you another example. I am an egotistical person; there is no doubt about it. I knew that most people who took a sabbatical to write a book, didn't finish it on time. So before I left, I told all my friends that when I come back, that book was going to be done! Yes, I would have it done - I'd have been ashamed to come back without it! I used my ego to make myself behave the way I wanted to. I bragged about something so I'd have to perform. I found out many times, like a cornered rat in a real trap, I was surprisingly capable. I have found that it paid to say, ``Oh yes, I'll get the answer for you Tuesday,'' not having any idea how to do it. By Sunday night I was really hard thinking on how I was going to deliver by Tuesday. I often put my pride on the line and sometimes I failed, but as I said, like a cornered rat I'm surprised how often I did a good job. I think you need to learn to use yourself. I think you need to know how to convert a situation from one view to another which would increase the chance of success. Now self-delusion in humans is very, very common. There are enumerable ways of you changing a thing and kidding yourself and making it look some other way. When you ask, ``Why didn't you do such and such,'' the person has a thousand alibis. If you look at the history of science, usually these days there are 10 people right there ready, and we pay off for the person who is there first. The other nine fellows say, ``Well, I had the idea but I didn't do it and so on and so on.'' There are so many alibis. Why weren't you first? Why didn't you do it right? Don't try an alibi. Don't try and kid yourself. You can tell other people all the alibis you want. I don't mind. But to yourself try to be honest. If you really want to be a first-class scientist you need to know yourself, your weaknesses, your strengths, and your bad faults, like my egotism. How can you convert a fault to an asset? How can you convert a situation where you haven't got enough manpower to move into a direction when that's exactly what you need to do? I say again that I have seen, as I studied the history, the successful scientist changed the viewpoint and what was a defect became an asset. In summary, I claim that some of the reasons why so many people who have greatness within their grasp don't succeed are: they don't work on important problems, they don't become emotionally involved, they don't try and change what is difficult to some other situation which is easily done but is still important, and they keep giving themselves alibis why they don't. They keep saying that it is a matter of luck. I've told you how easy it is; furthermore I've told you how to reform. Therefore, go forth and become great scientists! Questions and Answers A. G. Chynoweth: Well that was 50 minutes of concentrated wisdom and observations accumulated over a fantastic career; I lost track of all the observations that were striking home. Some of them are very very timely. One was the plea for more computer capacity; I was hearing nothing but that this morning from several people, over and over again. So that was right on the mark today even though here we are 20 - 30 years after when you were making similar remarks, Dick. I can think of all sorts of lessons that all of us can draw from your talk. And for one, as I walk around the halls in the future I hope I won't see as many closed doors in Bellcore. That was one observation I thought was very intriguing. Thank you very, very much indeed Dick; that was a wonderful recollection. I'll now open it up for questions. I'm sure there are many people who would like to take up on some of the points that Dick was making. Hamming: First let me respond to Alan Chynoweth about computing. I had computing in research and for 10 years I kept telling my management, ``Get that !@#% machine out of research. We are being forced to run problems all the time. We can't do research because were too busy operating and running the computing machines.'' Finally the message got through. They were going to move computing out of research to someplace else. I was persona non grata to say the least and I was surprised that people didn't kick my shins because everybody was having their toy taken away from them. I went in to Ed David's office and said, ``Look Ed, you've got to give your researchers a machine. If you give them a great big machine, we'll be back in the same trouble we were before, so busy keeping it going we can't think. Give them the smallest machine you can because they are very able people. They will learn how to do things on a small machine instead of mass computing.'' As far as I'm concerned, that's how UNIX arose. We gave them a moderately small machine and they decided to make it do great things. They had to come up with a system to do it on. It is called UNIX! A. G. Chynoweth: I just have to pick up on that one. In our present environment, Dick, while we wrestle with some of the red tape attributed to, or required by, the regulators, there is one quote that one exasperated AVP came up with and I've used it over and over again. He growled that, ``UNIX was never a deliverable!'' Question: What about personal stress? Does that seem to make a difference? Hamming: Yes, it does. If you don't get emotionally involved, it doesn't. I had incipient ulcers most of the years that I was at Bell Labs. I have since gone off to the Naval Postgraduate School and laid back somewhat, and now my health is much better. But if you want to be a great scientist you're going to have to put up with stress. You can lead a nice life; you can be a nice guy or you can be a great scientist. But nice guys end last, is what Leo Durocher said. If you want to lead a nice happy life with a lot of recreation and everything else, you'll lead a nice life. Question: The remarks about having courage, no one could argue with; but those of us who have gray hairs or who are well established don't have to worry too much. But what I sense among the young people these days is a real concern over the risk taking in a highly competitive environment. Do you have any words of wisdom on this? Hamming: I'll quote Ed David more. Ed David was concerned about the general loss of nerve in our society. It does seem to me that we've gone through various periods. Coming out of the war, coming out of Los Alamos where we built the bomb, coming out of building the radars and so on, there came into the mathematics department, and the research area, a group of people with a lot of guts. They've just seen things done; they've just won a war which was fantastic. We had reasons for having courage and therefore we did a great deal. I can't arrange that situation to do it again. I cannot blame the present generation for not having it, but I agree with what you say; I just cannot attach blame to it. It doesn't seem to me they have the desire for greatness; they lack the courage to do it. But we had, because we were in a favorable circumstance to have it; we just came through a tremendously successful war. In the war we were looking very, very bad for a long while; it was a very desperate struggle as you well know. And our success, I think, gave us courage and self confidence; that's why you see, beginning in the late forties through the fifties, a tremendous productivity at the labs which was stimulated from the earlier times. Because many of us were earlier forced to learn other things - we were forced to learn the things we didn't want to learn, we were forced to have an open door - and then we could exploit those things we learned. It is true, and I can't do anything about it; I cannot blame the present generation either. It's just a fact. Question: Is there something management could or should do? Hamming: Management can do very little. If you want to talk about managing research, that's a totally different talk. I'd take another hour doing that. This talk is about how the individual gets very successful research done in spite of anything the management does or in spite of any other opposition. And how do you do it? Just as I observe people doing it. It's just that simple and that hard! Question: Is brainstorming a daily process? Hamming: Once that was a very popular thing, but it seems not to have paid off. For myself I find it desirable to talk to other people; but a session of brainstorming is seldom worthwhile. I do go in to strictly talk to somebody and say, ``Look, I think there has to be something here. Here's what I think I see ...'' and then begin talking back and forth. But you want to pick capable people. To use another analogy, you know the idea called the `critical mass.' If you have enough stuff you have critical mass. There is also the idea I used to call `sound absorbers'. When you get too many sound absorbers, you give out an idea and they merely say, ``Yes, yes, yes.'' What you want to do is get that critical mass in action; ``Yes, that reminds me of so and so,'' or, ``Have you thought about that or this?'' When you talk to other people, you want to get rid of those sound absorbers who are nice people but merely say, ``Oh yes,'' and to find those who will stimulate you right back. For example, you couldn't talk to John Pierce without being stimulated very quickly. There were a group of other people I used to talk with. For example there was Ed Gilbert; I used to go down to his office regularly and ask him questions and listen and come back stimulated. I picked my people carefully with whom I did or whom I didn't brainstorm because the sound absorbers are a curse. They are just nice guys; they fill the whole space and they contribute nothing except they absorb ideas and the new ideas just die away instead of echoing on. Yes, I find it necessary to talk to people. I think people with closed doors fail to do this so they fail to get their ideas sharpened, such as ``Did you ever notice something over here?'' I never knew anything about it - I can go over and look. Somebody points the way. On my visit here, I have already found several books that I must read when I get home. I talk to people and ask questions when I think they can answer me and give me clues that I do not know about. I go out and look! Question: What kind of tradeoffs did you make in allocating your time for reading and writing and actually doing research? Hamming: I believed, in my early days, that you should spend at least as much time in the polish and presentation as you did in the original research. Now at least 50% of the time must go for the presentation. It's a big, big number. Question: How much effort should go into library work? Hamming: It depends upon the field. I will say this about it. There was a fellow at Bell Labs, a very, very, smart guy. He was always in the library; he read everything. If you wanted references, you went to him and he gave you all kinds of references. But in the middle of forming these theories, I formed a proposition: there would be no effect named after him in the long run. He is now retired from Bell Labs and is an Adjunct Professor. He was very valuable; I'm not questioning that. He wrote some very good Physical Review articles; but there's no effect named after him because he read too much. If you read all the time what other people have done you will think the way they thought. If you want to think new thoughts that are different, then do what a lot of creative people do - get the problem reasonably clear and then refuse to look at any answers until you've thought the problem through carefully how you would do it, how you could slightly change the problem to be the correct one. So yes, you need to keep up. You need to keep up more to find out what the problems are than to read to find the solutions. The reading is necessary to know what is going on and what is possible. But reading to get the solutions does not seem to be the way to do great research. So I'll give you two answers. You read; but it is not the amount, it is the way you read that counts. Question: How do you get your name attached to things? Hamming: By doing great work. I'll tell you the hamming window one. I had given Tukey a hard time, quite a few times, and I got a phone call from him from Princeton to me at Murray Hill. I knew that he was writing up power spectra and he asked me if I would mind if he called a certain window a ``Hamming window.'' And I said to him, ``Come on, John; you know perfectly well I did only a small part of the work but you also did a lot.'' He said, ``Yes, Hamming, but you contributed a lot of small things; you're entitled to some credit.'' So he called it the hamming window. Now, let me go on. I had twitted John frequently about true greatness. I said true greatness is when your name is like ampere, watt, and fourier - when it's spelled with a lower case letter. That's how the hamming window came about. Question: Dick, would you care to comment on the relative effectiveness between giving talks, writing papers, and writing books? Hamming: In the short-haul, papers are very important if you want to stimulate someone tomorrow. If you want to get recognition long-haul, it seems to me writing books is more contribution because most of us need orientation. In this day of practically infinite knowledge, we need orientation to find our way. Let me tell you what infinite knowledge is. Since from the time of Newton to now, we have come close to doubling knowledge every 17 years, more or less. And we cope with that, essentially, by specialization. In the next 340 years at that rate, there will be 20 doublings, i.e. a million, and there will be a million fields of specialty for every one field now. It isn't going to happen. The present growth of knowledge will choke itself off until we get different tools. I believe that books which try to digest, coordinate, get rid of the duplication, get rid of the less fruitful methods and present the underlying ideas clearly of what we know now, will be the things the future generations will value. Public talks are necessary; private talks are necessary; written papers are necessary. But I am inclined to believe that, in the long-haul, books which leave out what's not essential are more important than books which tell you everything because you don't want to know everything. I don't want to know that much about penguins is the usual reply. You just want to know the essence. Question: You mentioned the problem of the Nobel Prize and the subsequent notoriety of what was done to some of the careers. Isn't that kind of a much more broad problem of fame? What can one do? Hamming: Some things you could do are the following. Somewhere around every seven years make a significant, if not complete, shift in your field. Thus, I shifted from numerical analysis, to hardware, to software, and so on, periodically, because you tend to use up your ideas. When you go to a new field, you have to start over as a baby. You are no longer the big mukity muk and you can start back there and you can start planting those acorns which will become the giant oaks. Shannon, I believe, ruined himself. In fact when he left Bell Labs, I said, ``That's the end of Shannon's scientific career.'' I received a lot of flak from my friends who said that Shannon was just as smart as ever. I said, ``Yes, he'll be just as smart, but that's the end of his scientific career,'' and I truly believe it was. You have to change. You get tired after a while; you use up your originality in one field. You need to get something nearby. I'm not saying that you shift from music to theoretical physics to English literature; I mean within your field you should shift areas so that you don't go stale. You couldn't get away with forcing a change every seven years, but if you could, I would require a condition for doing research, being that you will change your field of research every seven years with a reasonable definition of what it means, or at the end of 10 years, management has the right to compel you to change. I would insist on a change because I'm serious. What happens to the old fellows is that they get a technique going; they keep on using it. They were marching in that direction which was right then, but the world changes. There's the new direction; but the old fellows are still marching in their former direction. You need to get into a new field to get new viewpoints, and before you use up all the old ones. You can do something about this, but it takes effort and energy. It takes courage to say, ``Yes, I will give up my great reputation.'' For example, when error correcting codes were well launched, having these theories, I said, ``Hamming, you are going to quit reading papers in the field; you are going to ignore it completely; you are going to try and do something else other than coast on that.'' I deliberately refused to go on in that field. I wouldn't even read papers to try to force myself to have a chance to do something else. I managed myself, which is what I'm preaching in this whole talk. Knowing many of my own faults, I manage myself. I have a lot of faults, so I've got a lot of problems, i.e. a lot of possibilities of management. Question: Would you compare research and management? Hamming: If you want to be a great researcher, you won't make it being president of the company. If you want to be president of the company, that's another thing. I'm not against being president of the company. I just don't want to be. I think Ian Ross does a good job as President of Bell Labs. I'm not against it; but you have to be clear on what you want. Furthermore, when you're young, you may have picked wanting to be a great scientist, but as you live longer, you may change your mind. For instance, I went to my boss, Bode, one day and said, ``Why did you ever become department head? Why didn't you just be a good scientist?'' He said, ``Hamming, I had a vision of what mathematics should be in Bell Laboratories. And I saw if that vision was going to be realized, I had to make it happen; I had to be department head.'' When your vision of what you want to do is what you can do single-handedly, then you should pursue it. The day your vision, what you think needs to be done, is bigger than what you can do single-handedly, then you have to move toward management. And the bigger the vision is, the farther in management you have to go. If you have a vision of what the whole laboratory should be, or the whole Bell System, you have to get there to make it happen. You can't make it happen from the bottom very easily. It depends upon what goals and what desires you have. And as they change in life, you have to be prepared to change. I chose to avoid management because I preferred to do what I could do single-handedly. But that's the choice that I made, and it is biased. Each person is entitled to their choice. Keep an open mind. But when you do choose a path, for heaven's sake be aware of what you have done and the choice you have made. Don't try to do both sides. Question: How important is one's own expectation or how important is it to be in a group or surrounded by people who expect great work from you? Hamming: At Bell Labs everyone expected good work from me - it was a big help. Everybody expects you to do a good job, so you do, if you've got pride. I think it's very valuable to have first-class people around. I sought out the best people. The moment that physics table lost the best people, I left. The moment I saw that the same was true of the chemistry table, I left. I tried to go with people who had great ability so I could learn from them and who would expect great results out of me. By deliberately managing myself, I think I did much better than laissez faire. Question: You, at the outset of your talk, minimized or played down luck; but you seemed also to gloss over the circumstances that got you to Los Alamos, that got you to Chicago, that got you to Bell Laboratories. Hamming: There was some luck. On the other hand I don't know the alternate branches. Until you can say that the other branches would not have been equally or more successful, I can't say. Is it luck the particular thing you do? For example, when I met Feynman at Los Alamos, I knew he was going to get a Nobel Prize. I didn't know what for. But I knew darn well he was going to do great work. No matter what directions came up in the future, this man would do great work. And sure enough, he did do great work. It isn't that you only do a little great work at this circumstance and that was luck, there are many opportunities sooner or later. There are a whole pail full of opportunities, of which, if you're in this situation, you seize one and you're great over there instead of over here. There is an element of luck, yes and no. Luck favors a prepared mind; luck favors a prepared person. It is not guaranteed; I don't guarantee success as being absolutely certain. I'd say luck changes the odds, but there is some definite control on the part of the individual. Go forth, then, and do great work! 你和你的研究PDF版
个人分类: 转载精品|17220 次阅读|2 个评论
新的研究方向 新的目标 新的努力
changanzhao 2009-9-24 16:31
毕业以后这段时间,一直不知道自己后面该要干点什么有意义的研究工作,所有一直摇摆不定.现在初步可以定下来,一是学代数译码方向,用代数或者代数几何(其实只到代数曲线部分)的工具去做一些译码方面的工作;二是想考虑椭圆曲线密码学或基于双线性对密码学的问题. 把目标明确后, 以后的计划才好做.不然总是东张西望的看看,没有重点,只有集中自己的所有注意力和精力,才有可能做些许工作. 不过很巧合的是这两个研究方向都可以缩写为ecc,看来真是和ecc有缘阿. 现在终于开始上课了,这个学期的离散数学课程对我来说是再适合不过了.离散数学是计算机科学的专业基础课程,对计算机专业非常重要. 而且这里面有许多知识在信息科学领域具有广泛的应用,我在教学的同时也可以把自己的理论修养提高些,此之谓教学相长也. 2009年9月20日我参加了老师组织的太极拳研讨会, 大家各抒己见,说了很多太极拳对自己的好处.总结下来我觉得有以下好处: 1. 对年轻人可以进行心理压力的调节,通过打太极可以放松整个身心. 2. 对年老人可以益寿延年,此不为虚言. 不少练拳的老人都感叹打拳后能够调整睡眠和减轻高血压等许多病的症状. 3. 对人的性格有影响. 比如对性格急躁的人可以磨练得稳重些. 所以此项运动对我来说是再合适不过了,因为我的性格比较急躁,而身体又显单薄,正好练习太极拳,唯有持之以恒的练拳,方不辜负老师的一片希望. 而且做科研是一项非常辛苦的事情,一定要有好的身体做支撑. 正好学习太极拳,打打太极,做做文章,快乐人生也!
个人分类: 未分类|3404 次阅读|0 个评论
[下载,原创]使用Grefenstette编码的求解TSP遗传算法
热度 2 fswdong 2009-8-15 20:24
附件程序是本人设计的使用Grefenstette编码方式实现的常规遗传算法计算工具,用于计算旅行商问题,随包附带了TSPLIB95中中等规模问题数据集,城市数量在200至1000个城市之间。Grefenstette编码的优点在于经过交叉、变异等繁殖算子作用后,个体仍然确保为是一条哈密尔顿环路,的确佩服这种编码的创意。试算过程中发现,结合链式Lin-kernighan算法,一般的中等规模问题都能很快收敛于问题的全局最优解,部分大规模问题也能收敛于问题的全局最优解,与常规的全排列编码方式相比,的确有过人之处。计算工具中没有使用任何个人创新内容,完全是兴趣所致,希望能在这种方法中寻求一些创新亮点。 该算法很多基础算法源自于Concorde,所以不用作商业用途,可以作为研究者交流,并不提供源代码交流,谢谢合作。 到这里点击下载: 点击下载
个人分类: 试算工具|6418 次阅读|0 个评论
[原创]用于旅行商问题的Grefenstette编码源程序
fswdong 2009-6-20 08:48
借鉴了其他同行的一些基础,改写成较为通用的一种形式。由于空间的编辑器把数组符号转用,所以用全角,如果使用替换一下就可以了 //解码函数 void Decoding( int Length, int *NewCode, int *Path ) { int i,j; for( i=0; iLength; i++ ) { Path = NewCode ; } for (i=12-1;i=0 ;i-- ) { for (j=i-1;j=0 ;j-- ) { if( Path = Path ) Path ++; } } } //编码函数 void Encoding( int Length, int *Path, int *NewCode ) { int i, j; for( i=0; iLength; i++ ) { NewCode = Path ; } for( i=0; iLength; i++ ) { for( j=i+1; jLength; j++ ) { if( NewCode NewCode ) NewCode --; } } }
个人分类: 个人开放资源|4698 次阅读|1 个评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-2 09:20

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部