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. /In a group of 6 students, some pairs are friends…
AdvancedMathematicsHigh School (11–12)Pigeonhole Principle, Recursion and Graph TheoryproofNumericalOlympiad

In a group of 6 students, some pairs are friends…

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.

In a group of 666 students, some pairs are friends. A teacher notices that no three students are all friends with each other. She wonders how many friendships there can be at most.

Prove Mantel's bound: a graph on nnn vertices with no triangle has at most n24\dfrac{n^2}{4}4n2​ edges. Use a vertex of largest degree. Then find the largest number of friendships among the 666 students and describe the friendship graph that reaches it.

Check your answer

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

Need a reminder? The key ideaShowHide

A tree on nnn vertices has n−1n - 1n−1 edges; a forest with ccc components has n−cn - cn−c. Bipartite means no odd cycle; with no triangle, E≤n24E \le \dfrac{n^2}{4}E≤4n2​. A connected graph has an Euler circuit when all degrees are even, and an Euler trail when exactly two are odd.

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.

Step 1. A vertex of largest degree. Let vvv have degree Δ\DeltaΔ, the largest. Its Δ\DeltaΔ neighbours form a set NNN.

Step 2. No edge inside NNN. Two joined neighbours of vvv would form a triangle with vvv.

Step 3. Count edges. So every edge has at least one end in the other n−Δn - \Deltan−Δ vertices. Each of those has degree at most Δ\DeltaΔ. Hence E≤(n−Δ)ΔE \le (n - \Delta)\DeltaE≤(n−Δ)Δ.

Step 4. AM-GM. (n−Δ)Δ≤(n2)2=n24(n - \Delta)\Delta \le \left(\dfrac{n}{2}\right)^2 = \dfrac{n^2}{4}(n−Δ)Δ≤(2n​)2=4n2​.

Step 5. Six students. E≤364=9E \le \dfrac{36}{4} = 9E≤436​=9. Split the students into two groups of 333 and make every student a friend of each student in the other group. This is K3,3K_{3,3}K3,3​: 999 friendships, and it is bipartite, so it has no triangle.

Answer: at most 999 friendships, reached by K3,3K_{3,3}K3,3​. Proof complete.

Log in to save this for later
← All Problems
← A water company lays pipes as a tree: every junction is joined to the network, and there are no…A river town has five land areas, A, B, C, D and E, joined by ten bridges… →
More onPigeonhole Principle, Recursion and Graph Theory

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Trees, bipartite graphs and Euler trailsGraph Theory

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 →