Hi all,
I have 'n' numbers between 0 and 1 .... and there sum 'S' is known .. so there are only two things 'n' & 'S' are known .... now I have to divide these 'n' numbers into two groups of (0, .5) & (.5, 1) ... I need numbers of elements & their sum in each group .... This can't be done arbritrarily .... solution using some distribution or statistical argument will be good ...

Interwal No. of elements Sum
------------------------------------------------------------------------------
(0,1) 'n' 'S' {We know}
(0,.5) 'n1' 'S1' {need to find}
(.5,1) 'n2' 'S2' {need to find}

Thanks,
ambrish

if they're evenly distributed random numbers, n1 = n2 = n / 2, and 3 * S1 = S2 = 3*S/4, approximately. I do not feel like calculating the actual probability distributions of these values, though...

there can be infinite solutions based on "ifs" but can you support your assumptions with any valid reasoning ... the solution can not be so arbit ... in you solution you are not at all incorpoating that how much the mean "S/n" is close to .5 ..... you are not at all using this information in this solution .....

Oh, wait, my answer was dumb and wrong, because if they're evenly distributed random numbers, then S = 0.5n....

You can't come up with any reasonable answer with just the information you've been given. You could for small values of n and extreme values of S, for example if n = 2 and S = 1.6, or the opposite case, n = 2 and S = 0.4. But if n = 2 and S = 1, or if n = 3 and S = 1, then you're out of luck.

Unless you either
(a) know what pattern the numbers tend to be distributed, or
(b) get an extreme case where all the numbers must lie in one of the halves,
you cannot make any nontrivial claims about the expected values of n1, n2, S1, and S2.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.