How to calculate the number of banner appearance based on monthly page views.

199 Views Asked by At

Hello fellow mathematicians. I have a website that gathers more then 44.000 page views per month. In my website I have 1 rotating place of 4 banner positions, each time it rotates 4 new banners will appear. So the client asks me, how many times will my banner appear in the website? So I figured out the following equation, in order to help me answer that question:

((page views) * (Available banner positions))/ (Total Page views) = (how many times will my banner appear in the website)

So if I have 4 banner positions that will rotate each time and 6 banners in my stack, I can calculate that within 7 page views I can ensure (7*4)/6=4.6 times will appear.

Here is a table I came up with in order to check if my answer is correct.

\begin{array}{c c c} page views& Banner pos 1& Banner pos 2 & Banner pos 3& Banner pos 4\\ 1& banner 1 & banner 2 & banner 3 & banner 4 \\ 2& banner 5 & banner 6 & banner 1 & banner 2 \\ 3& banner 3 & banner 4 & banner 5 & banner 6 \\ 4& banner 1 & banner 2 & banner 3 & banner 4 \\ 5& banner 5 & banner 6 & banner 1 & banner 2 \\ 6& banner 3 & banner 4 & banner 5 & banner 6 \\ 7& banner 1 & banner 2 & banner 3 & banner 4 \\ \end{array}

Indeed it looks that Banner 1 will appear 5 times and Banner 6 , 4 times so this means that 4,66 times is the answer 4 to 5 times.

I am not sure if this is correct though so I need your validation.

Thank you

2

There are 2 best solutions below

0
On BEST ANSWER

Assuming you have k banners and n places to show banners, then each banner will be shown n/k times per page view, assuming your rotation scheme is a fair one - which yours (essentially) is.

So, you are correct, and moreover, if you have a number of page views that is a multiple of the number of banners you have, then each banner will have been shown the same (integer) number of times. If you look at your table, but ignore row 7, you will see that each banner gets shown 4 times, which is what we'd expect: $6 \times 4 \div 6 = 4$.

Hope that helps!

0
On

What you actually calculate is the average (or mean) number of times that a banner will be displayed. Note that average has the property that it cannot exceed the maximal value and cannot be under the minimal value. By your algorithm, the difference between the number of appearances of two different banner cannot exceed 1, therefore there are at most two different values (of number of appearances of a banner). By the earlier remark, the average will be between these two values. By more subtle argument, if the average is a whole number then there is only one value.

Bottom line: If the calculation $x$ is a whole number, then all banners appear exactly $x$ many times, and if the calculation is fractional, $n<x<n+1$ where $n$ is whole, then some banners appear $n$ times and some $n+1$ times.