Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

The Pigeonhole Principle

Revision en2, by sahilPict_26, 2024-07-20 11:10:47

Recently, while upsolving Problem 4 from the Div 2 Contest 959, I encountered an intriguing concept called the Pigeonhole Principle. Although initially unfamiliar with this principle, I found it fascinating and wanted to share my newfound knowledge with the community.

Pigeonhole Principle states that, If we have n pigeons and m holes, and if n>m, then there will be at least one hole where more than one pigeons will be present.

While this statement might appear straightforward, its can be used in many of the complex problems.

Here are some problems which uses Pigeonhole Principle:-

1) https://www.codechef.com/problems/GRAYSC

2) https://www.geeksforgeeks.org/discrete-mathematics-the-pigeonhole-principle/

You must try this!

Happy coding!

Tags #pigeonhole principle

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English sahilPict_26 2024-07-20 11:10:47 4 Tiny change: 's, and if m>n, then the' -> 's, and if n>m, then the'
en1 English sahilPict_26 2024-07-20 10:57:07 807 Initial revision (published)