\documentclass[12pt,
               a4paper,
               article,
               oneside,
               oldfontcommands,
               UKenglish]{memoir}


\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[scaled]{beramono}
\usepackage[final]{microtype}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[nodayofweek]{datetime}
\usepackage{listings}
\lstset{basicstyle = \ttfamily}
\usepackage{textcomp}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage[colorlinks, allcolors = uiolink]{hyperref}


\renewcommand*{\chaptitlefont}{\Large\bfseries\sffamily\raggedright}
\setsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsubsecheadstyle{\normalsize\bfseries\sffamily\raggedright}
\setparaheadstyle{\normalsize\bfseries\sffamily\raggedright}
\setsubparaheadstyle{\normalsize\bfseries\sffamily\raggedright}
\setbeforesubsubsecskip{2ex}
\setaftersubsubsecskip{1ex}


\pretolerance = 2000
\tolerance    = 6000
\hbadness     = 6000


\renewcommand{\sfdefault}{phv}
\definecolor{uiolink}{HTML}{0B5A9D}


\declaretheorem[style = definition]{problem}
\declaretheorem[style = definition, sibling = problem]{exercise}

\def\bm#1{\mbox{\boldmath $#1$}}


\begin{document}


\begin{titlingpage}
    \vspace*{-8em}
    \setlength{\parskip}{1.5ex plus 0.5ex minus 0.2ex}
    \setlength{\parindent}{0pt}

    \begin{flushright}
        \small\today
    \end{flushright}

    \begin{center}
        \vspace{2em}
        {
            \bfseries\sffamily\huge
            STK2130
            %% Alternatively:
            %% COURSEXXXX \textthreequartersemdash\ COURSE NAME
        }
        \vskip0.2ex
        \Large
        Mandatory assignment 1 of 1
        \vskip1ex
    \end{center}

    \subsubsection*{Submission deadline}
    Thursday 15\textsuperscript{nd} April \the\year, 14:30 in Canvas
    (\href{https://canvas.uio.no}{\underline{canvas.uio.no}}).

    \subsubsection*{Instructions}
    You can choose between scanning handwritten notes or typing the solution directly on a computer (for instance with \LaTeX).
    The assignment must be submitted as a single PDF file.
    Scanned pages must be clearly legible.
    The submission must contain your name, course and assignment number.

    It is expected that you give a clear presentation with all necessary explanations.
    Remember to include all relevant plots and figures.
    Students who fail the assignment, but have made a genuine effort at solving the exercises, are given a second attempt at revising their answers.
    All aids, including collaboration, are allowed, but the submission must be written by you and reflect your understanding of the subject.
    If we doubt that you have understood the content you have handed in, we may request that you give an oral account.

    In exercises where you are asked to write a computer program, you need to hand in the code along with the rest of the assignment.
    It is important that the submitted program contains a trial run, so that it is easy to see the result of the code.

    \subsubsection*{Application for postponed delivery}
    If you need to apply for a postponement of the submission deadline due to illness or other reasons, you have to contact the Student Administration at the Department of Mathematics (e-mail: \href{mailto:studieinfo@math.uio.no}{studieinfo@math.uio.no}) well before the deadline.

    All mandatory assignments in this course must be approved in the same semester, before you are allowed to take the final examination.

    \subsubsection*{Complete guidelines about delivery of mandatory assignments:}
    \unskip
    \begin{center}
        \unskip
        \href{http://www.uio.no/english/studies/admin/compulsory-activities/mn-math-mandatory.html}
        {
            \resizebox{\textwidth}{!}
            {\underline{uio.no/english/studies/admin/compulsory-activities/mn-math-mandatory.html}}
        }
        \vspace{1ex}
        \vfill
        GOOD LUCK!
    \end{center}
\end{titlingpage}


\noindent

%% Correct typesetting of percentages: \SI{60}{\percent}

\begin{problem}
A Markov chain $X_0, X_1, X_2, \ldots$ with state space $\mathcal{S} = \{0, 1, 2, 3, 4\}$ is defined by the transition matrix:
$$
\bm{P} = \left[\begin{array}{ccccc}
\tfrac{1}{5} & \tfrac{1}{5} & \tfrac{1}{5} & \tfrac{1}{5} & \tfrac{1}{5} \\[2mm]
\tfrac{2}{5} & \tfrac{1}{5} & 0 & \tfrac{1}{5} & \tfrac{1}{5} \\[2mm]
0 & 0 & \tfrac{1}{2} & \tfrac{1}{2} & 0 \\[2mm]
0 & 0 & \tfrac{1}{2} & \tfrac{1}{2} & 0 \\[2mm]
0 & 0 & 0 & 0 & 1
\end{array}\right]
$$

\begin{description}
\item
a) \,\, The chain has three classes, $\mathcal{C}_0 = \{0,1\}$, $\mathcal{C}_1 = \{2,3\}$,  $\mathcal{C}_2 = \{4\}$. For each of these classes discuss whether the class is \emph{transient} or \emph{recurrent}.
\end{description}

\medskip

\noindent Let $T$ be the time until the chain enters $\mathcal{C}_1$ or $\mathcal{C}_2$, and define:
\begin{align*}
\mu_i = E[T | X_0 = i], \quad \mbox{for $i \in \mathcal{C}_0$}.
\end{align*}

\begin{description}
\item
b) \,\, Explain why:
\begin{align}
\label{eq:mu0}
\mu_0 &= (\mu_0 + 1) \tfrac{1}{5} + (\mu_1 + 1) \tfrac{1}{5} + \tfrac{3}{5} \\[2mm]
\label{eq:mu1}
\mu_1 &= (\mu_0 + 1) \tfrac{2}{5} + (\mu_1 + 1) \tfrac{1}{5} + \tfrac{2}{5}
\end{align}
Solve the equations \eqref{eq:mu0} and \eqref{eq:mu1} to obtain $\mu_0$ and $\mu_1$.
\end{description}

\medskip

\noindent Let $q_i$ be the probability that the chain ends up in state $4$ given that $X_0 = i$, $i \in \mathcal{C}_0$.

\begin{description}
\item
c) \,\, Find and explain equations for obtaining $q_0$ and $q_1$, and solve these equations.
\end{description}

\medskip

\noindent Let $s_{i,j}$ denote the expected number of visits to state $j$ given that $X_0 = i$, $i,j \in \mathcal{C}_0$.

\begin{description}
\item
d) \,\, Find and explain equations for obtaining $s_{0,0}, s_{0,1}, s_{1,0}, s_{1,1}$, and solve these equations.
\end{description}

\end{problem}

\newpage

\begin{problem}
Markov chains are used in numerous situations in real life. In physics, queueing theory, Internet, statistics, economy, social sciences, etc. In this exercise we will try to illustrate how one may use Markov chains in sociology. This exercise is inspired by the work of three economists "D. Acemoglu, G. Egorov, K. Sonin, \emph{Political model of social evolution}. Proceedings of the National Academy of Sciences 108: 21292–21296. (2011)" (You do not need to look at this article).

The authors propose a model using Markov processes for describing the dynamics of political and social changes in a society. We will illustrate in a very simple example how this can be done.

\bigskip

Consider a society or population. We assume that this society lives in a political regime among the following three: $\Omega = \{\mbox{Dictatorship}, \mbox{ Elections}, \mbox{ Democracy}\}$ which we code as $\mathcal{S} = \{0, 1, 2\}$, where $0 =$ Dictatorship, $1 =$ Elections and $2 =$ Democracy. This society behaves as follows: While in a dictatorship the probability that a revolution breaks out is $\alpha$ in such a case this society calls for elections to decide. Then democracy is established if there is a majority (more than \SI{50}{\percent} in favour). The probability that the inhabitants vote NO is $\beta$. While in democracy, the probability that a \emph{coup d'\'etat} breaks out will be denoted by $\gamma$, being $\gamma$ a small number hopefully. Once the society has reached democracy it will preferably stay there. In the following we assume that $0 < \alpha, \beta, \gamma < 1$.

\begin{description}
\item
a) \,\, Explain why the political status of this society can be modelled by using a Markov chain. Plot a diagram to help yourself.
\end{description}

\medskip

\begin{description}
\item
b) \,\, Explain why the transition probability matrix of such a process is:
\begin{align*}
\bm{P} = \left[\begin{array}{ccc}
1 - \alpha & \alpha & 0 \\[2mm]
\beta & 0 & 1 - \beta \\[2mm]
\gamma & 0 & 1 - \gamma
\end{array}\right]
\end{align*}
and comment on the different states. Is this process ergodic? Remember that in a finite-state Markov chain all recurrent states are positive recurrent.
\end{description}

\medskip

\begin{description}
\item
c) \,\, Given that there is a current dictatorship, what is the probability that there is democracy after three periods?
\end{description}

\medskip

\begin{description}
\item
d) \,\, Explain why the process is irreducible and aperiodic. Show that the stationary distribution is:
\begin{align*}
\pi_0 &= \frac{\gamma}{\gamma (\alpha + 1) + \alpha(1-\beta)}, \\[2mm]
\pi_1 &= \frac{\alpha \gamma}{\gamma (\alpha + 1) + \alpha(1-\beta)}, \\[2mm]
\pi_2 &= \frac{\alpha (1- \beta)}{\gamma (\alpha + 1) + \alpha(1-\beta)}
\end{align*}
Is this solution unique? Why?
\end{description}

\medskip

\begin{description}
\item
e) \,\, We say that a society is \emph{obedient} if it tends to accept a dictatorial regime, that is, the probability of a revolution, $\alpha$, converges towards 0. On the other hand, we say that a society is \emph{revolutionary} if the probability of a revolution converges towards 1 and the probability of obtaining democracy in the elections, $1-\beta$, converges towards 1.

\medskip

Compute the stationary distributions for both an obedient and revolutionary society and comment on that.
\end{description}

\medskip

\begin{description}
\item
f) \,\, Assume that there is democracy, however, there is a conspiracy in the air. The military is preparing a coup d’\'etat but they still do not know who will take the command. So $\gamma$ is uncertain. The uncertainty is quantified by the following probability density:
\begin{align*}
f_{\gamma} = 3(1-x)^2, \quad 0 \leq x \leq 1.
\end{align*}
Compute the probability that the coup d’\'etat will \emph{not} take place within the next $n$ periods.
\end{description}


\end{problem}


\end{document}