Ben Chuanlong Du's Blog

And let it direct your passion with reason.

How Many People Stay in the Same Position?

There are 100 seats on a plane. If each of the 100 passengers randomly take a seat, how many people will have his/her own seat on average?

There is a classic way to solve this problem, which is to decompose a (complicated) random variable into a sum of simple …

Calculate Covariance Between Multinomial Categories by Hand

Let \((X_1, \ldots, X_k)\sim\text{Multinomial}(n, p_1, \ldots, p_k)\). I'll show how to calculate \(Cov(X_i, X_j), i\ne j\). The main purpose of doing this is to illustrate the little trick of reducing complexity of problems by decomposing a complicated random variable into simple ones.

Let \((Y_ …

Creative Use of Keepassx -- Odd Skills?

I had to schedule an event on Doodle. I wanted to fill in all possible regular meeting times (starting at 8:00 am with 30 minutes interval). I am such a lazy guy who never want to repeat the same thing for more than 3 times. Typing all these time …

Inverse of a Special Class of Matrices with High Dimensions

One day, my officemate Tieming asked me about a problem that she met in her research. Suppose \(\boldsymbol{B}\) is a symmetric matrix of huge dimension and \(\boldsymbol{D}\) is a diagonal matrix with nonnegative diagonal elements. The inverse of \(\boldsymbol{B}\) is already known, how can we calculate the …

Which One Is the Best Strategy? (continued)

Suppose we flip a coin which has probability 0.7 to be head again and again and two people choose two different sequences of length 3 (e.g., THH). The people whose sequence appears first wins. If you are allowed to choose first, which sequence will you choose?

I discussed …

Expected Gain of Tossing a Dice

Suppose you toss a symmetric dice. You are allowed to quit the game and get money which equals the total points you get at any time if 6 has never showed up. Whenever 6 shows up, the game is over and you get nothing. For example, if the first three …