Ack, it's not so hard. You don't need the total number of hits...you have percentages...
If $a is worth 50% of the hits and $b is worth 30% and $c is worth 20% why do you need a total? It all adds up to a hundred...
$a = 5; // as in 5 out of 10 - it could be 50 out of 100
$b = 3;
$c = 2;
$a + $b + $c = 10;
So, just find a way, and there are a gazillion ways to do it, to apply your $a url to 5 out of 10 elements in an array (which is selected rand of course) and there you go.
I'd write this up, but I think that's the point of this forum.
Good luck...v