HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Every point of a grid with 3 rows and 7 columns is painted red or blue…
AdvancedMathematicsHigh School (11–12)Pigeonhole Principle, Recursion and Graph TheoryproofNumericalOlympiad

Every point of a grid with 3 rows and 7 columns is painted red or blue…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

Every point of a grid with 333 rows and 777 columns is painted red or blue. A rectangle with sides along the rows and columns has its four corners at grid points.

Prove that there is such a rectangle whose four corners all have the same colour. Use two steps of the pigeonhole principle. First look inside one column: it has 333 points and only 222 colours. Then compare the columns. Count the different kinds of column, where the kind records which two rows share a colour and what that colour is.

Find the number of kinds of column, and the fewest columns that make such a rectangle certain by this argument.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

If n+1n + 1n+1 objects go into nnn boxes, some box holds at least two. Decide what the objects and the boxes are. A "fewest number" answer needs a proof that it is enough and an example showing that one fewer can fail.

The worked solution

Check an answer or open a hint to unlock the worked solution.

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Plan. Give each column a kind. Two columns of the same kind give the rectangle.

Step 1. Inside a column. A column has 333 points and 222 colours, so two of its points have the same colour. Pick such a pair. If a column has all three points the same colour, pick the top two.

Step 2. The kinds. The chosen pair of rows is one of {1,2}\{1, 2\}{1,2}, {1,3}\{1, 3\}{1,3}, {2,3}\{2, 3\}{2,3}, three choices. Its colour is red or blue. So there are 3×2=63 \times 2 = 63×2=6 kinds of column.

Step 3. Two columns of one kind. There are 777 columns and 666 kinds, so two columns have the same kind. In both columns the same two rows carry the same colour.

Step 4. The rectangle. Those two rows and those two columns meet in four points, all of that colour. They are the corners of a rectangle.

Step 5. Fewest columns. With 666 columns the argument fails: the six columns could have six different kinds. Our program in verify_g1.py also finds a painting of 333 rows and 666 columns with no one-colour rectangle at all.

Answer: 666 kinds of column, so 777 columns make the rectangle certain. Proof complete.

Log in to save this for later
← All Problems
← A teacher writes some whole numbers on the board…A class of 50 students takes a quiz marked out of 10… →
More onPigeonhole Principle, Recursion and Graph Theory

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. The pigeonhole principleThe Pigeonhole Principle

More on this topic

  1. The 15 edges of K₆ are coloured red or blue…Advanced
  2. Three houses each need a path to each of three wells, nine paths in all, drawn on flat ground…Advanced
  3. A connected planar graph with 10 vertices is drawn without crossings, and every face of the…Hard
  4. The complete bipartite graph K_(m,n) joins each of m left vertices to each of n right vertices…
Advanced
  • A river town has five land areas, A, B, C, D and E, joined by ten bridges…Hard
  • All problems on this topic →