Sitemap
Divyosmi Goswami

Divyosmi Goswami

Divyosmi Goswami: A digital nomad's journal wandering through the physical and cyber city discovering himself.

Apple Tree Probability question

5 min readDec 28, 2021

Took me 7 minutes to solve, see how much it takes you to solve it.

Dear reader,

It is been a long time since I wrote something relating to math or stats. I was actually a little busy, with studies and as well as there were some other works to be done. But I am so happy to be back to writing. As you probably know that I have just finished the Statistics 131A course from UCI. I now have a pretty strong base in Probability theory and pure statistics. But there's a long way to go still, so I am also taking the 131B Statistics course. I have fallen in love with statistics. Moreover, I am in love with paradoxes and problems, it is the Christmas season. There are certain times in the year when I get time to delve into myself and invest in my skills for the future and prepare for the future early.

I took this time to understand and solve some problems. Here is one of them. The very famous and among students infamous question asked in 2016 Fall test of OMO or Online Math Olympiad. I am very much down to give this exam one day. The problem is not too much hard, it just was not well framed to make it ambiguous, less clear and much complicated than it actually is. I solved it because maybe I had much more formal training in statistics and my command over my language is better than most, I recognised that to solve any problem we need 3 things:-

  • command over the language, from learning the terminologies to understanding the problem and also breaking the question into simpler terms and extracting information from the question. In probability questions, one thing is clear to me, simplify your scenario to easily solve the problem.
  • Formal training is pretty important. Knowing everything theoretically correct helps us rock practically. My father always says, learn the theory and rock practically. Srinivasa Ramanujan is my maths idol, on 24th December it is Indian mathematics day on his birthday. He was a man of infinite imagination, he delved into the worlds of black holes and higher dimensions as well as the quantum scale. He wrote equations and formulated theorems and expressions, which were pieces of art that no one knew how to draw that or even what that was. Ramanujan due to lack of formal training could not propose proofs for his equations and ideas and toiled for a long time at the beginning of his career. He was a treasure trove for mathematicians, his love for maths was so powerful, that Namagiri herself came to him and whispered these equations like a blessing to him. With him gone, was a man gone, who knew infinity.
  • and practice! no, no, not like hard work, intelligent work. Practice intelligently. Love what you do. Understand what you are practising, feel for what you do, rest comes along.

Heres the problem —

At the end of day 0, six magical seeds are planted.

On each day following, each seed has a chance to magically transform into an apple tree with a probability of 1/2.

Once a seed transforms into an apple tree, it stays an apple tree and survives indefinitely.

What is the expected number of days until all six seeds have become apple trees?

Take your time and compute it as you may like. Then keep your answer scripts ready for the reveal.

I first came to know about this puzzle in mind your decision this year on 25th November. When i saw the word hardest problem, it excited me to solve it. There is the solution.

On reading the question carefully we find words like expected, and days and six seeds. So we have a rough sketch of what we need.

Let’s declare 6 geometric random variables. If you don’t know what geometric random variables are then let me tell you, geometric distribution is a distribution of the probability of winning a game or some event having a success of the k th trial. It maps the probability that some event will occur only on the k th trial and all preceding trials would be failures. So you map for all values of k and the property of this random variable is that it is strictly decreasing and limits to 0 as k goes to infinity. So here it would mean that k for our random variable X(i) is the day on which it would become a tree.

Get Divyosmi Goswami’s stories in your inbox

Join Medium for free to get updates from this writer.

Now we assume that no seed influences the probability of the growth of another tree. so all trees are independent.

So now that we have 6 independent discrete geometric random variables that map distribution of maximum number of days it would take to grow into a tree. We declare another variable X that is the maximum number of day it would take for all the plants to grow into tree.

So, the probability that X ≤ t, is

P(X(i)≤t) = 1-(1/2)^t [•here 1/2 is the probability of failure, and so we are subtracting that from 1 or total probability, this is the CDF of geometric random variable, this is strictly increasing but limits to 0 as k goes to infinity]

P(X≤t)=P(X(1)≤t)*…*P(X(6)≤t)

=(1-(1/2)^t)^6

Now we wish to find the exact value that it grows on someday, here t.

So here is a trick, we know P(X≤t) and we can find P(X≤t-1), so that means t-1 would include everything that t does except t. So,

P(X≤t)-P(X≤t-1) = P(X=t)

P(X=t) = P(X≤t)-P(X≤t-1)

= (1-(1/2)^t)^6-(1-(1/2)^t-1)^6

So we now have P(X=t).

Now why did we do all these sums, because we want to find the expected value of X.

E[X] = Sum[t=1, infinity, t(P(X=t))]

=4.033765823•••

Well i didn’t compute till infinity, I used Wolfram Mathematica.

So we finally have our answer that it would take only 4 days for all of them to grow into trees. But it is the expected value or the most probable event and not the exact number.

Thank you for reading, hope you enjoyed reading the blog. If there is any simpler solution you would like to tell or maybe there is any corrections that might be needed please do tell me. Take care, stay safe and positive. Stay mindful, keep reading and keep learning.

--

--

Divyosmi Goswami
Divyosmi Goswami

Written by Divyosmi Goswami

Divyosmi Goswami: A digital nomad's journal wandering through the physical and cyber city discovering himself.