Reliability of a network 
Consider the communication network shown in the figure below and
  suppose that each link can fail with probability p. Assume that
  failures of different links are independent:



All links are independent. Find the probability that there exists a
  path from A to B along which no link has failed.

I used this graph for my solution:


Given that exactly one link in the network has failed, find the
  probability that there exists a path from A to B along which no link
  has failed.

And for this question, which is my headache, based on my last graph I built this new graph with the solution there indicated.


I've tried to find a book about reliability of networks for more theory and examples but I've had no luck, so I'm developing my solution intuitively but I need to know if I'm in the right path. Anyone can advise me?
 A: Let $W_i$ be the event that Link $i$ is working.  Then, there is a path
of working links from $A$ to $B$ if the event $(W_1W_2 \cup W_3W_4)W_5 = W_1W_2W_5 \cup W_3W_4W_5$ occurs.  This has probability
\begin{align}
P(W_1W_2W_5 \cup W_3W_4W_5) &= P(W_1W_2W_5) + P(W_3W_4W_5) - P(W_1W_2W_5 \cap W_3W_4W_5)\\
&= P(W_1W_2W_3) + P(W_3W_4W_5) - P(W_1W_2W_3W_4W_5)\\
&= (1-p)^3+(1-p)^3 - (1-p)^5.
\end{align}
The event that exactly one link has failed is the union of $5$ mutually
exclusive events of probability $p(1-p)^4$ each. Exactly one of these
$5$ events (when Link 5 has failed) results in there being no path of 
working links from
$A$ to $B$.  So the desired conditional probability is $\frac 45$.
A: Let Lx = Link x. Using the first graph you provided, the probability is:
Pr(L5 = 1)Pr((L1 = 1 & L2 = 1) | (L3 = 1 & L4 = 1))
Assuming a Berniulli graph with independent and identically distributed ties,
Pr(L5 = 1)(Pr(L1 = 1)Pr(L2 = 1) + Pr(L3 = 1)Pr(L4 = 1))
Assuming that Pr(Lx = 1) = $p$ for all x,
$(1-p)((1-p)^2+(1-p)^2)=2(1-p)^3$
The intuition is that Link 5 is on both of the paths from A to B, and so it must be activated for there to be any path. If it is activated, either the 1 to 2 or the 3 to 4 paths to Link 5 must be activated, which requires that both edges in the path be activated. It turns out that the probability is simply two times the joint probability that either path is activated because both paths are of the same length and link failure is iid. It is late and I am kind of drunk so someone check my math on this.
