Chaitanya's Random Pages

November 27, 2011

The popularity of the Pixar films

Filed under: movies and TV — ckrao @ 5:06 am

After an earlier post on the success of the Harry Potter films, I decided to do the same for the Pixar films. The Toy Story films is arguably the best reviewed trilogy, while many of Pixar’s other films have had extremely positive reception.

Movie Release Date Worldwide Gross (USD millions) Worldwide Gross Rank (Nov 2011) imdb rating (/10) Metascore (/100) rottentomatoes fresh reviews
Toy Story Nov-95          362.0 178 8.2 92 76/76 (100%)
A Bug’s Life Nov-98          363.4 174 7.2 77 75/82 (91%)
Toy Story 2 Nov-99          485.0 94 8 88 146/146 (100%)
Monsters, Inc. Nov-01          525.4 82 8 78 159/167 (95%)
Finding Nemo May-03          867.9 26 8.1 89 196/199 (98%)
The Incredibles Nov-04          631.4 54 8 90 222/229 (97%)
Cars Jun-06          462.0 109 7.4 73 142/193 (74%)
Ratatouille Jun-07          623.7 58 8.1 96 209/217 (96%)
WALL-E Jun-08          521.3 84 8.5 94 222/231 (96%)
Up May-09          731.3 43 8.3 88 266/271 (98%)
Toy Story 3 Jun-10       1,063.2 7 8.6 92 248/251 (99%)
Cars 2 Jun-11          551.8 74 6.5 57 73/192 (38%)

An amazing nine out of the twelve films released to date have had 95+% scores from rottentomatoes!

Here is a graph comparing the worldwide grosses, including those of the US and Canada. Note that the numbers are all in $US and do not adjust for inflation or fluctuating exchange rates.


A few cute mathematical series

Filed under: mathematics — ckrao @ 3:11 am

From the geometric series \sum_{k=0}^{\infty} z^k = \frac{1}{1-z} we can arrive at a couple of attractive-looking series:

\displaystyle \sum_{n = 0}^{\infty} \frac{a^n}{(a+1)^{n+1}} = 1 \quad \quad (1)

\displaystyle \sum_{n=0}^{\infty} \left(1 - \frac{1}{a}\right)^n = a \quad \quad (2)

For example, \sum_{n=0}^{\infty} \frac{3^n}{4^{n+1}} = \sum_{n=0}^{\infty} \frac{4^n}{5^{n+1}} = 1 and \sum_{n=0}^{\infty} \left(\frac{7}{8}\right)^n = 8.

Furthermore, from the sums \sum_{k=1}^{\infty}k z^k = \frac{z}{(1-z)^2} and  \sum_{k=1}^{\infty} k^2z^k = \frac{z(1+z)}{(1-z)^3} we obtain (after setting z = a/(a+1))

\displaystyle \sum_{n = 1}^{\infty} \frac{na^{n-1}}{(a+1)^{n+1}} = 1 \quad \quad (3)

\displaystyle \sum_{n = 1}^{\infty} \frac{n^2a^n}{(a+1)^n} = a(a+1)(2a+1) \quad \quad (4)

This last sum reminds me of the identity \sum_{n = 1}^a n^2 = a(a+1)(2a+1)/6 for positive integers a, though a appear in the sums in different places!

So for what values of a are sums (1)-(4) valid (i.e. when do they converge)? For any positive integer k the sum \sum_{n=1}^{\infty} n^k z^n converges when |z| < 1, so this means sums (1), (3) and (4) converge when |a/(a+1)| < 1. In other words, |a| < |a+1|, or equivalently, a is closer to 0 than to -1. Hence the real part of a must be at least -1/2. Similarly, sum (2) converges when |(a-1)/a| < 1, which is equivalent to the real part of a being at least 1/2.

November 15, 2011

Crazy cricket from Cape Town

Filed under: cricket,sport — ckrao @ 10:52 am

The second day of the first cricket test between Australia and South Africa in Cape Town (November 10 2011) was as bizarre a day of cricket as I have heard about. Based on the references below here is a collection of some oddities and tidbits from this match.

  • In Australia’s first innings captain Michael Clarke produced one of his best test innings: 151 out of an Australian total of 284.
  • On day 1, Dale Steyn had figures of 4.1 overs for 22 runs versus Clarke and 9.5 overs, 4 wickets for 9 runs against the remaining players!
  • Boucher also took his 500th catch on the first day.
  • On day 2 Australia resumed from an overnight score of 8/214 and made it to 284, with Clarke the last batsman dismissed. South Africa made it to 1/49 just after lunch before Shane Watson came on and took two wickets in his first over (including Kallis for his first duck in 55 innings over almost four years). Then the true carnage began: both teams combined lost 16 wickets for 44 runs in 115 balls!! South Africa lost their last 7 wickets for 23, then Australia were reduced to 9/21 before the last wicket stand took them to 47 – past the lowest ever test score of 26 (by NZ). I went to bed after South Africa was bowled out for 96, thinking that even if Australia were bowled out for a similar total, they had enough of a first innings lead to win the match. The day ended with South Africa 1/81 comfortably on track for an unlikely victory. Never have I seen such a flurry of wickets with relatively free scoring on either side, on the same day!
  • Twenty-three wickets fell on the second day, the fourth most ever for a single day in test cricket and the most since 1902.
  • It was Australia’s third sub-100 score in 16 months (12 tests).  Only once in their previous 277 tests over 25 years had they done this! (This was back in Mumbai in 2003.)
  • Australia’s first innings was the sixth shortest completed innings in terms of balls (108). [ref]
  • It was only South Africa’s second sub-100 score since 1960.
  • Australia’s collapse from 1/11 to 9/21 was the third time in test cricket that 8 wickets fell for ten or fewer runs.
  • It was the eighth time that the number 11 batsman (Nathan Lyon with 14) top scored in a test innings. [ref] Interestingly the opening batsman (Shane Watson) was also the top wicket taker in South Africa’s first innings – how topsy-turvy!
  • The previous lowest score at the fall of the ninth wicket was 25.
  • Watson and Vernon Philander became the first pair of bowlers from opposite sides to take five-wicket hauls for fewer than 20 runs in the same Test. Watson’s spell was the second fastest 5-wicket haul (28 balls) from first coming on to bowl.
  • It was only the third time since WW1 that both teams had innings scores less than 100 in a test match.
  • It was the first time since 1912 that 22 batsmen were out in single figures in the first 3 innings of a Test. Seventeen batsmen in a row were dismissed for single figures!
  • South Africa became the 12th team to win a Test after being bowled out for under 100 (the third since 1907).
  • It was only the fourth time a completed innings had only the openers scoring in double figures. [ref]
  • It was the first time a batsman from each team was out twice on the same day (Clarke and Rudolph).
  • Australia’s first innings was only the second time a tenth wicket partnership accounted for more than 50% of a test innings. The first time was far more impressive: a partnership of 117 out of an innings total of 209 for England between Peter Willey and Bob Willis in 1980 against the West Indies. [ref]
  • It was the eighth time the fourth innings exceeded the sum of the second and third innings. [ref]
  • It was the ninth test in which one side scored more twice as many runs in the first innings as the opponent and still went on to lose the match. [ref]
  • South Africa won after conceding the ninth biggest first innings lead (188 runs) [ref]
  • On 11/11/11, at 11 minutes to 11, the score was 1/111! [ref]
  • On 11/11/11, at 11:11, South Africa needed 111 to win!

Other References

ESPNcricinfo on Twitter

A quiz on the capers in Cape Town | The Confectionery Stall | Cricket Blogs | ESPN Cricinfo

South Africa v Australia, 1st Test, Cape Town: The best bowling day in more than 100 years | Cricket Features | South Africa v Australia | ESPN Cricinfo

A list of amazing statistics from Day 2 of the Cape Town test: Indian Cricket Fans forum

SA-Aus 1st Test, Day 2: A day of numerous records – Sports

November 11, 2011

Counting rectangular lattice paths

Filed under: mathematics — ckrao @ 9:49 am

This post is inspired by an attempt at the following problem edited from the 1995 AIME.

Starting at (0,0) an object moves in the coordinate plane via a sequence of steps, each of length one. Each step is left, right, up, or down, all four equally likely. Find the probability that the object reaches (2,2) in six or fewer steps.

I wish to show my approach to the problem, which led me to find a formula for the number of ways the object reaches an arbitrary point (p,q) from (0,0) in n steps.

Before reading on, I encourage you to have a go at the above problem to get a feel for it!

The first thing to observe is that the object only can reach (2,2) in an even number of steps. The sum of the coordinates changes parity with each move, so it cannot reach (2,2) in say five steps. It can reach (2,2) in the minimum four steps only if each step moves towards that point, either to the right or upwards. Among four steps one chooses two to go up (and the other two to go right), so the number of ways of going from (0,0) to (2,2) in four steps is \binom{4}{2} = 6. Since in total there are 4^4 = 256 possible paths of four steps (a choice of four paths for each step), the probability that one arrives at (2,2) in exactly 4 steps is 6/256 = 3/128.

Next, we need to find the probability that one arrives at (2,2) for the first time in exactly six steps. To find this we will count the number of ways of arriving at (2,2) in exactly six steps (whether or not it arrived there in four steps) and subtract from that the number of ways in arriving at (2,2) in six steps having arrived there in four steps.

The second of these possibilities is easier to find, so let’s find that first. Above we saw that there are 6 ways of arriving at (2,2) in four steps. After two more steps it needs to return to (2,2), and there are 4 ways of that happening (the sixth step needs to be the reverse of the fifth). Hence in total there are 6 \times 4 = 24 ways for the object to arrive at (2,2) in six steps having been there two steps earlier.

Now we wish to find the number of ways of arriving at (2,2) in six steps without restriction.

We notice that to arrive at (2,2) in six steps, one of the steps needs to be in an “unhelpful” direction – either left or down. There are 6 choices of which of the six steps in which this occurs, and then 2 choices of direction. Then of the remaining five steps, the net position we wish to reach is (3,2) (if the unhelpful direction was left) or (2,3) (if it was down). In each case the number of ways to reach that position is \binom{5}{2} = 10. We conclude there are 6 \times 2 \times 10 = 120 ways of the object arriving at (2,2) in six steps without restriction.

The rest of the problem is easy: since there are 4^6 possible paths of six steps, the probability that one arrives at (2,2) for the first time in six steps is (120-24)/4^6 = 3/128. Combining this with the probability of arriving there in four steps, our final answer becomes 3/128 + 3/128 = 3/64.

After solving this I wondered about the question of how many ways there are of reaching an arbitrary point (p,q) in n steps. Let this number be f_n(p,q). To look for a pattern, I worked with small values of n and concentrating on the first quadrant progressively built up triangular arrays of numbers showing the number of ways of going to each point in n ways. The following recursion is used:

\displaystyle f_{n+1}(p,q) = f_n(p-1,q) + f_n(p+1,q) + f_n(p,q-1) + f_n(p,q+1)

The arrays are shown below for n = 2 to 6. Here the bottom left point corresponds to (0,0) while red dots indicate those lattice points that can not be reached.

Then it was time to stare at the numbers and look for a pattern. One thing I noticed was that the numbers corresponding to p = 0 or q = 0 (along the axes) are perfect squares. Then I noticed that for n = 6, the numbers along the diagonal p=q are multiples of \binom{6}{3} = 20. This enabled me to find the following representation for the numbers in terms of binomial coefficients.

From this the general formula (for any integers p, q) was conjectured to be

\displaystyle f_n(p,q) = \begin{cases} \binom{n}{(n + p + q)/2} \binom{n}{(n + p - q)/2}, & \mbox{if } p + q \equiv n \mod 2\\ 0, & \mbox{if } p + q \not\equiv n \mod 2. \end{cases}

This conjecture can be proven as follows. The above formula suggests that the number of ways to go to (p,q) can somehow be decoupled so that one can consider each of two directions independently. To do this we apply a rotation and replace the directions up, down, left and right with the directions north east, south west, north west, south east respectively:

\displaystyle (1,0) \rightarrow (1,-1) \quad (-1,0) \rightarrow (-1,1)
\displaystyle (0,1) \rightarrow (1,1) \quad (0,-1) \rightarrow (-1,-1)

This maps any point (p,q) to (p+q, q-p). We now consider the equivalent question of how many ways are there for the object to go to (p+q, q-p) from (0,0) using the four allowed steps (\pm 1, \pm 1).

This question is easier to solve since now we may treat each component separately:

  • for the first component we go to p+q in n steps (provided p + q \equiv n \mod 2) by choosing (n+p+q)/2 +1s and (n - (p + q))/2 -1s for each step’s first component. This can be done in \binom{n}{(n + p + q)/2}ways.
  • for the second component we go to q-p in n steps by choosing (n + q - p)/2 +1s and (n - (q-p))/2 -1s for each step’s second component. This can be done in \binom{n}{(n + p -q)/2} ways.

Hence we can go to (p+q,q-p) in a total of \displaystyle \binom{n}{(n + p + q)/2} \binom{n}{(n + p - q)/2} ways. Transforming back, this is equal to the number of ways of going to (p,q) from (0,0) using up, down, left and right moves of unit length provided p + q \equiv n \mod 2 (otherwise (p,q) cannot be reached). This proves the conjecture, an interesting result I had not seen before. The hard part was finding the pattern involving binomial coefficients by considering small cases for n.

It is interesting to see how this generalises the better known problem of reaching (p,q) (p, q non-negative) when using up or right moves only: it is equivalent to the case p + q = n, and using the above formula we find the number of ways to be

\displaystyle \binom{n}{(n + p + q)/2} \binom{n}{(n + p - q)/2} = \binom{n}{(n+n)/2} \binom{n}{(p + q + p - q)/2} = \binom{n}{p},

which we saw earlier (choose p of the n moves to be “right”).

November 6, 2011

The popularity of the Harry Potter films

Filed under: movies and TV — ckrao @ 4:52 am

Never before has a series of as many as eight films had such sustained success both at the box office and while maintaining mostly positive reception among film critics and the general public. During the past decade the Harry Potter films have amassed some US$7.7 billion worldwide at the box office, more than any franchise (second is the James Bond franchise of 24 movies, followed by Star Wars – a list of highest grossing films is here), and with an average close to $1 billion worldwide per movie (second best is the Pirates of the Caribbean franchise).

Movie Release Date Worldwide Gross (USD millions) Worldwide Gross Rank (Nov 2011) imdb rating (/10) Metascore (/100) rottentomatoes  fresh reviews
Philosopher’s/Sorcerer’s Stone Nov-01  974.76 11 7.2 64 148/186 (80%)
Chamber of Secrets Nov-02 878.98 24 7.2 63 170/205 (83%)
Prisoner of Azkaban Jun-04 796.69 33 7.7 82 210/232 (91%)
Goblet of Fire Nov-05 896.91 21 7.5 81 194/222 (87%)
Order of the Phoenix Jul-07 939.89 14 7.3 71 183/236 (78%)
Half Blood Prince Jul-09 934.42 15 7.3 78 212/254 (83%)
Deathly Hallows: Part 1 Nov-10 955.42 13 7.6 65 193/244 (79%)
Deathly Hallows: Part 2 Jul-11 1,327.84 3 8.2 87 255/265 (96%)

That all the movies have a rottentomatoes score at least 78% is most impressive and shows large appraisal among critics.

Here is a graph comparing the worldwide grosses, including those of the three biggest markets: the US and Canada, the UK and Japan. The movie franchise is arguably more popular in the UK and Japan than the US. Note that the numbers are all in $US and do not adjust for inflation or fluctuating exchange rates.

The series sure ended well, in more ways than one!


Create a free website or blog at

%d bloggers like this: