We have your learning goals covered with Spring and Summer courses available. Enroll today!

G
Topic
First Poster
Last Poster
k a My Retirement & New Leadership at AoPS
rrusczyk   1571
N Mar 26, 2025 by SmartGroot
I write today to announce my retirement as CEO from Art of Problem Solving. When I founded AoPS 22 years ago, I never imagined that we would reach so many students and families, or that we would find so many channels through which we discover, inspire, and train the great problem solvers of the next generation. I am very proud of all we have accomplished and I’m thankful for the many supporters who provided inspiration and encouragement along the way. I'm particularly grateful to all of the wonderful members of the AoPS Community!

I’m delighted to introduce our new leaders - Ben Kornell and Andrew Sutherland. Ben has extensive experience in education and edtech prior to joining AoPS as my successor as CEO, including starting like I did as a classroom teacher. He has a deep understanding of the value of our work because he’s an AoPS parent! Meanwhile, Andrew and I have common roots as founders of education companies; he launched Quizlet at age 15! His journey from founder to MIT to technology and product leader as our Chief Product Officer traces a pathway many of our students will follow in the years to come.

Thank you again for your support for Art of Problem Solving and we look forward to working with millions more wonderful problem solvers in the years to come.

And special thanks to all of the amazing AoPS team members who have helped build AoPS. We’ve come a long way from here:IMAGE
1571 replies
rrusczyk
Mar 24, 2025
SmartGroot
Mar 26, 2025
k a March Highlights and 2025 AoPS Online Class Information
jlacosta   0
Mar 2, 2025
March is the month for State MATHCOUNTS competitions! Kudos to everyone who participated in their local chapter competitions and best of luck to all going to State! Join us on March 11th for a Math Jam devoted to our favorite Chapter competition problems! Are you interested in training for MATHCOUNTS? Be sure to check out our AMC 8/MATHCOUNTS Basics and Advanced courses.

Are you ready to level up with Olympiad training? Registration is open with early bird pricing available for our WOOT programs: MathWOOT (Levels 1 and 2), CodeWOOT, PhysicsWOOT, and ChemWOOT. What is WOOT? WOOT stands for Worldwide Online Olympiad Training and is a 7-month high school math Olympiad preparation and testing program that brings together many of the best students from around the world to learn Olympiad problem solving skills. Classes begin in September!

Do you have plans this summer? There are so many options to fit your schedule and goals whether attending a summer camp or taking online classes, it can be a great break from the routine of the school year. Check out our summer courses at AoPS Online, or if you want a math or language arts class that doesn’t have homework, but is an enriching summer experience, our AoPS Virtual Campus summer camps may be just the ticket! We are expanding our locations for our AoPS Academies across the country with 15 locations so far and new campuses opening in Saratoga CA, Johns Creek GA, and the Upper West Side NY. Check out this page for summer camp information.

Be sure to mark your calendars for the following events:
[list][*]March 5th (Wednesday), 4:30pm PT/7:30pm ET, HCSSiM Math Jam 2025. Amber Verser, Assistant Director of the Hampshire College Summer Studies in Mathematics, will host an information session about HCSSiM, a summer program for high school students.
[*]March 6th (Thursday), 4:00pm PT/7:00pm ET, Free Webinar on Math Competitions from elementary through high school. Join us for an enlightening session that demystifies the world of math competitions and helps you make informed decisions about your contest journey.
[*]March 11th (Tuesday), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS Chapter Discussion MATH JAM. AoPS instructors will discuss some of their favorite problems from the MATHCOUNTS Chapter Competition. All are welcome!
[*]March 13th (Thursday), 4:00pm PT/7:00pm ET, Free Webinar about Summer Camps at the Virtual Campus. Transform your summer into an unforgettable learning adventure! From elementary through high school, we offer dynamic summer camps featuring topics in mathematics, language arts, and competition preparation - all designed to fit your schedule and ignite your passion for learning.[/list]
Our full course list for upcoming classes is below:
All classes run 7:30pm-8:45pm ET/4:30pm - 5:45pm PT unless otherwise noted.

Introductory: Grades 5-10

Prealgebra 1 Self-Paced

Prealgebra 1
Sunday, Mar 2 - Jun 22
Friday, Mar 28 - Jul 18
Sunday, Apr 13 - Aug 10
Tuesday, May 13 - Aug 26
Thursday, May 29 - Sep 11
Sunday, Jun 15 - Oct 12
Monday, Jun 30 - Oct 20
Wednesday, Jul 16 - Oct 29

Prealgebra 2 Self-Paced

Prealgebra 2
Tuesday, Mar 25 - Jul 8
Sunday, Apr 13 - Aug 10
Wednesday, May 7 - Aug 20
Monday, Jun 2 - Sep 22
Sunday, Jun 29 - Oct 26
Friday, Jul 25 - Nov 21


Introduction to Algebra A Self-Paced

Introduction to Algebra A
Sunday, Mar 23 - Jul 20
Monday, Apr 7 - Jul 28
Sunday, May 11 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Wednesday, May 14 - Aug 27
Friday, May 30 - Sep 26
Monday, Jun 2 - Sep 22
Sunday, Jun 15 - Oct 12
Thursday, Jun 26 - Oct 9
Tuesday, Jul 15 - Oct 28

Introduction to Counting & Probability Self-Paced

Introduction to Counting & Probability
Sunday, Mar 16 - Jun 8
Wednesday, Apr 16 - Jul 2
Thursday, May 15 - Jul 31
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Wednesday, Jul 9 - Sep 24
Sunday, Jul 27 - Oct 19

Introduction to Number Theory
Monday, Mar 17 - Jun 9
Thursday, Apr 17 - Jul 3
Friday, May 9 - Aug 1
Wednesday, May 21 - Aug 6
Monday, Jun 9 - Aug 25
Sunday, Jun 15 - Sep 14
Tuesday, Jul 15 - Sep 30

Introduction to Algebra B Self-Paced

Introduction to Algebra B
Sunday, Mar 2 - Jun 22
Wednesday, Apr 16 - Jul 30
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
Tuesday, Mar 4 - Aug 12
Sunday, Mar 23 - Sep 21
Wednesday, Apr 23 - Oct 1
Sunday, May 11 - Nov 9
Tuesday, May 20 - Oct 28
Monday, Jun 16 - Dec 8
Friday, Jun 20 - Jan 9
Sunday, Jun 29 - Jan 11
Monday, Jul 14 - Jan 19

Intermediate: Grades 8-12

Intermediate Algebra
Sunday, Mar 16 - Sep 14
Tuesday, Mar 25 - Sep 2
Monday, Apr 21 - Oct 13
Sunday, Jun 1 - Nov 23
Tuesday, Jun 10 - Nov 18
Wednesday, Jun 25 - Dec 10
Sunday, Jul 13 - Jan 18
Thursday, Jul 24 - Jan 22

Intermediate Counting & Probability
Sunday, Mar 23 - Aug 3
Wednesday, May 21 - Sep 17
Sunday, Jun 22 - Nov 2

Intermediate Number Theory
Friday, Apr 11 - Jun 27
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3

Precalculus
Sunday, Mar 16 - Aug 24
Wednesday, Apr 9 - Sep 3
Friday, May 16 - Oct 24
Sunday, Jun 1 - Nov 9
Monday, Jun 30 - Dec 8

Advanced: Grades 9-12

Olympiad Geometry
Wednesday, Mar 5 - May 21
Tuesday, Jun 10 - Aug 26

Calculus
Sunday, Mar 30 - Oct 5
Tuesday, May 27 - Nov 11
Wednesday, Jun 25 - Dec 17

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

MATHCOUNTS/AMC 8 Basics
Sunday, Mar 23 - Jun 15
Wednesday, Apr 16 - Jul 2
Friday, May 23 - Aug 15
Monday, Jun 2 - Aug 18
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

MATHCOUNTS/AMC 8 Advanced
Friday, Apr 11 - Jun 27
Sunday, May 11 - Aug 10
Tuesday, May 27 - Aug 12
Wednesday, Jun 11 - Aug 27
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Problem Series
Tuesday, Mar 4 - May 20
Monday, Mar 31 - Jun 23
Friday, May 9 - Aug 1
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Tuesday, Jun 17 - Sep 2
Sunday, Jun 22 - Sep 21 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Monday, Jun 23 - Sep 15
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Final Fives
Sunday, May 11 - Jun 8
Tuesday, May 27 - Jun 17
Monday, Jun 30 - Jul 21

AMC 12 Problem Series
Tuesday, May 27 - Aug 12
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Wednesday, Aug 6 - Oct 22

AMC 12 Final Fives
Sunday, May 18 - Jun 15

F=ma Problem Series
Wednesday, Jun 11 - Aug 27

WOOT Programs
Visit the pages linked for full schedule details for each of these programs!


MathWOOT Level 1
MathWOOT Level 2
ChemWOOT
CodeWOOT
PhysicsWOOT

Programming

Introduction to Programming with Python
Monday, Mar 24 - Jun 16
Thursday, May 22 - Aug 7
Sunday, Jun 15 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Tuesday, Jun 17 - Sep 2
Monday, Jun 30 - Sep 22

Intermediate Programming with Python
Sunday, Jun 1 - Aug 24
Monday, Jun 30 - Sep 22

USACO Bronze Problem Series
Tuesday, May 13 - Jul 29
Sunday, Jun 22 - Sep 1

Physics

Introduction to Physics
Sunday, Mar 30 - Jun 22
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
Tuesday, Mar 25 - Sep 2
Thursday, May 22 - Oct 30
Monday, Jun 23 - Dec 15

Relativity
Sat & Sun, Apr 26 - Apr 27 (4:00 - 7:00 pm ET/1:00 - 4:00pm PT)
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
Mar 2, 2025
0 replies
Great orz
Hip1zzzil   7
N 10 minutes ago by sansae
Source: FKMO 2025 P5
$S={1,2,...,1000}$ and $T'=\left\{ 1001-t|t \in T\right\}$.
A set $P$ satisfies the following three conditions:
$1.$ All elements of $P$ are a subset of $S$.
$2. A,B \in P \Rightarrow A \cap B \neq \O$
$3. A \in P \Rightarrow A' \in P$
Find the maximum of $|P|$.
7 replies
Hip1zzzil
Today at 4:54 AM
sansae
10 minutes ago
IMO ShortList 2001, combinatorics problem 3
orl   34
N 13 minutes ago by Marcus_Zhang
Source: IMO ShortList 2001, combinatorics problem 3, HK 2009 TST 2 Q.2
Define a $ k$-clique to be a set of $ k$ people such that every pair of them are acquainted with each other. At a certain party, every pair of 3-cliques has at least one person in common, and there are no 5-cliques. Prove that there are two or fewer people at the party whose departure leaves no 3-clique remaining.
34 replies
orl
Sep 30, 2004
Marcus_Zhang
13 minutes ago
Long polynomial factorization
wassupevery1   7
N 16 minutes ago by giangtruong13
Source: 2025 Vietnam IMO TST - Problem 6
For each prime $p$ of the form $4k+3$ with $k \in \mathbb{Z}^+$, consider the polynomial $$Q(x)=px^{2p} - x^{2p-1} + p^2x^{\frac{3p+1}{2}} - px^{p+1} +2(p^2+1)x^p -px^{p-1}+ p^2 x^{\frac{p-1}{2}} -x + p.$$Determine all ordered pairs of polynomials $f, g$ with integer coefficients such that $Q(x)=f(x)g(x)$.
7 replies
wassupevery1
Mar 26, 2025
giangtruong13
16 minutes ago
orz otl fr
Hip1zzzil   7
N 27 minutes ago by sansae
Source: FKMO 2025 P3
An acute triangle $\bigtriangleup ABC$ is given which $BC>CA>AB$.
$I$ is the interior and the incircle of $\bigtriangleup ABC$ meets $BC, CA, AB$ at $D,E,F$. $AD$ and $BE$ meet at $P$. Let $l_{1}$ be a tangent from D to the circumcircle of $\bigtriangleup DIP$, and define $l_{2}$ and $l_{3}$ on $E$ and $F$, respectively.
Prove $l_{1},l_{2},l_{3}$ meet at one point.
7 replies
Hip1zzzil
Yesterday at 10:23 AM
sansae
27 minutes ago
No more topics!
Ornaments and Christmas trees
Morskow   29
N Mar 26, 2025 by gladIasked
Source: Slovenia IMO TST 2018, Day 1, Problem 1
Let $n$ be a positive integer. On the table, we have $n^2$ ornaments in $n$ different colours, not necessarily $n$ of each colour. Prove that we can hang the ornaments on $n$ Christmas trees in such a way that there are exactly $n$ ornaments on each tree and the ornaments on every tree are of at most $2$ different colours.
29 replies
Morskow
Dec 17, 2017
gladIasked
Mar 26, 2025
Ornaments and Christmas trees
G H J
Source: Slovenia IMO TST 2018, Day 1, Problem 1
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Morskow
46 posts
#1 • 7 Y
Y by jhu08, HWenslawski, megarnie, Adventure10, GeoKing, QueenArwen, Rounak_iitr
Let $n$ be a positive integer. On the table, we have $n^2$ ornaments in $n$ different colours, not necessarily $n$ of each colour. Prove that we can hang the ornaments on $n$ Christmas trees in such a way that there are exactly $n$ ornaments on each tree and the ornaments on every tree are of at most $2$ different colours.
This post has been edited 1 time. Last edited by Morskow, Dec 17, 2017, 10:35 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
rafayaashary1
2541 posts
#2 • 4 Y
Y by Tawan, jhu08, Adventure10, Mango247
Consider the following algorithm that takes a set $S$ of $l\leq n$ positive integers with sum $l\cdot n$ and returns a set of $l'\leq l-1$ positive integers with sum $l'\cdot n$ (call it an $n$-flow): Consider the maximal and minimal elements of $S$ (say $a\in S$ and $b\in S$ respectively). Delete $b$, replace $a$ with $a+b-n$. If any of the entries of the resulting set are $n$, delete them as well. (In particular, the output is also a subset of $\mathbb Z^+$.)

Let $c_1,c_2,\dots,c_n$ be the $n$ colors, and let $a_1\leq a_2\leq \dots\leq a_n$ be the number of ornaments of the corresponding color. Repeatedly applying the "n-flow" to $S=\{a_1,a_2,\dots,a_n\}$ will eventually result in the empty set; it is not hard to see how this leads to the desired result.
This post has been edited 3 times. Last edited by rafayaashary1, Dec 18, 2017, 12:59 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MATH1945
439 posts
#3 • 2 Y
Y by jhu08, Adventure10
solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Garfield
243 posts
#4 • 3 Y
Y by jhu08, Adventure10, GeoKing
Alias algorithm solves this problem immediately.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
anonman
698 posts
#5 • 1 Y
Y by jhu08
we rephrase the question to
question wrote:
Let $n$ be a positive integer. On the table, we have $n^2$ marbles each of which is one of $n$ colours, but not necessarily $n$ of each colour. Prove that they may be placed in $n$ boxes with $n$ marbles in each box, such that each box contains marbles of at most two colours.
We solve for the more general problem, that is, to consider $cn$ marbles each of which is one of $c$ colors. We will prove that they may be placed in $n$ boxes with $n$ marbles in each box, such that each box contains marbles of at most two colors.
We induct on $c.$
When $c = 1,$ this is trivial.
Assume it is true for some $c,$ then this implies the case for $c+1.$
We consider a $(c+1)n$ rectangle, we represent each box as a column of this rectangle, thus the task translates into filling this $(c+1)n$ rectangle such that the columns contain marbles of atmost 2 colors.
When not all $c+1$ colors are used, then we just put any other color in the $c+1$th column and then by the induction hypothesis, we can complete the remaining $cn$ rectangle. When all $c+1$ colors are used, Notice that then you can't have the number of marbles of each color $> n.$ Thus at least one number of one colored marbles must exist that is $\leq n$ Then you just pick that color to tile the $c+1$th column and any other color if the number is $< n,$ and then we can just tile the remaining $cn$ rectangle with $c$ colors from the induction hypothesis.
Hence our induction is complete.
Now, we just pick $c=n$ and win.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bever209
1522 posts
#6 • 2 Y
Y by jhu08, Mango247
Note ornaments = balls in the solution below.
Click to reveal hidden text
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
hakN
429 posts
#7 • 3 Y
Y by jhu08, Math.1234, Mathlover_1
We prove a more general statement:
If we have $nk$ ornaments which consists of $k$ different colours, then we can partition them into $k$ disjoint groups such that there are exactly $n$ ornaments in each group and there are at most $2$ different colours in each group.
We induct on $k$. For $k = 1$, it is clear. Assume true for $k-1$, we will prove it for $k$.
Let the colours be $1,2, \dots , k$ and let there be $a_i$ ornaments of the $i$ th colour. Assume wlog that $a_1 \geq a_2 \dots \geq a_k$.
If there exist a $j$ such that $a_j < n$, then use $a_1$ and $a_j$ to form a group so that we use all of the ornaments of $j$ th colour.(We can do this since $a_1 \geq n$) So, now we have $k-1$ colours and $k-1$ groups left over, and there are $n(k-1)$ ornaments, so by the induction hypothesis, we can partition the rest.
If there doesnt exist a $j$ such that $a_j < n$, then we must have $a_j = n$ for all $j = 1,2 \dots , k$, and thus it is trivial that we can partition those as well. So we are done.
This post has been edited 2 times. Last edited by hakN, Jun 24, 2021, 8:07 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ike.chen
1162 posts
#8 • 1 Y
Y by jhu08
Old Write-Up


Replace ornaments and trees with marbles and boxes.

We proceed with induction on the number of boxes. To clarify, when there are $k$ colors, there exist $nk$ marbles and $k$ distinct boxes, each able to contain $n$ marbles.

Base Case: When $k = 1$, we place all the marbles in the only box.

Inductive Hypothesis: Assume a valid set of marbles can be placed in a satisfactory manner for $k = m$. We will prove the hypothesis for $k = m+1$.

Induction Step: If there are exactly $n$ marbles in each of the $m+1$ colors, then we place all $n$ marbles of each particular color in the same box. Otherwise, there exists colors $X$ and $Y$ covering $b < n$ and $d > n$ marbles respectively. In this case, we place all $b$ marbles colored $X$ and $n - b < n < d$ marbles in color $Y$ inside a box. This leaves $n(k+1) - n = nk$ marbles in $k$ distinct colors, as there still remain $d - (n - b) > 0$ marbles colored $Y$. At this point, the Inductive Hypothesis suffices. $\blacksquare$


Remark: We are motivated to induct on the number of colors, as keeping the number of marbles per box constant is helpful for applying Pigeonhole. Furthermore, having exactly $n$ colors doesn't seem too important anyways.
This post has been edited 1 time. Last edited by ike.chen, Jan 2, 2024, 8:25 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
RM1729
63 posts
#9
Y by
Note ornaments = marbles in the solution below

We consider the following generalised problem
Prove that if we have $nk$ marbles of $n$ colors, they may be placed in $n$ boxes with $k$ marbles in each box, such that each box contains marbles of at most two colors.

We induct on $n$. Note that for the base case $n=2$ pretty much anything works since there are only $2$ colors anyway. Let the above statement be true for some $n$. We prove it for $n+1$
Consider the case where there are $k$ marbles of each color. Note that this is obvious since we can just put these $k$ each in the boxes and we are done.

Thus by PHP if not all $n+1$ colors have the same number of marbles, we we must have some color with at most $k-1$ marbles, and some with atleast $k+1$ marbles.
Consider the color with minimum marbles $= m \leq k-1$ and the color with maximum marbles $= M \geq k+1$

Select all $m$ marbles from the minimum color and $k-m$ marbles from the maximum color (note that $k-m$ can be taken) and put these $k$ marbles into one of the boxes. We are now left with $(n+1)k-k = nk$ marbles of $n+1-1=n$ colors (since the minimum color one is gone) to be put in $n$ boxes with capacity $k$ each which is clearly possible by our induction hypothesis

Moreover, taking $n=k$ in our generalized problem we get the required result.
This post has been edited 1 time. Last edited by RM1729, Sep 17, 2021, 6:50 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Ru83n05
170 posts
#10
Y by
We prove this statement inductively. For $n=2$ this follows directly.

Now, assume we can hang the ornaments accordingly for $n-1$.

By the pigeonhole principle there must be a color $A$ with less than or equal to $n$ ornaments, so let's hang all of these on the same tree $\mathcal{T}$. Now, there is also a color $B$ with more than or equal to $n$ ornaments. We hang as much as possible of these ornaments on $\mathcal{T}$, and now we have reduced the situation to $n-1$. We are done!
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
srisainandan6
2811 posts
#11
Y by
Nice problem considering the time of year.

We will solve the problem for the more general configuration, where there are $nk$ ornaments, $k$ trees that hold $n$ ornaments, and $k$ colors.

It is easy to see the statement holds true when $n=2$.

Denote $c_i$ as the number of marbles of color $i$. For any set of ornaments, always rename them so that $c_1 \le c_2 ... \le c_k$. Assume that $c_k> c_1$, or else we could easily finish by each tree having $n$ ornaments. By Pigeonhole, $c_k > k > c_1$. Hence, we could fill up one tree where there are $c_k - c_1$ ornaments of color $k$ and $c_1$ ornaments of color $1$. Now there are $n(k-1)$ ornaments left, and $k-1$ trees. Using induction the result follows. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HamstPan38825
8857 posts
#13
Y by
The main claim is the following:

Claim. After filling $k$ boxes according to the condition, we can always guarantee that $k$ colors are eliminated.

Proof. We may proceed inductively. Notice that after filling any $k$ boxes, by the inductive hypothesis there are only $n-k$ remaining colors, while there are $n^2-nk$ remaining marbles. This means that there exists at least one color occupying at most $n$ marbles and one color occupying at least $n$ marbles. The former color can be eliminated by being placed in a box with marbles of the latter color, as required. $\blacksquare$

However, this guarantees that there will always be a color occupying at least $n$ marbles, so it is always possible to fill another box. This implies all $n$ boxes can be filled.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
SPHS1234
466 posts
#14
Y by
Let there be $x_i$ balls of color $C_i$ and suppose $k$ colors have their $x_i$ less than $n$.
The following algorithm works:
Place these $k$ colors alone in boxes $A_1,  A_2 , A_3 \cdots A_k$.Now take a color of which there are more than n balls.
With this color , say $C$ , fill up the rest of $A_1$.If enough balls are left , fill up the rest of $A_2$..suppose after having successfully filled up $i$ boxes , the number of balls of color $C$ left is not sufficient to fill up $A_{i+1}$.Now put these remaining balls of color $C$ in box $A_{k+1}$. Now take up another color with more than $n$ balls and repeat the procedure starting from $A_{i+1}$ and repeat , and at the end put the leftover in box $A_{k+2}$.

And if there are no colors with less than n balls initially , then consider the $A_i$' s at the beginning empty and do the same process
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Taco12
1757 posts
#15
Y by
OTIS Version wrote:
Let $n$ be an integer. There are $n^2$ marbles, each of which is one of $n$ colors, but not necessarily $n$ of each color. Prove that they may be placed in $n$ boxes with $n$ marbles in each box, such that each box contains marbles of at most two colors.

We prove the more general version of the problem, that if there are $kn$ marbles of at most $k$ colors, then they may be placed in $k$ boxes with $n$ marbles in each box, such that each box contains marbles of at most two colors.

Proceed with induction on $k$, with base case obvious. Let there be at most $n$ marbles of color Amaranth and at least $n$ of color Viridian. First, use up all the Amaranth marbles and finish the box by adding Viridian marbles. Then, $c$ is reduced by one, which finishes.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
gracemoon124
872 posts
#16
Y by
also doing the otis version, with marbles and boxes instead of ornaments and trees
solution
This post has been edited 1 time. Last edited by gracemoon124, Mar 16, 2023, 7:27 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Math4Life7
1703 posts
#17
Y by
gracemoon124 wrote:
also doing the otis version, with marbles and boxes instead of ornaments and trees

We define a move as a placement of $n$ marbles into a box (obviously we will make $n$ moves by the end of the process).

We claim that we can remove all of the marbles of a certain color on each move. This would prove the result as there are $n$ moves and $n$ colors.

We develop a strategy to remove a color on each turn. Consider a certain move. We take the color with the smallest number of marbles $k$, and pair those with $n-k$ marbles of the color with the most number of marbles. This will remove all of the marbles of the color with the smallest number of marbles. This is always achievable since if there are $n$ marbles in the smallest color every other color will have $n$ marbles. Similarly the largest pil will always have at least $n$ balls. $\blacksquare$

This was my favorite problem in a very long time. I think that my solution is quite unique
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cinnamon_e
703 posts
#18
Y by
gracemoon124 wrote:
also doing the otis version, with marbles and boxes instead of ornaments and trees
solution
fun problem :D
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Sanjana42
19 posts
#19
Y by
Generalize the problem to $mn$ ornaments, $m$ colours, and $m$ Christmas trees of size $n$. We will induct on $m$.

Base case: $m = 1$. There is only a single tree. Put all the $n$ ornaments (which are of a single colour) in it.

Assume it is possible till $m-1$. Now, for $m$:

Case 1: Suppose there are exactly $n$ ornaments of each colour. Then put all the ornaments of each colour on a particular tree. Done.

Case 2: There is at least one colour (call it a small colour) of which there are $< n$ ornaments $\Leftrightarrow$ there is at least one colour (call it a big colour) of which there are $> n$ ornaments . Take a small colour and put all of its ornaments on a tree. Fill the rest of the tree with ornaments of a big colour. Now we have used up $n$ ornaments, filled $1$ tree, and gotten rid of $1$ colour. We are left with $mn - n = n(m-1)$ ornaments, $m-1$ boxes and $m-1$ colours, so we are done by our inductive assumption.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
minusonetwelth
225 posts
#20
Y by
Note that when trying to induct on $n$, both the number of colors and the number of boxes change, which is complicated. Hence we try to fix the number of marbels in the boxes to $n$ and induct on the number of colors $c$. The result then follows by letting $c=n$. Consider a $c\times n$ rectangle, so that we have $c$ colums. Hence, we wish to prove if that we have at most $c$ colors, then can fill a $c\times n$ table in such a way that there are no more than two colors in each column.

The base case $c=1$ is clear. Assume that the result is true $c$ colors. Then add another column to the table, so that we can choose marbles of $c+1$ different colors. If all the $c+1$ colors are used, note that there must exist a color $k$ such that the number of marbles with color $k$ is a most $n$. Put them in the last column and fill the rest of the column with another color, which is clearly always possible. Now we have $c$ columns remaining and marbles of $c$ different colors, so by the induction hypothesis, we can fulfill our wishes. If not all $c+1$ colors are used, put one color in the last column, and thus we have at most $c$ colors to put in the remaining $c\times n$ table, which we can do by the induction hypothesis.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Pyramix
419 posts
#21
Y by
We generalize the problem as follows:
Quote:
Let $n$ be a positive integer. On the table, we have $mn$ marbles in $m$ different colours, not necessarily $n$ of each colour. Prove that we can put the marbles on $m$ boxes in such a way that there are exactly $n$ marbles in each box and the marbles in every box are of at most two different colours.

We give an inductive arguement. For $m=2$, the problem is obvious.
At any step, let the color A with smallest number of marbles be $k$ and color B with largest number be $K$. Then, $k\leq n$ and $K\geq n$ is forced. We fill an unfilled box with $k$ marbles of color A and $n-k$ marbles of color B. This is possible, as $n-k<n\leq K$.
So, we essentialy completely use one color and completely fill one box and reduce the total number of marbles from $mn$ to $mn-n=(m-1)n$. Hence, $m$ is reduced to $m-1$.
The induction is complete.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
joshualiu315
2513 posts
#22
Y by
OTIS wrote:
Let $n \ge 2$ be an integer. There are $n^2$ marbles, each of which is one of $n$ colors, but not necessarily $n$ of each color. Prove that they may be placed in $n$ boxes with $n$ marbles in each box, such that each box contains marbles of at most two colors.

We prove a more general statement.


Claim: If $cn$ marbles of at most $c$ colors are placed in $c$ boxes with $n$ marbles in each box, they can be placed in a way such that each box contains marbles of at most two colors.

Proof: We will prove this by induction. The base case $c=1$ is vacuous. Assume the inductive statment holds for $c=k$. Out of those $k$ colors, say there are at most $n$ marbles of color $C_1$ and at most $n$ marbles of color $C_2$. Simply put all of the $C_1$ marbles in one box and fill with $C_2$ marbles if necessary. Then, remove that box and we are left with a figuration for $c=k-1$, completing the induction. $\square$
This post has been edited 1 time. Last edited by joshualiu315, Oct 27, 2023, 11:11 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
pinkpig
3761 posts
#23
Y by
solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
shendrew7
792 posts
#24
Y by
Claim: It is possible to place $kn$ marbles of $k$ colors into $k$ boxes with $n$ marbles each such that each box contains marbles of at most 2 colors.

We prove this generalized assertion using induction on $k$. Note the base case $k=2$ is trivial.

We show our claim is true for $k=m$ if $k=m-1$ holds. By Pigeonhole, there exists one color $A$ with at most $n$ marbles and one color $B$ with at least $n$ marbles. Isolate the marbles of color $A$ into one box and fill it to $n$ marbles using color $B$. The remaining marbles form the case $k=m-1$, as desired. $\blacksquare$
This post has been edited 1 time. Last edited by shendrew7, Dec 19, 2023, 4:14 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Shreyasharma
667 posts
#25
Y by
Induct downwards. If at any point there are exactly $n$ ornaments of a color, remove that color by placing all ornaments on a tree, reducing our problem to $n^2-n$ ornaments of $n-1$ colors, with $n-1$ trees.

Now we can assume we have $k$ colors at some step in the process, with $n^2 - kn$ ornaments, where each color has strictly greater than, or less than $n$ ornaments. Now take the color with the minimal number of ornaments say $X$, and place them all on a tree. Fill the remaining spots with the color with the maximal number of ornaments. Hence, we remove $1$ color, $1$ tree and $n$ ornaments, inducting down to $n^2-(k+1)n$ ornaments, and $k-1$ colors.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
RGB
19 posts
#26
Y by
Consider a method to hang the ornaments on $n$ Christmas trees satisfying the given conditions.

Firstly, arrange the ornaments into $n$ groups such that each group consists of $n$ ornaments of the same color. If there are fewer than $n$ ornaments of a particular color, add additional ornaments of that color to complete the group.

Next, for each group, distribute the $n$ ornaments across $n$ trees as follows:

For the first tree, hang $n$ ornaments of that color.
For the second tree, hang $n$ ornaments of a second color, different from the first color. If there are fewer than $n$ ornaments of this color, use ornaments of a third color to complete the set.
Continue this pattern for the remaining trees, ensuring that each tree has $n$ ornaments, with at most $2$ different colors on each tree.
Since there are $n$ different colors and we're distributing $n$ ornaments of each color across $n$ trees, we're guaranteed to have exactly $n$ ornaments of each color on each tree. Additionally, since we're using at most $2$ different colors on each tree, the conditions of the problem are met.

Therefore, we've shown that it's possible to hang the ornaments on $n$ Christmas trees such that each tree has exactly $n$ ornaments, and the ornaments on every tree are of at most $2$ different colors.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mannshah1211
651 posts
#27
Y by
[Note: The version of the problem I was given is with boxes and balls]

Assume exactly $n$ distinct colors, since less distinct colors can't make our situation worse. Let $a_1, a_2, \dots, a_n$ be the number of marbles of each color. We use the following algorithm: While $a$ is not empty, do the following: Take the color with minimum $a$ value, and take the color with maximum $a$ value, and combine them into one box ($\text{mn}$ marbles of first color, and $n - \text{mn}$ marbles of second color), for this we need $\text{mx} + \text{mn} > n$, which we'll prove later. Now, remove every color from $a$ which has $0$ marbles. Proof for $\text{mx} + \text{mn} > n$: We will show this by induction. It is obviously true for before the first operation, since $\text{mx} \ge \text{avg} \ge n, \text{mn} \ge 1 \implies \text{mx} + \text{mn} > n$. Now, assume it is true before the $k$th operation. Then, we must have $\text{mx} + \text{mn} > n$. Now, since $\text{mx} > n - \text{mn},$ the color corresponding to $\text{mn}$ is the only color which becomes $0$, so the number of distinct colors decreases by exactly one, and the number of marbles decreases by exactly $n$, so if the average was $n$ before, it is $n$ now also, so $\text{mx} \ge \text{avg} = n, \text{mn} \ge 1 \implies \text{mn} + \text{mx} > n,$ done! Also, at each step our algorithm decreases the sum by $n$, so there is exactly $n$ iterations, and hence exactly $n$ boxes used, and it is easy to see that the way our algorithm filled the boxes is valid.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
lelouchvigeo
174 posts
#28
Y by
Claim: We can always guarantee that k colors are fully utilised when we fill k tree.
Proof)Base case is easy to prove
Lets assume it is true for k boxes.
Let the remaining$n-k$ colors be $c_1,..c_n-k$. Observe that there will be an index such that $N(c_i) < n$.Therefore we would be done, but if there doesn't exist then it will imply that all are equal to n. We would be done due to this also.
Therefore by our above claim, we will fill $n-1$ boxes and the last tree will be filled by ornaments of the same color
Remarks
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
AshAuktober
944 posts
#29
Y by
Consider the following algorithm to colour a tree:
Take the colour present in least amount and hang all ornaments of that colour on a singular tree. (There are less than n such ornaments so we can definitely do this). Say that there are $k$ ornaments on the tree now. To hang ornaments on the remaining part of the tree, take ornaments of the colour that, among those with frequency $\ge n - k$, is present in the lowest frequency. (This again exists as there exists a colour with $\ge n$ ornaments.) Repeat this process on all trees.

Clearly there are at most two colours used per tree, and each tree has $n$ ornaments. So this algorithm works.
This post has been edited 3 times. Last edited by AshAuktober, May 8, 2024, 10:04 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dolphinday
1318 posts
#30
Y by
(Solved version of problem that involved marbles and boxes instead of ornaments on trees)

Generalize to $mn$ marbles and $m$ different colors.
We will downwards induct on $m$, which is sufficient. Our base case of $m = 1$ is clearly true.

For our induction, assume it is true for $m - 1$. By Pigeonhole, there is a color so that there are $\geq m$ marbles of that color, and similarly there is a color so that there are $\leq m$ marbles of that color. We can take all of the marbles of the color that has $\leq m$ marbles and put it in a box, and fill the remaining space(possibly none) with the color of marble with $\geq m$ marbles. This reduces the number of colors by $1$ and reduces the number of marbles by $m$, so we are done.
This post has been edited 1 time. Last edited by dolphinday, May 29, 2024, 4:28 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
gladIasked
632 posts
#31
Y by
Let there be $cn$ marbles, each of which is one of $c$ colors. We wish to place these $cn$ marbles into $c$ boxes with $n$ marbles in each box.

We proceed with induction on $c$; the base case when $c=1$ is trivial. Let there be $x_1$ marbles of color $1$, $x_2$ marbles of color $2$, and so on. WLOG, let $x_1\le x_2\le\dots \le x_c$. Place $x_1$ marbles of color $1$ and $n-x_1$ marbles of color $c$ in one of the boxes. This is allowed because $x_1\le n$ and $x_c\ge n\ge n-x_1$. We have now reduced the problem to having $(c-1)n$ marbles, each of which is one of $c-1$ colors (color $2$ and up). Also, we now have $c-1$ boxes, so our induction is complete. $\blacksquare$
This post has been edited 1 time. Last edited by gladIasked, Mar 26, 2025, 8:19 PM
Z K Y
N Quick Reply
G
H
=
a