Since the number of elements is not fixed, let consider using random number.
<?php
$v = 230500;
$b = array(500, 2000, 1500, 1000, 750, 800, 900, 1300, 2000, 2500, 1400, 8000);
$N = count($b);
$n = rand(1,$N);
$s = 0;
$rollno = 0;
while ($n <= $N){
$display = 'roll no '.++$rollno.': ';
$a = $v;
for ($i = $s; $i < $n; $i++)
{
$a = $a - $b[$i];
$display = $display.$a.', ';
}
$display = substr($display,0,-2).'<br>';
echo $display;
$s = $n;
$n = $n + rand(1, $N - $n);
}
?>
The number of element in each roll is determined randomly. So, the outcome will be different for each run.