I am new to Mathematica. I am asking how to define a conditinal probability in Mathematica.
Here is an example of what I want to do:
Assume that $P(x_b\,|\,x_i)=\left\{ \begin{array}{} 1-p & : x_b=0\\ p & : x_b=x_i \end{array} \right.$
where $P(x_b|x_i)$ is the conditional probability which takes 0 with probability of $1-p$ and takes the value of $x_i$ with probability $p$, where $0\le p\le 1$.
Also, we have $x_i\in U[3,5]$, by which I mean $x_i$ is uniformly distributed between 3 and 5.
I know that: $P(x_i,x_b)=P(x_b|x_i)P(x_i)$
I know how to define $P(x_i)$ in Mathematica using
xi=UniformDestribution[{3,5}]
but I want to find how to define conditional probability $P(x_b|x_i)$ in Mathematica. I tried to use the following:
xb = TransformedDistribution[xi xb, xb \[Distributed] BernoulliDistribution[p]]
and then multiply $x_b$ with $x_i$, but when I run
RandomVariate[xb xi]
I get error message
The valid numeric parameters of distribution TransformedDistribution[[FormalX]UniformDistribution[{3,5}], [FormalX][Distributed]BernoulliDistribution[0.1]] are expected. Use DistributionParameterAssumptions to obtain the parameter assumptions.
Is there any way to find $P(x_i,x_b)$ which equals $P(x_b|x_i)P(x_i)$