Need a formula

Discuss the language of the universe.

Moderators: Calilasseia, ADParker

Need a formula

#1  Postby scott1328 » Nov 05, 2016 4:53 am

My company will soon be featured on a television spot and when this happens our website can be overwhelmed by a sudden surge of traffic. To mitigate this we are adopting a waiting room strategy. We will divert a certain fraction of the traffic to static waiting page where a user's session will be forced to wait a minimum amount of time, once that time is expired the user's browser is allowed to access the site again and the die is rolled again. Each roll of the die is independent of all others, and so, theoretically, a user can be forced to wait for an unbounded length of time. (Once the user is let through, he bypasses the waiting room until he completes his visit)

I need a formula that will let me calculate the average wait time in the waiting room given the probability p of being allowed through to the site that ranges on the half open interval (0,1] and the minimum wait time in the waiting room w

For example p=0.8 and w=30 means that 80% of the requests will bypass the waiting room while 20% will be forced to wait 30 seconds before making another request. How long is the average wait in the wait room.
User avatar
scott1328
THREAD STARTER
 
Name: Some call me... Tim
Posts: 8695
Male

United States (us)
Print view this post

Ads by Google


Re: Need a formula

#2  Postby BWE » Nov 05, 2016 7:46 am

I wouldn't use any random elements. If you want to let 20% wait, have every 5th visitor go there.
User avatar
BWE
 
Posts: 2498

Print view this post

Re: Need a formula

#3  Postby Fenrir » Nov 05, 2016 7:50 am

Just tell them all they have to wait. 80% will leave and you will have no problem servicing the rest.
Religion: it only fails when you test it.-Thunderf00t.
User avatar
Fenrir
 
Posts: 3613
Male

Country: Australia
South Georgia and the South Sandwich Islands (gs)
Print view this post

Re: Need a formula

#4  Postby Pulsar » Nov 05, 2016 8:55 am

At first glance it looks something like this:

formula.gif
formula.gif (1.91 KiB) Viewed 1397 times


The first term is the people who don't have to wait (i.e. 0 time), the second term those who have to wait once (with probability p(1-p) ), the third term those who have to wait twice (with probability p(1-p)2 ), etc. To go from the sum to the closed formula, see this.

In your example, this would be 7.5 seconds on average. A few unlucky bastards will have to wait for much longer, though.
"The longer I live the more I see that I am never wrong about anything, and that all the pains that I have so humbly taken to verify my notions have only wasted my time." - George Bernard Shaw
User avatar
Pulsar
 
Posts: 4618
Age: 43
Male

Country: Belgium
Belgium (be)
Print view this post

Re: Need a formula

#5  Postby scott1328 » Nov 05, 2016 1:34 pm

Pulsar wrote:At first glance it looks something like this:

formula.gif


The first term is the people who don't have to wait (i.e. 0 time), the second term those who have to wait once (with probability p(1-p) ), the third term those who have to wait twice (with probability p(1-p)2 ), etc. To go from the sum to the closed formula, see this.

In your example, this would be 7.5 seconds on average. A few unlucky bastards will have to wait for much longer, though.

Thank you I should have recognized it as a geometric series.

The only change I need to work out is to exclude those from the average who never had to wait at all.
User avatar
scott1328
THREAD STARTER
 
Name: Some call me... Tim
Posts: 8695
Male

United States (us)
Print view this post


Return to Mathematics

Who is online

Users viewing this topic: No registered users and 1 guest