A random graph

A graph is constructed iteratively according to the following algorithm. The graph starts as a single vertex. With probability p p , the graph stops here. Otherwise, 3 new vertices are constructed and joined to this vertex. If we have a graph with more than one vertex, for each vertex created at the previous stage, 3 new vertices are construed and joined to it with probability 1 p . 1 - p. We repeat this process until no new vertices are added. When the expected number of vertices in this graph is 100 , 100, the value of p p can be expressed as a b \frac{a}{b} where a a and b b are coprime positive integers. What is the value of a + b ? a + b?


The answer is 167.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

10 solutions

Qizhen Lim
May 20, 2014

First, we want to compute the expected number of increment of vertices for the n n th iteration.

For example, for the 1st iteration (i.e growth from 1 -> 3 vertices), the expected number of vertices increment is 3 × ( 1 p ) 3 \times (1-p) .

For the second iteration, the expected number of vertices increment is ( 3 × ( 1 p ) ) 2 (3 \times (1-p))^2 . This continues on, and so for the n n th iteration, the we have the expected number of vertices increment to be ( 3 × ( 1 p ) ) n (3 \times (1-p))^n .

Therefore, let X X be the total number of vertices increment, and X 1 , X 2 , , X n X_1, X_2,\ldots,X_n denote the vertices increment in the n n th iteration. We know that the expected number of vertices is 100, so:

100 100

= 1 + E ( X ) = 1 + E(X)

= 1 + E ( X 1 ) + E ( X 2 ) + + E ( X n ) + = 1 + E(X_1)+E(X_2)+\cdots+E(X_n) + \cdots

= 1 + 3 × ( 1 p ) 1 3 × ( 1 p ) = 1+ \frac{3 \times (1-p)}{1-3 \times (1-p)} .

The last step was through application for the infinite sum of a geometric progression, because E ( X 1 ) + E ( X 2 ) + + E ( X n ) + E(X_1)+E(X_2)+\cdots+E(X_n) + \cdots is a geometric series sum with first term = 3 × ( 1 p ) 3 \times (1-p) and common ratio = 3 × ( 1 p ) 3 \times (1-p) .

Solving for p p , we get p = 67 100 p = \frac{67}{100} .

Therefore a + b = 167 a+b = 167 .

Many students misinterpreted the question, yet still got the correct answer. Notice that in the question, each vertex gets 3 neighbours or not, independent of whether the other vertices do. Many students approached this question as if the graph grew in complete layers. Due to the parameters of the question, and the nature of expectation, the answer works out to be the same, so many students were able to get the correct answer while doing the wrong question.

Calvin Lin Staff - 7 years ago
Daisuke Kondo
May 20, 2014

Assuming the start time is 0 , and the algorithm processes 1 step by time 1 passes.

On time t t , the graph has a possibility to constructs 3 t 3^t new vertices.

The birth probability of each vertex is ( 1 p ) t (1-p)^t .

So

E x p = t = 0 3 t ( 1 p ) t = 1 1 3 ( 1 p ) Exp = \displaystyle \sum_{t=0}^\infty 3^t * (1-p)^t = \frac {1}{1 - 3(1-p)} (when p > 2 3 p > \frac{2}{3} .)

Now E x p = 100 Exp = 100 . Then We get p = 67 100 p = \frac{67}{100} .

Giving the answer of a + b = 167 a+b=167 .

Jimmy Kariznov
May 20, 2014

Let V V be the number of vertices in the graph.

There is a p p probability that the graph stops with 1 1 vertex.

There is a 1 p 1-p probability that the graph has the original 1 1 vertex and three "branches" with V 1 , V 2 , V 3 V_1,V_2,V_3 vertices.

Therefore, E [ V ] = p 1 + ( 1 p ) ( 1 + E [ V 1 + V 2 + V 3 ] ) E[V] = p \cdot 1 + (1-p) \cdot (1+E[V_1+V_2+V_3]) = 1 + ( 1 p ) ( E [ V 1 ] + E [ V 2 ] + E [ V 3 ] ) = 1 + (1-p)(E[V_1]+E[V_2]+E[V_3]) .

The process to generate each of the 3 branches is identical to the process to generate the overall graph. Thus, E [ V 1 ] = E [ V 2 ] = E [ V 3 ] = E [ V ] = 100 E[V_1] = E[V_2] = E[V_3] = E[V] = 100 .

Thus, the equation becomes: 100 = 1 + ( 1 p ) 300 100 = 1 + (1-p) \cdot 300 .

Solving yields p = 67 100 = a b p = \dfrac{67}{100} = \dfrac{a}{b} . Since gcd ( 67 , 100 ) = 1 \gcd(67,100) = 1 it follows that a = 67 a = 67 , b = 100 b = 100 , and a + b = 167 a+b = 167 .

Let E ( p ) E(p) be the expected number of vertices of the graph for probability p.

At the first step, a vertex is always created. With probability p, we stop there. If not, we are essentially initiating three versions of our original problem since vertices are added or not to existing vertices independently. Using linearity of expectation, we obtain E ( p ) = 1 + 3 ( 1 p ) E ( p ) E(p)=1+3(1-p)E(p)

This has the solution E ( p ) = 1 3 p 2 E(p)=\frac{1}{3p-2} . Setting E ( p ) = 100 E(p)=100 gives us p = 67 100 p=\frac{67}{100} .

Now, we need to make sure that this answer is really meaningful. For example, if p p were zero, E ( p ) E(p) is really infinite since the procedure never stops, but our foumula would give us E ( p ) = 1 2 E(p)=-\frac{1}{2} which is meaningless.

Thus we need to show that the procedure is expected to terminate for p = 67 100 p=\frac{67}{100} . Assume that the number of newly created vertices at a given stage is N N . Then the expected number of newly created vertices at the next stage is 3 N ( 1 p ) 3N(1-p) . For the procedure to be expected to terminate, we need 3 N ( 1 p ) N 3N(1-p)\le N . That is, p 2 3 p\ge \frac{2}{3} . Since 67 100 2 3 \frac{67}{100}\ge\frac{2}{3} , we are done.

Akanksha Jain
May 20, 2014

Expected number of new Nodes = E

E = p * 0 + (1-p) * (3 + 3 E); aw with 1-p probability we have 3 nodes and each will have E as its expected new nodes.

E = 99( given total node = 100, so expected number of new nodes = 99)

99* ( 3p -2) = 3 - 3p

p = 201/300 = 67/100

a = 67, b =100 ; a+b = 167

Expected number of vertices in graph = 1+(1-p) 3+(1-p)^2 *3^2+...... This forms a GP with r=(1-p) 3, It is given that Expected number of vertices in graph is 100. So , 100= 1+(1-p) 3+(1-p)^2 *3^2+...... 100=1+ (1-p) 3/(1-(1-p) 3) . 3-3 p=99-297(1-p) . 3-3 p=99-297+297 p . 300-99=300*p . p=201/300=67/100=a/b . a+b=67+100=167

Douglas Zare
May 20, 2014

The expected number of vertices e ( p ) e(p) satisfies

e ( p ) = p ( 1 ) + ( 1 p ) ( 1 + 3 e ( p ) ) e(p) = p(1) + (1-p)(1 + 3 e(p)) .

Setting e ( p ) = 100 e(p) = 100 , and solving for p p ,. we get p = 67 / 100 p = 67/100 .

Calvin Lin Staff
May 13, 2014

Let E E be the expected number of vertices in the graph. With probability p p , the graph has 1 vertex, and with probability 1 p 1-p , we have the initial vertex and repeat this process on 3 more vertices, so the expected number of vertices will be 1 + 3 E . 1 + 3E. This gives the relation

E = p + ( 1 p ) ( 1 + 3 E ) E = p + 1 p + 3 E ( 1 p ) E = 1 + 3 E 3 E p 1 + 2 E = 3 E p p = 1 + 2 E 3 E \ \begin{aligned} E & = p + (1-p)(1 + 3E)\\ E & = p + 1 - p + 3E(1-p)\\ E & = 1 + 3E - 3Ep\\ 1 + 2E & = 3Ep\\ p & = \frac{1+2E}{3E}\ \end{aligned}

When E = 100 E = 100 , we get p = 67 100 p = \frac{67}{100} , so a + b = 67 + 100 = 167. a + b = 67 + 100 = 167.

Michael Tong
May 20, 2014

For the simplicity of calculation, let m = 1 p m = 1 - p , i.e. let m m be the probability that more vertices are constructed and let 1 m 1 - m be the probability that no more vertices are constructed. From inspection, it becomes clear that if no additional vertices are constructed then there are 3 0 = 1 3^0 = 1 vertices; if additional vertices are constructed once then there are 3 0 + 3 1 = 4 3^0 + 3^1 = 4 vertices; and, generally, if additional vertices are constructed n n times then there are i = 0 n 3 i \displaystyle \sum_{i=0}^{n} 3^i vertices.

Next, we must apply the probability of obtaining each outcome, multiply it by the outcome's respective number of vertices, and add everything together to find what value of m m will make the expected value be 100 100 . So, the expected value is 1 ( 1 m ) + 4 ( m ) ( 1 m ) + 13 ( m 2 ) ( 1 m ) + 40 ( m 3 ) ( 1 m ) + . . . 1(1 - m) + 4(m)(1 - m) + 13(m^2)(1-m) + 40(m^3)(1-m) + ... , which equals 100 100

This series is geometric. By expanding each term, we come to the following: 1 + 3 m + 9 m 2 + 27 m 3 + . . . 1 + 3m + 9m^2 + 27m^3 + ... , an infinite geometric series with r = 3 m r = 3m and t 1 = 1 t_1 = 1

> Since the k t h kth term is i = 1 k 3 i 1 ( m i 1 m i ) \displaystyle \sum_{i=1}^{k} 3^{i-1} * (m^{i-1} - m^i) and the k + 1 t h k + 1th term is i = 1 k + 1 3 i 1 ( m i 1 m i ) \displaystyle \sum_{i=1}^{k+1} 3^{i-1} * (m^{i-1} - m^{i}) , the second part of the k t h kth term added to the first part of the k + 1 t h k + 1th term will always result in 3 k m k 3^{k} m^{k} . Therefore, the series is telescopic and the trend continues.

Using the formula for the sum of convergent geometric series, we come to 1 1 3 m = 100 m = 33 100 p = 67 100 a + b = 167 \frac {1}{1 - 3m} = 100 \rightarrow m = \frac {33}{100} \rightarrow p = \frac {67}{100} \Rightarrow a + b = 167

Could be that only some branches extend, not all.

Calvin Lin Staff - 7 years ago
Derk Pik
May 20, 2014

Let X X be the number of vertices of the graph. At the 0-th stage of the process we have just one vertex. The probability that the process stops there, is given by P ( X = 1 ) = p . P(X = 1) = p. Each time, new edges grow at all the vertices created at the previous stage with probability ( 1 p ) (1-p) . Hence the process will stop at the k-th stage with probability p ( 1 p ) k p(1-p)^k . At this stage we have 1 + 3 + 3 2 + + 3 k = 3 k + 1 1 3 1 = 1 2 ( 3 k + 1 1 ) 1 + 3 + 3^2 + … + 3^k = \frac{3^{k+1}-1}{3-1} = \frac12 \left(3^{k+1} -1\right) vertices. Thus: P ( X = 1 2 ( 3 k + 1 1 ) ) = p ( 1 p ) k . P(X = \frac12(3^{k+1} -1)) = p (1-p)^k. The expected number of vertices is E X = Σ k = 0 1 2 ( 3 k + 1 1 ) p ( 1 p ) k EX = \Sigma_{k = 0}^\infty \frac12 \left(3^{k+1} - 1\right) p (1-p)^k = 1 2 p ( Σ k = 0 3 k + 1 ( 1 p ) k Σ k = 0 ( 1 p ) k ) = \frac12 p \left( \Sigma_{k = 0}^\infty 3^{k+1} (1-p)^k - \Sigma_{k = 0}^\infty (1-p)^k \right) = 1 2 p ( 3 Σ k = 0 ( 3 ( 1 p ) ) k 1 p ) = \frac12 p \left(3 \cdot \Sigma_{k = 0}^\infty \left(3 (1-p)\right)^k - \frac1{p} \right) = 3 p 2 ( 3 p 2 ) 1 2 = 1 3 p 2 . = \frac{3p}{2(3p-2)} - \frac12 = \frac1{3p-2}. The expected number of vertices is 100. We have to solve 1 3 p 2 = 100. \frac1{3p-2} = 100. We thus obtain p = 67 / 100 p = 67/100 .

It can be that only some branches grow, need not be all.

Calvin Lin Staff - 7 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...