what is the probability that the system operates? I do not know what should I do when the parameter of a probability function is itself a random variable with certain distribution. should I solve this problem with conditional probability?  is anyone can solve this problem?
problem:
Suppose that three components in a certain system each function with probability p and fail with probability 1-p, each component operating or failing independently of the others. But the system is in a random environment so that p is itself a random variable. Suppose that p is uniformly distributed over the interval (0,1]. The system operates if at least two of the components operate. What is the probability that the system operates?
 A: Guide:
Yes, do it via conditional probability. You are given that $p \sim Uni(0,1]$
Hence the probability that the system is operating is 
$$\int_0^1Pr(X \ge 2|p)f(p) \, dp$$
A: All three components working happens with probability $p^3$.
Exactly two components working happens with probabiliy $3p^2(1-p)$.
So at least two components working happens with probability $p^3+3p^2(1-p)=3p^2-2p^3$.
Now, since $p$ itself is randomly distributed, our answer is just $\displaystyle \int_{0}^{1}(3p^2-2p^3)\,dp=0.5$.
In fact, this is kind of intuitive. There is the same chance that $2$ or $3$ components fail, as there are $2$ or $3$ components work. 
A: What you're describing is essentially a multivariate random variable. This can be treated as "normal" except now your sample space is a vector. Your variable is
$$\mathbf{X}:\mathbf{\Omega} \rightarrow \Bbb{R}^n$$
Where $\mathbf{X}$ is measurable and $\Omega:=\Omega_1\times\Omega_2...\times\Omega_n $ is your sample space. Each $\Omega_n$ is the sample space for a single valued random variable $X_n:\Omega_n \rightarrow \Bbb{R}$ (ie the usual type) and your multivariate random variable is the composition of these 
$$\mathbf{X}(X_1,X_2,...X_n):\mathbf{\Omega}\rightarrow \Bbb{R}^n$$
for your case
$$\mathbf{X}(X,P):\mathbf{\Omega}\rightarrow \Bbb{R}^2$$ Where the sample space is now
$$\Omega_X \times \Omega_P$$ where each $\Omega$ is the sample space for their respective variable. So if you were trying to model a simple bernoulli distribution, the mass function would be $$p^x(1-p)^{1-x}$$ as before but both $X$ and $P$ are allowed to vary. The probability associated would be $P(X=x\cap P=p)$ and the standard rules of probability apply (ie total probability is $1$, probability is always greater than $0$ etc)
