Problem:
Array with numeric values needs to be split in half with approximately equal or if possible equal array sum. Number or order of elements in arrays is not important.
$probabilites = array(0.4, 0.15, 0.1, 0.1, 0.2, 0.2, 0.3); # 1.45
$probabilites[0] = array(0.4, 0.15, 0.1, 0.1); # 0.75
$probabilites[1] = array(0.2, 0.2, 0.3); # 0.7
Any suggestions?
Thanks.
Like this?