# Mdm of a discrete distribution lemma

I may have found a useful transformation for calculating Mdm's of distributions defined on [ilmath]\mathbb{Z} [/ilmath] or a subset. I document my work so far below:

• Notes:Mdm of a discrete distribution lemma
• Notes:Mdm of a discrete distribution lemma - round 2

## Statement

Notice: - there are plans to generalise this lemma:- specifically to allow [ilmath]\lambda[/ilmath] to take any real value (currently only non-negative allowed) and possibly also allow [ilmath]\alpha,\beta[/ilmath] to be negative too

Let [ilmath]\lambda\in\mathbb{R}_{\ge 0} [/ilmath] and let [ilmath]\alpha,\beta\in\mathbb{N}_0[/ilmath] such that [ilmath]\alpha\le\beta[/ilmath], let [ilmath]f:\{\alpha,\alpha+1,\ldots,\beta-1,\beta\}\subseteq\mathbb{N}_0\rightarrow\mathbb{R} [/ilmath] be a function, then we claim:

• $\sum^\beta_{k\eq\alpha}\big\vert k-\lambda\big\vert f(k) \eq\sum^\gamma_{k\eq\alpha}(\lambda-k)f(k) +\sum_{k\eq\gamma+1}^\beta (k-\lambda)f(k)$ where:
• [ilmath]\gamma:\eq\text{Min}(\text{Floor}(\lambda),\beta)[/ilmath]

Note that [ilmath]\beta\eq\infty[/ilmath] is valid for this expression (standard limits stuff, see sum to infinity)

## Applications to computing Mdm

Let [ilmath]X[/ilmath] be a discrete random variable defined on [ilmath]\{\alpha,\alpha+1,\ldots,\beta-1,\beta\}\subseteq\mathbb{N}_0[/ilmath] (remember that [ilmath]\beta\eq\infty[/ilmath] is valid and just turns the second sum into a limit), then:

• define [ilmath]\lambda:\eq\E{X} [/ilmath]
• define [ilmath]f:k\mapsto \P{X\eq k} [/ilmath]

Recall the mdm of [ilmath]x[/ilmath] is defined to be:

• $\Mdm{X}:\eq \sum^\beta_{k\eq\alpha}\big\vert k-\E{X}\big\vert\ \P{X\eq k}$

It is easy to see that with the definitions substituted that:

• $\sum^\beta_{k\eq\alpha}\big\vert k-\lambda\big\vert f(k)\eq\Mdm{X}$