SIS , SIR stochastic models I am reading my textbook and I don't seem to understand some stuff. Here is what is written in the textbook:
Consider a population of $N$ people. There are $3$ different classifications of each person: 
$1)$ Susceptibles. $S_n$ denotes the number of susceptibles in the population at time $n$
$2)$ Infected. $I_n$ denotes number of infected in population at time $n$
$3)$ Recovered/Removed. $B_n$ denotes number of people recovered/removed at time $n$
Let $X_n=(S_n,I_n)$.
We will only consider a population that is closed, i.e no migration.
Assumptions:


*

*$N$ is fixed

*In between time steps $n$ and $n+1$, the probability the $i$-th susceptible avoids contact with any given infective is $P$ (independent of all others)

*Upon contact we assume that a susceptible becomes infected

*$\Bbb P($ $i$ th susceptible avoids the $I_n$ infectives at time $n$ $)= P^{I_n}$

*The infection period is distributed accordingly to some RV $T_I$

*$T_I \sim $Geom $(\lambda)$ $\Rightarrow \Bbb P(T_I =1)=\lambda$ .($(T_I=1)$ Basically denotes the time to recover.)
We have 2 basic models: SIS and SIR model
SIS MODEL
In this model, the individual is either infective or susceptible.
$S_{n+1}$ is the number of susceptibles at time $n+1$ in population
$S_{n+1}=$ Bin$(S_n,P^{I_n})$ $+$ Bin$(I_n, \lambda)$
Where:


*

*$A_{n+1}=$ Bin$(S_n,P^{I_n})$ is the number of susceptibles at time $n$ who avoid infection in the next time step

*$R_{n+1}=$Bin$(I_n, \lambda)$ is the number of infectives from time $n$ who recover over the next time step


Now, since we're in a closed population and no removed category ($B_n$) $\Rightarrow I_{n+1}=N- S_{n+1}$
The transition probabilities which define the $P$-matrix are :
$$\Bbb P(S_{n+1} = v | S_n=w)= \Bbb(A_{n+1} + R_{n+1}=v | S_n = w)=$$ $$ \sum^w_{k=0} \Bbb P(A_{n+1} =k | S_n =w) \Bbb P(R_{n=1} =v-k | S_n = w)= $$ $$\sum^w_{k=1} {w \choose k} \Bigl(1-P^{N-w}\Bigr)^{w-k}\Bigl(P^{N-w}\Bigr)^k {n-w \choose v-w} \lambda^{v-k}(1- \lambda)^{N-w+k} \tag{1}$$ 

Could somebody please explain me how do they get $(1)$. I am completely lost. If every term could be explained, that would help a lot.

Now we continue to the second model
SIR MODEL
Now we have 3 states for an individual: Susceptible, Infected, removed/recovered
$X_n=(S_n, I_n)$ . Note : $B_n= N-S_n-I_n$
$S_n=$ Bin$(S_n, P^{I_n})$
$I_{n+1}=$ Bin$(I_n, 1- \lambda)+(S_n-S_{n-1})$
Where:


*

*Bin$(I_n, 1- \lambda)$ is the number of infectives still infected from time $n$

*$(S_n-S_{n-1})$ is the number of newly infected individuals from time $n$
The transition probabilities which define the $P$-matrix are :
$$\Bbb P(X_{n=1}= (v,x) | X_n = (w,y))=$$
$$\Bbb P(S_{n+1}= v , I_{n+1} =x | S_n = w , I_n=y)=$$
$$\Bbb P(S_{n=1} =v | X_n =(w,y)) \Bbb P( I_{n=1} =x | X_n=(w,y))=$$
$$ {w \choose v} \Bigl(P^y\Bigr)^v \Bigl(1-p^y\Bigr)^{w-v} x {y \choose x-(w-v)} \Bigl(1- \lambda \Bigr)^{x-(w-v)}\lambda^{y-x+(w-v)} \mathbb 1_{\{w \geq v \}} \Bbb 1_{\{y \geq x-(w-v)\}} \tag{2}$$

Could somebody please explain me how do they get $(2)$. I am completely lost. If every term could be explained, that would help a lot.

 A: 
The random variable $\text{Bin}(m,p)$ can be thought of as the number
  of heads obtained after $m$ flips of a biased coin which has a
  probability $p$ of coming up heads on any given coin flip. So it
  satisfies the formula
  $$\mathbb{P}\left(\text{Bin}(m,p)=k\right)=\binom{m}{k}p^k(1-p)^{m-k}$$

Some people adopt the convention that $\binom{m}{k}=0$ when $k<0$. Others will instead write the binomial coefficient as $1_{k\geq 0}\binom{m}{k}$, hence the indicator functions in (2).
SIS model
DWe1 has already explained this in the comments, but just for completeness:
You know that 
$A_{n+1}=\text{Bin}\left(S_n,P^{I_n}\right)$ and hence that $\mathbb{P}\left(A_{n+1}=k\right)=\binom{S_n}{k}P^{I_nk}(1-P^{I_n})^{S_n-k}$.
Likewise, $R_{n+1}=\text{Bin}(I_n,\lambda)$ and so $\mathbb{P}\left(R_{n+1}=v-k\right)=\binom{I_n}{v-k}\lambda^{v-k}(1-\lambda)^{I_n-v-k}$.
Now substitute $S_n=w, I_n=N-S_n$ to deduce (1).
SIR model
The technique for the SIR model is exactly the same as for the SIS model.
For instance, $\mathbb{P}(S_{n+1}=v)=\binom{S_n}{v}P^{I_nv}(1-P^{I_n})^{S_n-v}$ and this time we can use the substitutions $S_n=w,I_n=y$.
