diff --git a/book/book.tex b/book/book.tex index 7465269e..4f73ca95 100644 --- a/book/book.tex +++ b/book/book.tex @@ -1649,7 +1649,7 @@ \section{Probability of connectivity} def prob_connected(n, p, iters=100): tf = [is_connected(make_random_graph(n, p)) for i in range(iters)] - return np.mean(bool) + return np.mean(tf) \end{code} The parameters \py{n} and \py{p} are passed along to \py{make_random_graph}; @@ -2135,7 +2135,7 @@ \section{WS graphs} consider the edges in a particular order and rewire each one with probability $p$. If an edge is rewired, they leave the first node unchanged and choose the second node at random. They don't allow self -loops or multiple edges; that is, you can't have a edge from a node to +loops or multiple edges; that is, you can't have an edge from a node to itself, and you can't have more than one edge between the same two nodes.