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?

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).
