By using the ITO matrices, we have (πk is the probability of k copies of IBD alleles between two relatives): E[xrel1,xrel2]=∑i,j=02i⋅j⋅P(xrel1=i,xrel2=j)=∑i,j=02ij∑k=02P(xrel2=j|i,k)πkP(xrel1=i)=π04p2+π1(4p2+pq)+π2(4p2+2pq)=4p2+pq(π1+2π2).