0 votes 0 votes From a complete binary tree T of 8 leaf nodes, two leaf nodes a and b are selected randomly and uniformly. What is the expected distance between a and b in T? pream sagar asked Feb 3, 2019 pream sagar 2.5k views answer comment Share Follow See all 9 Comments See all 9 9 Comments reply hitesh159 commented Feb 3, 2019 reply Follow Share 4.85? 5 votes 5 votes mickey_ commented Feb 3, 2019 reply Follow Share I got the same answer 0 votes 0 votes prashant jha 1 commented Feb 4, 2019 reply Follow Share got 4.84 :( 0 votes 0 votes Parimal Paritosh commented Feb 4, 2019 reply Follow Share I also got 4.84. And I can't remember how. Is there any chance it can lie in the given range? 0 votes 0 votes Ahabnnc commented Feb 4, 2019 reply Follow Share 34/7 0 votes 0 votes prashant jha 1 commented Feb 4, 2019 reply Follow Share I think in these type of problems , they keep some range 0 votes 0 votes Babaji commented Feb 4, 2019 reply Follow Share My answer comes 4.35. What will be the range in max case?? 0 votes 0 votes Duffer commented Feb 4, 2019 reply Follow Share 34/8. 0 votes 0 votes Parimal Paritosh commented Feb 5, 2019 reply Follow Share How many marks was this question for? 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes distance | number of cases 2 4 4 8 6 16 expectation = (2*4 + 4*8 + 6*16)/28 xariniov9 answered Feb 3, 2019 xariniov9 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes And:-34/7 sachin! answered Feb 3, 2019 sachin! comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Duffer commented Feb 4, 2019 i reshown by Duffer Feb 4, 2019 reply Follow Share N is 8 leaves One leaf with 2 edge distance . Two leaves with 4 edge distance Four leaves with 6 edge distance. Expectation = (1*2 + 2*4 + 4*6)/N = 34/8 = 4.25 (upto decimal places exact as stated in question) 0 votes 0 votes Aman Juyal commented Feb 4, 2019 reply Follow Share I had a big doubt regarding this question what actually they want from us it said that randomly two leaves are selected so expected length of what ,irrespective of the fact since they are talking about leaves only length must remain 6 only . May be i am ,without thinking answering it but since it is cbt (8 leaves is sufficient to say total 15 nodes )and we all know leaves are at bottom why would path length will change it will remain constant. Please tell me my flaws in this regard . 0 votes 0 votes Duffer commented Feb 4, 2019 reply Follow Share What if the two leaves chosen between which edge distance needs to be calculated turn out to be same node ? I think for that reason it's 34/8 not 34/7. 0 votes 0 votes Please log in or register to add a comment.