Probability for the difference between the the sum of the parts and the whole

39 Views Asked by At

I need help with a problem.

I have an scale that round the weight to the nearest integer. Errors are $U(-\frac{1}{2},+\frac{1}{2})$

We weighs n separately objects $q_i$ and get $\hat{q_i}$ (integer). Then we weighs the n objects as a whole ($Q$) and get $\hat{Q}$.

$\hat{q_i} = q_i + \epsilon_i$, with $ \epsilon_i \sim U(-\frac{1}{2},+\frac{1}{2}) \forall i$

$\hat{Q} = Q + \epsilon_Q$ with $\epsilon_Q \sim U(-\frac{1}{2},+\frac{1}{2})$

I want to measure $P(\vert \hat{Q} - \sum_{i=1}^n \hat{q_i} \vert \ge k)$

We now that $Q = \sum_{i=1}^n q_i$

Then we want to calculate $P(\vert \sum_{i=1}^n \epsilon_i - \epsilon_Q \vert \ge k)$

The $\epsilon_i $ are iid but $\epsilon_Q$ is not (note:$\vert \sum_{i=1}^n \epsilon_i - \epsilon_Q \vert$ it's integer).

If all the errors were iid, I can use Central Limit Theorem with n + 1 random vars iid because $-\epsilon_Q \sim U(-\frac{1}{2},+\frac{1}{2})$ too

Any idea?


I think I solved it.

Take a look at the next table

$$\begin{array}{|c|c|c|c|} \hline \sum\limits_{i=0}^n \epsilon_i & \epsilon_Q & |\sum\limits_{i=0}^n \epsilon_i - \epsilon_Q| & [|\sum\limits_{i=0}^n \epsilon_i|] \\ \hline -2.37 & -0.37 & 2.0 & 2.0 \\ -4.46 & -0.46 & 4.0 & 4.0 \\ -2.64 & 0.36 & 3.0 & 3.0 \\ 1.06 & 0.06 & 1.0 & 1.0 \\ 1.53 & -0.47 & 2.0 & 2.0 \\ \hline \end{array}$$

Note that $-\epsilon_Q$ don't afect the final error. I only need to work with $|\sum\limits_{i=0}^n \epsilon_i|$ rounded to the nearest integer (fourth column).

Then $P(|\sum\limits_{i=0}^n \epsilon_i - \epsilon_Q| \ge k) = P(|\sum\limits_{i=0}^n \epsilon_i| \ge k - \frac{1}{2}) = P(|S_{n+1}| \ge k - \frac{1}{2})$

Where $S_{n+1}$ is a sum of $n+1$ iid random variables $U(-\frac{1}{2},+\frac{1}{2})$

$\begin{align} P(|S_{n+1}| \ge k - \frac{1}{2}) & = 1-P(|S_{n+1}| < k - \frac{1}{2}) \\ & = 1-P(-k+\frac{1}{2} < S_{n+1} < k - \frac{1}{2}) \\ & = 1-[P(S_{n+1} < k - \frac{1}{2}) - P(S_{n+1} \le -k + \frac{1}{2})] \\ & = 1-P(S_{n+1} < k - \frac{1}{2}) + P(S_{n+1} \le -k + \frac{1}{2}) \\ & = 1-P(\frac{S_{n+1}}{\sigma \sqrt{n+1}} < \frac{k - \frac{1}{2}}{\sigma \sqrt{n+1}}) + P(\frac{S_{n+1}}{\sigma \sqrt{n+1}} \le \frac{-k + \frac{1}{2}}{\sigma \sqrt{n+1}}) \end{align}$

$\sigma^2=\frac{1}{12}$

$\begin{align} P(|S_{n+1}| \ge k - \frac{1}{2}) & = 1-P(\frac{S_{n+1}}{\sqrt{\frac{1}{12}} \sqrt{n+1}} < \frac{k - \frac{1}{2}}{\sqrt{\frac{1}{12}} \sqrt{n+1}}) + P(\frac{S_{n+1}}{\sqrt{\frac{1}{12}} \sqrt{n+1}} \le \frac{-k + \frac{1}{2}}{\sqrt{\frac{1}{12}} \sqrt{n+1}}) \\ & = 1-P(\frac{S_{n+1}}{\sqrt{\frac{1}{12}} \sqrt{n+1}} < \frac{\sqrt{3}\cdot {(2k - 1)}}{\sqrt{n+1}}) + P(\frac{S_{n+1}}{\sqrt{\frac{1}{12}} \sqrt{n+1}} \le \frac{\sqrt{3} \cdot {(-2k + 1)}}{\sqrt{n+1}}) \end{align}$

Applying Central Limit Theorem, we obtain this aproximation

$P(|\sum\limits_{i=1}^n \hat{q_i} - (\hat{Q} - \hat{q_0})| \geq k) = 1-\Phi(\frac{\sqrt{3}\cdot {(2k - 1)}}{\sqrt{n+1}}) + \Phi(\frac{\sqrt{3} \cdot {(-2k + 1)}}{\sqrt{n+1}})$