Problem link Hi i have solved above problem but i am trying a variant of the same problem.
From same problem our simplified but complicated version. Now lets assume from root ,all the vertices are directly connected to the root. But we the probability of selection of node i is p[i] such that any p[i]>0 and sum of p[i] is 1 We have to find the expected chances to delete the whole tree..same as the original problem
Now to deleted the root probability p[root] but now to delete the the children probability of direct removal is p[child]/p[root]+p[child]; But when i simulate i am getting wrong answer.. Can anybody help me where approach is going wrong