Hacker News new | ask | show | jobs
by meuk 2474 days ago
Thanks. I just don't understand how you arrived at

  k <= ceil cr (c(m-1) + r(n-1))
The rest is clear.
1 comments

Oh I see. Here's how I got there (still using the terminology / notation of my original post).

Without knowing anything about k except that k-1 < r/m, I counted how many cells are column-bad for this value of k. By the pigeon-hole-principle argument in the post this is at most c(m-1)(k-1) cells. Similarly, and still knowing nothing about k except that k-1 < c/n, I count how many cells are row-bad for this value of k and see that it is at most r(n-1)(k-1). Combining these two I know that as long as we have k-1 < r/m and k-1 < c/n the number of cells that are either column-bad or row-bad (or both) is at most:

  * c(m-1)(k-1) + r(n-1)(k-1)
Since I want to be able to conclude that there is a cell that is neither column-bad nor row-bad, and since there are rc cells in total, I then further require that k is such that:

  * c(m-1)(k-1) + r(n-1)(k-1) < rc
(The point is that this is a strict inequality and so there must be a cell that is neither column-bad nor row-bad.)

And then solve this to get the formula for k. Of course when expositing it in the post, I _start_ with the formula which perhaps makes things seem mysterious at first, but I thought was efficient.

Ah, it makes total sense now! Thanks for taking the time to explain your thought process to a random stranger on the internet ;)

I'd say that the exposition in your post is very fitting for the purpose of proving it. The most elegant proofs are usually not the most enlightening.

You're welcome.