<s>[INST] Choose two sequences from a set such that the average of one sequence is larger than the other by 4th decimal point 
Choose two sequences $a_n, b_m$ from $\{ \frac{1}{3}, \frac{2}{3}, 1, \frac{4}{3}, \frac{5}{3}, 2 \}$. Calculate their average $\bar{a_n}, \bar{b_m}$. Turned out that $\bar{a_n}$ is the same with $\bar{b_m}$ until the 4th decimal point (for example $\bar{a_n} = 0.xxxy$ and $\bar{b_m} = 0.xxxz$. Of course $\bar{a_n}$ can be $1$ too)
What's the minimum value of $\max(n,m)$.

If we only have two integers, $1, 2$, the results look simple. You need to have 1001 (with 1000 1's and 1 2's). But what if we got $\{ \frac{1}{3}, \frac{2}{3}, 1, \frac{4}{3}, \frac{5}{3}, 2 \}$?
 [/INST] Fill in the gaps as needed.

*

*The terms of the sequences are $ \{ \frac{1}{3},\frac{2}{3},\frac{3}{3},\frac{4}{3},\frac{5}{3},\frac{6}{3} \}$. So, we can write $ \bar{a} = \frac{ A}{ 3n}$, where $ n \leq A \leq 6n$. Likewise, $ \bar{b} = \frac{ B}{ 3m}$, where $ m \leq A \leq 6m$.

*$ \frac{A}{3n} \neq \frac{B}{3m} \Rightarrow Am-Bn \neq 0 $.

*$ | \bar{a} - \bar{b} | < \frac{1}{1000} \Rightarrow 1000 | Am - Bn | < 3 mn$.

*If $|Am-Bn| = 1$, then $1000 < 3mn \Rightarrow \max(m, n) \geq 19$.

*If $\max(m, n) = n = 19$, then $m \geq \frac{1000}{3n} \Rightarrow m \geq 18$. Notice that $|19A - 19B| = 1 $ has no solutions, so we must have $m = 18$ only.

*Solving for $18A - 19B = 1$, we get solutions $A = 19K + 18, B = 18K + 17$. However, verify that none of these lead to actual solutions.

*Likewise for $18A - 19B = -1$, we don't get solutions.

*Apart from the trial and error, that there are no solutions in these cases can be explained as such: We have $\frac{|Am-Bn|} { 3mn }  = \frac{1}{3}\times 19 \times 18 \approx 0.000974\ldots$, so this means that we either $\frac{A}{n} $ or $\frac {B}{m}$ will have to look like $0.xxx00, 0.xxx01, 0.xxx02, 0.xxx03$ in order for the other term to have the form $0.xxxz$. This is extremely restrictive (though we'd still have to check the various numbers to ensure that it isn't of this form).

*If $ \max(m, n) = n = 20$, then we have $ m \geq\frac{1000}{3n} \Rightarrow m\geq 17$. So let's consider $(m, n) = (17,20)$ in a similar manner. Solving $20A - 17B = 1$ gives us $A = 17k + 6, B = 20k + 7$. Because $\frac{27}{20} = 0.45000\ldots$, we know that this will work, namely $\frac{ 23}{17} = 0.45098\ldots$.

Hence, $\min (\max(m, n) ) = 20$.

Notes:

*

*As it turns out, selecting terms from $ \{ \frac{1}{3},\frac{2}{3},\frac{3}{3},\frac{4}{3},\frac{5}{3},\frac{6}{3} \}$ is a distractor. We only needed $\{ \frac{1}{3}, \frac{2}{3} \}$.

*To test your understanding of what is happening, figure out what happens with $(m, n) = (18, 20)$ (no solutions, why?), and $(m, n) = (19,20)$ (has solutions, which are?).

*We lucked out somewhat with the testing. If we wanted them to be the same until the 5th decimal point, what would the answer be?

</s>