I would like to define a function $f$ whose range is $[0,1]$ such that it takes a matrix $C \in R_+$ of dimension $m \times n$. The entries in the matrices are also in the range $[0,1]$. In addition, each row of $C$ sums to $1$.
The function $f$ should produce $0$ when all the entries in the matrix $C$ are same and produce $1$ when there is only one $1$ entry in each row.
For example,when
C = [1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0]
$f(C) = 1$
In other case, when
C = [0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25]
$f(C) = 0$
Can anyone help me out in contructing such a function?