0
$\begingroup$

This should be pretty simple. Here is what I want to put into a formula/algorithm:

Divide the size of every object of an array by the number of times that object has been accessed in the last n seconds and discarding the highest quotient. (You can probably ignore the bold part)

I can program this just fine, but I am going to be showing it to a Mathematician (one of my professors) and I would like to impress him a bit. If the description of what I want is not clear and an example in code would help let me know and I'll whip something up real quick.

  • 0
    I agree with Yuval here; there's no reason to use any fancy math notation because the words you have currently are already very clear. Adding any symbols would unnecessarily complicate the algorithm. (And anyway, I don't think that there is any standard notation for what you want. Probably the best you can do is just write pseudocode for the algorithm, but that's not particularly _mathy_.)2011-01-26

1 Answers 1

3

The sizes of the objects form a vector $\vec{s}$. The access statistics form a vector $\vec{a}$. The quotients form a vector $\vec{q}$ defined by $q_i = n_i/a_i.$ This is your array division. The "mathy" notation is $q_i$ for the C "q[i]".

Now you want to take your array and ignore the maximum, so let $p = \mathrm{argmax}_i q_i,$ and then you want to ignore coordinate $p$.

But I think your professor also understands English.

  • 1
    Point taken, I will stick with the English version and simply augment it with what I know (code).2011-01-26