there are two states:
the car is where he
is: CWH
the car is not
where he is: CNWH
if at CWH, the next
state is CWH with probability p (since if it rains, he will drive the car and
the car will be with him in the next state), and the next state is CNWH with
probability 1-p (if it doesn't rain, he won't drive, so the car won't be with
him in the next state)
if at CNWH, the
next state is always CWH with probability 1 (whether it rains or not, he will
walk back to where the car is)
writing the input
probability flow equations for CWH, we get
input: CNWH*1 +
CWH*p
this should be
equal to the state probability CWH
CWH = CNWH + p * CWH
we also know that
the sum of the probabilities of the two states is 1
CWH = 1- CWH + p*CWH
CWH (2-p) = 1
CWH = 1/(2-p)
on any given day,
he will walk in the rain if he doesn't have the car in the morning and it
rains, or if he has the car and it doesn't rain and he leaves the car at home,
but then on his way back home it rains
CNWH*p + CWH*(1-p)*p
=p * (CNWH + CWH -
p * CWH)
= p * (1 - p*CWH)
=p (1- p/(2-p))
=p- p^2 / (2-p)
=2p (1- p)/(2-p)