Here's the rule: With a fair coin, Helen gets a point when it flips head and Tim gets a point when it flips tail. Helen wins when she becomes 3 points ahead. Tim wins when he becomes 10 points ahead. How much more likely is Helen to win? And if we use a weighted coin, what should the weight be to make this into a 50/50 fair game?
Short notes kept by a devotee to the study of nature, computing, and mathematics.
Friday, June 17, 2011
Sunday, May 22, 2011
TBBT Physics Bowl
In one of the episodes of The Big Bang Theory, the gang enters into the department physics bowl. Near the end, Sheldon was stunned by the following Feynman diagram problem:
Considering that this is one of the basic diagram for QED, it would be impossible for the character to not even recognize the problem. Anyway, the janitor then answered that the correct answer is \( -8 \pi \alpha \). It is incorrect. Well, at least not without additional conditions not specified by the problem.Saturday, May 07, 2011
中文字體測試
| sans:中文字体测试。中文字體測試 |
| serif:中文字体测试。中文字體測試 |
| mono:中文字体测试。中文字體測試 |
| 黑体:中文字体测试。中文字體測試 |
| 宋体:中文字体测试。中文字體測試 |
| 新细明体:中文字体测试。中文字體測試 |
| 楷体:中文字体测试。中文字體測試 |
Saturday, February 05, 2011
0.999.... = 1
嚴格來說,小數并不代表實數、而是代表運算嘅一種簡寫(對人類來說比較方便)方法。
當你寫一個(10進制)小數嘅時候,例如0.33,這4嘅符號(0 . 3 3)代表嘅係以下運算嘅結果
它是一個實數(因為實數有限個基本運算下閉合)。而我們把這運算簡寫成0.33。
當你寫一個無限小數嘅時候,例如0.3333....代表嘅係以下无限級數嘅運算結果
這時候你就必須先問清楚咩係『無限個運算嘅結果』因為你不可能真係去做無限個運算。很自然你會回答:無限個運算我『識』做,因為我學過极限和收敛等概念!
跟住你必須問:咁呢個級數是否收敛到一個實數?如果不能收敛到一個實數、當然不能代表任何實數。好彩答案是肯定的:實數有完备性、以上數列是柯西序列、所以它收敛於一個實數(但這些都不是小學能輕易證明的事情)。和1/3結果一樣嘅實數。
所以說0.9999.... = 1只不過係表示
這個級數嘅收敛极限和
幾個運算結果相等。至於點證明,自己Google。
Tuesday, June 08, 2010
Converting vdi to vmdk
The only Windows installation I have is in a virtual machine that I keep for odd jobs. Usually these jobs are related to firmware updates because manufactures usually do not support Linux out-of-box. Generally the non-open source edition of VirtualBox works very well with USB pass-through. One item in which it decidedly failed is HTC's HTCSync software: it simply refuse to connect to my HTC Hero. Further research shows that VMWare is able to do the same job. So I decided to try VMware-player. I don't want to create a new image just for it, so I would like to convert the VBox image (.vdi) to the VMware format (.vmdk). Since VBox can also use .vmdk, I can keep using VirtualBox for all the stuff it can handles. VMware has some behavior that just annoy the hell out of me.
Simple googling shows how to convert the VirtualBox HDD image to a VMware one:
This, however, did not work for me. VMware cannot boot the converted image. Some blog mentioned that this is because dynamically allocated images are different and incompatible in the two formats. My image is pre-allocated, yet I still have problem. Does not matter. The solution is the same.$ qemu-image convert -O vmdk hddimage.vdi hddimage.vmdk
Sunday, March 07, 2010
4-force
Classes in relativity usually avoid discussing force even though every physics student started in non-relativistic physics with .
It is not immediately obvious if this is still true under relativity and if not what is the correct formula. Of course, discussion of regular 3-vector in relativity is not very convenience. It is more natural to construct relativistic (i.e. covariant) relations using 4-force
, 4-momentum
, 4-acceleration
, 4-velocity
, and with proper time
. There is a problem: should we define 4-force by acceleration
or momentum?
.
Momentum is more fundamental than acceleration, so:
We still want Newton's law to hold in some sense. Consider the collision of two particles. Newton's third law would read like this:
But this is strange because it means both particles have the same proper time even though they might be travelling with very different velocities.
Sunday, February 28, 2010
Relativity and photons
It's a relatively free weekend, so I ended up thinking about bunch of random stuff. Another problem I pondered: is number of photon a Lorentz invariance? That is, do observers in different frame count the same number of photons? From intuition, it seems photon number should be an invariance.
Series are fun.
Sunday, February 07, 2010
Python vs. MATLab
Whenever I need to put together quickly some numerical code, I immediately turn to MATLab. The problem with programs like MATLab and Mathematica is that they are very "packaged", i.e. it is not very easy to integrate those codes in to a regular SHELL session. If I want to further process the calculation result using other programs (e.g. gnuplot to make very pretty LaTeX plot), then I am almost always forced to write the result to some output file using fprintf or similar, then process that file. In principle, if the output is well formatted, one can run the MATLab code like this:
However, MATLab would also print out a long header as well as its own command prompts. Additional work is needed to get rid of those undesirables and make use of the print-out.$ matlab -nodisplay -nodesktop -nojvm -r "run_my_code(args);exit;"
Saturday, February 06, 2010
Poles of GF (time-independent)
From college to graduate school, it took me years to get used to Green's function. I often wonder if it's the same case for others or am I just not too bright. GF is of course an extremely powerful method that takes many years of reading and practice until one is completely comfortable with it. Physics undergraduates probably learned about it---as I did---in a mathematics class, but it is usually unused by physics classes. For example, Griffiths' EM book---standard textbook on the subject---do not use and GF and his QM book only uses it in the scattering theory chapter (for which GF is very useful) at the very end.
My hand-waving understanding of GF is the following: it is the inverse of the Hamiltonian/Linear operator in the following sense:
with the parameter
Thursday, February 04, 2010
Two bands interaction: self-energy and effective low energy Hamiltonian.
$$ H = \left( \begin{array}{cc} H_{11} &H_{12} \\ H_{12}^{\dag} & H_{22} \end{array} \right)\,, $$where $H_{11}$ and $H_{22}$ are some low and high energy bands that we know how to diagonalize and $H_{12}$ is some interaction between them. Since we know the spectrum of $H_{11}$, we can write down the GF. Here it is:
$$ G_{11}^{(0)} = \frac{1}{H_{11} - \epsilon^{0}} $$
Wednesday, February 03, 2010
Process substitution
$ diff <(cat FILE1) <(ssh remote-host cat remote-path/FILE1) $ diff FILE1 <(ssh remote-host cat remote-path/FILE1)
Monday, February 01, 2010
scpdiff
For convenience, I wrote the following function in my .bashrc:
Saturday, January 30, 2010
My LaTeX Makefile
Friday, October 30, 2009
Terminator keyboard shortcut list
Wednesday, September 09, 2009
Loop over filename with space
which breaks at space and therefore would fail for filename with space, dofor x in $(find -depth 1 -type d); do ... done
find -depth 1 -type d | while read x; do ... done
