If we are given a random graph G, where edges are made with probability $ \frac{1}{2}$.
A) What's the probability that $2$ different vertices have a path of length 2 between them.
B) What is the expected value of the number of paths of length 2 in the graph.
For A, would it simply be $ (\frac{1}{2})^2$ ?
For B, I know that there are (n-2) ways to choose a third vertex and that the probability of all three being connected is $ \frac{1}{2}^2$ but I am stuck.
You need to count the possible two-edged paths between two particular vertices (ie: how many other vertices are there in the graph) and determine the probability that at least one among these paths is made.
You need to count the number of pairs, determine the expected count of length-2 paths between each pair, and then apply the linearity of expectation.