The position of a hidden machine part, given a reading of total pollution

95 Views Asked by At

A machine has $n$ independent (hidden) movable parts and each part can have one of two different settings, $A$ or $B$. The position of each movable part is governed by a set of probabilities, $w_{A_j}$ and $w_{B_j} = 1 - w_{A_j}$, where $j$ denotes the particular part.

Assuming that whenever a part has a setting of $A$, it generates an amount of exhaust captured by the normal random variable $N (\mu_A, \sigma_A)$. Furthermore, whenever a part has a setting of $B$, it generates an amount of exhaust captured by the normal random variable $N (\mu_B, \sigma_B)$. In that situation, the CDF for the total level of exhaust, $T$, produced by the machine is given by:

$\frac{W_A \text{erfc}\left(\frac{\mu _A-T}{\sqrt{2} \sigma _A}\right)+\left(n W_B\right) \text{erfc}\left(\frac{\mu _B-T}{\sqrt{2} \sigma _B}\right)}{2 n}$,

where $W_A$ is the sum of all $w_{A_j}$ and $W_B$ is the sum of all $w_{B_j}$.

Deriving the above: I found the above using Mathematica. Assuming a machine with only four part, we have

\[ScriptCapitalD] = MixtureDistribution[{w1A1, 1 - w1A1, w2A2, 1 - w2A2 , w3A3, 1 - w3A3, w4A4, 1 - w4A4 }, {NormalDistribution[muA1, sdA1], NormalDistribution[muB1, sdB1], NormalDistribution[muA2, sdA2], NormalDistribution[muB2, sdB2], NormalDistribution[muA3, sdA3], NormalDistribution[muB4, sdB4], NormalDistribution[muA4, sdA4], NormalDistribution[muB4, sdB4]}]

producing the following $CDF$

Function[\[FormalX], (1/8)*w2A2*Erfc[(-\[FormalX] + muA)/(Sqrt[2]*sdA)] +(1/8)*w3A3*Erfc[(-\[FormalX] + muA)/(Sqrt[2]*sdA)] + (1/8)*w4A4*Erfc[(-\[FormalX] + muA)/(Sqrt[2]*sdA)] + (1/8)*w1A1*Erfc[(-\[FormalX] + muA1)/(Sqrt[2]*sdA1)] +(1/8)*(1 - w2A2)*Erfc[(-\[FormalX] + muB)/(Sqrt[2]*sdB)] + (1/8)*(1 - w3A3)*Erfc[(-\[FormalX] + muB)/(Sqrt[2]*sdB)] + (1/8)*(1 - w4A4)*Erfc[(-\[FormalX] + muB)/(Sqrt[2]*sdB)] + (1/8)*(1 - w1A1)*Erfc[(-\[FormalX] + muB1)/(Sqrt[2]*sdB1)]]

Now, assuming that all settings of $A$ have equal means and variances, and assuming the same for every setting of $B$, we get the much simpler $CDF$:

(1/8)*((w1A1 + w2A2 + w3A3 + w4A4)*Erfc[(-\[FormalX] + muA)/(Sqrt[2]*sdA)] -(-4 + w1A1 + w2A2 + w3A3 + w4A4)*Erfc[(-\[FormalX] + muB)/(Sqrt[2]*sdB)])

A pattern thus appears, which allowed me to express the general formula stated above. And now for the question:

Question: Let us assume that an inspector is interested one particular part of the machine (let's say the first part). The inspector obtains a precise reading of the total level of exhaust, and now wonders "what is the probability that the focus part is in position A?"