# I want to put my words into a formula/algorithm but I lack the mathematical fortitude

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.

-
Sounds pretty clear to me. – Yuval Filmus Jan 26 '11 at 6:02
@Yuval Filmus do you know how to write what I want in a formula? The part I don't know how to do is representing the array (I assume I would use a set) in mathematical terms and showing in the formula that I want to "loop" through all items in the set. – ubiquibacon Jan 26 '11 at 6:09
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.) – Ben Alpert Jan 26 '11 at 6:34

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$.