2016年1月23日星期六

2A 1/3 passé

这周结束了2A前两个小学期也就是一个大学期的考试,随便写点什么回顾一下学了什么以及后面的展望。

【P1】 = 统计 + 量子力学2 + INF411 + 动力系统(sup)

【统计】第一次给了我一个感觉统计也可以非常非常理论。应该说这个统计课就是告诉我们,在什么样的假设下,我们脑洞打开设计的方法是有道理的(estimateur), 或者随机变量之间应该有怎样的一种依赖性(regression),以及我们设计了一个方法,然后根据这个方法找变量的关系,这个方法的准确性是多少(test)。稍显美中不足的,过于理论了,甚至都没有拿这些方法做过什么。当下统计学习如此火热,我们当然要懂些原理,可是连一点点直觉都没有好像不太好。

【量子力学2】继续上学期的内容加强深化了些。物理毕竟外行没有学精,就记得好像我们推出了Pauli不相容原理,这个挺让我映像深刻的。

【INF411】继续打程序……链表二叉树深度优先广度优先最短路动态规划都一个个做了遍,原来算法计算机真的不难。

【动力系统】因为最后没有参加考试所以后来劲就送了,只能等到来年再来过了。不过我个人觉得这门课内容对我而言是有提升的。本科对ODE的了解就停留在解解方程了,而事实上呢?法国整个动力系统的框架完全是建立在更一般抽象的体系上的么。当然基石还是Cauchy Lipthiz.还有整个Flot的想法应该是渗透到了力学还有PDE当中去的。

不过最后因为和Section疯玩了一把,期末复习相当不到位,中间也没有抓的特别紧。说实话是要检讨的。成绩考出来也没有那么理想(但也不至于毁灭),想到未来成绩还是有用的,所以P2果断端正态度……

【P2】 = Distribution + 数值入门 + INF421 + 狭义相对论(sup)

【Distribution】在Coursera上已经上过了课拿了证书,再看老师上课的内容说实话还不如当时电子课。整个课程进度甚至比电子课更慢,留下了之后一大本关于PDE的内容,当中还有不少是很重要的,比如关于Laplacian的正则性。不过还好这门课开课的时候终于又捡回了TC的状态做掉了绝大部分习题。要给自己打分至少是个80分吧。

内容:分布理论就是把内积结构的一种推广。分布,紧支撑分布,缓增分布,Hopf方程,基本解和正则性。卷积一块是是比国内说的细的多,紧支撑分布可以各种和其他玩意儿做卷积。
(在此再次感谢当年李老师和雷老师教诲,X工程师教育再好,预科制度再棒,流水线生产比不过讨论班手把手拆招练出来的本事……)

【数值入门】整个学期最花精力的一门课。一方面因为刚刚上手觉得不花功夫难以学好,另一方面是这个里面的方程降低比上一门还要多些。事实也证明最后这门课学的得心应手。反思之处:还要多花时间写写数值解的程序啊。然后这门课虽然入门,但是体系里面该说的也说了特别多了。

内容:差分格式,变分和有限元,优化和算法。差分主要做热传导和波动,变分有限元则什么都能做。优化中说了些定性描述,优化算法还是有意思的。

当然目前的数学工具用的不多,可以感觉是各种数分习题的实践版本,我觉得一定有把小波这些高级工具用上的炫酷进阶版。

【INF421】stabe matching, DP, 各种最短路最小生成树,TPS,做了个Projet TTP,还有胡来的随机算法和启发式算法。
课程还不错无奈德国老师英语听着真累。反正每次我都带头做DM……当中还想出过一个关于随机树联通性的证明,也是佩服自己。


【狭义相对论】又当科普课上了,总算会用lorenz 变换写各种光啊波啊等等。

【小结】:说真的不是每一门课都那么喜欢,但是也强迫着自己拿出至少85分热情去面对了所以学着还挺好(?)吧。后面有概率模型,统计物理,BIG Data,还有NS方程。以及我们不能把PSC就这样落下啊。最后两个学期,是体现120分热情的时候了,小宇宙烧起来~

Three interesting questions

Yesterday, we talk about three interesting questions in the cuisine and luckily I have found the answers by myself for this three enigma. Now, I share them with you.

[Probability and a series of number]
A series of integers are coming but we don't know the total number of these integers. We have a fix number of memory. Try to design a way to give one number of them randomly.

Idea: Because we don't know the number, so in fact we keep the random during all the process. We start from the simple case. We we given one number, we just keep it. But once we have two, we must update it with the prob 0.5. That is the key. Once we know the total number until now, we have the method to update the data randomly.So two memory is OK.

[Find the polynomial]
We are given a polynomial of degree integer positive. We have two chance to test the polynomial by value. How we find it?

Idea: Intuitively, this is not so logical because in maths we know we can construct a polynomial of certain zeros. But pay attention to the positive integer coefficient. The addition of one polynomial cannot always be correct.

The correct way to think by maths: if we can separate the coefficient, we get it. But to separate the coefficient we have to know the range, so the first chance we can use it to test the range of coefficient. For example, we put 1 in it. We get the range. We put 100000~0 to it, then we get the coefficient.

RMK: It is said that this method can be used to attack the HashCode.

[The most frequent number]
Once again, we are given a series of integer and we know that there is one number which appears more than half of it. We don't know the number, try to find it.

Idea: this is one in which I use the most of time. I got the answer by intuition and then prove it by maths. We get one number, count the number from it, count the number it occurs. If the frequency is lower than half, erase all the data and re gain the number.

A better arrangement can reduce the memory to two. But the heart of this idea is that if we do partition of the interval, at least from one point, the frequency of this number is always above 0.5.

2015年11月11日星期三

Stable matching and two simple tricks(mix and comparison)

Stable matching

Recently, we begin our computer science lessons for the second period in A2 in X. The first course is a very interesting subject: Stable matching, which emerges in various situation like job-seeking and the choice of our marriage. (Oh, it's all about the big problem.)

An algorithm proposed by Gale and Shapley is very simple and it applies the idea that we do every day. Imagine that n boys would like to choose their girlfriend and there are n women. Everyone has a list totally ordered. The unstable matching means in two couples, the man and woman have intention to break up and regroup a new couple. So the algorithm of Gale works like this: one guy begins to find his girlfriend from the top to bottom of his list. He dates the girl available or replace the ex-boyfriend. If the latter happens, the poor ex-boyfriend has to find another girlfriend.

This algorithm always works and finishes with a stable matching because the configuration is always stable. Moreover, the boyfriends of the girls become better and better(according to the personal criteria) and the boy never asks a girl two times(so sad).

To implement this algorithm, we have to pay attention to the complexity. We can cut the branching for economize the time, but the greatest problem is that we should construct a table for avoiding the time consumed in comparison between two men. After all, the complexity is about O(n^2).(We can use stacks and lists but they are not essential)

Some other version various is like we can join the possibility of preference of being single. That is to say, we can put ourselves in the list. Then, we will not get married with the man or woman after ourselves.

Tip: Do not put yourself at the first place of the list TT.

Knuth mix
How to make a permutation more random? This is a question. In the famous paper about riffle-shuffle, Diaconis tells us that 7 times can make a deck of cards very random, but it is just a asymptotic way not a perfect solution.

A method from Knuth: we do one cycle and each time, we do the exchange of cards between it and the cards before it.

Some simple calculus shows that it works, but how to get this idea is really amazing.

How many times to get the max and min?
We know n times comparison makes the max, so does min. But if we want both of them, we need 2n times?

NO!We take 2n number and group two-by-two so that n pairs. Then one comparison in every group makes the n "big-one" and n "small-one". The max is in the n "big-one" and the min is in the "small-one". So 3n times comparison make the result.

Therefore, generally, for n number, 3/2 * n times comparison get help us get both the max and the min.

2015年10月17日星期六

To A2

【写这篇日志的原因】
写这篇日志的原因是今天看到李大潜先生给复旦本科生和研究生的一些讲话。李先生是土生土长的复旦人,后来也曾留学法国,在应用数学方面造诣相当深厚了。李先生的讲话大意可以分成三个。第一层是鼓励和激励:每个数学系的学生都应该有一个数学家的梦想,所以应该好好学数学。或者说,即使真的只是瞄准业界,也应该在本科阶段打好基本功。第二层是方法论,数学不好学,得花功夫,求精深而不应浅尝辄止或者泛泛而谈。第三层,大概是批评下时下的诸多现象,例如本科生只想着出国,最终大学四年只带走了一个成绩,成为复旦的匆匆过客。例如研究生博士生现在不努力,办公室总是空着。

作为一个都已经毕业一年的老人,现在看这些话觉得字字珠玑。很遗憾当年这样的谈话连一遍都没有听过,只记得软件学院老师告诉大家好好努力以后好找工作之类的话了。不过现在听起来也不晚吧,毕竟我还在读书。

哦,好吧,现在做的事情也不只是读书了。

【关于到目前为止的一切】
张媛学姐曾经有句话我还是认同的:直接去美国读PhD和来法国读工程师,当然是不一样的。但前者的收获未必会更多,后者也未必更少。

当然,我们对这句话的解释是不一样的。我发现好像去读PhD的同学并不都那么开心。他们有些感觉课业压力大,对怎样成为数学家有疑惑。有些对学校课程设置诸多不满,有些竞争环境太激烈了不开心。而一切都Hold住的又寂寞了,总在考虑人生大事到处相亲……好吧,还有他们不得不盼的绿卡。

要我说都是物质太丰富了,惯出来的。在山上多清净多好!

但我觉得真正意外的收获是两个。第一个是,学校还会非常认真负责的去照顾到每一个学生。或者说是制定规则和服从吧,反正我还挺喜欢的,或许是当年复旦给的自由太多了。第二个是,我在大学毕业后还有集体生活,尽管有时候价值观也不尽相同,总比办公室生活看起来好像有趣多了。

总结一下,来法国一半原因就是当年一时一个轻易的许诺,对X是什么我也不了解。当然了,我还是相信姚老师的,他给的建议还是靠谱的。

【关于A2】
说说A2的课程。非常懂的数学课基本也上完了,后面的都是不懂的。开学了觉得还是挺吃力的,然而这种事情不就是攻坚战么,只有一步一步跨过去了。

我还是保留了相当数量的分析课,综上算是一个平衡吧。当然也在布局开拓一些其他可能发展的方向了。

然后哲学老师让我重新有了上哲学课的想法。所以一个“坏”的哲学家和一个好的哲学家差别还是很大的。

纵观人生,每个阶段的第二年都是非常艰难的,我在各个阶段的第二年往往会有一种懈怠的习惯,原因是第一年都还比较认真成绩不错。然后到第三年再来幡然悔悟奋发向上。好吧,这种烂俗的剧本我可不想再演了。其实每一天都是新的,都值得去珍惜,尤其是当年华不再的时候。

希望能像每天坚持跑步一样,在这一年的每一天里保持能量!

【关于未来】
虽然我来法国之前,还是糊里糊涂的,但是没有多久就把问题想清楚了。所以说困境和痛苦是能促进人思考问题的。

X的校长在第一天就和我们说过,我们每个人都会成功,只要我们努力,学校也会帮助我们。事实看起来学校资源确实很多,多到平摊到人均根本花不完。

那么如果学校愿意帮助我实现一个愿望(也只有一个哦),该怎么说呢?我想了还挺久的,觉得如果只能许一个愿望,那么还是希望能在这几年里面好好修炼,成为一个数学家吧。

也就是这么一个简单的愿望。

【最后】
最后的最后,感谢周围的朋友,尤其多说点的,像老秦、C哥、校长、小明、缪,还有周医生、张医生和黄同学,还有实际上从幼儿园同学一路做到大学同学的胡爷,还有我的二哥和朱老师啊。

还有我们山上的小伙伴,2004年我认识的小伙伴们陪我度过了人生美好的10年,希望山上的小伙伴们在接下来10岁月里,也能像家人一样,彼此激励、关心。

Welcome to my blog!

Thanks to the development of technology, we can create a website easily and freely.

I come from China and I have finished my undergraduate in Fudan University. Now, I am studying in Ecole Polytechnique.(Donc, je parle français.)My interests are always mathematics and its applications in other fields like computer science, physics and finance.

Sometimes I wonder how Prof.Tao can create so many ideas and share them on the Internet. I am not as clever, but I would like also share my study and my life with you.