This might at first seem as a computer science question, but it is actually a mathematical question, since I am searching for a (particular?) function.
Let me phrase the problem I am trying to solve: Suppose, as the title suggests, that we have a menu with items that are getting clicked, and we are counting the clicks aiming to change the size of the items according to clicks, i.e. more clicks mean larger size. How are we to do that?
I have already found a nice way to compose a helpful data structure from the clicks made, which I am going to present now : We assign every item an arrow, $\cap$ is an up arrow and $\cup$ is a down arrow. Every item has a counter set to zero and an arrow set to $\cap$. With every click, regardless of item hit, every counter is increased or decreased by one, according to the arrows, ascending or descending. The particular item hit has the direction of its arrow changed after the counter is changed. The arrows are essentially mutable states. The data structure we are interested in is the record of each counter, i.e. a finite list of integers that go up and down by $1$
I want to use some function of these lists to determine the size of each item. Our program has essentially been given program time, with a "second" passing every time the user clicks on any item. I really like this data structure of records of counters, since it gives a lot more information than just the number of hits for each item. For example, an item that gets hit every "second", goes back and forth. An item that doesn't get hit a lot strays far away from the center of the system, which is zero. Having multiple items, i.e. multiple counter records gives room for intercorrelation between items, so that changing the size becomes dynamical and precise.
I cannot yet think of a good function, it could be that there is no best function. Probability and statistics might help, because we are essentially tinkering with the distribution of clicks.
So, with a slight abuse in terminology, I am looking for $F : \{records\} \rightarrow \{sizes\}$ where $F$ has to at least respect that $\{more$ $hits \Rightarrow larger$ $size\}$ for each record.
To make this rigorous, let $s$ be a finite list of integers. $s$ is called a record if-f $s(0)=0$ and $|s(n+1) - s(n)| = 1, \forall n \in \{1,2,...\}$. Let $R$ be the set of all records and $R^m$ be records of length $m$.
If two records, $r_1, r_2$ differ only by some non-empty tail of $r_2$, $t$ and $\exists n_0, r_2(n_0 - 2) \in t$ such that $r_2(n_0 - 1) > r_2(n_0 - 2), r_2(n_0)$, or the opposite inequality holds, we say that $r_1 < r_2$.
We are looking for a family of functions, $\mathcal{F}=\{F_m : R^m \rightarrow \mathcal{N}\}_{m \in \mathcal{N}}$, where $\mathcal{N}$ are the natural numbers representing sizes for records, such that;
$\forall r_1, r_2 \in \mathcal{R}$ with lengths $m_1, m_2$ respectively, we have that $r_1 < r_2 \Rightarrow F_{m_1}(r_1) < F_{m_2}(r_2)$
Some clarifications. $m$ plays the role of program time, so we need to differentiate between records of length $m$ and $m' \neq m$. The last condition asks that if a record could be the predecessor of some other record, and hits have increased, size should increase as well. This last part is up to interpretation actually, since one could argue that it is sort of a weak condition. Someone could interpret sizes as being rational numbers, or find some different way to express the non formal condition, as initially stated by the problem.
Remember as well, that the family $\mathcal{F}$ is to be applied on finite collections of records, of same length, as they share program time, i.e. elements $\in {(\mathcal{R}^m)}^N$ where $N$ is the number of items currently on the menu. I feel like there is a normed space hiding around this place, as there is a particular record that can be interpreted as zero, the forever ascending record without an infinite tail, which represents inactivity for an item.
NOTES : One could argue that size should decay given some period of inactivity.
An example run with four items on the menu, after three clicks, could look like this: Suppose I click items 1,4,3 in that order. Then our data would be four sequences of integers, as follows :
$s_1 = (0,1,0,-1)$
$s_2 = (0,1,2,3)$
$s_3 = (0,1,2,3)$, with the arrow looking down, so that in the next click it will descend,
$s_4 = (0,1,2,1)$.
EDIT : (I am continuously editing this question as I am working on my own on this problem as well)