Expectation = Summation(Output*Probability of Output)
→ Now for output 0 : Chose any node first, but for 2nd ,you have only 1 choice out of 8,that is the same node,so probability =(1/8)
→ Now for output 2 : Chose any node first, but for 2nd ,you have only 1 choice out of 8,that is the node beside it,so probability =(1/8)
→ Now for output 4 : Chose any node first, but for 2nd ,you have only 2 choices out of 8,which are the 2 nodes at distance 4 from it,so probability =(2/8)
→ Now for output 6 : Chose any node first, but for 2nd ,you have only 4 choices out of 8,which are the 4 nodes at distance 6 from it,so probability =(4/8)
=Summation(0*(1/8) + 2*(1/8) + 4*(2/8) + 6*(4/8)) = 34/8 = 4.25