Showing posts with label derivative. Show all posts
Showing posts with label derivative. Show all posts

Thursday, May 17, 2012

Differential Equations and Support Tickets

Slope fields are very useful in Differential Equations.
This one approximates the situation described below.


"It's been 3 days and my ticket still hasn't been resolved, this is bullshit"

"Why don't they just hire some temp support staff? Then they could just work through the backlog and then fire them and we'd have instantaneous response times."

I'm back with another entry that nobody asked for. Here I'm going to be talking about yet another practical use for mathematics that relates to World of Warcraft.

We often have to deal with situations where we have to wait for something to get resolved by someone else. And we'll find ourselves wondering why it's taking so long. We wonder why the queue is so long. We wonder why they don't just hire somebody else to work through the backlog.

The truth is that it probably wouldn't solve the problem. But looking at that is probably a question for differential equations. Normal equations relate to quantities. Here we'd be looking at the length of the support queue as a function of time or some other factor. For the purpose of this analysis I'll be looking at time. Often times it's incredibly difficult or impossible to come up with a function that describes certain situations. However, it can be relatively easy to come up with an equation that describes how a particular value changes.

You may have taken a calculus class at some point in time. You may remember that the derivative of a function describes how that function changes with respect to its variables. If we let Q(t) be the number of messages in the support queue at any given moment in time, then we'd be more concerned with
which is the rate of which Q(t) changes over time. So now we just have to ask ourselves, what causes Q(t) to change?

Well, Q(t) increases whenever somebody has some sort of error to report. And Q(t) decreases every time a petition is answered. So we might be inclined to say that
Where p is the rate at which petition-able items occur, and a is the rate at which the game masters can answer petitions. But that's not true. If the queue size is particularly large, people become less likely to submit a petition. We may do this because we're impatient or because it may be the type of issue that could resolve itself in that amount of time (say with a bugged mob). So I'm more inclined to say that the function more closely resembles.
Where k(q) is a function is always positive but decreases as q (the length of the queue/wait time) increases. It is the probability that a person will report their issue given the length of the queue. Now, if we presume that p and a are constants, meaning that petition-able items and the rate at which petitions are answered aren't affected by anything here, then our function is a differential equation of one variable, q.

So what does this mean. Well, if the queue is long, then q is high,  k(q) is small, and the value of our derivative is negative, meaning that the queue will get shorter. If the queue is short, then q will be small, k(q) will be higher, and the value of our derivative will be positive, meaning the queue will get longer. It turns out that if p and a remain constant, then the length of the queue will tend towards a value for which
 When the derivative is zero, that means that the length of the queue stays the same. So the length of the queue will tend to wards a particular length and then remain stable, provided p and a don't change. This is especially true of more demanding queues, such as the post office, where you must physically wait in line. It's still true for passive queues, such as WoW reporting system.

So hiring temp workers to reduce the queue length won't work, because once those temp workers are gone the queue length will return to normal. This is why it's very important for Blizzard (and other agencies) to create more automated support systems, so that smaller, easier-to-fix problems can be handled automatically and bypass the queue.

Wednesday, May 2, 2012

The Math of the Deeprun Tram

Moving Away At Other Station Coming Back Arrives At Your Station Leaves with you m w m w m How many times have you gone to the Deeprun Tram and it was there, waiting, but was gone before you could get to it? If you're a frequent Alliance player, probably tons of times. And whenever that has happened, have you said to yourself, "They should make it wait longer, then people wouldn't miss it so often and people would get to their destination faster." How would you feel if I told you that wasn't the case and that perhaps it waits too long?

On the left I have a little diagram, the part in orange is the part of your journey which you must always endure, the actual travel. The part in white represents where the tram may be when you are actually ready to board it (and not just running to be ready to board). When you are ready to board you may arrive at any one of those points. So your actual time spend waiting on the tram and traveling on it is
where X is a uniformly continuous random variable that ranges from zero to 2m+2w, where m is the amount of time spent moving from one side to the other and w is the amount of time the tram waits at each stop.

What we want to do is we want to minimize t. Or rather, we want to minimize the average value of t. We do this by calculating what's known as the expected value of t, E(t).
I'm fairly certain that I don't REALLY need to go through this next part, but it's a good indication of where calculus is helpful in real life type situations. That and I've spent a good amount of time teaching mathematics and I can't resist a good example. In order to minimize a function (which E(t) certainly is), you take the derivative and check the value of it when that derivative is zero, at endpoints, and at discontinuities. In this case, our variable is w, the amount of time spent at the station. The partial derivative of E(t) with respect to w is
This is because the partial derivative with respect to w of 2m is zero and the partial derivative with respect to w of w is 1.

Here we find that the derivative is never zero, so that means our function, E(t), must be minimized at an endpoint, in this case w=0. So with the goal of people arriving at the other side as fast as possible, it is optimal that the Deeprun Tram (and this can be said of other transports) not wait at all? Well, this is a mathematical model, and there were some limitations put on it to make it simple. What this tells us is that it is optimal for the tram to wait only long enough to let the people who are waiting for it board, which when you think about it, makes sense.

Why is that so? Wouldn't it benefit from waiting longer so that people who are close can get on? No, because if the tram waited longer, that would make its round trips longer and it would make the people who are on it and waiting for it to depart have to wait longer for it to leave.

This post was a fixed-up, more elaborate, better version of a blog post that I did when my blog was young. Many of those older posts have good content, but I was just terrible at writing/the web at the time and I feel they deserve a second chance. Furthermore, since it was old, I bet nobody saw it.