# If a wholesaler sells to 500 stores and one store shows a 50% uptick in sales, how can the wholesaler determine if this uptick is significant or if it is expected for a few stores to randomly see an uptick of 50%?

Mar 20, 2016

There is no single simple answer. It depends on additional parameters that are not given.
See explanation below.

#### Explanation:

Important parameters that are not given in this problem are distribution of goods among stores and the number of customers buying in these stores.

Let's try to address a problem generally, and then we will make certain reasonable assumptions.

The distribution of goods among stores is related to probability of customers to buy goods in each specific store.
Assume that the probability of a single item to be bought at store ${S}_{1}$ is ${p}_{1}$, at store ${S}_{2}$ is ${p}_{2}$, ... at store ${S}_{i}$ is ${p}_{i}$,... at store ${S}_{500}$ is ${p}_{500}$.

Assume further that the total number of items purchased is $n$.

Consider now a store ${S}_{i}$. Introduce a random variable ${\xi}_{i}$ that is equal to $1$ when an item is bought at store ${S}_{i}$ (with probability ${p}_{i}$) and is equal to $0$ otherwise (with probability $1 - {p}_{i}$).
This is a Bernoulli random variable.
Its mathematical expectation is
$E \left({\xi}_{i}\right) = 1 \cdot {p}_{i} + 0 \cdot \left(1 - {p}_{i}\right) = {p}_{i}$,
its variance is
$V a r \left({\xi}_{i}\right) = {\left(1 - {p}_{i}\right)}^{2} \cdot {p}_{i} + {\left(0 - {p}_{i}\right)}^{2} \cdot \left(1 - {p}_{i}\right) = {p}_{i} \left(1 - {p}_{i}\right)$,
its standard deviation is
$\sigma \left({\xi}_{i}\right) = \sqrt{{p}_{i} \left(1 - {p}_{i}\right)}$

The wholesaler has certain number $n$ of items of his goods that he distributes among $500$ stores. It's reasonable to assume that the number of items $n$ is rather big to cover all stores and must be significantly higher than the number of stores.
For instance, if we are talking about bottles of soda, it must be thousands per store.

Consider now $n$ random variables independent of each other and each distributed identically with ${\xi}_{i}$:
${\xi}_{i 1}$, ${\xi}_{i 2}$,...${\xi}_{i n}$
Here random variable ${\xi}_{i j}$ indicates whether $j$th item was bought at $i$th store.
Obviously, the sum of the above random variable is a random variable equal to the number of items bought at $i$th store:
${\eta}_{i} = {\xi}_{i 1} + {\xi}_{i 2} + \ldots + {\xi}_{i n}$

Let's analyse the distribution of probabilities of ${\eta}_{i}$.
First of all, according to the Central Limit Theorem, this distribution should be very close to Normal.
Since it's a sum of independent identically distributed random variables, its expectation is a sum of expectations of its components and its variance is a sum of variances:
$E \left({\eta}_{i}\right) = {p}_{i} \cdot n$
$V a r \left({\eta}_{i}\right) = {p}_{i} \cdot \left(1 - {p}_{i}\right) \cdot n$
$\sigma \left({\eta}_{i}\right) = \sqrt{{p}_{i} \cdot \left(1 - {p}_{i}\right) \cdot n}$

It's time to make some additional assumption. To simplify the problem, let's assume that all stores are approximately equal in the number of customers who buy there. Therefore, the probability of a single item to be bought in store ${S}_{i}$ is independent of store and, therefore, equal to $\frac{1}{500} = 0.002$.
That makes all ${\eta}_{i}$ to have the same distribution of probabilities - Normal with expectation $E \left({\eta}_{i}\right) = 0.002 \cdot n$ and standard deviation $\sigma \left({\eta}_{i}\right) \cong 0.0447 \cdot \sqrt{n}$

Let's say, we want to determine the probability of purchases in store ${S}_{1}$ (or any other fixed store for this matter) to be within reasonable limits around average with total number of items distributed among all stores $n = 10 , 000$.
In this case
$E \left({\eta}_{1}\right) = 0.002 \cdot 10000 = 20$,
$\sigma \left({\eta}_{1}\right) \cong 0.0447 \cdot \sqrt{10000} = 4.47$

According to the "rule of 2$\sigma$", with 95% certainty we can say that deviation of the value of our random variable ${\eta}_{1}$ from its mathematical expectation $E \left({\eta}_{1}\right)$ should not exceed $2 \cdot \sigma \left({\eta}_{1}\right) \cong 9$, which is slightly less than 50% of its average value $20$.
So, under the condition of equal probabilities of purchase in different stores ${p}_{i} = \frac{1}{500}$ and about $10 , 000$ items purchased in all stores combined, the probability of the number of items purchased in store ${S}_{1}$ (or any other fixed store) not to exceed 50% of average is greater than 95%.

The second part of this problem is related to probability of ANY store purchase not to exceed 50% of its average. With certain degree of precision it can be calculated as the product of corresponding probabilities in EACH store.
To achieve 95% certainty that number of purchases in any store would not exceed 95%, we need the probability of each store to be
0.95^(1/500)~=0.9999=99.99%

To achieve this probability for each store we need the number of purchases to be very high. "Rule of 3$\sigma$" states that Normal random variable takes values not further than 3$\sigma$ from its average with probability 99.7%. To achieve 99.99% certainty we have increase the interval around average to 6$\sigma$.

Thus, with $n = 100 , 000$ we have
$E \left({\eta}_{1}\right) = 0.002 \cdot 100000 = 200$
$\sigma \left({\eta}_{1}\right) \cong 0.0447 \cdot \sqrt{100000} = 14.14$
$6 \sigma \left({\eta}_{1}\right) \cong 85$,
which is about 43% of the average, so it's sufficient to have 100,000 items to distribute to make sure that none of the store would have more than 50% extra purchases with certainty of 95%.

If, evenly distributing 100,000 items among 500 relatively equivalent (in average number of purchases) stores, at least one store exceeded its sale by more than 50%, something abnormal and unexpected happened.

Please refer to Unizor for details on probabilities and statistics.