Suppose we have following pages and their serving weightage:

```
Page1    50%
Page2    20%
Page3    15%
Page4    15%

```

What would be a simple formula to serve pages based on their weightage? I am using Ruby.

Here is how I'm thinking.

```
actual_pct = Weightage 
tot_hits = Total hits against the URL
served_pct = Served percentage for each page based on tot_hits
served_to_actual_pct  = served_pct x 100 / actual_pct

```

Above will give me an array of pages with their `served_to_actual_pct`. Lets suppose I would be serving the pages based on their `create timestamp` when no page is served yet or more than one pages have the same `served_to_actual_pct`.

Based on this assumption I can sort this array on `create timestamp` and then on `served_to_actual_pct`. At this point the first page in the array would be the page to be served.