Expected value of the number of steps in a walk around the rectangle. We have a rectangle $ABCD$.
The walk starts at $A$. Let $X$ be the time required  to visit all the vertexes. (We independently go to the adjacent vertex with probability 1/2). 
Calculate $EX$. 
Some of the calculation I made 
$$E|X|=EX=\int_0^\infty P(X>t)dt=\int_0^\infty 1-P(X<=t)dt$$ 
but I have literally hardly any idea on how to calculate $P(X<=t)$. This excercise is ahead of my program at the uni yet, but I would like to know how to compute it.
 A: The system can be in one of $5$ states.
State $1:$ we have visited one vertex
State $2:$ we have visited two adjacent vertices
State $3:$ we have visited three vertices and we are at one of the vertices on the ends.
State $4:$ we have visited three vertices and we are at the middle vertex
State $5$: we have visited all vertices
Let $E(i)$ be the expected number of steps remaining to visit all vertices if we are presently in state $i,$ for $i=1,2,3,4,5.$  We start having visited one vertex, so we want to compute E(1).  We have $$
\begin{align}
E(1)&=1+E(2)\\
E(2)&=1+\frac12E(2)+\frac12E(3)\\
E(3)&=1+\frac12E(4)+\frac12E(5)\\
E(4)&=1+E(3)\\
E(5)&=0
\end{align}$$ 
Solve the system; $E(1)$ is the answer.  If we don't say that vertex A has been visited at the start, but only count a transition to a vertex as a visit to that vertex, then the answer is $1+E(1).$
A: A standard result worth remembering about the symmetric random walk to the nearest neighbours on the integer line, is that the mean number of steps needed to reach $i$ or $j>i$ starting from some $k$ between $i$ and $j$, is $(j-k)(k-i)$. 
In particular, the mean number of steps needed to reach $0$ or $n+1$ starting from $1$ is $n$.
To apply this to your problem, consider $t_k$ the mean number of steps needed to visit $k$ vertices, then $t_1=0$, $t_2-t_1=1$ (both obvious), and, more interestingly, $t_3-t_2=2$ and $t_4-t_3=3$. Thus, the mean number of steps needed to visit at least once every vertex of the rectangle is $$t_4=3+2+1=6$$
