# What Is the Probability that the Sun Will Rise Tomorrow? — Sunrise Problem

4 min readFeb 9, 2019

--

I have lived thousands of days waking up with rising of the sun and realizing the reality as bestowed by the light rays of the magnificent sun. Never in my life have I doubted ever about the rising of the sun for it has always made my day livable and moving. The sunshine rays which gleamed on the mirror always started my day with a positive note. I loved mirrors more than anything. Mirrors taught me to reflect myself when I am exposed to lights. When darkness was prevailing in every aspect of my life, the little glitter coming from far away window budded hope.

Now, I am starting to think the other way. I am deliberately being pessimistic about the sun rising next day. Let’s leave the science for now and talk the statistics. What if the sun does not rise tomorrow?

Science has restrained me in being pessimistic as the truth is undeniable. Fear on the other hand helps pulling me from thinking not rising of the sun. Whatever, let’s forget science, suppress fear and embrace statistics. Let’s think again with the mathematical jargon and immerse ourselves in the realm of patterns, formulas and logic.

## Question

You have lived n number of days and all the days you lived, you have seen sun rising. What is the probability that the sun rises tomorrow?

It is a famous problem in probability and statistics called as “Sunrise problem”, which was introduced by Laplace first time in the 18th century.

## Solution

Let the risings be independent identical indicator random variables and S[n] be the sum of them. Given that we have seen n risings, the fact we know is:
S[n] = n

Let X[n] be the indicator random variable representing sun shining in the nth day.

Now, we need to know the probability of sun rising tomorrow. So, the mathematical formulation of the question is:
P(X[n+1]|S[n]=n)

We do not know independent probability of the sun shining. Given S[n], let’s first work the probability density function (PDF) of the probability itself and then integrate to find the probability as we are not certain about the probability. To quantify the uncertainty, let’s employ uniform distribution, which accounts complete uncertainty.

So, our new goal is to find probability density function for p given S[n] = n i.e f(p|S[n]=n).

Using the conditional probability,
f(p|S[n]=n) = P(S[n]=n|p) * f(p) / P(S[n]=n)

The probability P(S[n]=n) does not depend on p and the value of f(p) is 1 everywhere as we have assumed uniform distribution.

So, f(p|S[n]=n) ∝ P(S[n]=n|p) ∝ p^n

Integrating to-be-PDF p^n in the interval [0, 1], we get, 1/(n+1).

So, we multiply it by (n+1) to conform with the definition of probability distribution.

Hence, the PDF becomes:
f(p|S[n]=n) = (n+1) * p^n

Now, to find the probability that sun shines tomorrow, let’s find expectation of the distribution.

P(X[n+1]=1|S[n]=n) = E[f(p|S[n]=n)]
= ∫[0 to 1] (n+1) * p^n * p dp
= (n+1) ∫[0 to 1] p^(n+1) dp
= (n+1)/(n+2) * [p^(n+1)] from 0 to 1
= (n+1)/(n+2)

So, the probability that the sun shines tomorrow given that it has shone for n days continuously is (n+1)/(n+2).

## Quantification

The earliest memory (at least) I can remember of is tearing apart of photo album cover at the age of 9. Today, I am 23. During this time, I have lived at least 5000 days and never ever has the sun not risen.

So, probability of rising of sun tomorrow for me is at least:
5001/5002 = 99.98%

## PDFs

I also wanted to see how PDFs vary with n. Intuitively speaking, with the increase in value of n, the density should be more and more concentrated around higher probability values (say 0.8–1.0).

Let’s see the PDFs for n in set {0, 1, 2, 3, 4}.

As expected, as the value of n increases, the density shifts towards higher values of probability.

## Strangers

When I know nothing about you, I am 50/50 on you. I do not really have an opinion about you. You might be friendly, you might be unfriendly. I might like you, I might not. You might like me, you might not. Everything is 50/50. To see this, let’s plug n=0 in our formula, it results (0+1)/(0+2) = 1/2.

## First Impression is the Last Impression

First meet is considered with high importance. First business deal is treasured. First goal in the football game is celebrated. First wicket in cricket created nervousness in the dressing room. First things tend to get importance. Why so?

Before your first meeting, the probability that someone likes you is 0.5. If in your first visit, someone liked you, the probability that someone likes you now becomes 0.667. The odds double if you win in the first visit. That is why first impression is crucial.

A tip for having a valentine in this Valentine’s day, singles! Happy Valentine’s week!

--

--

Data Scientist at Blue Cross and Blue Shield, MS CS from UAH — the views and the content here represent my own and not of my employers.