Let there be some constant $c \in [0, 1]$ and let $X$ be some random variable with the mean $\mu$. For convenience we could say that $X \sim N(0, 1)$, but it can be any distribution with a defined mean. Now let $Y$ be another random variable so that samples from $Y$ are generated in the following way:
Sample $u$ from $U(0, 1)$ and $x$ from $X$. If $u<c$, return $x$, otherwise return $|\mu - x|$.
How do we find the joint probability distribution of $X$ and $Y$ so that we can calculate their covariance?
I preassume $0<c<1$ and independence where it concerns the samples.
Then $Y=XB+|\mu-X|C$ where $B$ has Bernoulli distribution with parameter $P(U<c)=c$, $B+C=1$ and $X$ and $B$ are independent. With bilinearity of $\text{Cov}$ we find:
$$\text{Cov}(X,Y)=\text{Cov}(X,XB+|\mu-X|C)=\text{Cov}(X,XB)+\text{Cov}(X,|\mu-X|C)$$
For the first term we find:
$\text{Cov}(X,XB)=\mathbb E[X^2B]-\mathbb EX\mathbb E[XB]=\mathbb EX^2\mathbb EB-(\mathbb EX)^2\mathbb EB=\text{Var}X\mathbb EB=c\text{Var}X$
For the second term we find likewise:
$\text{Cov}(X,|\mu-X|C)=(1-c)\text{Cov}(X,|\mu-X|)$
So for finding $\text{Cov}(X,Y)$ it is enough to find $\text{Var}(X)$ and $\text{Cov}(X,|\mu-X|)$.