could you please explain the 2nd test case of LEBALONS problem ?
2 1
1 4
2 7
output :
7.333333333
could you please explain the 2nd test case of LEBALONS problem ?
2 1
1 4
2 7
output :
7.333333333
Hi here its the expected value of the balloons if the number of distinc colors is 1 ,ie 1 or 2
Here is how its computed
(4 + 7 + (4+7))/2
that’s we have 3 subsets of the balloons which could satisfy the need they are
{1} {2} and {1,2}
So we have to sum up the price of each set and divide it by number of sets that’s 3
(4+7+(4+7))/3*
Oh #falit94 that was a typo thankyou
Does the probability of every subset would be same or it can vary due to same color of balloons??
example :
1
3 1
1 2
2 3
2 4
subsets are :
{1}{2}{2} {1,2} {1,2} {2,2} {1,2,2}
so the probability of each subset will be same or different?
i dont think dey cn hv same colour
i guess baloon probabaly could be of same colour too…otherwise there would have twice submisssion of current no of submissions.