1

The question: Consider an n×n grid. The grid squares from the middle row are shaded in. What is the probability that a randomly selected rectangle contains at least one shaded square?

My (incorrect) method:

Using complementary probability, P(contains one shaded square) = 1 - P(contains no shaded square)

P(contains no shaded square) = # of rectangles with no shaded square / # of possible rectangles

In general, we can generate a rectangle by choosing any x,y such that 0 < x,y <= n.

The # of rectangles with no shaded square in the top half = $n *(n-1)/2$, we multiply by 2 by symmetry to get $n(n-1)$ total rectangles with no shaded square in both halves.

The # of total rectangles is just $n^2$, so $1-(n-1)/n = 1/n$.

What is specifically wrong with this counting method? I'm overcounting something, but I'm not sure what. I realize that in both the numerator and denominator, I am counting (for example) a 5x6 rectangle and a 6x5 rectangle separately. Is this an issue?

  • What is the middle down when $n$ is even? – Thomas Andrews Sep 25 '23 at 18:20
  • "The # of total rectangles is just $n^2$" looks too low: that is the number of small squares in the original grid. Is $n$ odd here? – Henry Sep 25 '23 at 18:23
  • 1
    It seems like the number of total rectangles is $\binom {n+1}2^2,$ not $n^2.$ There are $n^2$ $1\times1$ rectangles. – Thomas Andrews Sep 25 '23 at 18:24
  • When you refer to an $n \times n$ grid, do you mean that there are $n$ squares on a side or $n$ grid lines on a side? – N. F. Taussig Sep 25 '23 at 18:26
  • @Henry Ah I apologize, n here is odd. The original question set n=2023 but I am attempting to solve for a general case where n is odd. –  Sep 25 '23 at 18:31
  • @N.F.Taussig I mean that there are n squares on a side. –  Sep 25 '23 at 18:31
  • 1
    Possible duplicate here. – Peter Phipps Sep 25 '23 at 18:36
  • 1
    You can in fact reduce this to starting with an $n\times 1$ rectangle with the middle square shaded (the other dimension cancels out), so with $n$ odd you get $\dfrac{2\frac{{\frac{n-1}2\frac{n+1}2}}{2}}{\frac{n(n+1)}2} =\dfrac{n-1}{2n}$ – Henry Sep 26 '23 at 00:31
  • @Henry Thank you for that - this helped me come to the solution. If you'd like to submit as a full response, I am happy to accept your answer. –  Sep 26 '23 at 18:10

1 Answers1

0

Requested from comments:

You can in fact reduce this to starting with an $n \times 1$ rectangle with the middle square shaded (the other dimension cancels out),

with $\frac{n(n+1)}2$ total rectangles

and (assuming $n$ is odd) $\frac{{\frac{n-1}2\frac{n+1}2}}{2}$ rectangles on one side of the shaded square

and the same number on the other side

so you get a probability of $\dfrac{2\frac{{\frac{n-1}2\frac{n+1}2}}{2}}{\frac{n(n+1)}2} =\dfrac{n-1}{2n}.$

Henry
  • 169,616