A property of algebraic univoque numbers

Abstract: Consider the set $\uu$ of real numbers $q \ge 1$ for which only one sequence $(c_i)$ of integers $0 \le c_i \le q$ satisfies the equality $\sum_{i=1}^{\infty} c_i q^{-i} = 1$. In this note we show that the set of algebraic numbers in $\uu$ is dense in the closure $\uuu$ of $\uu$.

\section{Introduction}\label{s1}

Given a real number $q \ge 1$, a $q-${\it expansion} (or simply {\it expansion}) is a sequence $(c_i)=c_1 c_2 \ldots$ of integers satisfying $0 \le c_i \le q$ for all $i \geq 1$ such that
\begin{equation*}
\frac{c_1}{q} + \frac{c_2}{q^2} + \frac{c_3}{q^3} + \cdots = 1.
\end{equation*}

One such expansion, denoted by $(\gamma_i(q))= (\gamma_i)$, is obtained by performing the {\it greedy algorithm} of R\'enyi
(\cite{R}): if $\gamma_i$ is already defined for $ i < n$, then $\gamma_n$ is the largest integer satisfying
\begin{equation*}
\sum_{i=1}^{n} \frac{\gamma_i}{q^i} \leq 1.
\end{equation*}
Equivalently, $(\gamma_i)$ is the largest expansion in lexicographical order.

If $q >1$, then another such expansion, denoted by $(\alpha_i(q))= (\alpha_i)$, is obtained by performing the {\it quasi-greedy algorithm}: if $\alpha_i$ is already defined for $i < n$, then $\alpha_n$ is the largest integer satisfying
\begin{equation*}
\sum_{i=1}^{n} \frac{\alpha_i}{q^i} < 1.
\end{equation*}

An expansion is called {\it infinite} if it contains infinitely many nonzero terms; otherwise it is called {\it finite}. Observe that there are no infinite expansions if $q = 1$: the only 1-expansions are given by
$10^{\infty}, 010^{\infty}, 0010^{\infty}, \ldots$.
On the other hand, if $q >1$, then $(\alpha_i)$ is the largest infinite expansion in lexicographical order.

For any given $q >1$, the following relations between the quasi-greedy expansion and the greedy expansion are straightforward. The greedy expansion is finite if and only if $(\alpha_i)$ is periodic. If $(\gamma_i)$ is finite and $\gamma_m$ is its last nonzero term, then $m$ is the smallest period of $(\alpha_i)$, and
\begin{equation*}
\alpha_i = \gamma_i \quad \mbox{for } i = 1, \ldots, m-1, \quad \mbox{and } \alpha_m = \gamma_m -1.
\end{equation*}

Erd\H{o}s, Horv\'ath and Jo\'o (\cite{EHJ}) discovered that for some real numbers $q >1 $ there exists only one $q-$expansion. Subsequently, the set $\mathcal U$ of such {\it univoque numbers} was characterized in \cite{EJK1}, \cite{EJK2}, \cite{KL3} (see Theorem~\ref{t21}). Using this characterization, Komornik and Loreti showed in \cite{KL1} that $\mathcal U$ has a smallest element $q' \approx 1.787$ and the corresponding expansion $(\tau_i)$
is given by the truncated Thue-Morse sequence, defined by setting $\tau_{2^N}=1$ for $N=0,1,\ldots$ and
\begin{equation*}
\tau_{2^N + i} = 1 - \tau_i \quad \mbox{for }1 \le i < 2^N, \, N=1,2, \ldots.
\end{equation*}
Allouche and Cosnard (\cite{AC}) proved that the number $q'$ is transcendental. This raised the question whether there exists a smallest algebraic univoque number. Komornik, Loreti and Peth\H{o} (\cite{KL2}) answered this question in the negative by constructing a decreasing sequence $(q_n)$ of algebraic univoque numbers converging to $q'$.

It is the aim of this note to show that for each $q \in \mathcal U$ there exists a sequence of algebraic univoque numbers converging to $q$:

\begin{theorem}\label{t11}
The set $\mathcal{A}$ consisting of all algebraic univoque numbers is dense in $\overline{\mathcal U}$.
\end{theorem}

Our proof of Theorem \ref{t11} relies on a characterization of the closure $\overline{\mathcal U}$ of $\mathcal U$, recently obtained by Komornik and Loreti in \cite{KL3} (see Theorem~\ref{t22}).

\section{Proof of Theorem~\ref{t11}}\label{s2}

In the sequel, a sequence always means a sequence of nonnegative integers. We use systematically the lexicographical order between sequences; we write $(a_i) < (b_i)$ if there exists an index $n \geq 1$ such that $a_i=b_i$ for $i < n$ and $a_n < b_n$. This definition extends in the obvious way to sequences of finite length.

The following algebraic characterization of the set $\mathcal U$ can be found in \cite{EJK1}, \cite{EJK2}, \cite{KL3}:

\begin{theorem}\label{t21}
The map $q \mapsto (\gamma_i(q))$ is a strictly increasing bijection between the set $\mathcal U$ and the set of all sequences $(\gamma_i)$ satisfying
\begin{equation}\label{21}
\gamma_{j+1} \gamma_{j+2} \ldots < \gamma_1 \gamma_2 \ldots \quad \mbox{for all }\, j \geq 1
\end{equation}
and
\begin{equation}\label{22}
\overline{\gamma_{j+1} \gamma_{j+2} \ldots} < \gamma_1 \gamma_2 \ldots \quad \mbox{for all }\, j \geq 1
\end{equation}
where we use the notation $\overline{\gamma_n} := \gamma_1 - \gamma_n$.
\end{theorem}

\begin{remark}
It was essentially shown by Parry (see \cite{P}) that a sequence $(\gamma_i)$ is the greedy $q$-expansion for some $q \ge 1$ if and only if $(\gamma_i)$ satisfies the condition \eqref{21}.
\end{remark}

Using the above result, Komornik and Loreti (\cite{KL3}) investigated the topological structure of the set $\mathcal U$. In particular they showed that $\overline{\mathcal U} \setminus \mathcal U$ is dense in $\overline{\mathcal U}$. Hence the set $\overline{\mathcal U}$ is a perfect set. Moreover, they established an analogous characterization of the closure $\overline{\mathcal U}$ of $\mathcal U$:
\begin{theorem}\label{t22}
The map $q \mapsto (\alpha_i(q))$ is a strictly increasing bijection between the set $\overline{\mathcal U}$ and the set of all sequences $(\alpha_i)$ satisfying
\begin{equation}\label{23}
\alpha_{j+1} \alpha_{j+2} \ldots \le \alpha_1 \alpha_2 \ldots \quad \mbox{for all }\, j \geq 1
\end{equation}
and
\begin{equation}\label{24}
\overline{\alpha_{j+1} \alpha_{j+2} \ldots} < \alpha_1 \alpha_2 \ldots \quad \mbox{for all }\, j \geq 1
\end{equation}
where we use the notation $\overline{\alpha_n} := \alpha_1 - \alpha_n$.
\end{theorem}

\begin{remarks}
\mbox{}
\begin{itemize}

\item It was shown in \cite{BK} that a sequence $(\alpha_i)$ is the quasi-greedy $q$-expansion for some $q >1$ if and only if $(\alpha_i)$ is infinite and satisfies \eqref{23}. Note also that a sequence satisfying \eqref{23} and \eqref{24} is automatically infinite.

\item If $q \in \overline{\mathcal U} \setminus \mathcal U$, then we must have equality in \eqref{23} for some $j \geq 1$, i.e., the greedy $q$-expansion is finite for each $q \in \overline{\mathcal U} \setminus \mathcal U$. On the other hand, it follows from Theorems~\ref{t21} and \ref{t22} that a sequence of the form $(1^n0)^{\infty}$ $(n \ge 2)$ is the quasi-greedy $q$-expansion for some $q \in \overline{\mathcal U} \setminus \mathcal U$. Hence the set $\overline{\mathcal U} \setminus \mathcal U$ is countably infinite.
\end{itemize}

\end{remarks}

The following technical lemma is a direct consequence of Theorem~\ref{t22} and Lemmas 3.4 and 4.1 in \cite{KL3}:

\begin{lemma}\label{l23}
Let $(\alpha_i)$ be a sequence satisfying \eqref{23} and \eqref{24}. Then
\begin{itemize}
\item[\rm (i)] there exist arbitrary large integers $m$ such that
\begin{equation}\label{25}
\overline{\alpha_{j+1} \ldots \alpha_m} < \alpha_1 \ldots \alpha_{m-j} \quad \mbox{for all }\, 0 \le j < m;
\end{equation}
\item[\rm (ii)] for all positive integers $m \geq 1$,
\begin{equation}\label{26}
\overline{\alpha_{1} \ldots \alpha_{m}} < \alpha_{m+1} \ldots \alpha_{2m}.
\end{equation}
\end{itemize}
\end{lemma}

\begin{proof}[Proof of Theorem~\ref{t11}] Since the set $\overline{\mathcal U} \setminus \mathcal U$ is dense in $\overline{\mathcal U}$, it is sufficient to show that $\overline{\mathcal{A}} \supset \overline{\mathcal U} \setminus \mathcal U$.
In order to do so, fix $q \in \overline{\mathcal U} \setminus \mathcal U$.
Then, according to Theorem ~\ref{t22}, the quasi-greedy $q$-expansion $(\alpha_i)$ satisfies \eqref{23} and
\eqref{24}. Let $k$ be a positive integer for which equality holds in \eqref{23}, i.e.,
\begin{equation*}
(\alpha_i)= (\alpha_1 \ldots \alpha_k)^{\infty}.
\end{equation*}
According to Lemma~\ref{l23} there exists an integer $m \geq k$
such that \eqref{25} is satisfied.
Let $N$ be a positive integer
such that $kN \geq m $ and consider the sequence
$$(\gamma_i)= (\gamma_i^N)=( \alpha_1 \ldots \alpha_k)^N (\alpha_1 \ldots \alpha_m
\overline{\alpha_1 \ldots \alpha_m})^{\infty}.$$
For ease of exposition we suppress the dependence of $(\gamma_i)$ on
$N$. Note that $\gamma_i=\alpha_i$ for $ 1 \leq i \leq m+kN$. In particular, we have
\begin{equation}\label{27}
\gamma_i=\alpha_i \quad \mbox{for} \quad 1 \leq i \leq 2m.
\end{equation}
Since $(\gamma_i)$ has a periodic tail, the number $q_N$ determined by
$$1 = \sum_{i=1}^{\infty} \frac{\gamma_i}{q_{N}^i}$$
is an algebraic number and $q_N \to q$ as $N \to \infty$.

According to Theorem~\ref{t21} it remains to verify the inequalities \eqref{21} and \eqref{22}.
First we verify \eqref{21} and \eqref{22} for $j \geq kN$. For those values of $j$ the inequality \eqref{21} for $j+m$ is equivalent to \eqref{22} for $j$ and \eqref{22} for $j+m$ is equivalent to \eqref{21} for $j$. Therefore it suffices to verify the inequalities \eqref{21} and \eqref{22} for $kN \le j < kN +m$. Fix $kN \le j < kN +m$. From \eqref{23}, \eqref{26} and \eqref{27} we have
\begin{eqnarray*}
\gamma_{j+1} \ldots \gamma_{kN+2m}&=& \alpha_{j-kN +1} \ldots \alpha_m \overline{\alpha_1 \ldots \alpha_m} \\
& < & \alpha_{j-kN +1} \ldots \alpha_m \alpha_{m+1} \ldots \alpha_{2m} \\
&\leq& \alpha_1 \ldots \alpha_{kN + 2m - j}\\
&=& \gamma_1 \ldots \gamma_{kN + 2m - j}
\end{eqnarray*}
and from inequality \eqref{25} we have
\begin{eqnarray*}
\overline{\gamma_{j+1} \ldots \gamma_{kN+m}} &=& \overline{\alpha_{j-kN+1} \ldots \alpha_m} \\
&<& \alpha_1 \ldots \alpha_{kN+m-j} \\
&=& \gamma_1 \ldots \gamma_{kN+m-j}.
\end{eqnarray*}
Now we verify \eqref{21} for $j < kN$. If $m \leq j < kN$, then by \eqref{23} and \eqref{26},
\begin{eqnarray*}
\gamma_{j+1} \ldots \gamma_{kN+2m} &<& \alpha_{j+1} \ldots \alpha_{kN+2m} \\
& \leq& \alpha_1 \ldots \alpha_{kN+2m-j} \\
& = & \gamma_1 \ldots \gamma_{kN+2m-j}.
\end{eqnarray*}
If $1 \leq j < m$, then by \eqref{23} and \eqref{25},
\begin{eqnarray*}
\gamma_{j+1} \ldots \gamma_{kN+m+j} &=& \alpha_{j+1} \ldots \alpha_{kN+m}
\overline{\alpha_1 \ldots \alpha_j}\\
& \leq & \alpha_1 \ldots \alpha_{kN+m-j}\overline{\alpha_1 \ldots \alpha_j}\\
& < & \alpha_1 \ldots \alpha_{kN+m-j} \alpha_{m-j+1} \ldots \alpha_m \\
&=& \gamma_1 \ldots \gamma_{kN+m}.\\
\end{eqnarray*}
Finally, we verify \eqref{22} for $j < kN$.
Write $j=k \ell +i \, , 0 \leq \ell < N$ and $0 \leq i < k$. If $i=0$, then \eqref{22} follows from the relation
\begin{equation*}
\overline{\gamma_{j+1}}=\overline{\alpha_1}= 0 < \alpha_1 = \gamma_1.
\end{equation*}
If $ 1 \le i < k$, then applying Lemma~\ref{l23}(ii) we get
\begin{equation*}
\overline{\alpha_{i+1} \ldots \alpha_{2i}} < \alpha_1 \ldots \alpha_i.
\end{equation*}
Hence
\begin{eqnarray*}
\overline{\gamma_{j+1} \ldots \gamma_{j+k}} &=& \overline{\alpha_{j+1} \ldots \alpha_{j+k}} \\
&=& \overline{\alpha_{i+1} \ldots \alpha_{i+k}} \\
&<&  \alpha_1 \ldots \alpha_k \\
&=&  \gamma_1 \ldots \gamma_k.\\
\end{eqnarray*}
(In order for the first equality to hold in case $\ell = N-1$, we need the condition $m \geq k$.)
\end{proof}

\begin{remarks} \mbox{}
\begin{itemize}
\item Since the set $\overline{\mathcal U}$ is a perfect set and $\overline{\mathcal U} \setminus \mathcal U$ is countable, each neighborhood of $q \in \mathcal U$ contains uncountably many elements of $\mathcal U$. Hence the set of transcendental univoque numbers is dense in $\overline{\mathcal U}$ as well.
\item Recently, Allouche, Frougny and Hare (\cite{AHF}) proved that there also exist univoque Pisot numbers. In particular they determined the smallest three univoque Pisot numbers.
\end{itemize}
\end{remarks}


Inequalities detecting structural properties of a finite group

Abstract: We prove several results detecting ciclicity or nilpotency of a finite group $G$ in terms of inequalities involving the orders of the elements of $G$ and the orders of the elements of the cyclic group of order $|G|$. We prove that, among the groups of the same order, the number of cyclic subgroups is minimal for the cyclic group and the product of the orders of the elements is maximal for the cyclic group.

\section{Introduction}

In this paper all groups are assumed to be finite.

The problem of detecting structural properties of a finite group by looking at element orders has been considered by various authors. Amiri, Jafarian Amiri and Isaacs in \cite{isaacs} proved that the sum of element orders of a finite group $G$ of order $n$ is maximal in the cyclic group of order $n$. The problem of minimizing sums of the form $\sum_{x \in G} o(x)^{-m}$, where $m$ is a positive integer and $o(x)$ denotes the order of $x$, was considered in \cite{suminverses}, however there is a mistake in the proof pointed out by Isaacs in \cite{moverf}. The main point of the argument in \cite{suminverses} is a pointwise argument, and the strong evidence that it is true suggests to state it as a conjecture.
\begin{conj} \label{mainconj}
Let $G$ be a finite group of order $n$ and let $C_n$ denote the cyclic group of order $n$. There exists a bijection $f : G \to C_n$ such that $o(x)$ divides $o(f(x))$ for all $x \in G$.
\end{conj}
This is proved in \cite{oib} by Frieder Ladisch in the case in which $G$ is solvable. Note that the existence of a bijection as in the conjecture is equivalent to the existence of a family $\{S_d\ :\ d|n\}$ of subsets of $G$ with the following properties (here $\varphi$ denotes Euler's totient function):
\begin{itemize}
\item The sets $S_d$ are pairwise disjoint and $G = \bigcup_{d|n} S_d$.
\item $x^d = 1$ for all $x \in S_d$, for all $d|n$.
\item $|S_d| = \varphi(d)$ for all $d|n$.
\end{itemize}

Indeed, given a bijection $f$ as in the conjecture, define $S_d$ to be the preimage via $f$ of the set of elements of $C_n$ of order $d$, and given a partition as above, define $f$ piecewise sending $S_d$ to the set of elements of $C_n$ of order $d$.

\

The existence of such a partition is claimed in \cite{suminverses} with a wrong proof, although this is not the main result of that paper. The main result of \cite{suminverses}, dealing with the sum $\sum_{x \in G} 1/o(x)^m$, is a consequence of our main result (Theorem \ref{mainth}(1) for $s < 0 = r$). Although in this paper we do not prove Conjecture \ref{mainconj}, such conjecture is worth mentioning because it is very much related to our results.

\

Let $\varphi$ denote Euler's totient function, i.e. $\varphi(n)$ denotes the number of integers in $\{1,\ldots,n\}$ coprime to $n$. In this paper we consider the sum $$\sum_{x \in G} \frac{o(x)^s}{\varphi(o(x))^r}$$ for $r,s$ real numbers and compare it with the case of the cyclic group of size $|G|$. In the case $s=1$, $r=0$ this sum equals the sum of element orders, in the case $s=r=1$ it equals the sum of the cyclic subgroup sizes. Moreover if $s < 0 = r$ we get an extension of the case considered in \cite{suminverses} and the case $s=0$, $r=1$ gives the number of cyclic subgroups. This last case was what motivated us in the beginning, and as a particular case of our main theorem we obtain the following. Let $d(n)$ denote the number of positive divisors of the integer $n$.

\begin{teor} \label{motiv}
Let $G$ be a finite group. Then $G$ has at least $d(|G|)$ cyclic subgroups and $G$ has exactly $d(|G|)$ cyclic subgroups if and only if $G$ is cyclic.
\end{teor}

This theorem follows from Corollary \ref{cormotiv}.

Using the same techniques we also prove, in Section \ref{sprod}, the following:

\begin{teor} \label{thprod}
Let $G$ be a finite group of order $n$ and let $P_G := \prod_{x \in G} o(x)$. Then $P_G \leq P_{C_n}$ with equality if and only if $G$ is cyclic.
\end{teor}

We also obtain a very interesting characterization of nilpotency (Theorem \ref{mainth}(2)):

\begin{teor}
Let $r < 0$ be a real number and let $G$ be a finite group of order $n$. Then $$\sum_{x \in G} {\left( \frac{o(x)}{\varphi(o(x))} \right)}^r \geq \sum_{x \in C_n} {\left( \frac{o(x)}{\varphi(o(x))} \right)}^r$$ and equality holds if and only if $G$ is nilpotent.
\end{teor}

Let us be more specific about what we actually do in the paper. We prove the following result.

\begin{teor} \label{mainth}
Let $r,s$ be two real numbers, let $G$ be a finite group of order divisible by $n$ and let $$R_{G,n}(r,s) := \sum_{x \in G, o(x)|n} \frac{o(x)^s}{\varphi(o(x))^r}, \hspace{1cm} T_{G,n}(r,s) := R_{G,n}(r,s) - R_{C_{|G|},n}(r,s).$$Set $R_G(r,s) := R_{G,|G|}(r,s)$ and $T_G(r,s) := T_{G,|G|}(r,s)$.
\begin{enumerate}
\item If $s < r$ and $s \leq 0$ then $T_{G,n}(r,s) \geq 0$ with equality if and only if $G$ contains a unique cyclic subgroup of order $m$, for every divisor $m$ of $n$.
\item If $s = r < 0$ then $T_{G,n}(r,s) \geq 0$ with equality if and only if $G$ contains a unique subgroup of order $n$ and such subgroup is nilpotent.
\item If $r \leq s-1$ and $s \geq 1$ then $T_{G}(r,s) \leq 0$ with equality if and only if $G$ is cyclic.
\item If $G$ is nilpotent and non-cyclic then the sign of $T_{G}(r,s)$ equals the sign of $r-s$.
\end{enumerate}
\end{teor}

We prove this in Section \ref{main}. For the case $s \leq \min \{0,r\}$ we use Lemma \ref{nov} (a combinatorial tool, which is a key result in this paper) and for the case $s \geq \max \{1,r+1\}$ we adapt the arguments of \cite{isaacs}. In section \ref{examples}, for any positive integer $\gamma$, we construct infinitely many finite groups $G$ with exactly $d(|G|)+\gamma$ cyclic subgroups.

\section{The main result} \label{main}

In this section we prove Theorem \ref{mainth}.

\

As usual $\mathbb{N}$ denotes the set of natural numbers (in particular $0 \not \in \mathbb{N}$).

Denote by $\mu: \mathbb{N} \to \{0,1,-1\}$ (the M{\"o}bius function) the map taking $n$ to $0$ if $n$ is divisible by a square different from $1$, to $1$ if $n$ is a product of an even number of distinct primes and to $-1$ if $n$ is a product of an odd number of distinct primes. The following result is well-known.

\begin{prop}[M{\"o}bius inversion formula]
Let $f,g: \mathbb{N} \to \mathbb{C}$ be two functions such that $g(n) = \sum_{d|n} f(d)$ for all $n \in \mathbb{N}$. Then $f(n) = \sum_{d|n} \mu(d) g(n/d)$ for all $n \in \mathbb{N}$.
\end{prop}

An important example is the following. It is well-known that$\sum_{d|n} \varphi(d) = n$ for all $n \in \mathbb{N}$. This is because in the cyclic group of order $n$ for any divisor $d$ of $n$ there are exactly $\varphi(d)$ elements of order $d$. Applying the M{\"o}bius inversion formula we obtain $\varphi(n) = \sum_{d|n} \mu(n/d) d$.

The following is our key combinatorial tool.

\begin{lemma} \label{nov}
Let $A,B: \mathbb{N} \to \mathbb{C}$ be two functions such that $$\sum_{m|n} A(m) = B(n) \hspace{1cm} \forall n \in \mathbb{N}.$$ For $j,m \in \mathbb{N}$ and $r,s$ two real numbers such that $s \leq \min \{0,r\}$ set $$g^{r,s}_{m,j} := \sum_{i|j} \frac{\mu(i) (mi)^s}{\varphi(mi)^r}.$$ Then we have:
\begin{enumerate}
\item Write the prime factorizations of $j$ and $m$ as $j = {p_1}^{t_1} \cdots {p_k}^{t_k}$ and $m = m' {p_1}^{\alpha_1} \cdots {p_l}^{\alpha_l}$ where $l \leq k$ and $(m',j)=1$. Then $$g_{m,j}^{r,s} = \frac{m^s}{\varphi(m)^r} \cdot \prod_{t=1}^l \left( 1 - p_t^{s-r} \right) \cdot \prod_{t=l+1}^k \left(1-\frac{p_t^s}{(p_t-1)^r} \right).$$In particular $g_{m,j}^{r,s} \geq 0$ always and $g_{m,j}^{r,s} = 0$ if and only if one of the following holds:

\begin{itemize}
\item $s = r = 0$ and $j \neq 1$.
\item $s = r \neq 0$ and $l \geq 1$, i.e. $j$ and $m$ are not coprime.
\item $s = 0 \neq r$ and $p_t = 2$ for some $t \in \{l+1,\ldots,k\}$, i.e. $j$ is even and $m$ is odd.
\end{itemize}

\item $\sum_{m|n} \frac{m^s}{\varphi(m)^r} A(m) = \sum_{k|n} g_{k,n/k}^{r,s} B(k)$.

\item Suppose $\alpha, \beta$ are positive functions $\mathbb{N} \to \mathbb{R}$ with $\beta(n) = \sum_{m|n} \alpha(m)$ and $B(k) \geq \beta(k)$ for all divisors $k$ of $n$. Then $$\sum_{m|n} \frac{m^s}{\varphi(m)^r} A(m) \geq \sum_{m|n} \frac{m^s}{\varphi(m)^r} \alpha(m).$$Moreover equality holds if and only if $B(k) = \beta(k)$ for all divisors $k$ of $n$ such that $g_{k,n/k}^{r,s} \neq 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
\begin{enumerate}
\item Observe that since $\mu(i)$ is zero whenever $i$ is not square-free, $g_{m,j}^{r,s} = g_{m,p_1 \cdots p_k}^{r,s}$, hence we may assume $t_1 = \ldots = t_k = 1$. In the following computation the index $i$ will be written as ${p_1}^{\beta_1} \cdots {p_k}^{\beta_k}$ where $\beta_1,\ldots,\beta_k \in \{0,1\}$.
\begin{eqnarray}
g_{m,j}^{r,s} & = & m^s \sum_{i|j} \frac{\mu(i) i^s}{\varphi(mi)^r} = m^s \sum_{i|j} \frac{\mu(i) i^s}{\varphi({m'}{p_1}^{\alpha_1} \cdots {p_l}^{\alpha_l} \cdot i)^r} \nonumber \\ & = & \frac{m^s}{\varphi(m')^r} \sum_{i|j} \frac{\mu(i) i^s}{\varphi({p_1}^{\alpha_1} \cdots {p_l}^{\alpha_l} \cdot i)^r} \nonumber \\ & = & \frac{m^s}{\varphi(m')^r} \sum_{v \in \{1,\ldots,k\}, \beta_v \in \{0,1\}} \frac{\mu({p_1}^{\beta_1} \cdots {p_k}^{\beta_k}) {p_1}^{s \beta_1} \cdots {p_k}^{s \beta_k}}{\varphi({p_1}^{\alpha_1+\beta_1} \cdots {p_l}^{\alpha_l+\beta_l} {p_{l+1}}^{\beta_{l+1}} \cdots {p_k}^{\beta_k})^r} \nonumber \\ & = & \frac{m^s}{\varphi(m')^r} \sum_{v \in \{1,\ldots,k\}, \beta_v \in \{0,1\}} \frac{(-p_1^s)^{\beta_1} \cdots (-p_k^s)^{\beta_k}}{\prod_{t=1}^l (p_t-1)^r{p_t}^{r\alpha_t+r\beta_t-r} \prod_{t=l+1}^k (p_t-1)^{r\beta_t}} \nonumber \\ & = & \frac{m^s}{\varphi(m)^r} \sum_{v \in \{1,\ldots,k\}, \beta_v \in \{0,1\}} \frac{(-p_1^s)^{\beta_1} \cdots (-p_k^s)^{\beta_k}}{{p_1}^{r\beta_1} \cdots {p_l}^{r\beta_l} (p_{l+1}-1)^{r\beta_{l+1}} \cdots (p_k-1)^{r\beta_k}} \nonumber \\ & = & \frac{m^s}{\varphi(m)^r} \cdot \prod_{t=1}^l \left( 1-{p_t}^{s-r} \right) \cdot \prod_{t=l+1}^k \left(1-\frac{p_t^s}{(p_t-1)^r} \right). \nonumber
\end{eqnarray}
Since $s \leq r$ and $s \leq 0$, $g_{m,j}^{r,s}$ is a non-negative number, and it is zero if and only if either $p_t^{s-r}=1$ for some $t \in \{1,\ldots,l\}$, i.e. $l \geq 1$ and $s=r$, or $p_t^s=(p_t-1)^r$ for some $t \in \{l+1,\ldots,k\}$, i.e. $s=0$ and either $r=0$ or $p_t=2$ for some $t \in \{l+1,\ldots,k\}$, in other words $j$ is even and $m$ is odd.

\item We have
\begin{eqnarray}
\sum_{m|n} \frac{m^s}{\varphi(m)^r} A(m) & = & \sum_{m|n} \frac{m^s}{\varphi(m)^r} \sum_{k|m} B(k) \mu(m/k) = \sum_{k|m|n} \frac{m^s B(k) \mu(m/k)}{\varphi(m)^r} \nonumber \\ & = & \sum_{k|n,i|n/k} \frac{(ik)^s \mu(i)}{\varphi(ik)^r} B(k) = \sum_{k|n} \left( \sum_{i|n/k} \frac{\mu(i) (ik)^s}{\varphi(ik)^r} \right) B(k) \nonumber \\ & = & \sum_{k|n} g_{k,n/k}^{r,s} B(k). \nonumber
\end{eqnarray}

\item Since by point (1) $g_{k,n/k}^{r,s} \geq 0$ for all $k|n$, applying point (2) to $A,B$ and to $\alpha,\beta$ we obtain $$\sum_{m|n} \frac{m^s}{\varphi(m)^r} A(m) = \sum_{k|n} g_{k,n/k}^{r,s} B(k) \geq \sum_{k|n} g_{k,n/k}^{r,s} \beta(k) = \sum_{m|n} \frac{m^s}{\varphi(m)^r} \alpha(m).$$The statement about equality follows easily. This concludes the proof.
\end{enumerate}
\end{proof}

For $m$ a divisor of $|G|$ set $$c_m := |\{C \leq G\ :\ C\ \text{cyclic},\ |C|=m\}|,$$that is, the number of cyclic subgroups of $G$ of order $m$. Observe that $G$ has exactly $\varphi(m)c_m$ elements of order $m$. It follows that $G$ has exactly $\sum_{k|m} c_k \varphi(k)$ elements of order a divisor of $m$, that is, elements $x$ with the property that $x^m = 1$.

The following is a fundamental fact we will use in an essential way.
\begin{teor}[Frobenius \cite{frob} \cite{frobisaacsrob}] \label{frob}
Let $m$ be a divisor of $|G|$ and let $T_m$ be the set of elements $x \in G$ such that $x^m=1$. Then $m$ divides $|T_m|$.
\end{teor}
Thus we can write $$|T_m| = \sum_{k|m} c_k \varphi(k) = m f(m) \hspace{1cm} (\ast)$$ where $f(m) \geq 1$ is an integer depending on $m$ and $G$.

\

Let $r,s$ be two real numbers, let $G$ be a finite group of order divisible by $n$ and let $$R_{G,n}(r,s) := \sum_{x \in G, o(x)|n} \frac{o(x)^s}{\varphi(o(x))^r}, \hspace{1cm} T_{G,n}(r,s) := R_{G,n}(r,s) - R_{C_{|G|},n}(r,s).$$Set $R_G(r,s) := R_{G,|G|}(r,s)$ and $T_G(r,s) := T_{G,|G|}(r,s)$. Note that $T_G(0,0)=0$. We proceed with the proof of Theorem \ref{mainth}.

\subsection{Case $s<r$, $s \leq 0$} \label{case2}

\

We prove that if $s < r$ and $s \leq 0$ then $T_{G,n}(r,s) \geq 0$ with equality if and only if $G$ contains a unique cyclic subgroup of order $m$, for every divisor $m$ of $n$.

\

Observe that $$R_{G,n}(r,s) = \sum_{m|n} \frac{m^s}{\varphi(m)^{r-1}} c_m.$$ Apply Lemma \ref{nov} to $A(n) = c_n \varphi(n)$, $B(n) = n f(n)$, $\alpha(n) = \varphi(n)$, $\beta(n) = n$. Since $s < r$, if $s < 0$ then $T_{G,n}(r,s) \geq 0$ and equality holds if and only if $f(k) = 1$ for all divisors $k$ of $n$, i.e. $G$ has a unique cyclic subgroup of order $k$ for all divisors $k$ of $n$.

Now suppose that $s=0$. Then following the above argument we find that $g_{k,n/k}^{r,s} \geq 0$ with equality if and only if $p_t=2$ for some $t \in \{l+1,\ldots,h\}$. In other words, equality holds if and only if whenever $k$ is a divisor of $n$ such that either $k$ is even or $n/k$ is odd, $f(k)=1$. We prove that $f(k)=1$ for all divisors $k$ of $n$, from which it follows that if $m$ is a divisor of $n$ then $c_m = \frac{1}{\varphi(m)} \sum_{k|m} k f(k) \mu(m/k) = \frac{1}{\varphi(m)} \sum_{k|m} k \mu(m/k) = 1$, i.e. $G$ has a unique cyclic subgroup of order $m$. So let $k$ be a divisor of $n$. If $k$ is even then $f(k)=1$, and the same is true if $n/k$ is odd, so now suppose that $k$ is odd and $n/k$ is even. In particular $2k$ divides $n$ and is even, hence $f(2k)=1$. We prove that $f(k)=1$. If by contradiction $f(k) \neq 1$ then since $f(k)$ is a positive integer (by Frobenius Theorem), $f(k) \geq 2$ hence $kf(k) \geq 2k$, that is, there are at least $2k$ elements $x \in G$ such that $x^{k}=1$. But these elements also verify $x^{2k}=1$, and $|T_{2k}| = 2kf(2k) = 2k$, i.e. there are exactly $2k$ elements $x$ in $G$ verifying $x^{2k}=1$. This means that every $x \in G$ such that $x^{2k}=1$ verifies $x^k=1$. Now since $n/k$ is even $G$ has an element $x$ of order $2$, and since $k$ is odd $x^k=x$; on the other hand $x^{2k} = x^2 = 1$, a contradiction. Conversely, if $c_m = 1$ for all divisor $m$ of $n$ then if $m$ divides $n$, $f(m) = \frac{1}{m} \sum_{k|m} c_k \varphi(k) = \frac{1}{m} \sum_{k|m} \varphi(k) = 1$.

\subsection{Case $s = r < 0$} \label{case3}

\

We prove that if $s=r < 0$ then $T_{G,n}(r,s) \geq 0$ with equality if and only if $G$ contains a unique subgroup of order $n$ and such subgroup is nilpotent.

\

As above, using Lemma \ref{nov}, we find $T_{G,n}(r,s) \geq 0$, and equality holds if and only if $f(k) = 1$ whenever $k$ is a divisor of $n$ such that $k$ and $n/k$ are coprime. Applying this to the case when $k$ is a prime power we find that writing $n = p_1^{a_1} \cdots p_u^{a_u}$, $G$ has a unique subgroup of order $p_i^{a_i}$ (which must then be normal in $G$) for $i = 1,\ldots,u$, thus the product of such subgroups is the unique subgroup of $G$ of order $n$, and it is nilpotent. Conversely, if $G$ has a unique subgroup $N$ of order $n$ and $N$ is nilpotent then every Sylow subgroup of $N$ is the unique subgroup of $G$ of its size. Indeed if $P$ is a Sylow subgroup of $N$ and $N = PH$ with $(|P|,|H|)=1$ and $Q$ is some subgroup of $G$ such that $|P|=|Q|$ then $HQ$ is a subgroup of $G$ of order $n$ (because $H \unlhd G$ being the Sylow subgroups of $N$ normal in $G$), hence $HQ=N$ and this implies $Q=P$. Hence if $k$ is a divisor of $n$ such that $(k,n/k)=1$ then $f(k)=1$.

\subsection{Case $r \leq s-1$ and $s \geq 1$} \label{case4}

\

We prove that if $r \leq s-1$ and $s \geq 1$ then $T_{G}(r,s) \leq 0$ with equality if and only if $G$ is cyclic.

\

The following arguments are the natural generalization of the arguments in \cite{isaacs}. For $X$ a subset of $G$ define $\psi(X) := R_X(r,s) := \sum_{x \in X} \frac{o(x)^s}{\varphi(o(x))^r}$. The following is Lemma C in \cite{isaacs}.

\begin{lemma} \label{largep}
Let $p$ be the largest prime divisor of the integer $n > 1$. Then $\varphi(n) \geq n/p$.
\end{lemma}

\begin{lemma} \label{nphi}
Let $s \geq r$ be two real numbers. Let $m \neq 1$ be a positive divisor of $n$. Then $\frac{n^s}{\varphi(n)^r} \geq \frac{m^s}{\varphi(m)^r}$, and equality holds if and only if one of the following occurs.
\begin{itemize}
\item $s > r$ and $m=n$.
\item $s = r$ and each prime divisor of $n$ divides $m$.
\end{itemize}
\end{lemma}

\begin{proof}
Since the function $n \mapsto f(n) = \frac{n^s}{\varphi(n)^r}$ is multiplicative we may assume that $n = p^a$ and $m = p^b$ with $p$ a prime and $1 \leq b \leq a$. The inequality $f(n) \geq f(m)$ becomes $(p^s)^{a-b} \geq (p^r)^{a-b}$, i.e. $p^{(s-r)(a-b)} \geq 1$ which follows from $a \geq b$, $s \geq r$. If equality holds and $s > r$ we find $a=b$.
\end{proof}

\begin{lemma} \label{cosets}
Let $P$ be a cyclic normal Sylow $p$-subgroup of $G$. Let $x \in G$ and assume that the coset $Px$ has order $m$ as an element of $G/P$. Suppose $s > r$. Then $\psi(Px) \leq  \frac{m^s}{\varphi(m)^r} \psi(P)$ with equality if and only if $x$ centralizes $P$.
\end{lemma}

\begin{proof}
The case $m=1$ is clear, so now assume $m > 1$. Since $m$ divides $o(x)$ we can write $o(x) = mq$ for some integer $q$. Then $q = o(x^m)$ and as $x^m \in P$, we see that $q$ is a power of $p$. But $m$ divides $|G/P|$, which is not divisible by $p$, so $q$ and $m$ are coprime, and there exists an integer $n$ such that $qn \equiv 1 \mod m$. Now $o(x^q) = m$ and we write $y=(x^q)^n$ so that $o(y) = m$ because $n$ is coprime to $m$. Also $Py = Px^{qn} = (Px)^{qn} = Px$ so since $P$ is abelian, $y$ centralizes $P$ if and only if $x$ centralizes $P$. We can thus replace $x$ by $y$ and assume that $o(x) = m$.

\

Every element of $Px$ has the form $ux$ for some element $u \in P$, and we argue that $\frac{o(ux)^s}{\varphi(o(ux))^r} \leq \frac{m^s}{\varphi(m)^r} \frac{o(u)^s}{\varphi(o(u))^r}$ with equality if and only if $x$ centralizes $u$. Since $P$ is cyclic, $\langle u \rangle$ is characteristic in $P$, and thus $\langle u \rangle \unlhd G$ and $\langle u \rangle \langle x \rangle$ is a subgroup. Now $ux$ is an element of $\langle u \rangle \langle x \rangle$, so $o(ux)$ divides $|\langle u \rangle \langle x \rangle| = m o(u)$, and if equality holds then $\langle u \rangle \langle x \rangle$ is cyclic hence $x$ centralizes $u$, and conversely if $x$ centralizes $u$ then since $o(x)$ and $o(u)$ are coprime, $o(ux) = o(u)o(x) = mo(u)$. Since $s > r$ it follows from Lemma \ref{nphi} that $\frac{o(ux)^s}{\varphi(o(ux))^r} \leq \frac{m^s o(u)^s}{\varphi(m o(u))^r} = \frac{m^s}{\varphi(m)^r} \frac{o(u)^s}{\varphi(o(u))^r}$ with equality if and only if $x$ centralizes $u$. Now
\begin{eqnarray}
\psi(Px) & = & \sum_{u \in P} \frac{o(ux)^s}{\varphi(o(ux))^r} \leq \sum_{u \in P} \frac{m^s}{\varphi(m)^r} \frac{o(u)^s}{\varphi(o(u))^r} \nonumber \\ & = & \frac{m^s}{\varphi(m)^r} \sum_{u \in P} \frac{o(u)^s}{\varphi(o(u))^r} = \frac{m^s}{\varphi(m)^r} \psi(P). \nonumber
\end{eqnarray}
Moreover equality holds if and only if $x$ centralizes $u$ for every $u \in P$, i.e. $x$ centralizes $P$.
\end{proof}

\begin{cor} \label{psigp}
Let $P$ be a cyclic normal Sylow $p$-subgroup of $G$. Then $\psi(G) \leq \psi(P) \psi(G/P)$ with equality if and only if $P$ is central in $G$.
\end{cor}

\begin{proof}
Write $o(Px)$ to denote the order of a coset $Px$ viewed as an element of $G/P$. Applying Lemma \ref{cosets} to each coset of $P$ in $G$ we have
\begin{eqnarray}
\psi(G) & = & \sum_{Px \in G/P} \psi(Px) \leq \sum_{Px \in G/P} \frac{o(Px)^s}{\varphi(o(Px))^r} \psi(P) \nonumber \\ & = & \psi(P) \sum_{Px \in G/P} \frac{o(Px)^s}{\varphi(o(Px))^r} = \psi(P) \psi(G/P). \nonumber
\end{eqnarray}
By Lemma \ref{cosets} equality holds if and only if every element $x \in G$ centralizes $P$, i.e. $P$ is central in $G$.
\end{proof}

We show that if $T_G(r,s) \geq 0$ then $G$ is cyclic, and we do it by induction on $|G|$. This is a straightforward generalization of the argument used in \cite{isaacs} (proof of the main theorem). Assume $T_G(r,s) \geq 0$, i.e. $R_G(r,s) \geq R_{C_n}(r,s)$, which we can write as $\psi(G) \geq \psi(C_n)$ where $n = |G|$. Then averaging on $G$ and using the fact that $C_n$ has $\varphi(n)$ elements of order $n$ and Lemma \ref{largep}, where $p$ is the largest prime divisor of $n$, we find
\begin{eqnarray}
\frac{1}{|G|} \sum_{x \in G} \frac{o(x)^s}{\varphi(o(x))^r} & \geq & \frac{1}{n} \sum_{x \in C_n} \frac{o(x)^s}{\varphi(o(x))^r} > \frac{1}{n} \frac{n^s}{\varphi(n)^r} \varphi(n) \nonumber \\ & \geq & \frac{1}{n} \frac{n^s}{\varphi(n)^r} \frac{n}{p} \geq \frac{n^s}{\varphi(n)^r} \frac{1}{p}. \nonumber
\end{eqnarray}
The strict inequality comes from the fact that we did not count the contribution of the identity element of $C_n$. This implies that there exists at least one element $x \in G$ ``not below the average'', i.e. such that $$\frac{o(x)^s}{\varphi(o(x))^r} > \frac{n^s}{\varphi(n)^r} \frac{1}{p}.$$ Let $m = o(x)$. Since $s \geq 1$ we have $(n/m)^{s-1} \geq (\varphi(n)/\varphi(m))^{s-1}$ by Lemma \ref{nphi}, and since $s-1 \geq r$ we have $(\varphi(n)/\varphi(m))^{s-1} \geq (\varphi(n)/\varphi(m))^r$. We deduce that $$|G:\langle x \rangle| = \frac{n}{m} \leq \frac{n}{m} \cdot \frac{(n/m)^{s-1}}{(\varphi(n)/\varphi(m))^r} = \frac{(n/m)^s}{(\varphi(n)/\varphi(m))^r} < p.$$Hence $p$ does not divide $|G:\langle x \rangle|$, in other words $\langle x \rangle$ contains a Sylow $p$-subgroup $P$ of $G$. Moreover $\langle x \rangle \subseteq N_G(P)$ hence $|G:N_G(P)| < p$ and it follows from the Sylow theorem that $|G:N_G(P)|=1$, i.e. $P \unlhd G$. Corollary \ref{psigp} then implies that $\psi(G) \leq \psi(P) \psi(G/P)$ with equality if and only if $P$ is central in $G$. Let $Q$ be the Sylow $p$-subgroup of $C = C_n$, so that $P \cong Q$ and $\psi(P) = \psi(Q)$. We have $$\psi(P) \psi(G/P) \geq \psi(G) \geq \psi(C) = \psi(Q) \psi(C/Q) = \psi(P) \psi(C/Q)$$hence $\psi(G/P) \geq \psi(C/Q)$. By the induction hypothesis we deduce that $G/P$ is cyclic. Then $G/P \cong C/Q$ and hence $\psi(G/P) = \psi(C/Q)$. Thus equality holds in the above chain of inequalities and thus $P$ is central in $G$.

Since $P$ is central and $G/P$ is cyclic, it follows that $G$ is abelian, and as $P$ is a Sylow subgroup of $G$, we know that we can write $G = P \times B$ where $B \cong G/P$ is cyclic. Thus $G$ is a direct product of cyclic groups of coprime orders, and thus $G$ is cyclic, as required.

\subsection{Nilpotent case} \label{case5}

\

We prove that if $G$ is nilpotent and non-cyclic then the sign of $T_{G}(r,s)$ equals the sign of $r-s$.

\

By Lemma \ref{nov} applied to $A(n) = c_n \varphi(n)$, $B(n) = n f(n)$, we have $R_G(r,s) = \sum_{k|n} g^{r,s}_{k,n/k} kf(k)$, hence $$T_G(r,s) = \sum_{k|n} g^{r,s}_{k,n/k} k(f(k)-1).$$ Suppose first that $|G| = p^d$ with $p$ a prime. We then have
\begin{align*}
T_G(r,s) & = \sum_{i=0}^d g^{r,s}_{p^i,p^{d-i}} p^i(f(p^i)-1) = \sum_{i=1}^{d-1} g^{r,s}_{p^i,p^{d-i}} p^i(f(p^i)-1),
\end{align*}
where we used that $f(1) = 1 = f(p^d)$. Now, for $1 \leq i \leq d$ we have $g^{r,s}_{p^i,p^{d-i}} = \frac{p^{is}}{\varphi(p^i)^r}(1-p^{s-r})$. Therefore $g^{r,s}_{p^i,p^{d-i}} < 0$ if and only if $s > r$, $g^{r,s}_{p^i,p^{d-i}} > 0$ if and only if $s < r$, and $g^{r,s}_{p^i,p^{d-i}} = 0$ if and only if $s = r$. Since $G$ is non-cyclic, $f(p^i) \neq 1$ for some $1 \leq i \leq d$ hence $T_G(r,s) < 0$ if $s > r$, $T_G(r,s) = 0$ if $r = s$ and $T_G(r,s) > 0$ if $s < r$.

Now assume that $G$ is any nilpotent non-cyclic group, and write $G = P_1 \times \cdots \times P_t$ as direct product of its Sylow subgroups. Note that $R_G(r,s)$ is multiplicative in the sense that if $A,B$ are groups of coprime orders then $R_{A \times B}(r,s) = R_A(r,s) R_B(r,s)$. Write $|P_i| = p_i^{a_i}$ and $n = |G| = p_1^{a_1} \cdots p_t^{a_t}$. If $r < s$ then, since $G$ is non-cyclic, by our above discussion of $p$-groups $R_{P_i}(r,s) < R_{C_{p_i^{a_i}}}(r,s)$ for some $i \in \{1,\ldots,t\}$ hence taking the product we find $R_G(r,s) < R_{C_n}(r,s)$. Similarly if $r > s$ then $R_G(r,s) > R_{C_n}(r,s)$ and if $r=s$ then $R_G(r,s) = R_{C_n}(r,s)$.

\section{Some observations}

Consider now the case $(r,s) = (1,0)$. In this case the result looks as follows. Let $d(n)$ denote the number of positive divisors of the integer $n$.

\begin{cor} \label{cormotiv}
Let $n$ be a divisor of $|G|$. Then $G$ has at least $d(n)$ cyclic subgroups of order a divisor of $n$. Moreover the following are equivalent.
\begin{enumerate}
\item For all divisors $m$ of $n$, $G$ has exactly $m$ elements $x$ such that $x^m=1$.
\item $G$ has exactly $d(n)$ cyclic subgroups of order a divisor of $n$.
\item The subgroup generated by the cyclic subgroups of $G$ of order a divisor of $n$ is cyclic and has order $n$.
\end{enumerate}
\end{cor}

\begin{proof}
We prove that the number of cyclic subgroups of a finite group $G$ whose order divides $n$ equals $\sum_{x \in G, o(x)|n} \frac{1}{\varphi(o(x))}$. Let $\langle x_1 \rangle, \ldots, \langle x_k \rangle$ be the distinct cyclic subgroups of $G$ of order a divisor of $n$. Then $\langle x_i \rangle$ contains $\varphi(o(x_i))$ elements of order $o(x_i)$. For $x, y \in G$ write $x \sim y$ if $x,y$ generate the same cyclic subgroup of $G$. Then $\sim$ is an equivalence relation in $\{x \in G\ :\ o(x)|n\}$ hence $$\sum_{x \in G,o(x)|n} \frac{1}{\varphi(o(x))} =  \sum_{i=1}^k \sum_{x \sim x_i} \frac{1}{\varphi(o(x))} = \sum_{i=1}^k \frac{\varphi(o(x_i))}{\varphi(o(x_i))} = k.$$Now the result follows from Theorem \ref{mainth} choosing $(r,s) = (1,0)$.
\end{proof}

\includegraphics{detectflip3.png}

De Medts and Tarnauceanu in \cite{medts2} prove that if $G$ is nilpotent then $T_G(1,1)=0$, and they conjecture that the converse holds, namely if $T_G(1,1)=0$ then $G$ is nilpotent. Also, they conjecture in \cite{medts} that $T_G(1,1) \leq 0$ for all finite groups $G$.

\begin{question}
Does the equation $T_G(r,s)=0$ detect solvability of $G$ for some $(r,s)$? (This is a version of a question of Thompson, cf. \cite{medts2}).
\end{question}

\begin{question}
What structural properties of $G$ can be detected by the equation $T_G(r,s)=0$ (for fixed $r,s$)?
\end{question}

\begin{question}
Is the set of pairs $(r,s)$ for which cyclic groups are detected by the equation $T_G(r,s)=0$ dense in $\mathbb{R}^2$?
\end{question}

In the picture above the point $O = (0,0)$ does not detect anything, $A = (1,0)$ (which corresponds to the number of cyclic subgroups of $G$) and $C = (0,1)$ (which corresponds to the sum of the orders of the elements of $G$) detect cyclicity and whether $B = (1,1)$ detects nilpotency is the question of De Medts and Tarnauceanu. The checked zone detects cyclicity and the thick line detects nilpotency.

\section{Proof of Theorem \ref{thprod}} \label{sprod}

Let $G$ be a finite group of order $n$. For a divisor $d$ of $n$ let $A(d)$ be the number of elements of $G$ of order $d$. Then $P_G := \prod_{x \in G} o(x) = \prod_{d|n} d^{A(d)}$ hence $\log(P_G) = \sum_{d|n} A(d) \log(d)$. Let $B(m)$ be the size of $\{x \in G\ :\ x^m=1\} \subseteq G$ for $m|n$. Then $\sum_{d|m} A(d) = B(m)$. We compute

\begin{eqnarray}
\sum_{m|n} \log(m) A(m) & = & \sum_{m|n} \log(m) \sum_{k|m} B(k) \mu(m/k) = \sum_{k|m|n} \log(m) B(k) \mu(m/k) \nonumber \\ & = & \sum_{k|n, i|n/k} \log(ik) \mu(i) B(k) = \sum_{k|n} \left( \sum_{i|n/k} \mu(i) \log(ik) \right) B(k) \nonumber \\ & = & \sum_{k|n} g_{k,n/k} B(k) \nonumber
\end{eqnarray}
where $g_{m,j} = \sum_{i|j} \mu(i) \log(mi)$. Clearly $g_{m,1} = \log(m)$ and if $j > 1$ then $g_{m,j} = \sum_{i|j} \mu(i) \log(i)$. We now compute $g_{m,j}$ for $j > 1$. If $j$ is a power of a prime $p$ then $g_{m,j} = -\log(p)$. Now assume this is not the case. Let $P$ be the set of prime divisors of $j$, so that $|P| > 1$. We prove that $g_{m,j} = 0$.
\begin{eqnarray}
g_{m,j} & = & \sum_{i|j} \mu(i) \log(i) = \sum_{I \subseteq P} (-1)^{|I|} \sum_{p \in I} \log(p) \nonumber \\ & = & \sum_{p \in P} \sum_{p \in I \subseteq P} (-1)^{|I|} \log(p) = - \sum_{p \in P} \log(p) \sum_{I \subseteq P-\{p\}} (-1)^{|I|} = 0. \nonumber
\end{eqnarray}
We used that $P-\{p\} \neq \emptyset$.

In conclusion, writing $n = p_1^{c_1} \cdots p_t^{c_t}$ and $B_i := \sum_{j=1}^{c_i} B(n/p_i^j)$ we have that $\log(P_G)$ equals
\begin{align*}
\sum_{m|n} \log(m) A(m) = & \sum_{k|n} g_{k,n/k} B(k) = \log(n) B(n) - \sum_{i=1}^t \log(p_i) \sum_{j=1}^{c_i} B(n/p_i^{j}) \\ = & \log \left( \frac{n^{B(n)}}{p_1^{\sum_{j=1}^{c_1} B(n/p_1^{j})} \cdots p_t^{\sum_{j=1}^{c_t} B(n/p_t^{j})}} \right) = \log \left( \frac{n^{B(n)}}{p_1^{B_1} \cdots p_t^{B_t}} \right).
\end{align*}
Since $B(n)=n$ we obtain that $$P_G = \frac{n^{n}}{p_1^{B_1} \cdots p_t^{B_t}}.$$
Since $B(m) \geq m$ for all $m|n$ (by Frobenius Theorem), we obtain $$P_G = \frac{n^{n}}{p_1^{B_1} \cdots p_t^{B_t}} \leq \frac{n^{n}}{p_1^{\sum_{j=1}^{c_1} n/p_1^{j}} \cdots p_t^{\sum_{j=1}^{c_t} n/p_t^{j}}} = P_{C_n}.$$Suppose now that equality holds. Then $B(n/p_i^{j}) = n/p_i^{j}$ for $i = 1,\ldots,t$ and $j = 1,\ldots,c_i$. In particular if $p|n$ then $B(n/p) = n/p$ hence there are $n-n/p > 1$ elements of $G$ of order not dividing $n/p$, in particular the Sylow $p$-subgroups of $G$ are cyclic. In particular if $G$ is a $p$-group we are done, so now assume that $n$ is divisible by at least two distinct primes. Let $P$ be a Sylow $p$-subgroup of $G$. We prove that $P$ is central in $G$. To do this it is enough to show that for all prime $q$ dividing $n$ there is a Sylow $q$-subgroup $Q$ of $G$ which centralizes $P$. If $p=q$ choose $Q=P$. Now suppose $q \neq p$. Write $c_p$, $c_q$ for the positive integers such that $p^{c_p}$, $q^{c_q}$ are the largest powers of $p,q$ dividing $n$, respectively. It is enough to prove that $G$ contains elements of order $p^{c_p} q^{c_q}$. There are $n/p$ elements of order dividing $n/p$ and $n/q$ elements of order dividing $n/q$, hence there are at least $n-n/p-n/q$ elements of order not dividing $n/p$ and not dividing $n/q$, in other words there are at least $n-n/p-n/q$ elements of order divisible by $p^{c_p} q^{c_q}$, a suitable power of which has order $p^{c_p} q^{c_q}$. We only need to make sure that $n-n/p-n/q > 0$. We have $n-n/p-n/q \geq n-n/2-n/3 = n/6 > 0$.

Since the Sylow subgroups of $G$ are central and cyclic, $G$ is cyclic. The proof is completed.

\section{An example} \label{examples}

Let $\gamma$ be a fixed positive integer. In this section we construct infinitely many finite groups $G$ with exactly $d(|G|) + \gamma$ cyclic subgroups. This is done by applying Proposition \ref{subcont} with $m=3$, $\beta = 5^{\gamma-1}$.

\

Let $\alpha, \beta, m, u$ be positive integers with $\alpha = 2^u \beta$ (since $u \geq 1$, $\alpha$ is even), $\beta$ odd and $(\alpha,m) = 1$. Let $G := C_m \rtimes C_{\alpha}$ where the action of $C_{\alpha} = \langle x \rangle$ on $C_m = \langle a \rangle$ is given by inversion: $a^x = x^{-1}ax = a^{-1}$.

\begin{prop} \label{subcont}
The number of cyclic subgroups of $G$ is $d(|G|) + d(\beta) (m-d(m))$.
\end{prop}

For the record, $$T_G(r,s) = \frac{2^{us}}{\varphi(2^u)^{r-1}} (m-\sigma_{r,s}(m)) \sigma_{r,s}(\beta)$$ where $\sigma_{r,s}(x) := \sum_{i|x} \frac{i^s}{\varphi(i)^{r-1}}$.

\begin{proof}
We will first find the cyclic subgroups generated by elements of the form $a^r x^w$ where $w$ divides $\beta$ and then we will look at the elements of the form $a^r x^{2t}$.

\

Let $r \in \{0,\ldots,m-1\}$ and let $w$ be a divisor of $\beta$. We compute $o(a^r x^w)$. Since $\beta$ is odd, $w$ is odd, hence $a^{x^w} = a^{-1}$ hence $(a^r x^w)^2 = x^{2w}$. This implies that $(a^r x^w)^n$ equals $x^{nw}$ if $n$ is even and $a^r x^{nw}$ if $n$ is odd, implying that $o(a^r x^w) = o(x^w) = \alpha/w$, which is divisible by $2^u$. Moreover clearly $a^r$ is determined by $\langle a^r x^w \rangle$ (all the elements of $\langle a^r x^w \rangle$ outside $\langle x \rangle$ are of the form $a^r x^{nw}$) and $x^w$ is determined by $\langle a^r x^w \rangle$ because $o(a^r x^w) = \alpha/w$. This means that different pairs $(r,w)$ give rise to distinct cyclic subgroups $\langle a^r x^w \rangle$. Hence there are $m d(\beta)$ such subgroups. Hence we have found $m d(\beta)$ cyclic subgroups of the form $a^r x^w$ where $w$ is a divisor of $\beta$ (so $w$ is odd).

\

Since $a$ commutes with $x^2$ we have $(ax^2)^n = a^n x^{2n}$ hence $o(ax^2) = m \alpha/2$. Moreover the elements of $G$ of the form $a^r x^{2t}$ (i.e. $a^r$ times an even power of $x$) verify $(a^r x^{2t})^{m \alpha/2} = a^{rm} x^{\alpha} = 1$ hence their order divides $m \alpha/2$, on the other hand there are exactly $m \alpha/2$ such elements hence they all belong to $\langle a x^2 \rangle$. This proves that $\langle a x^2 \rangle$ is the only cyclic subgroup of $G$ of order $m \alpha/2$.

\

We have found $m d(\beta) + d(m \alpha/2)$ cyclic subgroups of $G$. We have $d(|G|) = d(m \beta 2^u) = (u+1) d(m) d(\beta)$ and $d(m \alpha/2) = d(m) d(\beta) u$, hence $$m d(\beta) + d(m \alpha/2) = m d(\beta) + d(m) d(\beta) u = d(|G|) + m d(\beta) - d(m) d(\beta).$$ Therefore all we are left to show is that the cyclic subgroups we listed are all the cyclic subgroups of $G$.

\

We need to show that if $C$ is a cyclic subgroup of $G$ of order divisible by $2^u$ then $C$ is generated by an element of the form $a^r x^w$ with $w$ a divisor of $\beta$. Say $C$ is generated by $a^r x^t$. Then $t$ is odd, indeed if $t$ is even then $a^r$ and $x^t$ commute hence $(a^r x^t)^{m \alpha/2} = 1$, contradicting the fact that $o(a^r x^t)$ is divisible by $2^u$. Now, similarly as above, $a^r x^t$ has order $o(x^t) = \alpha/w$ where $w = (\alpha,t)$ is an odd divisor of $\alpha$, that is, a divisor of $\beta$. Since $\langle x^t \rangle = \langle x^w \rangle$ there is some integer $s$ such that $x^{ts}=x^w$ and $s$ is coprime to $o(x^t)=o(a^rx^t)$. This implies that $\langle a^r x^t \rangle = \langle (a^r x^t)^s \rangle$ and $(a^r x^t)^s$ equals $a^r x^w$ if $s$ is odd, it equals $x^w$ if $s$ is even.
\end{proof}

\section{Acknowledgements}

We are really grateful to Andrea Lucchini and Federico Menegazzo for helpful discussions, comments and suggestions. We are also very grateful to the referee for his/her very careful reading of a previous version of the paper.


Comparing Measures of Sparsity

Abstract: Sparsity of representations of signals has been shown to be a key concept of fundamental importance in fields such as blind source separation, compression, sampling and signal analysis. The aim of this paper is to compare several commonlyused sparsity measures based on intuitive attributes. Intuitively, a sparse representation is one in which a small number of coefficients contain a large proportion of the energy. In this paper six properties are discussed: (Robin Hood, Scaling, Rising Tide, Cloning, Bill Gates and Babies), each of which a sparsity measure should have. The main contributions of this paper are the proofs and the associated summary table which classify commonly-used sparsity measures based on whether or not they satisfy these six propositions and the corresponding proofs. Only one of these measures satisfies all six: The Gini Index. measures based on whether or not they satisfy these six propositions and the corresponding proofs. Only one of these measures satisfies all six: The Gini Index.

\section{Introduction}
\label{sec:intro} Whether with sparsity constraints or with sparsity
assumptions, the concept of sparsity is readily used in diverse areas
such as oceanic engineering \cite{li07estimation}, antennas and
propagation \cite{adams08sparse}, face recognition
\cite{wright08robust}, image processing
\cite{mairal08sparse,aharon08sparse} and medical imaging
\cite{leung08sparse}. Sparsity has also played a central role in the
success of many machine learning algorithms and techniques such as
matrix factorization \cite{gupta97highly}, signal recovery/extraction
\cite{ tropp06just}, denoising \cite{candes07enhancing, zhu08stable},
compressed sensing \cite{mishali08reduce}, dictionary learning
\cite{aharon06algorithm}, signal representation \cite{akcakaya08frame,
gribonval03sparse}, support vector machines \cite{licheng07sparse},
sampling theory \cite{blu08sparse,goyal08compressive} and source
separation/localization \cite{ogrady05survey,he07convolutive}. For
example, one method of source separation is to transform the signal to
a domain in which it is sparse (e.g.  time-frequency or wavelet) where
the separation can be performed by a partition of the transformed
signal space due to the sparsity of the representation
\cite{rickard07DUET, yilmaz04blind}. There has also been research in
the uniqueness of sparse solutions in overcomplete representations
\cite{elad06sparse,bruckstein08uniqueness}.

There are many measures of sparsity. Intuitively, a sparse
representation is one in which a small number of coefficients contain
a large proportion of the energy. This interpretation leads to further
possible alternative measures. Indeed, there are dozens of measures of
sparsity used in the literature. Which of the sparsity measures is the
best?  In this paper we suggest six desirable characteristics of
measures of sparsity and use them to compare fifteen popular sparsity
measures.

Considering the nebulous definition of sparsity we begin by examining
how a sparsity measure should behave in certain scenarios.  In
Sec.~\ref{sec:crit} we define six such scenarios and formalize these
scenarios in six mathematical criteria that capture this desirable
behavior. We prove two theorems showing that satisfaction of some
combinations of criteria result in automatic compliance with a
different criteria. In Sec.~\ref{sec:meas} we introduce the most
commonly-used sparsity measures in the literature. We elaborate on one
of these measures, the Gini Index, as it has many desirable
characteristics including the ability to measure the sparsity of a
distribution. We also show graphically how some measures treat
components of different magnitude.  In Sec.~\ref{sec:comp} we present
the main result of this work, namely, the comparison of the fifteen
commonly-used sparsity measures using the six criteria. We show that
the only measure to satisfy all six is the Gini Index.  Proofs of the
table are attached in Appendices~\ref{sec:cex} and \ref{sec:proofs}. A
preliminary report on these results (without proofs) appeared in
\cite{hurley08comparing}. We then compare the fifteen measures
graphically on data drawn from two sets of parameterized
distributions. We select distributions for which we can control the
`sparsity'. This allows us to visualize the behavior of the sparsity
measures in view of the sparse criteria. In Sec.~\ref{sec:concl} we
present some conclusions. The main conclusion is that from the fifteen
measures, only the Gini Index satisfies all six criteria, and, as
such, we encourage its use and study.

\section{The Six Criteria}
\label{sec:crit}
The following are six desirable attributes of a measure of
sparsity. The first four, {$D1$}~through {$D4$}, were originally applied in
a financial setting to measure the inequity of wealth distribution in
\cite{dalton20measurement}. The last two, {$P1$}~and {$P2$}, were proposed
in \cite{rickard04gini}. Distribution of wealth can be used
interchangeably with distribution of energy of coefficients and where
convenient in this paper, we will keep the financial interpretation in
the explanations.  Inequity of distribution is the same as
sparsity. An equitable distribution is one with all coefficients
having the same amount of energy, the least sparse distribution.

\begin{itemize}
\item[{$D1$}] {\em Robin Hood} - Robin Hood decreases sparsity (Dalton's
1st Law). Stealing from the rich and giving to the poor decreases the
inequity of wealth distribution (assuming we do not make the rich poor
and the poor rich). This comes directly from the definition of a
sparse distribution being one for which most of the energy is
contained in only a few of the coefficients.
\item[{$D2$}] {\em Scaling} - Sparsity is scale invariant (Dalton's
modified 2nd Law \cite{arnold86majorization}). Multiplying wealth by a
constant factor does not alter the effective wealth distribution. This
means that relative wealth is important, not absolute wealth. Making
everyone ten times more wealthy does not affect the effective
distribution of wealth. The rich are still just as rich and the poor
are still just as poor.
\item[{$D3$}] {\em Rising Tide} - Adding a constant to each coefficient
decreases sparsity (Dalton's 3rd Law).  Give everyone a trillion
dollars and the small differences in overall wealth are then
negligible so everyone will have effectively the same wealth. This is
intuitive as  adding a constant energy to each coefficient reduces
the relative difference of energy between large and small
coefficients. This law assumes that the original distribution contains
at least two individuals with different wealth. If all individuals
have identical wealth, then by {$D2$}~ there should be no change to the
sparsity for multiplicative or additive constants.
\item[{$D4$}] {\em Cloning} - Sparsity is invariant under cloning
(Dalton's 4th Law). If there is a twin population with identical
wealth distribution, the sparsity of wealth in one population is the
same for the combination of the two.
\item[{$P1$}] {\em Bill Gates} - Bill Gates increases sparsity. As one
individual becomes infinitely wealthy, the wealth distribution becomes
as sparse as possible.
\item[{$P2$}] {\em Babies} - Babies increase sparsity. In populations
with non-zero total wealth, adding individuals with zero wealth to a
population increases the sparseness of the distribution of wealth.
\end{itemize}

These criteria give rise to the sparsest distribution being one with
one individual owning all the wealth and the least sparse being one
with everyone having equal wealth.

Dalton \cite{dalton20measurement} proposed that multiplication by a
constant should decrease inequality. This was revised to the more
desirably property of scale invariance. Dalton's fourth principle,
{$D4$}, is somewhat controversial. However, if we have a distribution
from which we draw coefficients and measure the sparsity of the
coefficients which we have drawn, as we draw more and more
coefficients we would expect our measure of sparsity to converge.
{$D4$}~ captures this concept.
\begin{quote}
`Mathematically this [{$D4$}] requires that the measure of inequality of
the population should be a function of the sample distribution
function of the population. Most common measures of inequality
satisfy this last principle.'\cite{arnold86majorization}
\end{quote}
Interestingly, most measures of sparsity do not satisfy this
principle, as we shall see.

We define a sparse measure $S$ as the a function with the following
mapping
\begin{equation}\label{eq:spmeasC}
S:\left(\bigcup_{n\geq1}\mathbb{C}^n \right)\rightarrow\mathbb{R}
\end{equation}
where $n \in \mathbb{N}$ is the number of coefficients. Thus $S$ maps
complex vectors to a real number.

There are two crucial, core, underlying attributes which our sparsity
measures must satisfy. As all measures satisfy these two conditions
trivially we will not comment on them further except to define them.
\begin{itemize}
\item[{$A1$}] $S({\vec{c}}) = S(\Pi{\vec{c}})$ where $\Pi$ denotes permutation, that
is, the sparsity of any permutation of the coefficients is the
same. This means that the ordering of the coefficients is not
important.
\item[{$A2$}] The sparsity of the coefficients is calculated using the magnitudes of the coefficients. This
means we can assume we are operating in the positive orthant, without
loss of generality.
\end{itemize}

By {$A2$}~ we can assume we are operating in the positive orthant, and as
such we can rewrite (\ref{eq:spmeasC}) as
\begin{equation}\label{eq:spmeasR}
S:\left(\bigcup_{n\geq1}\mathbb{R}_{+}^n \right)\rightarrow\mathbb{R},
\end{equation}
which is more consistent with the wealth interpretation.

We will use the convention that $S({\vec{c}})$ increases with increasing
sparsity where ${\vec{c}}=\left[ \begin{array}{cccc} c_1& c_2&\cdots \end{array} \right]$ are the
coefficient strengths. Given vectors
\begin{eqnarray*}
{\vec{c}}&=&\left[ \begin{array}{ccccc} c_1& c_2&\cdots &c_N\end{array} \right]\\
{\vec{d}}&=&\left[ \begin{array}{ccccc} d_1& d_2&\cdots &d_M\end{array} \right]
\end{eqnarray*}
we define concatenation, which we use $\|$ to denote, as
\[
{\vec{c}}\|{\vec{d}} = \left[ \begin{array}{cccccccc} c_1& c_2&\cdots &c_N&d_1& d_2&\cdots &d_M\end{array} \right].
\]
We also define the addition of adding a constant to a vector as the
addition of that constant to each element of the vector, that is,
for $\alpha in \mathbb{R}$,
\[
{\vec{c}} + \alpha  =\left[ \begin{array}{ccccc} c_1 + \alpha& c_2 + \alpha&\cdots &c_N + \alpha\end{array} \right].
\]
The six sparse criteria can be formally defined as follows:
\begin{itemize}
\item[{$D1$}] {\em Robin~Hood}:\\{\small $S(\left[ \begin{array}{cccccc}c_1& \cdots& c_i-\alpha&
\ldots& c_j+\alpha& \ldots\end{array} \right] )$ $<S({\vec{c}})$} for all $\alpha, c_i, c_j $
such that $c_i>c_j$ and $0<\alpha < \frac{c_i-c_j}{2}$.
\item[{$D2$}] {\em Scaling}:\\ $S(\alpha{\vec{c}}) = S({\vec{c}})$, $\forall \alpha \in \mathbb{R},~\alpha > 0$.
\item[{$D3$}] {\em Rising Tide}:\\$S(\alpha + {\vec{c}})<S({\vec{c}})$, $\alpha \in
\mathbb{R},~\alpha > 0$ (We exclude the case $c_1 = c_2 = c_3 = \cdots
= c_i = \cdots \forall i$ as this is equivalent to scaling.).
\item[{$D4$}] {\em Cloning}:\\$ S({\vec{c}}) = S({\vec{c}}\|{\vec{c}}) = S({\vec{c}}\|{\vec{c}}\|{\vec{c}}) = S({\vec{c}}\|{\vec{c}}\|\cdots\|{\vec{c}})$.
\item[{$P1$}] {\em Bill Gates}:\\  $\forall i \exists \beta = \beta_i>0$, such that $\forall \alpha >0:$ {\small \[S(\left[ \begin{array}{cccc}c_1& \ldots& c_i+\beta+\alpha&\ldots\end{array} \right])>S(\left[ \begin{array}{cccc}c_1&\ldots&c_i+\beta& \ldots\end{array} \right]).\]}
\item[{$P2$}] {\em Babies}:\\$S({\vec{c}}||0) > S({\vec{c}})$.
\end{itemize}

As stated above, when proving {\em Rising Tide} we exclude the
scenario where all coefficients are equal. In this case, adding a
constant is actually a form of scaling. Another interpretation is that
the case with all coefficients equal is, in fact, the minimally sparse
scenario and hence adding a constant cannot decrease the sparsity.

\subsection{Two Proofs}
As one would surmise there is some overlap between the criteria. We
present and prove two theorems which demonstrate this overlap.
Theorem~\ref{thm:1} states that if a measure satisfies both criteria
{$D1$}~ and {$D2$}, the sparsity measure also satisfies {$P1$}~ by default.
Theorem~\ref{thm:2} states that a measure satisfying {$D1$}, {$D2$}~ and
{$D4$}~ necessarily satisfies {$P2$}.
\begin{thm}{\em $D1~\&~D2\Rightarrow P1$, that is, if both {$D1$}~ and {$D2$}~
  are satisfied, {$P1$}~ is also satisfied.}
\label{thm:1}
\end{thm}
\begin{proof}
  Without loss of generality, we begin with the vector ${\vec{c}}$ sorted in
  ascending order
\begin{equation}
  \nonumber {\vec{c}}=\left[ \begin{array}{cccc} c_1& c_2&\cdots&c_N \end{array} \right]
\end{equation}
with $c_{1}\leq c_{2} \leq\cdots\leq c_{N}$. We then perform a
series of inverse Robin Hood steps to get a vector ${\vec{d}}$, that is, we
take from smaller coefficients and give to the largest coefficient
\begin{eqnarray*}
  d_i  &=& c_i - \Delta c_i  ~~~~~~~~ \forall i = 1,2,\ldots,N-1\\
 d_N &=& c_N + \Delta c_i
 \end{eqnarray*}
with condition $\Delta<1$. As these are inverse Robin Hood steps
(inverse {$D1$}), they increase sparsity and result in the vector
{\footnotesize
\begin{equation}
 \nonumber {\vec{d}} = \begin{array}{ccl} \left[ (c_1-\Delta c_1)\right.& (c_2-\Delta c_2)&\cdots\\
                             \cdots&{\footnotesize (c_{N-1}-\Delta c_{N-1})}&\left.{\tiny (\Delta c_1+\cdots+\Delta c_{N-1} +c_N)}\right]\end{array}.
\end{equation}}
Without affecting the sparsity we can then scale ({$D2$}) ${\vec{d}}$ by $\frac{1}{1-\Delta}$ to get
{\small \begin{eqnarray*}
 {\vec{e}} &=& \begin{array}{ccl}\left[ c_1\right.& c_2&\cdots\\\cdots&c_{N-1}&\left.{\footnotesize\frac{1}{1-\Delta}( \Delta c_1+\Delta c_2+\ldots+\Delta c_{N-1} +c_N)}\right]\end{array}\\
 &=&\begin{array}{ccl}\left[ c_1\right.& c_2&\cdots\\\cdots&c_{N-1}&\left.\alpha + c_N\right],\end{array}
\end{eqnarray*}}
where
\begin{eqnarray*}
  \alpha &=& \frac{1}{1-\Delta}(\Delta c_1+\Delta c_2+\ldots+\Delta c_{N}).
\end{eqnarray*}
It is clear that
\begin{equation}
  \nonumber S({\vec{e}}) = S({\vec{d}})>S({\vec{c}}),
\end{equation}
which is equivalent to {$P1$}~ with the given $\alpha$ and $\beta=0$.  If we wish to operate on $c_i$ (instead of $c_N$ as
above), $\beta$ can be chosen sufficiently large to make the desired coefficient the
largest, that is, we set
\[
\beta > c_N - c_i
\]
\end{proof}
\begin{thm}
{\em $D1~\&~D2~\&~D4\Rightarrow P2$, that is, if  {$D1$}, {$D2$}~ and {$D4$}~
 are satisfied, {$P2$}~ is also satisfied.}\label{thm:2}
\end{thm}
\begin{proof}
We begin with vector ${\vec{c}}$
\begin{equation}
  \nonumber {\vec{c}}=\left[ \begin{array}{cccc} c_1& c_2&\ldots&c_N \end{array} \right].
\end{equation}
We then clone ({$D4$}) this $N+1$ times to get
\begin{equation}
\nonumber
 \begin{array}{cccc}
  {\vec{C}}&=& \left[ \underbrace{\begin{array}{cccc} {\vec{c}}& {\vec{c}}&\ldots&{\vec{c}} \end{array}}\right].& \\
&&N+1&
  \end{array}
\end{equation}
We then take one of the ${\vec{c}}$ from ${\vec{C}}$, which we shall refer to as
$\vec{\hat{c}}$ and by a series of inverse Robin Hood operations ({$D1$})
we distribute this $\vec{\hat{c}}$ in accordance with the size of each element
to form new vector ${\vec{D}}$. That is to say, each $c_i$ of each ${\vec{c}}$
(excluding $\vec{\hat{c}}$) becomes $c_i +\frac{c_i}{N}$ by $N$ consecutive inverse
Robin Hood operations which increase sparsity. The result is
{\small
\begin{equation}
  \nonumber \begin{array}{ccccc}
  {\vec{D}} &=&\left[\underbrace{ \begin{array}{cccc}{\vec{c}} +\frac{{\vec{c}}}{N}& {\vec{c}} +\frac{{\vec{c}}}{N}&\cdots&{\vec{c}} +\frac{{\vec{c}}}{N} \end{array}}\right.&\left.\underbrace{\begin{array}{cccc}0&0&\cdots&0\end{array}}\right].& \\
&&$N$&$N$&
  \end{array}
\end{equation}}
We can then scale ({$D2$}) ${\vec{D}}$ by a factor of $\frac{N}{1+N}$ without
affecting the sparsity to get
\begin{equation}
  \nonumber \begin{array}{ccccc}
  {\vec{E}} &=&\left[\underbrace{ \begin{array}{cccc}{\vec{c}}& {\vec{c}}&\cdots&{\vec{c}} \end{array}}\right.&\left.\underbrace{\begin{array}{cccc}0&0&\cdots&0\end{array}}\right],& \\
&&$N$&$N$&
  \end{array}
\end{equation}
which by cloning ({$D4$}) we know is equivalent to
\begin{equation}
  \nonumber {\vec{F}} = \left[ \begin{array}{cc}{\vec{c}} &0\end{array} \right].
\end{equation}
In summation, we have shown that
\begin{equation}
 S({\vec{c}}) =  S({\vec{C}})< S({\vec{D}}) =  S({\vec{E}}) = S({\vec{F}}),
\end{equation}
that is,
\begin{equation}
 S({\vec{c}}) < S({\vec{c}}\|0)
\end{equation}
which is also known as {$P2$}.
\end{proof}
\section{The Measures of Sparsity}
\label{sec:meas}
In this section we discuss a number of popular sparsity
measures. These measures are used to calculate a number which
describes the sparsity of a vector $ {\vec{c}}=\left[ \begin{array}{cccc} c_1&
c_2&\ldots&c_N \end{array} \right]$. The measures' monikers and their definitions
are listed in Table~\ref{table:measurerefs}.  Some measures in
Table~\ref{table:measurerefs} have been manipulated (in general
negated) to ensure that the an increase in sparsity results in a
(positive) increase in the sparse measure.

\begin{table}[ht]
\caption{Commonly used sparsity measures modified to become more positive for increasing sparsity.}
\begin{center}
\begin{tabular}{|c|l|}
\hline
Measure &  Definition \\
\hline
\hline
$\ell^0$ & $\#\left\{j,c_j = 0\right\}$ \\
\hline
$\ell^0_\epsilon$ & $\#\left\{j,c_j\leq \epsilon\right\}$ \\
\hline
$-{\ell^1}$ & $-{\left(\sum_j c_j \right)}$ \\
\hline
$-{\ell^p}$ & $-{\left(\sum_j c_j^p\right)^{1/p},\,\,\,0<p<1}$  \\
\hline
$\frac{\ell^2}{\ell^1}$ &$\frac{\sqrt{\sum_j c_j^2}}{\sum_j c_j}$ \\
\hline
$-{\tanh_{a,b}}$  & $-{\sum_j\tanh\left(\left(ac_j\right)^b\right)}$  \\
\hline
  $-\log$ & $-\sum_j\log\left(1+c_j^2\right)$ \\
\hline
  $\kappa_4$ & $\frac{\sum_j c_j^4}{\left(\sum_j c_j^2\right)^2}$ \\
\hline
   ~   &    $1-\min_{i=1,2,\ldots,N-\lceil \theta N\rceil+1}\frac{c_{(i+\lceil \theta N\rceil -1)}-c_{(i)}}{c_{(N)} -c_{(1)}|} $        \\
      $u_\theta$        &  $\text{ s.t. } \lceil \theta N \rceil \neq N$  $\text{ for ordered data, }$     \\
    ~             & $c_{(1)}\leq c_{(2)} \leq\cdots\leq c_{(N)}$ \\
\hline
  $-\ell^p_{-}$ & $-\sum_{j,c_j\neq 0}c_j^p,\,\,\, p<0$ \\
\hline
  $H_G$  & $-\sum_j\log  c_j ^2$ \\
\hline
 $H_S$ & $-\sum_j \tilde{c_j}\log  \tilde{c_j} ^2 \text{ where }
\tilde{c_j}=\frac{c_j^2}{\|{\vec{c}}\|_2^2}$ \\
\hline
 $H_S^\prime$ & $-\sum_j  {c_j}\log   {c_j} ^2$ \\
\hline
 Hoyer & $(\sqrt{N}-\frac{\sum_j c_j}{\sqrt{\sum_j c_j^2}})(\sqrt{N}-1)^{-1}$ \\
\hline
  ~   &   $1 - 2\sum_{k=1}^N \frac{c_{(k)}}{\|{\vec{c}}\|_1}\left(\frac{N-k+\frac{1}{2}}{N}  \right) $\\
      Gini        &    $\text{ for ordered data, }$     \\
    ~             & $c_{(1)}\leq c_{(2)} \leq\cdots\leq c_{(N)}$ \\
\hline
\end{tabular}
\label{table:measurerefs}
\end{center}
\end{table}

In \cite{karvanen03measuring} the $\ell^0$, $\ell_{\epsilon}^0$,
$\ell^1$, $\ell^p$, $\tanh_{a,b}$, $\log$ and $\kappa_4$ were
compared.  The most commonly used and studied sparsity measures are
the $\ell^p$ norm-like measures,
\[
\|{\vec{c}}\|_p = \left( \sum_j c_j^p \right)^{1/p} ~~~\mbox{for~} 0\leq p \leq 1.
\]
The $\ell^0$ measure simply calculates
the number of non-zero coefficients in ${\vec{c}}$,
\[
\|{\vec{c}}\|_0 = \# \{ c_j\neq 0, j = 1, \ldots,N\}.
\]
 The $\ell^0$ measure is the traditional sparsity measure in many
mathematical settings. However, it is unsuited to most practical
scenarios, as an infinitesimally small value is treated the same as a
large value. This means that the derivative of the measure contains no
information and as such the $\ell^0$ cannot be used in optimization
problems. Exhaustive search is the only method of finding the sparsest
solution when using the $\ell^0$ measure and approximations are
usually used \cite{fuchs05recovery, donoho06stable}.  The presence of
noise makes the $\ell^0$ measure completely inappropriate. In noisy
settings, the $\ell^0$ measure is sometimes modified to
$\ell^0_{\epsilon}$ where we are interested in the number of
coefficients, $c_j$ that are greater than a threshold $\epsilon$
\cite{rath08sparse}.  Clearly, the value of $\epsilon$ is crucial for
$\ell^0_\epsilon$ to be meaningful. This is undesirable.  As
optimization using $\ell^0_{\epsilon}$ is difficult because the
gradient yields no information, $\ell^{p}$ with $0<p<1$ is often used
in its place, \cite{xu07norm}.  The $\ell^1$ measure, that is,
$\ell^{p}$ with $p=1$, approximates the $\ell^0$ measure and is easily
calculated. Under this measure, large coefficients are considered more
important than small coefficients unlike the $\ell^0$ measure. In most
settings, the $\ell^1$ solution can be used to find the support of the
$\ell^0$ solution \cite{ balan05equivalence}. The $\ell^1$ measure is
used in many optimization problems, as linear programming offers a
fast, computationally efficient solution \cite{candes05decoding,
donoho08fast}.

In \cite{karvanen03measuring} several alternative measures of sparsity
are noted which approximate the $\ell^0$ measure but emphasize
different properties. $\tanh_{a,b}$ is sometimes used in place of
$\ell^{p}$, $0<p<1$, as it is limited to the range $(0, 1)$ and
better models $\ell^0$ and $\ell^0_{\epsilon}$ in this respect. A
representation is more sparse if it has one large component, rather
than dividing up the large component into two smaller
ones. $\tanh_{a,b}$ and $\ell^p$ preserve this.  In
\cite{rickard04gini} it is shown that the $\log$ measure enforces
sparsity outside some range, but for distributions with low energy
coefficients the opposite is achieved by effectively spreading the
energy of the small components. $\kappa_4$ is the kurtosis which
measures the peakedness of a distribution
\cite{olshausen04sparse}. $u_{\theta}$ measures the smallest range
which contains a certain percentage of the data. This is achieved by
sorting the data and determining the minimum difference between the
largest and smallest sample in a range containing the specified
percentage ($\theta$) of data points as a fraction of the total range
of the data. The reason that a continuous parameter $\theta$ is used in the model is to maintain compatibility with pre-existing literature.

For measuring `diversity', \cite{rao99affine,kreutz-delgado98measures}
use some different measures. Three of these are entropy measures: the
Shannon entropy diversity measure $H_S$, a modified version of the
Shannon entropy diversity measure $H_{S}\prime $ and the Gaussian
entropy diversity measure $H_G$. They also extend the $\ell^p$ measure
to negative exponents, that is, $-1<p<0$. We call this measure
$\ell_{-}^p $ to avoid confusion.

Some of the measures can be normalized to satisfy more of the
constraints, although in general for the measures, forcing
satisfaction of one constraint means breaking another. The exception
to this is the Hoyer measure \cite{hoyer04nonnegative} which is a
normalized version of the $\frac{\ell^2}{\ell^1}$ measure as is
obvious from its definition,
$(\sqrt{N}-\frac{\ell^1}{\ell^2})(\sqrt{N}-1)^{-1}$.
\begin{figure*}[htpb]
\begin{center}
\includegraphics[width=15cm]{comparison_of_measures.pdf}
\caption{Component contribution to sparsity measure vs component amplitude.}\label{fig:comp}
\end{center}
\end{figure*}
In Fig.~\ref{fig:comp} we can get an insight into how component
magnitude affect certain measures. In general, the smaller the
magnitude the less it impinges on the sparsity of the measure. We can
see how many of the measures approximate the $\ell^0$ measure but as
they are not flat like the $\ell^0$ measure, they have a gradient that
can be used in optimization problems. The $\ell^0$, $\ell^0_\epsilon$,
$\tanh$, $\log$, $\ell^p (0<p<1)$, $\ell^1$ measures all prefer
components to be zero or near zero. Oddly, the Shannon entropy based
measures $H_S$ and $H_S\prime$ prefer components to be at a non-zero
value less than 1.

\subsection{The Gini Index}
\label{sec:gini} Having perused the measures thus far, some
desirable aspects of a sparsity measure emerge. Like
 $\frac{\ell^2}{\ell^1}$ and Hoyer, a measure should be some kind of
 weighted sum of the coefficients. This means that unlike $\ell^0$
 when a coefficient changes slightly we have a weighted effect on the
 corresponding change in the value of the sparsity measure based on
 how `important' that particular coefficient is to the overall
 sparsity. Large coefficients should have a smaller weight than the
 small coefficients so that they do not overwhelm them to the point
 that smaller coefficients have a negligible (or no) effect on the
 measure of sparsity. If even one of the smaller coefficients is
 changed, that change should be reflected by a change in the value of
 the sparsity measure. A weighted sum achieves this.  In other words,
 we have a gradient which we can use in optimization problems. Another
 important aspect of a sparsity measure is normalization. A set of
 coefficients should not be rated more or less sparse simply because
 it has more coefficients than another set, nor should it be deemed
 more or less sparse simply due to having louder or quieter
 coefficients. In short, there should be two forms of
 normalization. Firstly, the measure of sparsity should be dependent
 on the relative values of coefficients as a fraction of the total
 value. Secondly, the measure of sparsity should be independent of the
 number of coefficients so that sets of different size can be
 compared. Lastly, it would be useful if the measure was 0 for the
 least sparse case and 1 for the most sparse case. All these qualities
 are embodied by the Gini Index, which we now define.

Given a vector, ${\vec{c}}=\left[ \begin{array}{cccc} c_1& c_2&c_3&\cdots \end{array} \right]$,
we order from smallest to largest , $c_{(1)}\leq
c_{(2)}\leq\cdots\leq c_{(N)}$ where $(1),(2),\ldots,(N)$ are the
new indices after the sorting operation. The Gini Index is given by
\begin{equation}
S({\vec{c}}) = 1 - 2\sum_{k=1}^N \frac{c_{(k)}}{\|{\vec{c}}\|_1}\left(\frac{N-k+\frac{1}{2}}{N}  \right).
\end{equation}

The Gini Index also has an interesting graphical interpretation which
we see in Fig.~\ref{fig:lor}. If percentage of coefficients versus
percentage of total coefficient value is plotted for the sorted
coefficients we can define the Gini Index as twice the area between
this line and the 45$^{\circ}$ line.  The 45$^{\circ}$ line represents
the least sparse distribution, that with all the coefficients being
equal.

If we have a distribution from which we draw coefficients and measure
the sparsity of the coefficients which we have drawn, as we draw more
and more coefficients we would expect our measure of sparsity to
converge.  The Gini Index meets these expectations.  The Gini Index of
a distribution with probability density function $f(x)$ (which
satisfies $f(x)=0,x<0$) and cumulative distribution function $F(x)$ is
given by
\begin{equation}
  \nonumber G = 1-2\int_{0}^{1} \frac{\int_{0}^{x}tf(t) dt}{\int_{0}^{\infty}tf(t) dt}dF(x).
\end{equation}

As a side note, the Gini Index was originally proposed in economics as
measure of the inequality of wealth
\cite{lorenz05methods,gini21measurement, dalton20measurement,
arnold86majorization} and is still studied in relation to wealth
distribution as well as other
areas. \cite{shalit05mean,aaberge01axiomatic,aaberge08erratum,milanovic97simple}
`Inequality in wealth' in signal processing language is `efficiency of
representation' or `sparsity'. The utility of the Gini Index as a
measure of sparsity has been demonstrated in
\cite{rickard04gini,rickard06sparse,hurley05parameterized,hurley07maximizing}.

\begin{figure}[htpb]
\begin{center}
\begin{tabular}{c}
\includegraphics[width=5cm]{lsparse00001.pdf}\\
\includegraphics[width=5cm]{lsparse112310.pdf}
\end{tabular}\caption{Percentage of coefficients versus percentage of total coefficient value is plotted for the sorted coefficients for  [0 0 0 0 1] (top) and [1 1 2 3 10] (bottom). The Gini Index is twice the shaded area.}\label{fig:lor}
\end{center}
\end{figure}

\section{Comparison of Sparsity Measures}
\label{sec:comp}
In this section we present the main result of the paper, the
comparison of the measures using the criteria. Many of the measures
fail for simple test cases which prove non-compliance. For example,
$[0,1,3,5]$ is more sparse than $[0,2,3,4]$ because a Robin Hood
operation maps one sequence to the other. Six of the measures do not
correctly handle this case. Others fail on similar examples. Seven of
the measures, however, satisfy {$D1$}. An example for each sparse
criterion is given in Table~\ref{table:typcex} along with the desired
outcome when the sparsity of the examples are measured with sparsity
measure $S(\cdot)$.
\begin{table*}[ht]
\caption{Most common counter-example for a given property with measure
of sparsity and desired outcome with sparsity measure $S(\cdot)$.}
\begin{center}
\rowcolors[]{2}{blue!1}{blue!5}
\begin{tabular}{crclrcl}
Property&\multicolumn{3}{c}{Most common counter-example} &\multicolumn{3}{c}{Desired outcome}\\
\hline
{$D1$}&$[0,1,3,5]$&vs&$[0,2,3,4]$&$S([0,1,3,5])$& $>$& $S([0,2,3,4])$ \\
{$D2$}&$[0,1,3,5] $&vs&$[0,2,6,10]$&$S([0,1,3,5])$& $=$& $ S([0,2,6,10])$ \\
{$D3$}&$[1,3,5]$&vs&$[1.5,3.5,5.5]$&$S([1,3,5])$& $<$& $S([1.5,3.5,5.5])$ \\
{$D4$}&$[0,1,3,5]$&vs&$[0,0,1,1,3,5]$&$S([0,1,3,5])$& $=$& $S([0,0,1,1,3,5])$ \\
{$P1$}&$[0,1,3,5]$&vs&$[0,1,3,20]$&$S([0,1,3,5])$& $<$& $S([0,1,3,20])$ \\
{$P2$}&$[0,1,3,5]$&vs&$[0,0,0,1,3,5]$&$S([0,1,3,5])$& $<$& $S([0,0,0,1,3,5])$
\end{tabular}

\label{table:typcex}
\end{center}
\end{table*}
Table~\ref{table:checks} details which of the six sparse criteria hold
for each of the fifteen measures. The information is based on proofs
and counter-examples which are contained in their entirety in
Appendices~\ref{sec:cex}~and~\ref{sec:proofs}.  There are essentially
two types of proof, Type~A and Type~B. Type~A is the standard form of
proof which uses inequalities, an example of which is the following:
\begin{thm}
  $\frac{\ell^2}{\ell^1}$   satisfies \[S(\left[ \begin{array}{cccccc}c_1& \cdots& c_i-\alpha&
\cdots& c_j+\alpha& \cdots\end{array} \right] ) < S({\vec{c}}),\] for all $\alpha, c_i, c_j $
such that $c_i>c_j$ and $0<\alpha < \frac{c_i-c_j}{2}$.
\end{thm}
\begin{proof}
\label{proof:A}
As $\frac{\ell^2}{\ell^1} = \frac{\sqrt{\sum_j c_j^2}}{\sum_j
c_j}$ we can restate the above as
\[
\frac{\sqrt{\sum_{k \neq i,j}c_k^2 +(c_i -\alpha)^2  + (c_j +\alpha)^2 }}{\sum_k c_k+\alpha -\alpha} < \frac{\sqrt{\sum_k c_k^2} }{\sum_k c_k}.
\]
This simplifies to
\begin{equation}
  \nonumber (c_i -\alpha)^2  + (c_j +\alpha)^2 < c_i^2 + c_j^2.
\end{equation}
Expand this to get
\begin{eqnarray*}
c_i^2 -2c_i \alpha + \alpha^2  + c_j^2 +2c_j \alpha + \alpha^2 &<& c_i^2 + c_j^2\\
c_j - c_i + \alpha &<&0,
\end{eqnarray*}
which we know is true as $0<\alpha < \frac{c_i-c_j}{2}$.
\end{proof}

A type~B proof on the other hand uses
derivatives, for example:
\begin{thm}
 $-{\ell^p}$ satisfies  \[S(\left[ \begin{array}{cccccc}c_1& \cdots& c_i-\alpha&
\cdots& c_j+\alpha& \cdots\end{array} \right] ) < S({\vec{c}}),\] for all $\alpha, c_i, c_j $
such that $c_i>c_j$ and $0<\alpha < \frac{c_i-c_j}{2}$.
\end{thm}
\begin{proof}
\label{proof:B}
\[
-{\ell^p} = -{\left(\sum_k c_k^p\right)^{1/p},\,\,\,0<p<1}.
\]
We wish to show that the following  holds true  for all $\alpha , c_i, c_j $ such that $c_i>c_j$ and $0<\alpha < \frac{c_i-c_j}{2}$
\[
\frac{\partial}{\partial \alpha}\left[-{\left(\sum_{n \neq i,j} c_n^p  +(c_i-\alpha)^p + (c_j+\alpha)^p \right)^{1/p}}\right] <0.
\]
Expand this to get
{\small
\begin{eqnarray*}
&   -\frac{1}{p} \left(\sum_{k\neq i,j} c_k^p +(c_i-\alpha)^{p}+(c_j+\alpha)^{p}\right)^{\frac{1}{p}-1}
\left(-p(c_i-\alpha)^{p-1}\right.&\\
&\left. +p(c_j+\alpha)^{p-1}\right)<0.&
\end{eqnarray*}}
Which holds true if
\begin{equation}
  \nonumber (c_j+\alpha)^{p-1}-(c_i-\alpha)^{p-1}>0.
\end{equation}
As $p-1<0$ we can rewrite the above as
\begin{eqnarray*}
\frac{1}{ (c_j+\alpha)^{1-p}}-\frac{1}{(c_i-\alpha)^{1-p}}&>&0\\
\frac{1}{ (c_j+\alpha)}&>&\frac{1}{(c_i-\alpha)}\\
c_i-\alpha&>&c_j+\alpha\\
\frac{c_i-c_j}{2}&>&\alpha,
\end{eqnarray*}
which is necessarily true as it is one of the constraints upon $\alpha$.
\end{proof}
From Table~\ref{table:checks} we can see that {$D3$}~({\em
 Rising Tide}) is satisfied by most measures. This shows that relative
 size of coefficients is of the utmost importance when desiring
 sparsity. As previously mentioned, most measures do not satisfy
 {$D4$}~({\em Cloning}). Each of the other criteria is satisfied
 by a varying number of the fifteen measures of sparsity. This
 demonstrates the variety of attributes to which measures of sparsity
 attach importance. $\kappa_4$ and the Hoyer measure satisfy most of the
 criteria. The Gini Index alone satisfies all six criteria.
{\large
\begin{table}[ht]
\caption{Comparison of different sparsity measures using criteria defined in  Sec.~\ref{sec:crit}}
\begin{center}
\begin{tabular}{|c||c|c|c|c|c|c|}
\hline
Measure &  {\bf {$D1$}}&
{\bf {$D2$}}&
{\bf {$D3$}}&
{\bf {$D4$}}&
{\bf {$P1$}}&
{\bf {$P2$}}\\
\hline
\hline
$\ell^0$
                      &            & \checkmark     &              &            &            & \checkmark\\
\hline
$\ell^0_\epsilon$
                      &            &      &              &            &            & \checkmark\\
\hline
$-{\ell^1}$
                      &            &                &  \checkmark &            &            &           \\
\hline
$-{\ell^p}$
                     & \checkmark  &                &  \checkmark &            &            &           \\
\hline
$\frac{\ell^2}{\ell^1}$
                     & \checkmark  & \checkmark     &             &            &\checkmark  &           \\
\hline
$-{\tanh_{a,b}}$
                      &\checkmark  &                &  \checkmark            &            &            &           \\
\hline
  $-\log$
                      &            &                &  \checkmark &            &            &           \\
\hline
  $\kappa_4$
                      &            & \checkmark     &  \checkmark &            &  \checkmark &           \\
\hline
  $u_\theta$
                      &            &     \checkmark           &             &\checkmark  &  \checkmark   &\\
\hline
  $-\ell^p_{-}$
                      &  &                &   &            &  \checkmark     &           \\
\hline
  $H_G$
                      & \checkmark &                &  \checkmark &            &            &        \\
\hline
 $H_S$
                      &            &                &   &            &            &           \\
\hline
$H_S^\prime$
                      &            &                &   &            &            &    \\
\hline
 Hoyer
                      &\checkmark  & \checkmark     & \checkmark  &            & \checkmark & \checkmark \\
\hline
Gini
                      & \checkmark & \checkmark     &  \checkmark & \checkmark & \checkmark & \checkmark\\
\hline

\end{tabular}
\label{table:checks}
\end{center}
\end{table}}

\subsection{Numerical Sparse Analysis}
\label{sec:ana}
In this section we present the results of using the fifteen sparse
measures to measure the sparsity of data drawn from a set of
parameterized distributions. We select data sets and distributions for
which we can change the `sparsity' by altering a parameter. By
applying the fifteen measures to data drawn from these distributions
as a function of the parameter, we can visualize the criteria. The
examples are based on the premise that all coefficients being equal is
the least sparse scenario and all coefficients being zero except one
is the most sparse scenario.

In the first experiment we draw a variable number of coefficients from
a probability distribution and measure their sparsity. We expect sets
of coefficients from the same distribution to have a similar
sparsity. As we increase the number of coefficients we expect the
measure of sparsity to converge. In this experiment we examine the
sparsity of sets of coefficients from a Poisson distribution
(Fig.~\ref{fig:poissplot})
\begin{figure*}[htpb]
\begin{center}
\includegraphics[width=15cm, height = 9cm]{plot_of_poisson_curves_5_10_15_30.pdf}
\caption{Sample Poisson distribution probability density functions for $\lambda = 5,10,15,30$. We expect the distributions with a `narrower' peak (small $\lambda$) to have a higher sparsity than those with a `wider' peak (large $\lambda$)}
\label{fig:poissplot}
\end{center}
\end{figure*}
with parameter $\lambda = 5$ as a function of set size.  From the
normalized version of the sparsity plot in Fig.~\ref{fig:d4alt} we can
see that three measures converge. They are $\kappa_4$, the Hoyer measure
and the Gini Index. As this is similar in nature to {$D4$}~we expect the
Gini Index to converge. The convergence of Hoyer measure is
unsurprising as this measure almost satisfies {$D4$}~ especially for
large $N$.  The results are also normalized for clearer visualization
in that they are modified so that the sparsity falls between 0 and 1.
\begin{figure*}[htpb]
\begin{center}
{\includegraphics[width=15cm]{D4_alt_normed.pdf}}\\
\caption{\small{Sparsity of sets of coefficients drawn from a Poisson
 distribution ($\lambda=5$) {\it vs} the length of the vector of
 coefficients. The erratically ascending measures are $\ell^0$ and
 $\ell^0_{\epsilon}$. The measures $\ell^1$, $\log$, $\tanh$, $H_G$,
 $H_S^\prime$ and $\ell^p_{-}$ are grouped in an almost-straight
 decreasing line. The measures are scaled to be between 0 and 1.}
 }\label{fig:d4alt}
\end{center}
\end{figure*}

In the second experiment we take coefficients from a Bernoulli
distribution where coefficients are either $0$ with probability $p$ or
$1$ with probability $1-p$. For this experiment the set size remains
constant and the probability $p$ varies from $0$ to $1$.  With a low
$p$ most coefficients will be 1 and very few zero. The energy
distribution of such a set is not sparse and accordingly has a low
value (see Fig~\ref{fig:bern}). As $p$ increases so should the
sparsity measure. We can see this is the case in some form for all of
the measures except $H_S \prime$. We note that  $\kappa_4$
does not rise steadily with increasing $p$ but rises dramatically as
the set approaches its sparsest. This is of some concern if optimizing
sparsity using $\kappa_4$ as there is not much indication that the
distribution is getting more sparse until its already quite
sparse.
\begin{figure*}[htpb]
\begin{center}
\includegraphics[width=14cm]{sparse_bernoulli.pdf}
\caption{Sparsity {\it vs} $p$ for a Bernoulli distribution with
coefficients being $0$ with probability $p$ and $1$ otherwise. The
measures are scaled to fit between a sparsity range of 0 to 1.}
\label{fig:bern}
\end{center}
\end{figure*}

\section{Conclusions}
\label{sec:concl} In this paper we have presented six intuitive
attributes of a sparsity measure. Having defined these attributes
mathematically, we then compared commonly-used measures of sparsity.
The goal of this paper is to provide motivation for selecting a
particular measure of sparsity. Each measure emphasizes different
combinations of attributes and this should be addressed when
selecting a sparsity measure for an application. We can see from the
main contribution of this paper, Table~\ref{table:checks} and the
associated proofs in Appendices~\ref{sec:cex} and \ref{sec:proofs},
that the only measure to satisfy all six criteria is the Gini Index.
This aligns well with \cite{rickard06sparse} in which it is shown
that the Gini Index is an indicator for when sources are separable,
a property which itself relies on sparsity. The Hoyer measure
\cite{hoyer04nonnegative} comes a close second, failing only
{$D4$}~(invariance under cloning), which is, admittedly an arguable
criterion for certain applications. For applications in which the
number of coefficients is fixed both the Gini Index and the Hoyer
measure satisfy all criteria.

We have also presented two graphical examples of the performance of
the measures when quantifying the sparsity of a distribution with
sparsity controlled. Again, both the Gini Index and the Hoyer
measure outperform the other measures, illustrating their utility.

Sparsity is used in many applications but with few exceptions it is
not studied as a concept in itself. We hope that this work will not
just encourage the use of the Gini Index but encourage users of
sparsity to consider in more depth the concept of
sparsity.

Comparing Measures of Sparsity