Consider an endemic infection in a population of approximately 10^7 individuals. An individual in the population may be susceptible to infection, infected, or recovered. It is estimated that a susceptible individual on a given day may contract the infection the following day in 0.5% of cases. After an individual contracts the infection, in 20% of cases they recover the following day. A recovered individual is partially immunized, and in 0.1% of cases, they lose immunity the following day. Knowing that on a given day there are approximately 1000 infected individuals, the aim is to study the evolution of the infection in the population.

a) Model the problem using Markov chains.

b) Calculate the long-term average number of infected individuals in the population.