# Minimum of a constant and a random variable

Let $X$ be a random variable and I now assume for simplicity that it is uniformly distributed on $[0,1]$.

Now fix $t \in [0,1]$ and let $Y_t$ be the random variable $Y_t:=\min \{t,X\}$.

I have problems computing for example the density

Computing the cdf is easy: Of course $P(Y_t \leq y)= 1- P(t>y,X>y)$. Now I tried to split this apart as if $t$ was just random variable independet of $X$ and this gives $P(Y_t \leq y)=y$ if $y<t$ and $1$ if $y\geq t$.

However, I feel that taking the derivative is not the appropriate her since $Y_t$ attains the value $t$ with positive probability. So $Y_t$ seems to be a random variable that is neither a discrete nor a continuous random variable. So maybe a density does not make sense.

However, in order to be able to compute expectation and so on, I would need a density. In fact I guess everything becomes easy if I knew on which space $Y_t$ actually lived. However, I have problems formalizing that. Can anybody help.

Maybe for the uniform distribution everything is easy by direct arguments. But I would like to see a general approach which is valid for $X$ having an continuous distribution.

-
You could use the Riemann-Stieltjes integral when computing expectation and so on. –  Yuval Filmus Sep 1 '11 at 13:41

Your approach is correct. The distribution of $Y_t$ is partly absolutely continuous with respect to the Lebesgue measure, and partly discrete. A formal notation for the distribution $P_{Y_t}$ of $Y_t$ is $$\text{d}P_{Y_t}(x)=\mathbf{1}_{[0,t]}(x)\text{d}x+(1-t)\delta_t(\text{d}x).$$ But this is only a notation. More to the point, for every Borel subset $B$, $$P(Y_t\in B)=\text{Leb}(B\cap[0,t])+(1-t)\mathbf{1}_B(t).$$ And to compute expectations, for every bounded measurable function $u$, use $$E(u(Y_t))=\int_0^tu(x)\text{d}x+(1-t)u(t).$$ In the general case, if $X$ has density $f_X$, one gets $\text{d}P_{Y_t}(x)=f_X(x)\mathbf{1}_{x<t}\text{d}x+P(X\ge t)\delta_t(\text{d}x),$ hence $$P(Y_t\in B)=P(X\in B\cap(-\infty,t))+P(X\ge t)\mathbf{1}_B(t),$$ and $$E(u(Y_t))=\int_{-\infty}^tu(x)f_X(x)\text{d}x+u(t)\int_t^{+\infty}f_X(x)\text{d}x.$$

-

Didier's and Yuval's answers are the correct formal way to compute the expectation.

More informally: A (purely) continuous random variable that takes values in some interval (say [0,1]) has zero probability of taking a particular value. Which is the same as saying that the distribution function is continuouos (typically piece-wise derivable), which is the same as saying that the density function is a "true" function (i.e. not including Dirac deltas). By contrast, a discrete variable has finite non-zero probabilities of taking a (discrete) set of values, and its distribution function is discontinuous, piecewise constant.

A uniform variable in [0,1] is clearly continuous. But $Y_t$ has a finite probability of taking the value $t$, hence the density will exhibit a Dirac delta there, and the distribution function will have a discontinuity.

Hence, as Yuval points out, $Y_t$ can be seen as a mixture (a convex combination) of two random variables: a continuous one (uniform in [0,t]) and a discrete variable (a constant, actually, with value $t$). The mix of two variables gives a density function that is the same linear combination of the two densities (here a truncated uniform, and a dirac delta) (you should graph this), and the same holds (by linearity) for the expectations.

-
...*the same as saying that the distribution function is continuouos*... Hmmmm, no. You explain pretty well the dichotomy between Dirac and densitable measures but there exists a third kind of distribution with a continuous distribution function but no density. –  Did Sep 1 '11 at 14:47
@Didier: a continuous but not piece-wise derivable distribution? that's "pathological" ;-) –  leonbloy Sep 1 '11 at 16:07
Yes. In fact, I did not reproduce the part in your post which is problematic (sorry about that). This is: ...*which is the same as saying that the density function is a "true" function*... Now, I can write: Hmmmm, no... this is not the same. –  Did Sep 1 '11 at 16:39

Some probability distributions are discrete, some are continuous, and some are neither. If you want to use one integral-like formula for all, you can use the Riemann-Stieltjes integral.

Alternatively, every "reasonable" random variable (see discussion in the comments below) is a convex combination of a discrete random variable (formed by taking all its atoms, points with positive probability) and a continuous random variable (the rest). Whatever it is that you're calculating is a convex combination of the same thing on both parts, and for the latter you already know how to calculate things like expectation.

For example, suppose that $0 \leq t \leq 1$. Then $Y_t$ is a convex combination of the constant $t$ r.v. (with probability $1-t$), and of a uniform $[0,t]$ r.v. (with probability $t$). Hence its expectation is $$(1-t)t + t(t/2) = t-t^2/2.$$

-
...*every random variable is a convex combination of a discrete random variable /.../ and a continuous random variable*... Sorry but no. In general there is a third part in the probability distribution, namely a measure without density with respect to Lebesgue measure and without atom either. –  Did Sep 1 '11 at 13:55
@Didier: two or three types depends on whether you require a continuous random variable to have a continuous cumulative distribution function or an absolutely continuous cumulative distribution function. –  Henry Sep 1 '11 at 14:28
@Henry, we agree. –  Did Sep 1 '11 at 16:41