If I have a function
$f(t) = y$
where $t$ & $y$ are positive Integers
for $t = \{1,2,3,4,5,6,7,8\} \to y = \{1,1,1,2,1,2,3,1\}$
How can I create a function $g(y)$ such that it counts the number of times a value of $y$ occurs. For instance if we used the above data $g(y)$ would be the following:
$g(y) = \{5, 2, 1, 0\}$ for the $y$ values $\{1,2,3,4\}$
Once I have this I need to represent this as a function $k(t) = \max R$
$R = y * g(y) + y * g(y+1) + y * g(y+2)...+ y * g(y+n)$
for all values $g(y+n) > 0$.
Please can someone help me represent $k(t)$ more mathematically. Would something like the Discrete time Fourier Transform help with $f(t) \Longrightarrow g(y)$
Thanks a mill