What is the relation between a random switch with an exponential distribution and the $\sigma$ of the switch state?

94 Views Asked by At

Imagine a switch that is randomly turned on and off with an exponential probability density function of $\lambda e^{\lambda t}$, and I'm interested in the distribution of the average state of the switch over a certain period.

It's easy to see this switch would be observed for a long time it would on average be on for half of the time, and I imagine the distribution of the switch state will be some sort of normal distribution.

However, I think there should be a relation between $\lambda$ of the exponential distributed switch, and $\sigma$ of the normal distribution of the average state of the switch over a given period.

How can I calculate this value?

1

There are 1 best solutions below

2
On BEST ANSWER

If the time period we're averaging over is short relative to $\frac1{\lambda}$, then the average state of the switch should be bimodal: it will depend mostly on the initial state of the switch.

Even over longer time periods, we will see some amount of degeneracy. To be precise, let $X$ be the fraction of time, over an interval of length $t$, that the switch spends in the "on" state. Then we have $X = 1$ and $X = 0$ each with probability $\frac12 e^{-\lambda t}$, because with probability $e^{-\lambda t}$, the state never changes. So $X$ does not even have a continuous probability distribution.

To calculate the variance, your best bet is to condition on the number of times the switch is flipped over the interval. I'll take $t=1$ for simplicity (in general, changing $t$ and $\lambda$ while keeping $\lambda t$ constant does nothing). Then if there are $k$ flips, they are distributed uniformly in $[0,1]$. But we want to look at intervals between the flips, so this requires us to consider order statistics of the uniform distribution (Wikipedia link).

Suppose that there are $k$ flips at intervals $0 < T_1 < T_2 < \dots < T_k < 1$. Then $X$ is a sum of (with equal probability) either $\lfloor \frac{k+1}{2}\rfloor$ or $\lceil \frac{k+1}{2}\rceil$ of the intervals $T_{i+1}-T_i$, which all have the same distribution by symmetry.

We compute the second moment $\mathbb E[X^2]$ instead of the variance, because this plays nicely with all the conditioning we're doing. This requires finding $\mathbb E[T_1^2]$ (which is equal to $\mathbb E[(T_{i+1}-T_i)^2]$ for any $i$, by symmetry) and $\mathbb E[T_1(T_3-T_2)]$ (which is equal to $\mathbb E[(T_{i+1}-T_i)(T_{j+1}-T_j)]$ for any $i \ne j$, by symmetry).

The joint density function of $T_1, T_2, T_3$ is $k(k-1)(k-2)(1-t_3)^{k-3}\,dt_1\,dt_2\,dt_3$: in $k(k-1)(k-2)$ ways, we choose which three uniforms will be $T_1, T_2, T_3$. These must land in intervals of length $dt_1, dt_2, dt_3$ respectively, while the other uniforms must all land in an interval of length $1-t_3$. So we have $$\mathbb E[T_1(T_3-T_2)] = \iiint_{0<x<y<z<1}k(k-1)(k-2) x (z-y) (1-z)^{k-3}\,dx\,dy\,dz = \frac1{(k+1)(k+2)}.$$ We get $\mathbb E[T_1^2] = \frac2{(k+1)(k+2)}$ by a similar but less complicated integral.

Let $k$ be even and say the switch starts in the "on" state. Then there are $\frac k2 + 1$ "on" intervals, and $\mathbb E[X^2]$ expands as $$(\tfrac k2+1) E[T_1^2] + (\tfrac k2 + 1)(\tfrac k2)\mathbb E[T_1(T_3-T_2)] = \frac{k+4}{4k+4}.$$ On the other hand, if the switch starts in the "off" state, then there are only $\frac k2$ "on" intervals, and $\mathbb E[X^2]$ expands as $$(\tfrac k2) E[T_1^2] + (\tfrac k2)(\tfrac k2-1)\mathbb E[T_1(T_3-T_2)] = \frac{k}{4k+4}.$$ These are equally likely, so on average $\mathbb E[X^2] = \frac{k+2}{4k+4}$. Finally, if $k$ is odd, there are always $\frac{k+1}{2}$ "on" intervals, and $\mathbb E[X^2]$ expands as $$(\tfrac {k+1}2) E[T_1^2] + (\tfrac {k+1}2)(\tfrac {k-1}2)\mathbb E[T_1(T_3-T_2)] = \frac{k+3}{4k+8}.$$ Since the distribution of $k$ is Poisson with rate $\lambda$, we can average all of these together, which is an exponential series that Mathematical tells me averages to $\frac{\lambda ^2+\lambda -e^{-\lambda } \sinh (\lambda )}{4 \lambda ^2}$. So $\operatorname{Var}[X]$ simplifies to $\mathbb E[X^2] - \mathbb E[X]^2 = \mathbb E[X^2] - \frac14 = \frac{2 \lambda +e^{-2 \lambda }-1}{8 \lambda ^2}$.

Generalizing away from $t=1$, we get $\operatorname{Var}[X] = \frac{2 \lambda t +e^{-2 \lambda t}-1}{8 (\lambda t)^2}$.