I am not able to get it where to use probability as it was given in question you need to find the expected Xor in the final answer of the subset.
suppose input is
n=3
b value- 4 5 8
probabilty- 0.2 0.3 0.4
Now we need to choose subset so there will be 2^n-1.
here 4 ,5 ,8 , 4 5 , 5 8 , 4 8 , 4 5 8.Now we need to xor of all the b value present in subset.But where to use probability i didn’t get this . Great help if you explain me with an example .
problem link - CodeChef: Practical coding for everyone
Thankyou.