I have the following algorithm which needs to be expressed more concisely using mathematical symbols and I need help for that.
The algorithm accepts a square matrix and a related set of integers (ids) and returns a real number.
(1) I have a square matrix S of size N x N.
(2) Each row of the matrix has two integers associated with it. $Id_{true}$ and $Id_{obs}$.
(3) V consecutive rows have the same $Id_{true}$. Rows with the same $Id_{true}$ may or may not have same $Id_{obs}$. Thus each $Id_{true}$ is related to V number of $Id_{obs}$.
(4) Let the most frequently occurring id in $\{Id_{obs}\}$ be $Id_f$. Tie is not acceptable. The frequency with which $Id_f$ occurs must be greater than all other Ids frequency.
(5) If $Id_{true}$ == $Id_{f}$, success else failure.
(6) At the end of processing all rows of S, the no of successes is counted and returned as a percentage.