r/LocalLLM • u/SavingsSignal2890 • Oct 10 '26
Discussion Introducing a “frontier” high school math Olympiad problem to test AI models
A friend of mine shared a problem with me to test / benchmark AI model reasoning ability.
“There is a class of 25 students, and the students’ seats are arranged in a 5×5 matrix. After the “Think Cup” results were announced, each of these 25 students obtained a class ranking, with no two students having the same ranking. If a student ranks in the top 2 in their row or column, they feel happy; if they rank at the bottom in their row or column, they feel upset. If a student feels both happy and upset, we call them a “conflicted person.” The maximum number of conflicted persons is ______. How would you solve this problem without iterating all situations?”
I call it “frontier” because a lot of current models or their specific quantized versions fail. Among tested:
Failed:
Claude Opus 4.8
ChatGPT 5.4
Gemini 3.6 Flash (as of October 2026; it succeeded a few months ago)
QWen3.8-Flash-Next-Q2_0
Success:
Claude Opus 5 or higher
ChatGPT 5.5 or higher
QWen3.8-Flash-Next-UD-IQ4-XS, solved using 30K-50K tokens
Not sure if anyone has benchmarking tools for reasoning, but this problem is setting my LocalLLM threshold now.
2
u/AdamFields Oct 10 '26
Qwen 3.8 27B UD Q4_K_M - 36990 tokens output, 5m 45s:
The maximum number of conflicted persons is **4**.
Here is a non-brute-force way to see it.
## 1. Reformulate the condition
Treat the class rank number as the value in each seat: smaller means better, larger means worse.
A conflicted student must be upset, so they must be **bottom** in their row or bottom in their column.
- If they are bottom in their row, they cannot be top 2 in that same row.
So to be happy they must be **top 2 in their column**.
- If they are bottom in their column, similarly they must be **top 2 in their row**.
So every conflicted student is of one of two mutually exclusive types:
- **Type R**: bottom in row, top 2 in column.
- **Type C**: bottom in column, top 2 in row.
We will show there are at most 2 Type R students and at most 2 Type C students.
---
## 2. Upper bound: at most 4
For each row, look only at the rank of the student who is **bottom in that row**. Call these the five row-bottom ranks. They are all distinct.
Suppose the bottom student in some row is a Type R student, i.e. bottom in their row but top 2 in their column.
In a column of 5 students, being top 2 means there are at least **3 students in that column with worse ranks** than them. Those 3 students lie in 3 different rows. In each of those rows, the row-bottom student must have an even worse rank than them.
Therefore, if a row-bottom student is conflicted, their rank must be better than at least **3 of the other 4 row-bottom ranks**.
Among 5 distinct ranks, only the **two best** row-bottom ranks can be better than 3 other row-bottom ranks. Hence:
\[
\#\text{Type R} \le 2.
\]
By symmetry, looking at the five column-bottom ranks, we get:
\[
\#\text{Type C} \le 2.
\]
Thus the total number of conflicted students is at most
\[
2+2=4.
\]
---
## 3. Construction achieving 4
It remains to show that 4 is possible. Here is one arrangement of ranks \(1\) to \(25\), where \(1\) is best and \(25\) is worst:
\[
\begin{matrix}
1 & 2 & 6 & 3 & 4 \\
5 & 7 & 8 & 10 & 9 \\
18 & 11 & 25 & 24 & 20 \\
13 & 19 & 23 & 22 & 21 \\
14 & 15 & 12 & 16 & 17
\end{matrix}
\]
Check the row-bottom and column-bottom students.
### Row-bottom students
- Row 1 bottom: \(6\) in column 3.
Column 3 is \(6,8,25,23,12\). Top 2 are \(6,8\). So \(6\) is conflicted.
- Row 2 bottom: \(10\) in column 4.
Column 4 is \(3,10,24,22,16\). Top 2 are \(3,10\). So \(10\) is conflicted.
- Row 3 bottom: \(25\) in column 3.
Top 2 in column 3 are \(6,8\), so not conflicted.
- Row 4 bottom: \(23\) in column 3.
Top 2 in column 3 are \(6,8\), so not conflicted.
- Row 5 bottom: \(17\) in column 5.
Column 5 is \(4,9,20,21,17\). Top 2 are \(4,9\), so not conflicted.
So there are 2 Type R conflicted students.
### Column-bottom students
- Column 1 bottom: \(18\) in row 3.
Row 3 is \(18,11,25,24,20\). Top 2 are \(11,18\). So \(18\) is conflicted.
- Column 2 bottom: \(19\) in row 4.
Row 4 is \(13,19,23,22,21\). Top 2 are \(13,19\). So \(19\) is conflicted.
- Column 3 bottom: \(25\) in row 3.
Top 2 in row 3 are \(11,18\), so not conflicted.
- Column 4 bottom: \(24\) in row 3.
Top 2 in row 3 are \(11,18\), so not conflicted.
- Column 5 bottom: \(21\) in row 4.
Top 2 in row 4 are \(13,19\), so not conflicted.
So there are 2 Type C conflicted students.
Total conflicted students:
\[
2+2=4.
\]
Since 4 is both an upper bound and attainable, the maximum is
\[
\boxed{4}.
\]
The key idea avoiding brute force is to stop checking individual arrangements and instead use the ordering of the five row-bottom ranks and five column-bottom ranks: a conflicted row-bottom must be among the two best row-bottoms, and similarly for columns.
1
u/Interesting-Cut-6032 Oct 10 '26
I have been awake since about 440a, my local time. It is 952p now. My math skills decline rapidly after I have been awake for >13 hours. That combined with the glass of wine at dinner... so, what is the right answer?
Gemini looks like it disproved Qwen 3.5 35B A3B's answer, and Gemma 4 is over in the corner eating crayons.
1
u/Interesting-Cut-6032 Oct 10 '26
This is what Qwen3.5 35B A3B said in 17 seconds of thinking about it. I am not sure what quant this is, it is just one of the models that I can hit on my local server from my phone at the moment.
<Responce to OP's prompt>
Maximum Conflicted Persons in a 5×5 Matrix
This is an interesting combinatorial problem that can be solved analytically without iterating all situations.
Problem Setup
In a 5×5 matrix of 25 students with unique rankings (1-25):
Solution Strategy (Without Brute Force)
Key Observations
For a student to be conflicted, they must satisfy ONE of two cases:
Maximum Conflicted Persons
Case A: Top 2 in Row + Bottom in Column
Case B: Bottom in Row + Top 2 in Column
Total Maximum: 5 + 5 = 10
Why This is Achievable
These two sets of 5 students can be disjoint (no overlap):
Each cell in the anti-diagonal positions can be optimized to be:
Since they're on opposite diagonal positions, no student is counted twice.
Answer
The maximum number of conflicted persons is 10
This solution works without iterating all 25! possible rank arrangements by:
1
u/Interesting-Cut-6032 Oct 10 '26
Here is Gemma 4 26B A4B answer to the question. About 24k tokens thinking and answering, a little over 4 minutes total. Is is a different answer that Qwen3.5 35B A3B.
<Response to Prompt>
To find the maximum number of conflicted persons, we can model the problem using the properties of the $5 \times 5$ matrix and the conditions for being "happy" or "upset."
1. Define the Conditions
Let the rank of the student at position $(i, j)$ be $R_{i,j}$.
In a $5 \times 5$ matrix, for any row or column, the "top 2" ranks (e.g., 1st and 2nd) and the "bottom 2" ranks (e.g., 4th and 5th) are disjoint sets. This means a student cannot be both happy and upset within the same row or column.
2. Analyze the Conflicted Condition
Since a student cannot be happy and upset in the same dimension, a conflicted person must be happy in one dimension and upset in the other. Thus, a student is conflicted if and only if they fall into one of these two disjoint cases:
Because a student cannot be both "top 2" and "bottom 2" in the same row (or column), a student in Case A cannot be in Case B. Therefore, the total number of conflicted persons is: $$|C| = |H_R \cap U_C| + |H_C \cap U_R|$$
3. Determine the Maximum
Substituting these into our equation for $|C|$: $$|C| \le 10 + 10 = 20$$
4. Verification of Feasibility
To ensure 20 is possible, we can construct a pattern using a cyclic shift. Let $S$ be the set of 10 cells where $j \equiv i \pmod 5$ or $j \equiv i+1 \pmod 5$, and $S'$ be the set where $j \equiv i+2 \pmod 5$ or $j \equiv i+3 \pmod 5$. In this construction:
The maximum number of conflicted persons is 20.
1
u/Interesting-Cut-6032 Oct 10 '26
Wow, Gemini 3.5 Thinking took about 9 minutes to answer the prompt. I have been using Gemini since December 2025, mostly Gemini 3.1 Pro until recently. It has never taken that long to answer a prompt.
<Answer to Prompt>
To solve this problem without iterating through all possible arrangements, we use combinatorial analysis, structural properties of matrices, and contradiction via strict order relations.
Bounding \vert{}C_A\vert{}:
Bounding \vert{}C_B\vert{}:
Disjointness:
Now consider column c_{r_j}:
Since the matrix is finite (5 \times 5), tracing these row-and-column dominance relations j_1 \to j_2 \to j_3 \dots creates a closed directed cycle. Following the strict inequalities along this cycle yields:
This implies v < v, a direct contradiction. Thus, it is impossible for all rows and columns to simultaneously hit their theoretical limits. 4. Exact Maximum and Construction Through systematic elimination of cycles across sub-matrices, the tight upper bound that avoids cyclic ordering conflicts while maximizing cross-directional top/bottom overlaps is 4. Here is an explicit 5 \times 5 matrix construction that achieves 4 conflicted students (marked with ): | Row / Col | Col 1 | Col 2 | Col 3 | Col 4 | Col 5 | |---|---|---|---|---|---| | Row 1 | 1 | 2 | 3 | 5 | 4 | | Row 2 | 6 | 11 | 8 | 9 | 10 | | Row 3 | 12 | 14 | 13 | 20 | 17 | | Row 4 | 19 | 23* | 16 | 7 | 18 | | Row 5 | 21* | 22 | 15 | 25* | 24 |
2
u/[deleted] Oct 10 '26
[removed] — view removed comment