Probability of a Sum of Roundoff Errors

562 Views Asked by At

Suppose you balance your checkbook by rounding amounts to the nearest dollar. Between 0 and 49 cents, drop the cents; between 50 and 99 cents, drop the cents add a dollar. Find the approximate probability that the accumulated error in 100 transactions is greater than 5 dollars (either way). Assume the number of cents involved are indepedent and uniformly distributed between 0 and 99.

Let $X$ = cents gained on each transaction.

$X \in \{-49, -48, ..., 0, 1, ..., 49, 50\}$

Each outcome of $X$ has equal probability of $\frac{1}{100}$ because "the number of cents involved are indepedent and uniformly distributed between 0 and 99".

Let $X_i$, $1\le i\le100$, have the same distribution as $X$.

$X_i$ are independent from each other.

$S =$ sum of cents gained from 100 transactions $= X_1 + X_2 + ... +X_{100}$

$P(S > 5)$

$\approx P(S > 5.5)$, continuity correction.

$=P(\frac{S-E(S)}{SD(S)} > \frac{5.5-E(S)}{SD(S)})$

$=P(z > \frac{5.5-E(S)}{SD(S)})$, where $z= \frac{S-E(S)}{SD(S)}$

$=P(z > \frac{5.5-50}{\sqrt{Var(S)}})$

$=P(z > \frac{5.5-50}{\sqrt{83325}})$

$=P(z > -0.15416023)$

$=1- \Phi(-0.15416023)$

$=1- (1-\Phi(0.15416023))$

$=\Phi(0.15416023)$

$=0.5596$

Textbook Answer:

0.0876

1

There are 1 best solutions below

0
On

Let $S_{100} = \sum_{i=1}^{100} X_i$, where $X_i$ is uniform on $\{-49,...,0,...,50\}$, with expected value of $\frac{-49+50}{2}=1/2$ and variance $ \frac{(50 +49 +1)^2 - 1}{12} = 833.25$. The error is at least $5\$$ or $500$ cent. It can be either negative or positive, thus the error is greater than $|500|$ cent. Using CLT the approximate distribution of $S_{100}$ is

$$ \mathcal{N}(100/2, 100\times 833.35), $$ hence, \begin{align} \mathbb{P}(S_{100}>|500|) &\approx 1 - \Phi(-500 < S_{100} < 500)\\ &=1 - [\Phi((500.5 - 50)/\sqrt{83335}) - \Phi((-500.5 - 50)/\sqrt{83335})\\ &=0.0875. \end{align}

Quick simulation in R gives the same results and nice plot of the absolute sum of the error.

SEQ = seq(-49, 50, by=1)

VEC = numeric()
for(i in 1:10000)
{
  W      = sample( SEQ, 100, replace = T)
  VEC[i] = abs(sum(W))  
}

nn = 0

for( i in 1:10000)
{
  if(VEC[i] > 500) { nn = nn + 1 }
}

nn/10000

[1] 0.0824

enter image description here