A string is essentially a sequence of characters. This is how string is implemented in many programming languages (string in Java is different). For this reason, you can operate string like an array in some programming languages. This post is a shallow summary on strings in different programming languages. For …
What are the Two Integers?
I met a friend majored in math on a bus home today. He held a piece of paper with a question (probably an interview question since he is trying to find a job recently). He asked the question to me and I found it to be an interesting one.
A …
Probability to Get a Complete Deck of Cards?

Suppose a poker games requires 4 decks of poker. After the game, the cards are put back into the 4 decks randomly. Now there is another game which requires only 1 deck of poker, so we want to open some decks of the poker and find a complete set of …
Chance to Take One's Own Seat?

There are \(N\) seats on a plane. Suppose the first passengers is drunk and he takes a seat randomly. For each of the other passengers, if his/her seat is not taken by other people, then he/she sits on his/her own seat, otherwise he/she takes a seat …
Sun Bin PK Pang Juan

Dating back to the time when I was a sophomore, I read a very interesting problem from "Waming", which is a magazine of math department of USTC (University of Science and Technology of China).
One day Guigu Zi (a famous ancient Chinese sophist, the teacher of Sun Bin and Pang …
Basketball Player

Suppose a basketball player make \(N\) shots, and we know that in the first \(n(\le N)\) shots he sinked \(m(\le n)\) shots. If from the \((n+1)^{th}\) shot, his ratio of sink a shot is his accumulative ratio before the shot, e.g., suppose he sinked 40 …