Dirac background and problem statement:
The Dirac delta function $\delta(x)$ defined as $$ \delta(x) = \lim_{c \to 0} \delta_c(x) \\ \delta_c(x) = \begin{cases} 1/c && |x| \leq \frac c2 \\ 0 && |x| > \frac c2 \end{cases} $$ can be used as the probability density function for a random variable $Y$ whose CDF is the unit step function: $$ \begin{align} &F_Y(y) = \begin{cases} 0 && y < 0 \\ 1 && y \geq 0 \end{cases} \\ &f_Y(y) = \delta(y) \end{align} $$
I'm trying to define the PDF for another random variable with a step function CDF, $X$ (parameterized by a), which is the uniform distribution over $[0,1]$ but with a size $a$ step in density at $x=\frac 12$.
$Y$ translated to the right by $\frac 12$ is a special case of $X$ with $a=1$, and the standard uniform distribution is another special case with $a=0$. Here is $X$'s CDF defined formally, along with an interactive visual: $$ F_X(x) = \begin{cases} 0 && x<0 \\ x(1-a) && 0 \leq x < \frac 12 \\ a + x(1-a) && \frac 12 \leq x < 1 \\ 1 && x \geq 1 \end{cases} \qquad 0 \leq a \leq 1 $$
Can we use the Dirac delta similarly to how it's used in $f_Y(y)$ to help define $f_X(x)$?
Issues:
My first instinct was that we might define $f_X(x)$ as $$ f_X(x) = \begin{cases} (1-a) + \delta(x-\frac 12) && 0 \leq x \leq 1\\ 0 && \text{otherwise} \end{cases} $$
But this is not quite right as the Dirac impulse itself contributes 1 to the overall probability mass in the CDF, yielding
$$ F_X(x\geq1) = \int_0^1 f_X(u)du = (1-a) + 1 $$
which is of course invalid for $a<1$ and doesn't match our desired CDF. I then thought the fix might be as simple as scaling the output of the delta function by $a$, as with:
$$ f_X(x) = \begin{cases} (1-a) + a\cdot\delta(x-\frac 12) && 0 \leq x \leq 1\\ 0 && \text{otherwise} \end{cases} $$
However, that also doesn't seem quite right to me because from my understanding $\delta(0) = \infty$, and I don't see how multiplying the point mass at x=1/2 of infinity by $a$ would actually reduce the jump in mass at that point in the integration of $f_X$ from 1 to $a$.
Question:
Is it possible to modify our definition of the $f_X(x)$ so that the Dirac impulse at $x=1/2$ contributes a mass of $a$ rather than a mass of 1, or to define a function analogous to the Dirac delta but but with a similarly reduced impulse mass? Or am I just off track with trying to use the Dirac delta for this PDF, and if so, what would be a better tool?
your first instinct is quite correct.
$$f_X(x)=(1-a)\cdot\mathbb{1}_{\left(0;0.5 \right)\cup(0.5;1)}(x)+a\delta(x-0.5)$$
now your impulse contributes exactly for a proportion $a$
Remember that this is NOT a pdf because your F is not absolutely continuous