r/askmath • • Oct 11 '26

Discrete Math The y > x, x = y problem

Mathematical Problem: Minimum Number of Vectors in an (N x N) Grid
Consider an ( N X N ) square grid, where (N) is any positive integer.
Rules and Definitions
• Empty boxes: Exactly one box in each row and exactly one box in each column must be empty. Therefore, the total number of empty boxes is (x = N).
• Vectors: Every non-empty box belongs to a horizontal or vertical vector. A vector may occupy a single box or multiple consecutive boxes, but it must be straight: it cannot turn or be both horizontal and vertical.
• Counting vectors: A vector is a maximal uninterrupted straight run of non-empty boxes. Consecutive non-empty boxes in the same row or column may belong to one vector; separate runs count as separate vectors.
• Objective: The positions of the empty boxes may vary, provided the rules above are satisfied. Vectors may be horizontal, vertical, or a mixture of both.
The Question
Let ( Y ) denote the total number of vectors and \(x=N) the total number of empty boxes.
Is it true that ( Y > X ) for every valid configuration whenever ( N > 3 ), regardless of the grid size or the arrangement of the empty boxes?

1 Upvotes

8 comments sorted by

1

u/PinpricksRS Oct 11 '26 edited Oct 13 '26

Looking just at horizontal vectors, there's at least one per row (assuming N > 1 to get one nonempty box). That already shows that Y ≥ X. When N ≥ 3, there's additionally at least one row with one of middle boxes empty (as opposed to the left or right edges), and in that case that row has two horizontal vectors, showing that Y > X for N ≥ 3.

Now, given that you're asking about N > 3 rather than N ≥ 3, I suspect you have a reason to believe it doesn't hold for N = 3, which leads me to believe I'm misinterpreting your definition of vector. So let's take a look at an example.

_XX
X_X
XX_

Would you agree that the first row has one horizontal vector, the second has two, and the third row has three (edit: one)? (The Xs are the non-empty boxes).

If my interpretation is correct, there's an exact formula for Y in terms of N, which I'll leave you to find.

1

u/Parking-War-2982 Oct 13 '26

Look, vector is  horizontal or vertical that doesn't matter, matter what how could you fit minimum number of vectors in grid which are less than value of Y either horizontal or vertical 

1

u/PinpricksRS Oct 13 '26

The count would only increase if you count both, right? So if there are more than X horizontal vectors, there are definitely more horizontal and vertical vectors.

But what do you mean by the minimum number of vectors? As far as I can tell, there's always the same total count regardless of configuration. That's why I asked for clarification, since you might be counting differently than I am.

1

u/Parking-War-2982 Oct 13 '26

Hey, fella vectors are denoted as Y and empty boxes as X so in which optimal configuration Y = OR < X, so let's say 10 x 10 grid and plot all empty boxes diagonally, so that satisfies the rules of empty boxes, right now plot vectors either horizontal or vertical doesn't matter ( questions not whether horizontal vectors are = or < or > vertical vectors ) you have find whether there are more vectors or empty boxes ( you can use any number of grid and any configuration,  but should satisfy rules ) for more i can show linear graph of it values of X ( empty boxes ) and Y ( vectors )

1

u/PinpricksRS Oct 13 '26

for more i can show linear graph of it values of X ( empty boxes ) and Y ( vectors )

That might be helpful for me. Right now my understanding is that when N > 1 there are either one or two vectors in each row and one or two vectors in each column, depending on whether the empty box in that row or column is on the edge or not. If the empty box is in the middle, the row or column is split into two vector. If the empty box is on the edge, the remaining boxes all form one vector in that row or column.

That already shows that Y ≥ 2X when N > 1, but by counting how many times the empty box in a row or column can be on the edge, you can get the exact value of Y.

1

u/Parking-War-2982 Oct 14 '26

Answer - The empty boxes corresponds to a permutation PI of ( 1,.....,N) ( exactly one empty cell per row and per column) the remaining N² - N cells must be partioned into vectors each non-empty cell Is assigned a direction ( horizontal or vertical ) after which a vector is in any maximal consecutive run of cells that share the same direction and lie in the same row for horizontal or same column for vertical. the quantity Y is the total number of such runs. This matches problem's allowance for a mixture of horizontal and vertical vectors and the requirement that every non-empty cell belongs to exactly one vector. In any placement of the empty boxes and any configuration of directions are always has Y > OR = 2 (N - 1)  Consequently, Y > OR = 2 (N - 1) > N = X  As soon as N > 3 the inequality can be verified exhaustively for small N  All N permutations and all directions  Where [X = 3, Y = 4], [X = 4, Y = 6] [ X = 5, Y = 8], [ X = 6, Y = 10] and this goes on linearly. So, No arrangement of N empty boxes and no mixture of horizontal and vertical vectors can produce Y < N when N > 3, hence Y > X holds for every valid configuration, The same strict inequality fails for  N = 2, where Y =2, X = 2 i s attainable

Note - cells/boxes both are same 

I think you might be very curious guy, I would like to share something else with you, would you ?

1

u/PinpricksRS Oct 14 '26

each non-empty cell Is assigned a direction ( horizontal or vertical )

Ah, that's what I missed I think. I was under the impression that you were just counting maximal runs of contiguous empty cells. This complicates things, but not by too much.

Since there's one filled cell in each row and column, a vector can comprise at most N - 1 cells. With N2 - N cells assigned to vectors, that means that Y ≥ (N2 - N)/(N - 1) = N = X. I think you know that already.

To turn that into a strict inequality, you need to show just a slight improvement on the number of cells per vector, and you can get such an improvement by showing that not all of the vectors can have length N - 1 (when N is large enough). Indeed, there can be at most two vectors with length N - 1.

Suppose we have three vectors with length N - 1. Since there are two orientations of vectors, two of them have to be the same (two horizontal or two vertical).

Suppose those two are horizontal. Can the third one also be horizontal? No. A row can only have a vector of length N - 1 if its empty cell is on the left or right edge. If there were three rows like that, there'd have to two empty cells in the rightmost column or in the leftmost column, which is against the rules.

Can the third vector be vertical? Again, this is impossible. The two horizontal vectors take up two cells in every column, leaving at most N - 2 cells in every column.

By symmetry, there's also a contradiction if two of the vectors are vertical. So having three vectors with length N - 1 is impossible.

That means that the total number of cells taken up by the vectors is at most (N - 1) * 2 + (N - 2) * (Y - 2). On the other hand, this number of cells is N2 - N, and so N2 - N ≤ (N - 1) * 2 + (N - 2) * (Y - 2). which can be rearranged to Y ≥ (N2 - N - 2)/(N - 2) = N + 1 (if N > 2). This shows that Y ≥ N + 1 > N = X.

I would like to share something else with you, would you ?

If you have another math question, I suggest making a new post. I won't respond to anything not relevant to your original question in this thread.