Probability of seeing sun rise tomorrow using Bayes theorem When Richard Price's published the Bayes theorem, he gave the example of a man seeing the sun-rise for the first time and wondering if it happened everyday. With each observation thereafter, he updates his belief (i.e. the sun does rise everyday) using Bayesian reasoning. This question tries to analyze the same problem.

It is a stormy night and an alien prisoner is abandoned on the frigid earth during the first ice age. Scared, he finds a cave and only comes out for a few hours at night to find some food. He has no luck though. After spending 6 nights like this, hunger becomes unbearable and so on the 7th night he decides to venture out for a little longer. After a few hours, he sees the skies changing colors. The only time he saw them change color before was during  thunderstorm lightning on the night he was dropped. This time, however, he witnesses a glorious sunrise. He came from the dark side of a tidally-locked planet (i.e.  one side always faces its star and the other  side is forever dark). On his planet, days are not tied to the sun, but time (24 hours is measured as a day). As the warmth soothes him, he wonders if this is an one off event on earth or if the sun will rise again tomorrow. How can he use Bayes theorem to update his beliefs?

Bayes Theorem
Total number of nights observed            = 7
Total number of times sky changed colors   = 2 (once due to lightning and once due to sunrise)
Total number of times the sunrise happened = 1

P(belief | observation) = P(observation | belief) x P(belief) / P(observation)

P(Belief)      = The sun will rise tomorrow
P(Observation) = Sky changed colors
P(Sun will rise | Sky changed color) = P (Sky changed color | Sun will rise) * P (Sun will rise) / P(Sky changed color)

Day 2
P(Sun will rise | Sky changed color) = (1/2) * (1/7) / (2/7)
                                 = 0.25

Day 3
P(Sun will rise | Sky changed color) = (2/3) * 0.25 / (3/8)
                                 = 0.44

Day 4
P(Sun will rise | Sky changed color) = (3/4) * 0.44 / (4/9)
                                 = 0.74

Day 5
P(Sun will rise | Sky changed color) = (4/5) * 0.74 / (5/10)
                                 = 1.184

Why does the posterior probability go beyond 1? What am I doing wrong here?
 A: This is an extended comment rather than an answer. I don't think I understand your intention, but I'll show how I interpret the question as it's now written and how I would solve it. Maybe that will help you clarify what you're asking.
Let $A$ be the event "the sun rises", $A^c$ be "no sunrise", $B$ be "the sky changes color", and $B^c$ be "no change in color. The data observed for the first 7 days are the events (say the lightning happened on the third day)
$A^cB^c$, $A^cB^c$, $A^cB$, $A^cB^c$, $A^cB^c$, $A^cB^c$, $AB$
We now begin observing $AB$ every day, and want to find $P(A|B)$, the probability that the sun will rise given the sky changes color. I would use the definition of conditional probability, $P(A|B) = P(A,B)/P(B)$.
When we wake up on Day 8, we have 7 days of previous data and we calculate
$P(A|B) = P(A,B)/P(B) = (1/7)/(2/7) = 1/2$
On Day 9 we add the value $AB$ to the previous data
$P(A|B) = P(A,B)/P(B) = (2/8)/(3/8) = 2/3$
Day 10
$P(A|B) = P(A,B)/P(B) = (3/9)/(4/9) = 3/4$
Etc. These values converge to 1, as expected.
We could also use $P(A|B) = P(B|A)P(A)/P(B)$. Notably, in this example $P(B|A) = 1$
Day 8
$P(A|B) = P(B|A)P(A)/P(B) = \frac{(1/1)(1/7)}{(2/7)} = 1/2$
Day 9
$P(A|B) = P(B|A)P(A)/P(B) = \frac{(2/2)(2/8)}{(3/8)} = 2/3$
Day 10
$P(A|B) = P(B|A)P(A)/P(B) = \frac{(3/3)(3/9)}{(4/9)} = 3/4$

I will also remark that in your "Day 2" calculation, you use P(Sky changes color | Sun will rise) = 1/2, which is incorrect. I don't follow your calculations for Day 3 and beyond.

Further example showing updating with new independent information, similar to this youtube video from comments. Let $C$ be the event "the moon is visible", and assume that $C$ is appropriately independent of $B$ and independent of $B$ given $A$.
As the alien is exploring on the 9th day he finds a record from a previous traveler that says "The moon was visible on only 20% of the days when the sun rose" and "the moon is visible 40% of the time". That is, $P(C|A) = 0.2$, $P(C) = 0.4$. When the alien wakes up on the 10th day he observes the sky changing color, that is, he observes $B$. He calculates the probability of seeing the sun rise later that day as $3/4$ as above. Then he notices that he can see the moon, which he wasn't paying attention to before. He decides to use the traveler's information to update his belief. His prior probability of the sun rising (given he has already seen $B$) was 0.75.
$$
P(A|C) \approx P(C|A)P(A)/P(C) = \frac{0.2 * 0.75}{0.4} = 0.375
$$
This calculation was not really correct. What we were trying to calculate was $P(A|B,C)$, the probability of a sunrise given we've seen the sky change color and have seen the moon. Depending on exactly what independence assumptions between $B$ and $C$ are available the calculation we performed may be reasonable or may not be.
If we actually calculate $P(A|C)$, that would be assuming that we can see the moon but have not seen whether the sky changes color yet. On day 10 we've observed the sun rise 3 out of 9 times, so $P(A) = 3/9$. Doing that calculation gives
$$
P(A|C) = P(C|A)P(A)/P(C) = \frac{0.2*(3/9)}{0.4} = 0.167
$$
Clearly stating exactly what you're calculating and assuming is necessary to get the correct value and communicate it correctly.
A: First, a simplification.  The event "the sky changes color" is actually irrelevant to this problem, since the individual is not concerned with whether or not the sky changes color, either as an outcome or as a conditioning event.  Consequently, we can ignore it; the data then becomes seven observations, assumed independent and identically distributed, with one of those observations being a sunrise and the other six not.  This will give us a $\mathrm{Binomial}(7,p)$ likelihood for the probability parameter $p$ at the end of the seven days.
We have to assume some prior distribution on $p$ at the start of the seven days.  Given the background of the individual, $p=0$ would be not unreasonable, but we will ignore this and select an arbitrary $\mathrm{Beta}(a,b)$ prior, with $a,b > 0$.  Since the prior is conjugate, the posterior, given a single day's observation $x \in \{0,1\}$ where $1$ represents sunrise and $0$ represents no sunrise, will be a $\mathrm{Beta}(a+x, b+1-x)$ distribution.
After day 1, the posterior will be a $\mathrm{Beta}(a,b+1)$ distribution.  This then becomes the prior for day 2.
After day 2, the posterior will be a $\mathrm{Beta}(a,b+2)$ distribution.   We have added one "failure" to the second parameter of the Beta prior, which has parameters $(a,b+1)$. This then becomes the prior for day 3.  Note that this is exactly the same posterior we would have had with our initial prior and two days of no sunrise added in one step instead of sequentially.
...
After day 7, the posterior will be a $\mathrm{Beta}(a+1,b+6)$ distribution.  We will have sequentially added six "failures" to $b$ and $1$ "success" to $a$.
Let us compare with the results of a one-step update of the original prior with all seven  days of information:
$$f'(p) \propto p^{a-1}(1-p)^{b-1} \times p^1(1-p)^6  = p^a(1-p)^{b+5}$$
which is a $\mathrm{Beta}(a+1, b+6)$ distribution, the same functional form and parameterization we see if we add the seven days of information one at a time.
A: Statistics has initially little to do with it when the alien is analysing the sunrise if this is a smart alien.
The theoretical analysis, and how well the alien is at it, will determine how the alien will model the situation and how the alien will perform a potential Bayesian analysis.
At the aliens planet the alien doesn't have days but a smart alien (one that understands Bayesian analysis) should, after experiencing day and night on earth, be able to deduce that this circular bright thing that rises into the air is the star which the planet is circling around. And after a single day the alien should know that there is only one single star in the system (unless the observation of the sun's trajectory is made difficult and the alien might belief or consider that there are more than one stars or that the orbit of the planet is unstable which might result in variable daily periods and uncertainty about the sunrise for the next "day").
This is not Bayesian or other statistical analysis but simple deduction and theoretical knowledge of physics that the alien will apply.
The alien could use a Bayesian analysis. After seeing a sunrise and day and night cycle you could test different hypotheses. But the problem with all potential hypotheses is that if they are not the hypothesis 'the planet is rotating around it's axis and has a daily cycle around 24 hours' then

*

*either the hypothesis does not explain the sunrise and P(sunrise | other theory) is zero

*or they do explain the sunrise but are extremely unlikely theories (e.g. the alien might believe that it is a dream or very weird space ship).

For such kind of hypotheses the alien won't be able to do a formal Bayesian analysis because the prior probabilities and the likelihood are not able to be determined with a reasonable accuracy.
However, since most of those probabilities are incredibly small the alien won't need to use a formal analysis. After seeing a sunrise and day and night cycle the alien will believe that the planet has a daily cycle and will strongly believe that there is a sunrise every 24 hours. The alien won't be able to express exactly the probability since the prior probabilities are not able to be expressed, but the alien will know that the posterior probability is very close to 100%.


Probability of seeing sun rise tomorrow using Bayes Theorem

Bayes theorem is used to describe probabilities of different hypotheses/theories.
The probability of events is not directly modeled with Bayes theorem, but given the posterior probability of the hypotheses/theories, you can compute a posterior prediction of new events.
You seem to be making a shortcut here and in your formula...

P(belief | observation) = P(observation | belief) x P(belief) / P(observation)

... you are filling in the observation 'sunrise' as the hypothesis/belief.

Why does the posterior probability go beyond 1? What am I doing wrong here?

The term P(observation) is filled in based on observational data, but it should be computed as
P(observation) = P(observation | belief)*P(belief) + P(observation | not belief)*P(not belief)
About the sun example in Price's and Bayes' work.
The problem statement is as following

Let us imagine to ourselves the case of a person just brought forth into this world, and left to collect from his observation of the order and course of events what powers and causes take place in it. The Sun would, probably, be the first object that would engage his attention; but after losing it the first night he
would be entirely ignorant whether he should ever see it again. He would therefore be in the condition of a person making a first experiment about an event entirely unknown to him. But let him see a second appearance or one return of the Sun, and an expectation would be raised in him of a second return, and he might know that there was an odds of 3 to 1 for some probability of this. This odds would increase, as before represented, with the number of returns to which he was witness. But no finite number of returns would be sufficient to produce absolute or physical certainty. For let it be supposed that he has seen it return at regular and stated intervals a million of times. The conclusions this would warrant would be such as follow. There would be the odds of the millioneth power of 2, to one, that it was likely that it would
return again at the end of the usual interval. There would be the probability expressed by 0-5352, that the odds for this was not greater than 1,600,000 to 1; and the probability expressed by 0-5105, that it was not less than 1,400,000 to 1.

The used model here is that the sun rises every 24 hours with some probability $p$ (as if it is a coin flip or other random event) and we ask ourselves what is $p$?
One solution to that specific setting is to use a 1,1 beta prior for the parameter $p$ (which is equal to a uniform distribution) and update the posterior based on the observations whether or not the sun rises a particular period of 24 hours.
Then the posterior is a 1,1+k beta distribution if we (and the history book) have observed $k$ days without the sun not rising. The average of this distribution is (k+1)/(k+2) making an estimate for the odds of a sunrise 1 to k+1.
See also https://en.m.wikipedia.org/wiki/Rule_of_succession

This example problem is a bit difficult. We need to imagine ourselves a person that is unaware of the mechanics of the sun and models this as if it is an object that has some probability to appear every day.
In the problem setting of this stackexchange question it is made even more difficult. We need to imagine an alien and how it would model the situation. Also it is unclear what we need to do with the information about the thunder and the sky changing colours and how to incorporate the data that no sunrise was seen. It becomes unclear what we are actually modelling, the probability that we see a sunrise (e.g. including the chance that we oversleep and remain in our cave an entire day without seeing the sun) or the probability that there is a sunrise?
It is not for nothing that Price and Bayes wrote the following a paragraph after their sun example

It should be carefully remembered that these deductions suppose a previous total ignorance of nature. After having observed for some time the course of events it would be found that the operations of nature are in general regular, and that the powers and laws which prevail in it are stable and permanent. The consideration of this will cause one or a few experiments often to produce a much stronger expectation of success in further experiments than would otherwise have been reasonable; just as the frequent observation that things of a sort are disposed together in any place would lead us to conclude, upon discovering there any object of a particular sort, that there are laid up with it many others of the same sort. It is obvious that this, so far from contradicting the foregoing deductions, is only one particular case to which they are to be applied.

These potential considerations make the problem statement unclear. The question could be better stated as 'probability of seeing a sun rise tomorrow by naively applying the law of succession'.
In reality, this is not how this problem will be tackled by the alien. The problem of a sunrise tomorrow is not to be based on previous observations of a sunrise,  because the model of a sunrise on a particular day as an independent Bernoulli trial is a wrong* model. The sun is not like the mailman who might have a day of being sick. If the sun doesn't rise tomorrow then it is because of some catastrophic event.
*Yes, all models are wrong. But this Bernoulli trial model for the sunrise is very unuseful (as far as we can describe 'usefulness' in this setting, another problem with this example).
