Ben Chuanlong Du's Blog

And let it direct your passion with reason.

How Long Does It Take to Observe a Sequence?

There are many interesting while at the same time very tricky problems in statistics. One famous question is that how many steps (expected) does it take to observe a given sequence (e.g. THTH, TTHH), if we flip a balanced coin?

This problem can be solved using (delay) renewal theory …

First 10-digit Prime in Consecutive Digits of Euler Constant?

One day my friend Ru He asked me a question.

What is the first 10-digit prime found in consecutive digits of e?

This is an easy problem with the help of Mathematica. The following is the Mathematica code I wrote to solve this question. It actually solves the general problem …

Probability to Lose All Money

A few days ago I found someone asking an interview questions on mitbbs. The question is as follows. A gambler plays a fair game and bet 1 dollar each time. If he lose all his money, the game stops. Suppose he has 10 dollars and is only allowed to play …

The Power of Generating Functions

Generating functions is a very powerful way to find closed formula for sequences defined iteratively. I was so bored during the final week, so I went on internet for fun. Finally I found someone from Sydney University was asking for help on this question:

(a) If Ln=Ln-1+Ln-2 for …

Which One Is the Best Strategy?

Another interesting problem I met in statistic is: 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're allowed to choose first …

The Sum and Product Puzzle

I talked about an interesting problem in this post. I had onsite-inteviews from Wolfram at the end of April this year, and I decided to talk how to solve the problem using Mathematica. I did some research and realized that the problem is a well-known one which is called the …