八月 15 2010

因果关系、INUS定义和SUPPES定义


        我们知道,因果关系对于我们想任何问题和做任何事情,都是非常重要的。甚至有很多人认为,天赋的因果联想能力,是人类得以成为“万物之灵长”的首要条件之一。在哲学上,确实存在怀疑甚至否定因果关系的意见,而且这些意见甚至不可能被驳倒。但这些意见说来玩玩可以,不可以当真,因为否定因果关系,导致的只能是不可知论。

        离开因果关系,我们通过经验获取知识就成为几乎不可能的事情。赫拉克利特的诅咒就要成为现实,真实世界对于我们来说变成一条永远不可能再次踏入的河流。我们所能收获的,只能是一个一个碎片状、彼此毫无关系的观测语句。而且这些语句都是关于过去的,对我们预知未来,或者采取行动以应付未来毫无帮助。这样的世界当然是非常可怕的。

        我们似乎天生就有建立因果联想的能力,也有这种冲动。比如说,我们被一株荆棘刺伤了之后,见了其他尖尖的硬东西就会躲开。再比如说,我们从小就喜欢问“为什么”,得到了一个回答就会觉得快乐。但究竟什么是因果关系,或者说如何鉴别是否因果关系,就不是每一个人能够讲得清楚的了。

        在因果关系理解上的含混或者分歧,会严重阻碍人们之间达成共识。因果关系的确定,有时候会影响“责任”的划分,有时候会影响“当前应该做什么”之类的决定。如果双方对因果关系的界定不统一,就会发生无谓的争论。

        建立因果关系,也是科学的一个本能冲动。因果关系是非常有说服力的,“知识就是力量”,这个力量很大程度上来自因果观念。所以,如果对因果关系认识胡涂,科学研究的结果只怕也是很糊涂的。进而把这样胡涂的结论付诸实践,那就非常危险了。

        在因果关系问题上,最容易犯的错误是两个。一是将因果关系混同于充分和必要条件关系,在既不存在充分条件、也不存在必要条件的情况下,就认为不存在因果关系了。二是将因果关系混同于统计相关性关系,找到了数据上的正相关,就以为找到了因果关系。

        这两种错误,前者通常对应于单个经验事件或比较直接的因果关联,后者通常对应于大量经验事件或比较复杂的因果关联。要避免犯这两种错误,我们就有必要了解因果关系的两种定义:INUS定义和SUPPES定义。

        下面我们通过两个例子来分别说明。

        第一个例子是,某甲将某乙从五楼上推下来,某乙落地后死掉了。通常情况下,某甲应该为此负责,因为我们认为某甲推某乙下楼是某乙死亡的原因。但如果用充分/必要条件关系来检验,这个因果关系就不成立。因为即使某乙不被推下去,他也未必不死,所以某甲推某乙下楼不是必要条件。另一方面,如果某乙落地的地方刚好是一个充气垫子,或者某乙身负绝世轻功,那么他即使被推下去也未必死,所以这里也不存在充分条件。

        这和我们的常识显然是相悖的。由此可见,因果关系不一定是充分条件关系,也不一定是必要条件关系。在这里我们需要INUS定义,它可以帮助我们解决这一问题。

        INUS定义是一个叫马奇的人提出来的,所以它也被称为“马奇定义”。INUS是它的定义的缩写:

        An insufficient but necessary part of a condition which is itself unnecessary but sufficient for the result.(结果的一个不必要但是充分的条件中,一个不充分但是必要的组成部分)

        这句话可以进一步简缩一下,就是:

        所谓原因,就是结果的一个充分条件组中的一个必要组成部分。

        也就是说,假设A和B是两个事件,那么在以下的情况下,我们称A是B的原因:

1.A加上其他某些事件,可以组成一个复合条件C,C是B的充分条件;
2.如果把A从C中间拿掉,C就不再是B的充分条件。
套用到我们上面的例子中,不难发现:

1.“某甲推某乙下楼”加上“楼下是硬地”加上“某乙不会绝顶轻功”是“某乙死亡”的充分条件;
2.单纯“楼下是硬地”加上“某乙不会绝顶轻功”不是“某乙死亡”的充分条件。
由此我们可以得到结论,“某甲推某乙下楼”是“某乙死亡”的原因。

        当然,从上面我们也可以看出,一个结果通常不止一个原因。那么,什么是“主要原因”呢?被“辩证法”搞胡涂了的人可能会问这个问题。其实在逻辑上是没有什么“主要原因”可言的。只不过我们在实践中会根据语境来进行选择使用它们罢了。

        比如“楼下没有充气垫子”和“某乙不会绝顶轻功”同样是“某乙死亡”的原因。但我们不会说某乙活该,或者去责问那块地的主人为什么不摆上一个充气垫子,这是因为我们在责任认定时,除了因果关系认定之外,还有“不能预计”、“不能选择”这样的免责条款。

        INUS定义也可以帮助我们理解,为什么原因的原因不一定是原因,结果的结果也不一定是结果。

        以上说的是单个经验事件。而对于大量经验事件,我们通常用统计方法进行分析。统计所能建立的是一种数据上的相关性。但是统计上的正相关,即使是非常高度的正相关,也并不等于因果关系。

        有一个例子,说是有人做过统计,家里打火机数量越多,男主人患咳喘病的比例就越高。因此,在家里放太多打火机是致癌的原因。这个结论显然是荒谬的。我们一般的解释是,抽烟的人会有比较多的打火机,而抽烟的人患咳喘病的比例比较高。所以打火机多不是患咳喘病的原因,而是和患咳喘病一样,都是抽烟的结果。

        但这个例子,确实说明了统计正相关不一定是因果关系。那么,有没有一个方法来验证统计正相关是否包含因果关系呢?在这里我们需要SUPPES定义。

        SUPPES定义是一个叫Suppes的人提出来的。在这个定义中,概率上的正相关关系被称为“初步原因”。“初步原因”有可能是“真实原因”,也有可能是“虚假原因”。而成为真实原因的前提是:不存在一个这样的事件,在给定这一事件时,这个正相关关系趋于消失。

        在上面的例子中,我们可以发现,打火机数量显然是一个虚假原因。因为如果我们给定“抽烟”这个校验事件,只考虑抽烟的人,或者只考虑不抽烟的人的话,这个正相关关系都趋于消失。

        那么,“抽烟”是不是一个真实原因呢?迄今为止,我们似乎给不出任何事件,可以使得抽烟与患咳喘病的相关关系消失。但回答仍然是否定的。SUPPES定义中的所谓“真实原因”其实是不可能被确认的,因为“不存在一个证伪事件”本身就是一个不可确证的前提。

        比如说,假定有一种基因,它既决定人会不会染上烟瘾,也决定人会不会患咳喘病。那么,分别对于有无这种基因的人来说,吸烟和患咳喘病之间的相关关系就消失了。

        所以,SUPPES定义其实是给了我们一个证伪“初步原因”的方法。如果我们想要验证一种统计相关性是否包含因果关系,办法就是去寻找一个可让这种相关关系消失的条件。如果找到了,那么它就是一个虚假原因。而在没有找到之前,我们不妨假定它是一个真实原因。

        因果关系除INUS定义和SUPPES定义之外,当然还有其他的定义方法。但就易于理解和应用而言,它们确实是最好的两种。在我看来,它和每一个人的思考和生活都息息相关,其重要价值毫不逊色于牛顿的力学定律,而使用频率则远远超过之。普及这样的常识,真应该从娃娃抓起。遗憾的是,我们的中学不开逻辑课,大学里也没有科学方法论课程。无怪乎逻辑混乱的文学青年会充塞于天地之间,而头脑胡涂的“学者”群也构成了这“文明古国”一道“亮丽的风景线”。

原文地址:http://wt.vankeweekly.com/blog/%B4%F3%CA%AB/articles/11884.html

七月 23 2010

用户凭什么跟你走

故事:用户凭什么跟你走
作者:caoz

        先说一个寓言,caoz自己编的。

        从前有个山沟,住着一群村民;山沟缺水,村民到处打井。

        第一个人出现了,他帮助村民打井总能又快又好,村民都很信任他,但是水仍然越来越少,井越打越深,难度越来越大,村民越来越辛劳。

        第二个人住在山顶,他每天都在远眺,有一天他跑下来对忙碌的村民说,你们跟我走吧,离开这个地方去外面的世界。村民放下工具问他,我们为什么跟你走?他说,外面有落日余晖,有大片的草场,有漂亮的花朵和成群奔跑的羚羊。村民说,干我球事,于是拿起工具继续挖井。这个人只好离开,喃喃自语,愚蠢的人们啊。

        第三个人出现了,他也帮村民打过井,也在干渴中煎熬过,但是有一天,他走到了山顶,远眺了一下,他的眼镜放出了光芒;他匆匆的跑下山,走到村民中,大声喊。收拾自己的东西,赶紧跟我走,我们现在就出发,离开这里! 村民放下工具问他,我们为什么跟你走? 他说,山外有条大河!我们再也不用打井了!!

        故事结束,您应该知道我要说什么了。

        第一个人,他是我们常说的合格的产品经理,他理解体会用户的需求,并为此努力着,他奉行绝对跟随用户的原则,这种人,每个公司其实都需要。

        第二个人,高端,精英,他看的比别人远,知道的比别人多,他们一厢情愿的以为自己描绘的蓝图可以吸引用户,很抱歉,他们不了解用户真正的饥渴,用户凭什么跟他走?这种人在现实中经常是评论家。

        第三个人,是真正的大师,领袖,如果要在现实中找一个载体,这个人叫乔布斯。

        好了,谁能让用户跟随,第一你要知道用户的饥渴,也就是本质需求,用户告诉你他需要一口井,其实他需要的是水;第二,看到的比用户更远;第三,有更好的解决用户本质需求的方法和路线。

        中国IT产业,呼唤新的大师。

七月 23 2010

自动检测COM口分配情况的方法讨论

          要想让程序自动检测到插入的USB转UART设备的COM端口号,就需要通过查询注册表的方式来获得。当某台PC安装了USB转UART设备的驱动之后,第一次插入设备,会在下列注册表的位置建立新的文件夹以存储相应的端口:

          HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Control/Class/{4D36E978-E325-11CE-BFC1-08002BE10318}

          其中文件夹“0000”表示COM1,“0001”表示COM2,依次类推。

          每个端口文件夹中包含有两个关键的键值,一个为“DriverDesc”为端口驱动描述,对于CP2102的驱动来说,该键值会显示“CP210X USB to UART Bridge Controller”。相同驱动的设备,无论插入多少个,该键值都一样。

          当插入多个设备时,就要靠键值“SavedInstanceNumber”来判断依次分配的端口。该键值为“0”的端口分配给最先插入的该类设备,键值为“1”的端口分配给第二个插入的该类设备,依次类推。

          创建端口的顺序是从端口号最小的未使用的端口开始创建。假设计算机已经存在COM1、COM3、COM4和COM6,则插入三个设备,会依次分配COM2、COM5和COM7。

          如果要实时监控设备,则需要用到WDM模型中的DriverEntry方法,由于涉及核心编程,待研究后再讨论。

七月 05 2010

ZZ何毓琦:For young scholars - How to wrtie a technical paper

 

On Writing a Technical Paper

There is a joke that a technical paper published in a professional journal is read on the average by five persons – the author, the editor, and the three reviewers of the paper. This is not far from the truth because most technical papers are difficult to understand and follow even for the professionals. This does not even take into account the other approximately three times of the amount rejected due to poor writing and incomprehensibility. 

Thus, if the purpose of your writing a paper is to have it accepted AND to have your ideas widely known, then special care must be taken to write the paper. It is worth remembering that three entirely separate, different , and equally important tasks are:

1. having a good idea and work out the required analysis, experimentation, and verifications.

2. devising a powerpoint presentation that can impress your audience and "sell" your ideas.

3. write a technical paper of archival quality that will be read and referenced by others; and in some rare instances, stand the test of time.

Most young or beginning authors consider #1 to be 90% of a technical person's effort. Tasks #2 and #3 are considered as unpleasant and minor exercises unworthy of much attention. When most authors undertake tasks #2 and #3, they tend to follow the recipe of recording their stream of conscious thought – a totally self-centered experience. However, if tasks #2 and 3 are to be accomplished successfully, the effort must be READER- or AUDIENCE-CEDNTERED. We have discussed the "how-to" for #2 elsewhere [see Introduction To The World Of Science For Young Scholars, Y.C. Ho, et al Tsinghua University Press 2004]. This short article is devoted to task #3. 

There are generally three types of readers for your paper. First type is the reader who only wish to find out if the paper contains material of interest to him. A well written abstract is what you need here. Generally, as far as transmitting contents are concerned, short paragraphs is much more difficult than long texts (Recall here the famous quote attributed to Samuel Johnson who apologizes for writing a long letter because he does not have the time to write a short one.) Thus do not dismiss this as a simple task. Secondly, there are readers who is only interested in the basic idea and/or history of the paper but not necessarily the detail "nuts and bolts" of the paper. S/he is willing to spend sometime reading the introductory section or two to accomplish his/her goal.  You do this using everyday not technical language so that the maximal number of readers can follow your text. Remember an average reader can retain the definition and meaning of only four or five mathematical symbols at anytime . Thus use mathematics only when absolute necessary in introductory sections and these must be repeatedly reinforced later on. Appeal to intuition and common sense to convey the big picture here and avoid details like the plague. The second type of reader may stop reading after the introductory sections either because s/he got what they wanted or decided that s/he has no more interest to read further. Ineither case, s/he will thank you for not waste his/her time which is often the most precious resources a scholar possesses. Even if you are the third type of reader who is interested in all the gory details, a well written introductory sections will have properly prepared you to follow the details. A map reading metaphor is appropriate here. If you have a clear picture of the general geography of an area in terms of major roadway and sign posts, then it is much more difficult to get lost and easier to follow a detail map. Several of the advices and techniques discussed in carrying out task #2 in the above reference are also conceptually applicable for writing the introductory sections. Finally. when you write for the third type of detail oriented reader, you still need to differentiate important details from those that are side issues or branches of thought. Thus, you often see a theorem or result precisely stated and its significance carefully explained. But the proof of the theorem or the detail derivation is relegated to an appendix. The principle to observe here is that you want the reader to follow the details in one smooth reading without constantly pausing to think, backtracking, remembering a particular definition several pages earlier, (or worse, to have to read another paper referenced) and any act that interrupts the thought you want him to follow as you develop your text.

To get a paper accepted, you must win the approval of the reviewers of your paper. They are not willing readers of your paper. They are forced to be reader type number three. Thus, the more you make their job easier, the better impression you will make. You may also want to go a step beyond a reader-centered writing by becoming reviewer-centered. Again this is discussed elsewhere in the above reference. The main point is that "walk in other people's shoes".

Other specific comments:

o Don't over inflate your claims or over promise what is to come in your introductions. It is bad form and often you live to regret it.

o Give proper credit and reference to others. Don't be stingy.

o Don't turn one paper into three slightly different versions of the same idea. You can give a good presentation talk several times. But publishing essentially the same paper several times is bad form.

o Do not submit a paper to several journals at the same time in the hope of increasing the chance of acceptance. This is unethical and waste valuable reviewers' time which are always in short supply. .Editors will hate you for it. Unfortunately, at least in areas I am familiar with, Chinese authors have already acquired a bad international reputation for doing this.  

The discipline of mathematics has her own set of traditions and protocol for writing mathematical papers. This note applies only to scientific and engineering type of technical papers.

本文引用地址: http://www.sciencenet.cn/m/user_content.aspx?id=4939