-
Basics of Matter.js
What is Matter.js Matter.js is a Javascript library, just like p5.js. While p5.js focuses on the drawings for web pages, Matter.js is a 2D physics engine, and works well with p5.js. To use p5.js and Matter.js on your web pages, you simply add the following script to your html file’s <head> part. <script src="https://cdnjs.cloudflare.... Read More
-
How to Get Jekyll Running locally?
Life as a blogger before running jekyll locally If you ever have a Github account, you must hear about Github pages and jekyll. I’m just starting using these tools and are not quite familiar with the technical details, so forgive me if I said something wrong. In my rough understanding, Github provides users a function that it can turn the conte... Read More
-
Virtual Environment: Why and How?
This post is based on a Youtube video by teclado, which I belive, is the clearest explanation of virtual environment for python available online. Table of Contents: Why do we need virtual environment for Python projects? Python versions on your Mac Default python directory Install virtual environment for projects on Python 3 Install... Read More
-
按揭利率和每期供款
我一直以为房贷按揭利率和每期供款的算法,是人尽皆知的常识。最近偶遇网友,才发现绝大部分人其实对银行是怎么算账,怎么从他们身上赚按揭利息的,基本搞不清楚。鉴于咱不能让银行挣了钱,还被人挣得稀里糊涂,我叔决定一次把这个问题讲透。 资金的时间成本 资金是有时间成本的,问人借钱,到期除了还本之外,还要支付利息,这利息就是资金的时间成本。 同样道理,如果你把钱存在银行,就相当于把钱借给了银行,存款到期,银行就得给你支付利息。 时间成本有高有低,对应表现就是利率的不同。如果按年利率 12%计算,你今天存到银行或借给朋友 100 元,一年后对方就应该还本付息 112 元。 复利和连续复利 利息看似简单,但在银行这里,就会有很多弯弯绕。跟居民切身利益最相关的房贷按揭中,简单的利息却... Read More
-
香港,再见!
启程 今天,穿过这道门,飞 12 个小时,我就要去到一个陌生的城市,开始人生的下一段旅程了。 再见了,香港! 回忆跑马地 从 2021 年初移居香港,其实我已经在这里长住快两年了。而在这之前的三年,我每周末往来广州香港两地。前后差不多总计五年,我和我的家人一起,用足迹丈量了这个城市的各个热点,留下了许多美好的回忆。 在一个城市呆久了,尤其跟家人一起的时光,会镌刻到记忆深处,让人念念不忘。这不,我还在香港机场,就开始想念这个城市的角角落落了。 太平洋咖啡 在跑马地,有我最后半年最常去的 Pacific Coffee。基本每天,我都会抱着电脑在那里学习,每个店员都认识我,以至于我一进到店里,不用我开口点单,店员就会立刻开始为我准备 grande 热美式。 同芯咖啡 ... Read More
-
Selection Sort
The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from the unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array. But be noted that we don’t create two arrays, but operate the whole process within the original array. The subarra... Read More
-
Radix Sort
This post is based on Geeksforgeeks, Brilliant and Interview Kickstart. The lower bound for the comparison based sorting algorithm (Merge Sort, Heap Sort, Quick-Sort .. etc) is $O(n \log n)$. They cannot do better than that. Counting sort is a linear time sorting algorithm that sort in $O(n+k)$ time when elements are in the range from 1 to k. ... Read More
-
Counting Sort
This post is based on two posts by Geeksforgeeks and interviewcake. First thing first, what’s counting sort? Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values (a kind of hashing). Then do some arithmetic operations to calculate the position of e... Read More
-
Bucket Sort
This post is based on Geeksforgeeks and Javapoint. Bucket sort is mainly useful when input is uniformly distributed over a range. By custom, this range usually is from 0 to 1. For example, consider the following problem: Sort a large set of floating point numbers which are in range from 0.0 to 1.0 and are uniformly distributed across the rang... Read More
-
上海乌鲁木齐中路
从那天起, 就不再有乌鲁木齐中路, 往后就剩下两条路: 一条是死路, 另一条也是死路。 Read More
-
If X Then Y - Sufficiency and Necessity
If Then Format If then is one of the most important and common logic format we see everyday. When we see if X, then Y, the relation can be represented symbolically as: \[X \rightarrow Y\] This is a cause and effect relation, a logically equivalent one is called its contrapositive: \[\neg Y \rightarrow \neg X\] However, we must bear in mind ... Read More
-
为什么我的省提名不加600分?
本文来自于知乎小安说加拿大。 加拿大联邦移民 加拿大的项目主要分为联邦移民项目和省提名。首先来看联邦移民项目。联邦移民的项目是涵盖各省的,也就是说申请人无论在哪个省都可以申请(魁北克除外)。联邦的项目主要有三大类:经验类移民(CEC)、技术移民(FSW)、以及技工移民(FST)。 联邦经验类移民(Canadian Experience Class ,简称 CEC)要求申请人有一年的加拿大工作经验。申请人通过外劳 LMIA 获得加拿大工作签证进入加拿大进行实际工作(期间孩子可以免费读书,爱人也可以拿到开放工签或者学习签证),积累一年全职的加拿大工作经验并取得雅思 5 分以上的成绩就满足了经验类移民的要求。 移民局官网链接:http://www.cic.gc.ca/en... Read More
-
包子帝是中共的宿命
时代的更替 2022 年 10 月 23 日,中共 20 大闭幕前的最后环节,是全体党代表(大约 2000 人)选举中央委员、政治局委员和常委。在各方落座、记者进场后,发生了令所有人瞠目结舌的一幕:前中共中央总书记胡锦涛因桌上的文件跟栗战书拉扯起来,然后被包子帝安排的安保人员,在众目睽睽之下,强行从会场架走。 大会最后在涛哥缺席的情况下完成投票,包子帝全票连任总书记当不意外,更让惊掉外界下巴的,是原本呼声甚高的李克强、汪洋、胡春华等等全部落选政治局常委,而代之以包子帝的马仔们。至此,代表中共中央最高权力机构的政治局,不再有任何所谓的“江派”、“团派”常委,包子帝大获全胜、一统江湖,中共内再无任何制衡包子帝的力量。 对于涛哥被意外架出会场一事,坊间多有流言,一说是涛哥老年... Read More
-
Proof of Trigonometry Limit Theorem
The trigonometry limit theorem $\lim_{x \rightarrow 0} \sin x / x$ is so important that it is sometimes called the fundamental trig limit theorem in calculus. This post is about the proof of this theorem. Read more Read More
-
Compare 99 to the power of 100 and 100 to the power of 99
There are a lot of ways to compare these two numbers. Today, we are going to use a bit knowledge from calculus to do our job. Read more Read More
-
何其芳的《预言》
今天介绍一首诗,是何其芳在 1932 年发表的《预言》。我是因为先看了许知远十三邀访谈节目中,有一集采访了钟叔河,钟老先生在访谈中间谈起年轻时的阅读,就信口背起了这首诗中的一段。短短几句话,就马上打动了我,赶紧找来好好学习。 读完这首诗,我的第一感想就是:很多优美的中文作品,都被时间深深埋没了。像这样的作品,如果我能在学生时代读到,说不定就会让我从此爱上现代诗歌。废话不多说,让我们一起来欣赏本诗。 《预言》 这一个心跳的日子终于来临! 呵,你夜的叹息似的渐近的足音 我听得清本是林叶和夜风私语, 麋鹿驰过苔径的细碎的蹄声! 告诉我用你银铃的歌声告诉我, 你是不是预言中的年青的神? 你一定来自那温郁的南方! 告诉我那里的月色,那里的日光! 告诉我... Read More
-
时代革命
今天看到了一本书,是关于香港反送中运动的介绍。反送中运动对香港的影响深远,怎么强调都不过分,因此我一直想找相关的记录做点调研,刚好看到这本书,非常之及时。以下是本书的序言,我就直接拿来作摘要了。可能出于自身安全的考虑,本书作者并没有留下姓名,但有人走上街头,有人拿起纸笔,都是抗争的手足。 “关于 2019 年爆發的「反修例」运动,官媒的定性及假新闻铺天盖地,尽管民间也有大量来自参与者、记者、学者贡献的纪录,但随着运动的急剧 变化,中文世界的读者要穿透国家舆论机器的叙事、辨析海量的信息、理解运动的發展轨迹仍是非常困难。相信不少朋友心裡都有这些疑问:香港的运动是由一小撮激进份子搞出来的吗?为什麽《逃犯条例》已经撤回了,示威者还继续上街? 为什麽运动能持续这麽久?「无大台」的运动是... Read More
-
The Definition of Natural e as A Sum of Binomial
For a binomial of $(1+ 1/n)^n$, when $n$ goes to infinity, we conclude that the sum of the binomial approaches natural number $e$. This post elaborates how we reach this conclusion. Read more Read More
-
英女王伊丽莎白二世驾崩
今天,受世人尊敬的英女王伊丽莎白二世在苏格兰 Balmoral 城堡过世,享年 96 岁。这么多年,我们都习惯了有女王的日子,老太太一走,突然感觉好像这个世界少了点什么。我这个人不善言辞,对英国的历史有知之甚少,所以这里直接引用 BBC 的文案,算作我对此事的纪念。 Queen Elizabeth II: A life in pictures. Read More
-
Basic Definitions and Theorems about Number Theory
Trivia Definitions Let $a$ and $b$ be integers with $a \neq 0$. We say $a$ divides $b$, denoted by $a \mid b$, if there exists an integer $c$ such that $b=ac$. And we say that $a$ is a divisor (or factor) of $b$, and $b$ is a multiple of $a$. If $a$ does not divide $b$, we write $a ∤ b$. If $a \mid b$ and $0<a<b$, then $a$ is called a ... Read More
-
Pumping Lemma
Pumping lemma is a theorem that states that all regular languages have a special property: all strings in the language can be “pumped” if they are at least as long as a certain special value, called the pumping length. Pumping lemma is saying Regular Language must have 3 properties. We can use its contrapositive to prove if a language is not re... Read More
-
Master Theorem
For analyzing the time complexity of a recursion algorithm, we can use a recursion tree to help. By rough calculation, we can divide the computing work into two parts, those at the leaves (bottom level) and those at branches including the root (uppper levels). Depending on the asymptotical positive function the recursive fork complexity may take... Read More
-
Stable Marriage Problem
Table of Contents: Introduction Algorithm explained Pseudocode Code example The variables we need: helper functions Key function to execute the algorithm Final kick An test result Proof of the algorithm Time complexity Introduction According to wikipedia, the stable mar... Read More
-
Recursion
As mentioned in other posts before, recursion is just a coding technique, not fancy as it sounds at all. Let’s take a look at a recursion example: // find GCD (greatest common dividor) // using recursive coding method const gcdFind = function (a, b) { // roll back condition if (a === b) return a; else return a > b ? gcdFind(a - b, b)... Read More
-
Quicksort
History According to wikipedia, quicksort is an in-place sorting algorithm. Developed by British computer scientist Tony Hoare in 1959 and published in 1961, it is still a commonly used algorithm for sorting. Algorithm explained Quicksort is a divide-and-conquer algorithm. It works by selecting a ‘pivot’ element from the array and partitionin... Read More
-
Mergesort
History According to wikipedia, merge sort (also commonly spelled as mergesort) is an efficient, general-purpose, and comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the order of equal elements is the same in the input and output. Merge sort is a divide-and-conquer algorithm that was invented by ... Read More
-
Heap Sort
Table of Contents: Definition and categories of heaps index and height of a heap Max and min heaps Insert an element to a heap Algorithem in normal language Code example Time complexity of heap insertion Create a heap Time complexity Heapify: a faster method to ... Read More
-
Binary Search
**Comment:** I made the post date at Sept. 01, 2022 at first. It cost me the whole morning trying to make this post show up on the blog but failed. It turns out that you cannot pre-date post, otherwise it cannot be rendered by github. An 3-hour expensive lesson!~ If you are given an array of un-ordered numbers, and asked to find if there’s a n... Read More
-
Insertion Sort
Insertion sort is among the first models we learn about algorithms. It sorts an array of numbers from left to right, make comparison with all sorted numbers to the left, and act on one move when it finds its place in the left sub-array: inserting into the right place. Insertion Sort Illustration We implement insertion sort with Javascript: ... Read More
-
Bubble Sort
Bubble sort is always discussed along side insertion sort. Contrary to sorting from left to right by insertion sort, Bubble sort works from right (last) to left (first). Furthermore, Bubble sort uses swap rather than shift to order numbers. It’s working as a compare and swap model. Bubble Sort Illustration We implement bubble sort with Javas... Read More
-
Create Google File Dowanload Links in A Different Way
Google Drive is a powerful app to store files of pdf, word, excel and other formats. If you create a copy link from google drive and embed the link into your webpage directly, the default setting is that when user click on the download link, browser will open the file in google doc viewer in a new tab. It’s a handy solution when it comes to pdf... Read More
-
Video Embeding and Styling on Webpages
Table of Contents: Introduction Video From Cloud How to find google photo link How to style the video Google drive as a backup Okay, not a good solution Video from Youtube Youtube example: Introduction This post is based on content in the posts by Chris Coyier and Nikhil Azza. B... Read More
-
窜访加拿大
今年暑假陪小朋友来美国玩,刚到洛杉矶小朋友还需要一两天调整时差,没法立即安排游玩行程。于是我就想,不如趁休整期间,窜访一下加拿大,毕竟来都来的,不去可惜。所以就有了这趟 3 天 2 地的短促行程。 温哥华的确是华人的聚集地,一下飞机看到英法中三语指示牌,服了! 来到边检大厅,布局陈设(包括图腾柱)看上去都很熟悉,应该就是20年前我第一次来的样子 机场直通Sky Train,一趟可以坐到市中心,可惜我第一回不知道,傻傻地去打车了 我要不说小伙伴能猜到这是在加拿大么?其实这就是Richmond某商场里一间普通的港式餐厅 刚才说的餐厅所在商场叫香港仔,然后楼下Sky Train的站名叫Aberdeen,据说开发商就是港资,这个老板是有多留恋香港... Read More
-
两个月复习备考的心得
汇报成绩 今年 5 月中旬,跟中介商讨方案时,中介说:要不先去把雅思考了吧,不然后面的方案没法评估。于是我就报了 5 月底的雅思考试,怕临时失手,当时连报两场 General 的,结果第一场考完感觉不太好,又立马报了一场 Academic 的,所以在 5 月的最后一周,油腻叔接连刷了三场雅思,搞得监考老师都看我面熟,口语老师两次都遇到同一人。 备考雅思的同时,我叔想着万一去读 MBA 呢,还需要 GMAT/GRE 成绩。本着来都来了的想法,所以就给自己留个一个半月时间,报了 7 月中旬的 GRE 考试。为什么选择 GRE 而不是 GMAT?因为有 GRE 既可以报 MBA,还可以报其它科目,适用范围广啊。 虽然备考过程比较煎熬,特别是 GRE,但最后的结果总算还比较让人欣... Read More
-
LMIA,边境工签和省提名
基本概念 很多人大概都知道如果在海外要申请加拿大的工作机会,首先雇主要先去申请一个 LMIA 许可。LMIA 的全称是 Labor Market Impact Assessment,具体的程序和要求很容易在网上查询,主要就是需要雇主证明这个工作岗位没法在加拿大本地招到合适人选,所以才会要从海外雇员。 不过小伙伴们不太需要知道 LMIA 申请的细节,因为这件事的主办人在雇主,我们需要关心的是接下来的事情:就是在雇主提供 LMIA 之后,本人需要申请工作签证入境加拿大。 我叔之前一直混淆了 LMIA 和工签的概念,现在搞清楚了,LMIA 是工签的前提,小伙伴凭 LMIA 申请到工作许可(Work Permit)及附带相应的签证, 才能入境加拿大开始工作。 那么怎么申请工... Read More
-
时代造就的大佬们
互联网时代在中国成就了很多大佬,这些大佬们各有各的本事或者说活法,但很遗憾,很多大佬们就想着挣钱了,没能抓住机遇转型升级,错失了更大成就的可能。 本文图片源于漫画互联网大佬们的生意经,不过这些漫画也不是该文原创。在此,对原作者表示十二分的敬意和感谢! 马云老师不爱钱 PONY 哥专骗小孩 盲脸东哥卖光盘 罗本人帅货色烂 网易丁磊养猪忙 雷军老师 I’m fine 养毒杀毒周鸿祎 自己带货董大姐 国庆抢章不算偷 下周回国贾会计 全是傻逼罗永浩 Read More
-
GRE资料分享
我叔最近从网上找了一些 GRE 复习资料,秉持着知识应当无偿分享的理念,所以公开分享给有需要的小伙伴们。 写作 GRE 写作有两篇,一篇是逻辑找错,另一篇是观点讨论。 逻辑部分:包括写作方法说明,以及逻辑题库。 观点讨论:包括写作方法说明,以及观点讨论题库. 最后必须奉上北美范文。 单词 单词量是 GRE 考试取得好成绩的基础,注意是基础,但不是充分条件。我叔当年就是完全把时间花在背单词上,但是忽视了阅读,结果成绩十分不理想。但另一方面说,如果连单词也不掌握,那建立在单词量基础上的阅读、填空和替换等等,根本就无从谈起。 这里分享的单词资料是单词汇总和同义词精选. 但是,我叔认为更好更基础的单词复习资料,当属新东方俞敏洪老师编著的红宝书。 ... Read More
-
回归25年
华盛顿邮报 The Washington Post近期刊出了一篇文章:25 years of China’s slow takeovers of Hong Kong in pictures,本文是原文的翻译,当然未经授权,向 Theodora Yu 和 Karina Tsui 两位作者表示歉意。 移交前夕 1997 年,英国结束了对香港长达 150 年的殖民统治,把这片土地及子民移交给中国大陆。 香港末任总督彭定康 Chris Patten在移交仪式上致辞,他说, 英国为香港打造了一个基本框架,以保证市民的权利,即:法治,廉洁高效的政府,以及自由社会的价值观。 1997年6月30日,彭定康的专车驶出礼宾府 移交仪式当晚,香港会展中心外的焰火 ... Read More
-
香港的另一种可能
25 年前的那个夜晚,大雨滂沱,五星红旗升起,米字旗落地。英国把管治近 150 年的香港交到大陆手上,一并交付的还有 560 万的香港市民。 大陆凭“一国两制”,成功从英国手里接管香港,到今天已经 25 年。2020 年港版国安法的实行,被认为是香港的二次回归。今天,香港又挂起 8 号风球,风雨交加,呼应着 25 年前的那个夜晚。我叔突然开了一个脑洞:如果存在平行时空,在另一个宇宙里,如果多了一只煽动翅膀的蝴蝶,香港是否会出现另外一种结局? 我叔有这个想法,源于几年前看到了马克·罗伯特(Mark Roberti)1的一本书 The Fall of Hong Kong。马克在这本书里,以当时的报章新闻、英美政府信息公开资料为基础,详细回顾了香港管治权转让前的主要事件,并试... Read More
-
说说我的外婆
我最早写这篇文章,是在外婆刚去世的时候。去年我外公也去世了,因为疫情,我也没有回去。但就着这事儿,我这两天又常常想起外婆,翻出这篇文章一看,这才发现外婆走了已经整整 10 年了!稍微修改润色一下,我把这篇给外婆的文章放到博客上,聊作纪念。 接到电话 2012 年 12 月 20 日,北京迎来了一波寒潮。 傍晚,我接到老妈的电话,说外婆走了。当时外婆已经 88 岁了,按这个年纪来说,这个结果一点不意外,但真正听到她过世的消息,我还是有点吃惊和无措。 我小时候上幼儿园之前,被父母寄养在乡下外婆家,所以那几年是外婆带大的。后来上学了,父母工作忙,有时也会找外婆来宁波照顾我,所以我打小跟外婆感情很深。这次外婆走了,我一定要最后送送她。 怀着这个想法,我第二天晚上回到父母家... Read More
-
在早春的日子里
我最早读到冯骥才的这篇小说,是在一本叫意大利小提琴的合集里。那年我读小学四年级,暑期放假前,老师叫着我们几个还没来得及走的同学,一起去打扫校图书馆,然后说每人走之前可以挑一本书带走,作为劳动奖励。我随手就拿了这本书,没想到里面的小说竟然让我记了半辈子。那天阳关灿烂,正是少年人朝气蓬勃的年纪。 前言 早春吗?就是你放开眼寻不到一点绿意,小河依旧覆盖着亮闪闪的薄冰,阳光还无力驱尽空气中的冷冽。早晨,你坐着马车在村道上,耳朵竟然感到有些冻得发疼;马儿的鼻孔里喷出一股股蒸气似的热气……可是,偶然不知从哪儿吹来一阵挺凉的风,却与冬天扫荡大地的寒飚全然不同了。你分明觉得有一种清新、有力、醉人的气息扑在脸上。这是春天将临的讯息呵! 就在这一瞬间,你曾经在这个季节里一些经受过的、久已... Read More
-
Writing the GRE Issue Essay
This is an excerpt of a youtube video about how to write a GRE issue essay. The author of this guide is Greg Mat. First of all, let’s explore the structure of an issue essay: Introduction Hook (generalization, anecdote, interesting fact, trend, quote, etc.) ○ Introduce the topic (nothing more). Don’t write your thesis or supporting ideas... Read More
-
Gre Argument Essay Step by Step
This is an excerpt of a youtube video about how to write a GRE argument essay. The author of this guide is Greg Mat. Question The following appeared in an editorial in a local newspaper. “Commuters complain that increased rush-hour traffice on Blue Highway between the suburbs adn the city center has doubled their commuting time. The favored... Read More
-
香雪国际公寓印象
我个人体会,黄埔有三条优点,鱼羊鲜农庄的柴鸡算一条,雪松周边其它不错的餐馆加起来算一条,还有就是香雪国际公寓算一条。 香雪国际公寓由两栋塔楼和两排多层建筑构成,围合在中间的是个酒吧餐饮小楼,地下还有健身中心和停车场,建筑舒展不拥挤,造型现代又不失稳重,应该说硬件条件在黄浦区算是一流,就是放到全广州市也屈指可数。 但这个地方的缺点是管理不太跟得上,因为业主是国企,因此做起事情来,给你的感觉不紧不慢,服务意识上差点意思。 香雪国际公寓 A 栋 A 栋是两栋塔楼之一。这座楼作为酒店,提供给短租客人,另一栋是 C 栋,在 A 栋的斜对角,跟其它两栋多层一样(就是照片里的左右两栋),提供给长租客人。 彩虹 某天下班回家,抬头看到彩虹,刚好把 C 栋照进去了。 ... Read More
-
如何在网页中嵌入google照片库链接
在博客或个人网页中,我们往往需要嵌入图片,这涉及到两个问题:第一是图片文件本身存放在哪里,第二是怎么把图片嵌入到网页中。 以个人博客网站来说,由于博客一般都部署在 Github 上,所以容量相对有限。虽然图片可以跟博客文档一并存放在 GitHub 项目文件池里,但通常来说我们都不会这么做,因为图片比较占用空间,很快就会吃掉有限的容量配额。 Google photo 提供了 15G 容量的空间,所以博客经常把需要使用的图片存放在这里,然后通过在网页上嵌入链接的方式,让博客网站调取图片实现页面展示。 由于 Google photo 的图片地址不是静态链接,没法直接复制使用,因此外链图片的使用过程要分为两步: 第一步是找到图片的原始链接。我们需要去到 Google phot... Read More
-
英文名字的由来
“Reading A-Z for Kids” 是套非常优秀的英语阅读教材。我随着监督孩子学习,自己也涨了不少见识,这里就通过 S 级的第一本书,介绍一下英文名字的由来。 为节省时间,文章就不翻译了,直接上英文,反正能读到这篇文章的小伙伴们,这点英文不成问题。当然,我做了点删减。 Introduction There are twenty-four other children in Tommy’s class. Twelve are boys and twelve are girls. Every morning, at school, Mrs. Zimmerman, the teacher, calles out the names of the children. ... Read More
-
可转债与对冲基金
convertible bonds algo 21 BBC_Dr.Thorp Black Scholes Model Read More
-
简单聊聊润的姿势
我叔在年届不惑的时候,想明白了一个道理。人生或主动、或被动,都是一个接一个的选择题。当下的选择,不见得有立竿见影的效果,但若干选择的累积,假以时日,就走出各自不同的人生道路。 好多人都在问,我马上就要润,应该怎么做?简单地回答是,马上润不了。润学作为一门显学,需要你采取正确的策略,然后做一系列的选择和努力,才有可能最终达成。 润的三种段位 有钱人 在润学的世界里,什么叫有钱人?我叔的观点是,财富身家足以支持下半辈子全家吃喝玩乐,润到国外不需要打工挣钱,也能保持现有生活水准不下降的阶层。 如果你属于这个阶层,那投资移民最适合你。我叔只对枫叶国移民有研究,就拿该国投资移民政策举例。加国投资移民方案,所需家庭总资产大约在 60 万加币上下,这点对土豪朋友根本不叫事,项目投资... Read More
-
Finding Student t Distribution
In reality we may never know the variance of the population, and we have only a limited sample size due to economical reason as well as other restraints. It turns out the pdf of t ratio is not exactly the same as normal distribution. Oxford graduate William Sealy Gossett published a paper in 1908 in which he derived a formula for the pdf, and l... Read More
-
The Generalized Likelihood Ratio
We’ve already known that in hypothesis testing, we have a null hypothesis, where $ H_0: \theta = \theta_0$ versus alternative hypothesis $H_A: \theta \neq \theta_0$. We also have a presumed pdf function for the variables. Based on these information, we can construct a critical point/region when whatever level of significance $\alpha$ is given. T... Read More
-
Bayesian Estimation
Even if we can pick the correct pdf model for the whole population of data, we may never know the true parameters for such models. We construct different kinds of functions to evaluate the parameters, which we call point estimators. We feed sample data to the function and get the result, i.e., estimate(s), for the true parameter(s). Apparently, ... Read More
-
Sufficient Estimators
After the expected value and variance of an estimator, we now discuss a third feature: sufficiency. Whether or not an estimator is sufficient refers to the amount of “information” it contains about the unknown parameter $\theta$. We start by defining what sufficient means for an estimator for true $\theta$. Read more Read More
-
The Cramer-Rao Theorem
The Cramér-Rao Inequality theorem provides a lower bound for the variance of an unbiased estimator of a density function parameter. Many statistics textbooks provide the theorem without giving any proof, which sometimes frustrates students like me. I therefore did some research online and referred mainly to Miller’s paper to get the proof for th... Read More
-
The Sample Median Theorem
The Central Limit Theorem is one of the gems in probability realm. Another important and related theorem is about the sample median. It says that the density of the median of a sample, if the sample size goes large enough, will also follow a normal distribution. This note will try to establish a proof and explore the mean and variance of the sam... Read More
-
Interval Estimation
We can get the estimate for parameters based on a survey of $n$ results, either by the method of maximum likelihood or moments. For example, we have $\lambda = X$ as the estimator for a Poisson parameter, $\lambda$. Now we need to consider another question: how close is this estimated $\lambda_e$ to the real value? The usual way to quantity the... Read More
-
How to find pdf for sum, quotient and difference of variables
Given pdf of two independent varialbes, how can we find the pdf of their sum, quotient or differnece? Although this is a basic technique in statictics, but it finds its application in a very broad scope. Read more Read More
-
Hyper-geometric Distribution
The hyper-geometric distribution is about the un-ordered sampling without replacement. Read more Read More
-
Estimating Parameters - Maximum Likelihood and Moments
If a phenomenon is likely to be described by a kind of distribution function, we might want to know the best parameters for the distribution function. There’re two ways to estimate the parameters based on a collection of samples, the method of maximum likelihood and the method of moments. Read more Read More
-
The Gamma Distribution
First of all, we define what gamma function is, then we proceed with gamma distribution, and followed by the discussion of its properties. Read more Read More
-
The Negative Binomial Distribution
Follow the logic of geometric distribution, if we want to study the probability of $r^{\text{th}}$ success in $k^{\text{th}}$ of a series of trials, it must be the case that $(r −1)$ success occur during the first $(k −1)$ trials and the $r^{\text{th}}$ happens on exactly the $k^{\text{th}}$ trial. If we let $X$ be the sum of independent variab... Read More
-
The Geometric Distribution
Consider a series of independent trials and each has one of two outcomes, success or failure. If $p$ is the probability of success, the geometric distribution means the probability at which the first success occurs. This is the geometric distribution. Read more Read More
-
A Weak Proof of Central Limit Theorem
Central Limit Theorem (CLT) is one of the two most important theorems in statistics (the other is the Large Number Theorem). In this note, the theorem of moment generating function is used to prove the CLT. This is a weak proof, because the underlying logic is that by showing two varibles have the same mgf, we jump to conclude that they are also... Read More
-
Taylor Theorem and its Proof
Taylor’s Theorem is a very powerful tool to approximate any functions that are infinitely differentiable on a certain interval between a and b. Of course, the exact value of a and b need to be carefully defined, so the formula/series developed by the theorem shall converge within the defined interval. Read more Read More
-
How to Deduce Stirling Formula
Stirling formula is the approximation to $n!$ This is a formula widely used in statistics theorem proofs. However, the detailed proof are often omitted in most textbooks. I digged into the online resources. Among numerous articles and papers, I referred to Marton Balazs and Balint Toth’s “Stirling’s Formula and DeMoivre-Laplace Central Limit The... Read More
-
Poisson Distribution
In the binomial distribution where n is quite large, it’s usually a tedious job to calculate k! when computer was not available back in the 18th to early 20th century. So Simeon Denis Poisson, a French mathematician came up with a approximation, which proves to be working quite well with a small p. Read more Read More
-
Moment Generating Function
Moment generating function is the expected value of $e^{tx}$ with respect to the pdf of the variable. If we differentiate mgf and then let $t=0$, we can get $E(X), E(X^2), \dots$. So mgf is a way to find $\mu$ and $\sigma$ if the pdf itself is complicated. Furthermore, mgf can also be used to prove the similarity of two pdfs, if and only if thei... Read More
-
Welcome to Jekyll!
You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the _posts dire... Read More
-
Video example
Canon in D (Pachelbel’s Canon) - Cello & Piano [BEST WEDDING VERSION] Some of you know that we occasionally play for weddings. As you can imagine, we get a LOT of requests for Canon in D, and we discovered that there were no good arrangements available anywhere for piano and cello! Hard to believe given its popularity. So we decided to make ... Read More