0

During coding specific algorithms I required an averaged of minimums of three arrays (they are same size), but I have only access to averaged array of three mentioned above. During testing numbers appears to be the same, but I have no luck understanding why. Is there a proper name for this question? I tried searching the Internet but didn't find anything related.

In formula wise I want to prove or disprove that:

$min(\frac{a_0 + a_1 + a_2}{3}) = \frac{min(a_0) + min(a_1) + min(a_2)}{3}$, where $a_0, a_1, a_2$ arrays of equal size.

Digoya
  • 13
  • 2
  • This will not yield the same answer unless you specifically cook up an example so that it does. e.g. if the arrays are [0,1], [1,2], [2,3], then the average of the minimums is $\frac{0+1+2}{3}=1$ but the minimum of the averages is $\min(0.5, 1.5, 2.5)=0.5$. – Snaw Feb 20 '22 at 01:25
  • Have yoh thought about examples where the arrays have length 2? – Jamie Radcliffe Feb 20 '22 at 01:26
  • Yes, it turned out I used bad numbers for checking, probably that confused me. And I agree that starting from arrays of two numbers would push me towards the right answer, thank you! – Digoya Feb 20 '22 at 02:15

1 Answers1

0

A counter example is sufficient for a disproof. Suppose that the size of the arrays ($a_i$) is $2$ with the following values: $a_0=(3,6)^T;a_1=(1,10)^T; a_2=(5,4)^T$. Then

$$\textrm{min}\left(\frac{a_0+a_1+a_2}{3}\right)=\textrm{min}\left(\frac{(3,6)^T+(1,10)^T+(5,4)^T}{3}\right)$$ $=\textrm{min}\left(\frac{(9,20)^T}{3}\right)=3$

In the other case we have

$$\frac{\textrm{min}(a_0)+\textrm{min}(a_1)+\textrm{min}(a_2)}{3}=\frac{\textrm{min}((3,6)^T)+\textrm{min}((1,10)^T)+\textrm{min}((5,4)^T)}{3}$$ $=\frac{3+1+4}{3}=2\frac23$

callculus42
  • 30,550