Stay ahead of learning milestones! Enroll in a class over the summer!

G
Topic
First Poster
Last Poster
k a April Highlights and 2025 AoPS Online Class Information
jlacosta   0
Apr 2, 2025
Spring is in full swing and summer is right around the corner, what are your plans? At AoPS Online our schedule has new classes starting now through July, so be sure to keep your skills sharp and be prepared for the Fall school year! Check out the schedule of upcoming classes below.

WOOT early bird pricing is in effect, don’t miss out! If you took MathWOOT Level 2 last year, no worries, it is all new problems this year! Our Worldwide Online Olympiad Training program is for high school level competitors. AoPS designed these courses to help our top students get the deep focus they need to succeed in their specific competition goals. Check out the details at this link for all our WOOT programs in math, computer science, chemistry, and physics.

Looking for summer camps in math and language arts? Be sure to check out the video-based summer camps offered at the Virtual Campus that are 2- to 4-weeks in duration. There are middle and high school competition math camps as well as Math Beasts camps that review key topics coupled with fun explorations covering areas such as graph theory (Math Beasts Camp 6), cryptography (Math Beasts Camp 7-8), and topology (Math Beasts Camp 8-9)!

Be sure to mark your calendars for the following events:
[list][*]April 3rd (Webinar), 4pm PT/7:00pm ET, Learning with AoPS: Perspectives from a Parent, Math Camp Instructor, and University Professor
[*]April 8th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS State Discussion
April 9th (Webinar), 4:00pm PT/7:00pm ET, Learn about Video-based Summer Camps at the Virtual Campus
[*]April 10th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MathILy and MathILy-Er Math Jam: Multibackwards Numbers
[*]April 22nd (Webinar), 4:00pm PT/7:00pm ET, Competitive Programming at AoPS (USACO).[/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, 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
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
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
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
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
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
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
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
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
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
Tuesday, Jun 10 - Aug 26

Calculus
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
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
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
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
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
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
Apr 2, 2025
0 replies
k i Adding contests to the Contest Collections
dcouchman   1
N Apr 5, 2023 by v_Enhance
Want to help AoPS remain a valuable Olympiad resource? Help us add contests to AoPS's Contest Collections.

Find instructions and a list of contests to add here: https://artofproblemsolving.com/community/c40244h1064480_contests_to_add
1 reply
dcouchman
Sep 9, 2019
v_Enhance
Apr 5, 2023
k i Zero tolerance
ZetaX   49
N May 4, 2019 by NoDealsHere
Source: Use your common sense! (enough is enough)
Some users don't want to learn, some other simply ignore advises.
But please follow the following guideline:


To make it short: ALWAYS USE YOUR COMMON SENSE IF POSTING!
If you don't have common sense, don't post.


More specifically:

For new threads:


a) Good, meaningful title:
The title has to say what the problem is about in best way possible.
If that title occured already, it's definitely bad. And contest names aren't good either.
That's in fact a requirement for being able to search old problems.

Examples:
Bad titles:
- "Hard"/"Medium"/"Easy" (if you find it so cool how hard/easy it is, tell it in the post and use a title that tells us the problem)
- "Number Theory" (hey guy, guess why this forum's named that way¿ and is it the only such problem on earth¿)
- "Fibonacci" (there are millions of Fibonacci problems out there, all posted and named the same...)
- "Chinese TST 2003" (does this say anything about the problem¿)
Good titles:
- "On divisors of a³+2b³+4c³-6abc"
- "Number of solutions to x²+y²=6z²"
- "Fibonacci numbers are never squares"


b) Use search function:
Before posting a "new" problem spend at least two, better five, minutes to look if this problem was posted before. If it was, don't repost it. If you have anything important to say on topic, post it in one of the older threads.
If the thread is locked cause of this, use search function.

Update (by Amir Hossein). The best way to search for two keywords in AoPS is to input
[code]+"first keyword" +"second keyword"[/code]
so that any post containing both strings "first word" and "second form".


c) Good problem statement:
Some recent really bad post was:
[quote]$lim_{n\to 1}^{+\infty}\frac{1}{n}-lnn$[/quote]
It contains no question and no answer.
If you do this, too, you are on the best way to get your thread deleted. Write everything clearly, define where your variables come from (and define the "natural" numbers if used). Additionally read your post at least twice before submitting. After you sent it, read it again and use the Edit-Button if necessary to correct errors.


For answers to already existing threads:


d) Of any interest and with content:
Don't post things that are more trivial than completely obvious. For example, if the question is to solve $x^{3}+y^{3}=z^{3}$, do not answer with "$x=y=z=0$ is a solution" only. Either you post any kind of proof or at least something unexpected (like "$x=1337, y=481, z=42$ is the smallest solution). Someone that does not see that $x=y=z=0$ is a solution of the above without your post is completely wrong here, this is an IMO-level forum.
Similar, posting "I have solved this problem" but not posting anything else is not welcome; it even looks that you just want to show off what a genius you are.

e) Well written and checked answers:
Like c) for new threads, check your solutions at least twice for mistakes. And after sending, read it again and use the Edit-Button if necessary to correct errors.



To repeat it: ALWAYS USE YOUR COMMON SENSE IF POSTING!


Everything definitely out of range of common sense will be locked or deleted (exept for new users having less than about 42 posts, they are newbies and need/get some time to learn).

The above rules will be applied from next monday (5. march of 2007).
Feel free to discuss on this here.
49 replies
ZetaX
Feb 27, 2007
NoDealsHere
May 4, 2019
Inspired by 2025 Nepal
sqing   1
N 15 minutes ago by sqing
Source: Own
Let $ a, b, c $ be positive reals such that $ a+b +c+abc = 4 $. Prove that
$$ \frac{1}{a+1} + \frac{1}{b+1} + \frac{1}{c+ 1}\leq\frac{3}{2}(2 - abc) $$$$ \frac{1}{ab+1} + \frac{1}{bc+1} + \frac{1}{ca + 1}\leq\frac{3}{2}(2 - abc) $$
1 reply
1 viewing
sqing
18 minutes ago
sqing
15 minutes ago
Thanks u!
Ruji2018252   2
N 22 minutes ago by lbh_qys
Let $a^2+b^2+c^2-2a-4b-4c=7(a,b,c\in\mathbb{R})$
Find minimum $T=2a+3b+6c$
2 replies
1 viewing
Ruji2018252
Yesterday at 5:52 PM
lbh_qys
22 minutes ago
Inspired by Ruji2018252
sqing   0
32 minutes ago
Source: Own
Let $ a,b,c $ be reals such that $ a^2+b^2+c^2-2a-4b-4c=7. $ Prove that
$$ -4\leq 2a+b+2c\leq 20$$$$5-4\sqrt 3\leq a+b+c\leq 5+4\sqrt 3$$$$ 11-4\sqrt {14}\leq a+2b+3c\leq 11+4\sqrt {14}$$
0 replies
sqing
32 minutes ago
0 replies
Isos Trap
MithsApprentice   38
N 41 minutes ago by eg4334
Source: USAMO 1999 Problem 6
Let $ABCD$ be an isosceles trapezoid with $AB \parallel CD$. The inscribed circle $\omega$ of triangle $BCD$ meets $CD$ at $E$. Let $F$ be a point on the (internal) angle bisector of $\angle DAC$ such that $EF \perp CD$. Let the circumscribed circle of triangle $ACF$ meet line $CD$ at $C$ and $G$. Prove that the triangle $AFG$ is isosceles.
38 replies
MithsApprentice
Oct 3, 2005
eg4334
41 minutes ago
Funny function that there isn't exist
ItzsleepyXD   0
42 minutes ago
Source: Own, Modified from old problem
Determine all functions $f\colon\mathbb{Z}_{>0}\to\mathbb{Z}_{>0}$ such that, for all positive integers $m$ and $n$,
$$ m^{\phi(n)}+n^{\phi(m)} \mid f(m)^n + f(n)^m$$
0 replies
ItzsleepyXD
42 minutes ago
0 replies
Inspired by Deomad123
sqing   3
N an hour ago by sqing
Source: Own
Let $ a,b,c $ be real numbers so that $ a+2b+3c=2 $ and $ 2ab+6bc+3ca =1. $ Show that
$$\frac{10}{9} \leq a+2b+ c\leq 2 $$$$\frac{11-\sqrt{13}}{9} \leq a+b+c\leq \frac{11+\sqrt{13}}{9} $$$$\frac{29-\sqrt{13}}{9} \leq 2a+3b+4c\leq \frac{29+\sqrt{13}}{9} $$
3 replies
sqing
Yesterday at 2:28 PM
sqing
an hour ago
Incircle and circumcircle
stergiu   6
N an hour ago by Sadigly
Source: tst- Greece 2019
Let a triangle $ABC$ inscribed in a circle $\Gamma$ with center $O$. Let $I$ the incenter of triangle $ABC$ and $D, E, F$ the contact points of the incircle with sides $BC, AC, AB$ of triangle $ABC$ respectively . Let also $S$ the foot of the perpendicular line from $D$ to the line $EF$.Prove that line $SI$ passes from the antidiametric point $N$ of $A$ in the circle $\Gamma$.( $AN$ is a diametre of the circle $\Gamma$).
6 replies
stergiu
Sep 23, 2019
Sadigly
an hour ago
2011-gon
3333   27
N an hour ago by Maximilian113
Source: All-Russian 2011
A convex 2011-gon is drawn on the board. Peter keeps drawing its diagonals in such a way, that each newly drawn diagonal intersected no more than one of the already drawn diagonals. What is the greatest number of diagonals that Peter can draw?
27 replies
3333
May 17, 2011
Maximilian113
an hour ago
ISL 2015 C4 But I misread statement (ii)
ItzsleepyXD   1
N 2 hours ago by golue3120
Source: ISL 2015 C4 misread
Let $n$ be a positive integer. Two players $A$ and $B$ play a game in which they take turns choosing positive integers $k \le n$. The rules of the game are:

(i) A player cannot choose a number that has been chosen by either player on any previous turn.
(ii) A player cannot choose a number consecutive to any number chosen by any player on any turn.
(iii) The game is a draw if all numbers have been chosen; otherwise the player who cannot choose a number anymore loses the game.

The player $A$ takes the first turn. Determine the outcome of the game, assuming that both players use optimal strategies.

note
1 reply
ItzsleepyXD
2 hours ago
golue3120
2 hours ago
Geometry tangent circles
Stefan4024   65
N 2 hours ago by eg4334
Source: EGMO 2016 Day 2 Problem 4
Two circles $\omega_1$ and $\omega_2$, of equal radius intersect at different points $X_1$ and $X_2$. Consider a circle $\omega$ externally tangent to $\omega_1$ at $T_1$ and internally tangent to $\omega_2$ at point $T_2$. Prove that lines $X_1T_1$ and $X_2T_2$ intersect at a point lying on $\omega$.
65 replies
Stefan4024
Apr 13, 2016
eg4334
2 hours ago
Maximum Sum in a Grid
Mathdreams   1
N 2 hours ago by iliya8788
Source: 2025 Nepal Mock TST Day 3 Problem 1
Let $m$ and $n$ be positive integers. In an $m \times n$ grid, two cells are considered neighboring if they share a common edge. Kritesh performs the following actions:

1. He begins by writing $0$ in any cell of the grid.
2. He then fills each remaining cell with a non-negative integer such that the absolute difference between the numbers in any two neighboring cells is exactly $1$.

Kritesh aims to fill the grid in a way that maximizes the sum of the numbers written in all the cells. Determine the maximum possible sum that Kritesh can achieve in terms of $m$ and $n$.

(Kritesh Dhakal, Nepal)
1 reply
Mathdreams
Yesterday at 8:31 PM
iliya8788
2 hours ago
Something nice
KhuongTrang   25
N 3 hours ago by KhuongTrang
Source: own
Problem. Given $a,b,c$ be non-negative real numbers such that $ab+bc+ca=1.$ Prove that

$$\sqrt{a+1}+\sqrt{b+1}+\sqrt{c+1}\le 1+2\sqrt{a+b+c+abc}.$$
25 replies
KhuongTrang
Nov 1, 2023
KhuongTrang
3 hours ago
Beautiful problem
luutrongphuc   12
N 3 hours ago by luutrongphuc
(Phan Quang Tri) Let triangle $ABC$ be circumscribed about circle $(I)$, and let $H$ be the orthocenter of $\triangle ABC$. The circle $(I)$ touches line $BC$ at $D$. The tangent to the circle $(BHC)$ at $H$ meets $BC$ at $S$. Let $J$ be the midpoint of $HI$, and let the line $DJ$ meet $(I)$ again at $X$. The tangent to $(I)$ parallel to $BC$ meets the line $AX$ at $T$. Prove that $ST$ is tangent to $(I)$.
12 replies
luutrongphuc
Apr 4, 2025
luutrongphuc
3 hours ago
Navid FE on R+
Assassino9931   0
4 hours ago
Source: Bulgaria Balkan MO TST 2025
Determine all functions $f: \mathbb{R}^{+} \to \mathbb{R}^{+}$ such that
\[ f(x)f\left(x + 4f(y)\right) = xf\left(x + 3y\right) + f(x)f(y) \]for any positive real numbers $x,y$.
0 replies
1 viewing
Assassino9931
4 hours ago
0 replies
USAMO 2000 Problem 3
MithsApprentice   9
N Apr 4, 2025 by Anto0110
A game of solitaire is played with $R$ red cards, $W$ white cards, and $B$ blue cards. A player plays all the cards one at a time. With each play he accumulates a penalty. If he plays a blue card, then he is charged a penalty which is the number of white cards still in his hand. If he plays a white card, then he is charged a penalty which is twice the number of red cards still in his hand. If he plays a red card, then he is charged a penalty which is three times the number of blue cards still in his hand. Find, as a function of $R, W,$ and $B,$ the minimal total penalty a player can amass and all the ways in which this minimum can be achieved.
9 replies
MithsApprentice
Oct 1, 2005
Anto0110
Apr 4, 2025
USAMO 2000 Problem 3
G H J
G H BBookmark kLocked kLocked NReply
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MithsApprentice
2390 posts
#1 • 3 Y
Y by samrocksnature, Adventure10, Mango247
A game of solitaire is played with $R$ red cards, $W$ white cards, and $B$ blue cards. A player plays all the cards one at a time. With each play he accumulates a penalty. If he plays a blue card, then he is charged a penalty which is the number of white cards still in his hand. If he plays a white card, then he is charged a penalty which is twice the number of red cards still in his hand. If he plays a red card, then he is charged a penalty which is three times the number of blue cards still in his hand. Find, as a function of $R, W,$ and $B,$ the minimal total penalty a player can amass and all the ways in which this minimum can be achieved.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MithsApprentice
2390 posts
#2 • 3 Y
Y by samrocksnature, Adventure10, Mango247
When replying to the problem, I ask that you make posts for solutions and submit comments, jokes, smilies, etc. separately. Furthermore, please do not "hide" any portion of the solution. Please use LaTeX for posting solutions. Thanks.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
JSteinhardt
947 posts
#3 • 16 Y
Y by henrypickle, explogabloger, pickten, ilovemath121, Dynamite127, Akababa, utkarshgupta, jam10307, vsathiam, Delray, v_Enhance, e_plus_pi, MathbugAOPS, lneis1, samrocksnature, Adventure10
We claim (inductively) that the minimum is just going to be $min(BW,2WR,3RB)$. We'll start our induction with the case where one of the three quantities is zero, in which case we verify that we can indeed get away without any penalty by, for example, discarding blue if we are out of white.

Now, for the inductive step, let $f(R,W,B)$ be the minimum we seek. Note that
\[f(B,W,R) = min(W+f(B-1,W,R),2R+f(B,W-1,R),3B+f(B,W,B-1)) \]
By our inductive hypothesis, $f(B-1,W,R) = min((B-1)W,2WR,3R(B-1))$. In order for this to cause our inductive step not to hold, we would require that $W+min((B-1)W,2WR,3R(B-1)) < min(BW,2WR,3RB)$. It is evident that the first two entries in the $min$ expression cannot cause this to happen, so that we need only consider $W+3R(B-1) < min(BW,2WR,3RB)$. So $W+3R(B-1) < BW$, whence $3R < W$. But $W+3R(B-1) < 3RB$, so that $W < 3R$, a contradiction.

For the other two cases, we can get similar contradictions, so that our inductive step must hold, and so $f(B,W,R)$ is indeed $min(BW,2WR,3RB)$.

We now need only establish how many ways to do this. If one of these quantities is smaller, our induction and the fact that it is eventually zero guarantees that it will continue to be the smallest quantity as cards are discarded. (For example, if it is currently optimal to discard a blue card, it will continue to be so until we run out of blue cards.) Therefore, assuming that there is currently only one best choice of card to discard, this will continue to be so in the future, whence if $BW \neq 2WR \neq 3RB$, there is only $1$ optimal strategy.

Suppose, now, that $BW = 2WR$. It is thus optimal to discard either a $B$ or $W$ card. If we ever discard a blue card, then we will cause $BW < 2WR$, whence there is only one possible strategy from then on. However, if we discard a white card, then we will still have $BW = 2WR$, meaning that we continue to have the choice of discarding a white or blue card. Since we can discard a white card at most $W$ times, there are $W+1$ choices for how many $W$ cards to discard ($0$ to $W$), meaning that there are $W+1$ optimal strategies.

By similar logic, we get $R+1$ optimal strategies if $2WR = 3RB$, and $B+1$ optimal strategies if $3RB = BW$.

The final case, then, is if $BW = 2WR = 3RB$. In this case, if we first discard a white card, we are left with the $BW = 2WR$ case, and similarly for a blue and white card. The total number of optimal strategies in this case is then the sum of the optimal strategies in those cases, or, in other words, $B+W+R$.

To summarize:
The minimum penalty is $min(BW,2WR,3RB)$.
If $BW \neq 2WR \neq 3RB$, there is $1$ optimal strategy.
If $BW = 2WR < 3RB$, there are $W+1$ strategies.
If $2WR = 3RB < BW$, there are $R+1$ strategies.
If $3RB = BW < 2WR$, there are $B+1$ strategies.
If $BW = 2WR = 3RB$, there are $R+B+W$ strategies.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
IAmTheHazard
5001 posts
#4 • 2 Y
Y by samrocksnature, centslordm
Unexpectedly nice. Here is a nice "local"-type solution.
The answer is $\min(BW,2WR,3RB)$. We can achieve $BW$ by removing $B$ blue cards (with $W$ penalty each), then removing the red cards with $0$ penalty each and then the white cards with $0$ penalty each. We can also achieve $2WR$ and $3RB$ with a similar procedure.
Consider the order in which cards are played. If a player first plays three red cards, then one white, then one red, then two blue, we can represent the order as $RRRWRB$. Define a "C-block" of plays as some consecutive (possibly zero-length) plays in which the same card C is played, so an R-block is red cards for example. Clearly, we can represent every card order as a list of blocks such that every red block is followed by a blue block, every blue block is followed by a white block, and every white block is followed by a red block (except for the last block) and no two consecutive blocks are zero-length. For instance, we can represent $RRRRRBBW$ as a 5-long R-block, a 2-long B-block, and then a 1-long W-block. We can represent $WBBR$ as a 1-long W-block, a 0-long R-block, a 2-long B-block, a 0-long W-block, and finally a 1-long R-block.
Consider some arbitrary play order $P$. I claim that we can find some play order $P'$ which results in at most as much penalty as $P$ and has fewer nonempty blocks than $P$, unless $P$ has at most 3 nonempty blocks. If $P$ has more than 4 nonempty blocks, it is clear that at least one of the block orders R-B-W-R, B-W-R-B, W-R-B-W occurs, where the first and fourth blocks are nonempty, while the second and third are not necessarily nonempty.
Focus on the R-B-W-R case. Suppose there are $b$ blue cards in the blue block, $w$ in the white block, $r_1$ in the first red block, and $r_2$ in the second red block. Now consider the following subcases:
Subcase 1: $3b \leq 2w$. Consider the play order $P'$ formed by deleting the second red block and adding $r_2$ red cards to the first block. For example, if the blocks are $\boxed{RRRR}\boxed{B}\boxed{WW}\boxed{RR}$ before, then they will be $\boxed{RRRRRR}\boxed{B}\boxed{WW}$. Clearly this decreases the number of nonempty blocks. It is clear that this process increases the penalty by $3r_2b$, but also decreases it by $2r_2w$. Since $3b \leq 2w$, it follows that $2r_2w \geq 3r_2b$ and the penalty does not increase.
Subcase 2: $3b > 2w$. Consider the play order $P'$ formed by deleting the first red block and adding $r_1$ red cards to the second block. Clearly this decreases the number of nonempty blocks. It is clear that this process increases the penalty by $2r_1w$, and decreases it by $3r_1b$. Since $3b>2w$, it follows that $3r_1b>2r_1w$ and the penalty decreases.
Combining these cases implies that there always exists such a $P'$ for the R-B-W-R case. The other two cases can be dealt with similarly, which implies the claim.

Repeating this process shows that any play order $P$ accumulates at least as much penalty as some play order with three or fewer nonempty blocks. Hence to find the minimum it suffices to only consider play orders with three or fewer nonempty blocks. Clearly if there are at most two nonzero numbers in the multiset $\{R,B,W\}$, the minimum is zero, which fits the expression. Otherwise, if all of $\{R,B,W\}$ are nonzero, we can easily derive the above expression by considering cases on the order in which blocks are removed, which completes the proof. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MatBoy-123
396 posts
#5
Y by
JSteinhardt wrote:
We claim (inductively) that the minimum is just going to be $min(BW,2WR,3RB)$. We'll start our induction with the case where one of the three quantities is zero, in which case we verify that we can indeed get away without any penalty by, for example, discarding blue if we are out of white.

Now, for the inductive step, let $f(R,W,B)$ be the minimum we seek. Note that
\[f(B,W,R) = min(W+f(B-1,W,R),2R+f(B,W-1,R),3B+f(B,W,B-1)) \]By our inductive hypothesis, $f(B-1,W,R) = min((B-1)W,2WR,3R(B-1))$. In order for this to cause our inductive step not to hold, we would require that $W+min((B-1)W,2WR,3R(B-1)) < min(BW,2WR,3RB)$. It is evident that the first two entries in the $min$ expression cannot cause this to happen, so that we need only consider $W+3R(B-1) < min(BW,2WR,3RB)$. So $W+3R(B-1) < BW$, whence $3R < W$. But $W+3R(B-1) < 3RB$, so that $W < 3R$, a contradiction.

For the other two cases, we can get similar contradictions, so that our inductive step must hold, and so $f(B,W,R)$ is indeed $min(BW,2WR,3RB)$.

We now need only establish how many ways to do this. If one of these quantities is smaller, our induction and the fact that it is eventually zero guarantees that it will continue to be the smallest quantity as cards are discarded. (For example, if it is currently optimal to discard a blue card, it will continue to be so until we run out of blue cards.) Therefore, assuming that there is currently only one best choice of card to discard, this will continue to be so in the future, whence if $BW \neq 2WR \neq 3RB$, there is only $1$ optimal strategy.

Suppose, now, that $BW = 2WR$. It is thus optimal to discard either a $B$ or $W$ card. If we ever discard a blue card, then we will cause $BW < 2WR$, whence there is only one possible strategy from then on. However, if we discard a white card, then we will still have $BW = 2WR$, meaning that we continue to have the choice of discarding a white or blue card. Since we can discard a white card at most $W$ times, there are $W+1$ choices for how many $W$ cards to discard ($0$ to $W$), meaning that there are $W+1$ optimal strategies.

By similar logic, we get $R+1$ optimal strategies if $2WR = 3RB$, and $B+1$ optimal strategies if $3RB = BW$.

The final case, then, is if $BW = 2WR = 3RB$. In this case, if we first discard a white card, we are left with the $BW = 2WR$ case, and similarly for a blue and white card. The total number of optimal strategies in this case is then the sum of the optimal strategies in those cases, or, in other words, $B+W+R$.

To summarize:
The minimum penalty is $min(BW,2WR,3RB)$.
If $BW \neq 2WR \neq 3RB$, there is $1$ optimal strategy.
If $BW = 2WR < 3RB$, there are $W+1$ strategies.
If $2WR = 3RB < BW$, there are $R+1$ strategies.
If $3RB = BW < 2WR$, there are $B+1$ strategies.
If $BW = 2WR = 3RB$, there are $R+B+W$ strategies.

You are using Induction of which quantity?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
awesomeming327.
1692 posts
#6
Y by
1. Setup
For each order of playing, we write it out by repeatedly appending either $r$, $w$, or $b$ based on the color played in that move to the end of a sequence which starts off as empty. For example, if the player plays five reds and then three blues, then we say this player played sequence $\alpha=rrrrrbbb.$ We call a sequence $u$ a subsequence of another one $v$ if and only if we can remove some elements of $v$ and get $u$. Denote by $\#$ to be a function taking in a sequence and outputting a nonnegative integer that finds the number of times the sequence is a subsequence of $\alpha.$ Note that the penalty is equal to $\#(bw)+2\#(wr)+3\#(rb).$ Call a subsequence of consecutive elements of the same color a block. Furthermore, let a block of $k$ $r$'s be denoted by $r^k$.

2. In the minimum-penalty played sequence $\alpha$, $b$ must be followed by $r$, $r$ by $w$, and $w$ by $b$.
Assume otherwise that we have a played sequence $\alpha$ for which two consecutive elements are $rb$, $bw$, or $wr$. Clearly, transposing these two will not cause change in the penalty induced by any other element. The penalty induced by the second transposed element ($b$, $w$, $r$, respectively) will also not change. However, the first transposed element's penalty will decrease because we are losing either an $(rb)$ subsequence, a $(bw)$ subsequence, or a $(wr)$ subsequence.

3. If $\alpha$ contains exactly four consecutive blocks, we can decrease that number to three blocks while not increasing the penalty.
Suppose we have $\alpha=w^{a_1}b^{a_2}r^{a_3}w^{a_4}$. The penalty is $a_2a_4+2a_1a_3.$ Then, $w^{a_1+a_4}b^{a_2}r^{a_3}$ has penalty $2a_1a_3+2a_3a_4$ and $b^{a_2}r^{a_3}w^{a_1+a_4}$ has penalty $a_2a_1+a_2a_4.$ Depending on the relative sizes of $a_2$ and $2a_3$, one of these must not increase the penalty. The process for the other three cases are similar and I will not go into detail.

4. One minimal-penalty $\alpha$ is in the form $w^{W}b^{B}r^{R}$ or any cyclic shifts.
Note that in $\alpha$ we can apply the previous step to any four consecutive blocks, and we will only affect the penalties of elements inside of that block, and the other blocks will not be affected. Therefore, if we continually apply the algorithm in the previous step, the number of blocks decreases while the penalty doesn't increase. Therefore, one of the minima must be the case where there are three consecutive blocks, in the form $w^{W}b^{B}r^{R}$ or any cyclic shifts. The penalty here is either $BW,2WR,3RB$ so the minimum is $\min(BW,2WR,3RB).$

5. The equality case.
In the final application of the algorithm, as described in step $4$, the equality case of step $3$ is either $W=3R$, $B=2R$, or $2W=3B$. Therefore, if none of these equalities are true, then the inequality in the final application in step $4$ is strict and so the only minimum case is the one with exactly three blocks. Note that in this case, $BW,2WR,3RB$ are pairwise distinct. If the minimum is $BW$, then the only minimum case is $b^Br^Rw^W.$ Similar goes for the other cases. The other cases can all be deduced by reverse application of the algorithm in step $4$ mindful of the equality case.

Equal case
@above
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
fuzimiao2013
3301 posts
#7 • 2 Y
Y by Jndd, winniep008hfi
The answer is $\boxed{\min(BW, 2RW, 3BR)}$. Each of these is achievable with $\textbf{BRW}$, $\textbf{WBR}$, and $\textbf{RWB}$, respectively, where $\textbf{B}, \textbf{R}, \textbf{W}$ are some number of (in this case, all) blue cards, red cards, and white cards. We will prove this is minimal.

Consider a moveset that gives minimal penalty (we can assume this since there are finitely many possible movesets), which we will call a $\textit{Mondrian}$. For convenience, we will let $B$, $W$, and $R$ denote a blue, white, and red card when describing a moveset. Then notice that if there exists $BW$ in the moveset, we can switch both to strictly decrease the penalty, which would be a contradiction, so there do not exist $BW$ in any $\textit{Mondrian}$. Similarly, neither does $WR$ nor $RB$. Therefore, every $\textit{Mondrian}$ is of the form $X_1X_2X_3\dots X_n$, where each $X_i$ consists of $R\cdots RW\cdots WB\cdots B$ (where there are a positive number of each $R$, $W$, and $B$), and $X_1$ may start with $R$, $W$, or $B$ and $X_n$ may end with $R$, $W$, or $B$.

When $BW \neq 2RW \neq 3BR \neq BW$, notice that we can now move the first "block" of cards of the same color in the first $X_i$ to the "block" in the last $X_n$ (with the same color, so red goes into a red block) to strictly decrease the penalty of a $\textit{Mondrian}$, a contradiction. (If this does not decrease it, do the opposite and move the last block to the first one, since either one is guaranteed to work). Therefore, the $\textit{Mondrian}$ must be of the form we mentioned at the start. There is obviously only $\boxed{1}$ way to achieve this.

By extremely similar logic, we can conclude that
$BW = 2RW \neq 3BR \implies \boxed{W+1}$,
$BW = 3BR \neq 2RW \implies \boxed{B+1}$,
$2RW = 3BR \neq BW \implies \boxed{R+1}$, and
$BW = 2RW = 3BR \implies \boxed{R+W+B}$, done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
huashiliao2020
1292 posts
#8
Y by
Alright here we go... this sols different from above sols i think and it is legitimately solved
We use a local technique (even though this is in DCY-process :rotfl: )

The answer is min(BW,2RW,3RB), obtained by taking all of B then R then W (cyclically shifting for other minimums). Note that WB,RW,BR are more efficient versions of BW,WR,RB, hence we know the dealing of cards occurs in blocks $B_1B_2...B_n$, where each $B_k$ is a sequence of $R...RW...WB...B$, and henceforth suppose that we have obtained the minimal penalty config s.t. $n\ge 2$, with $BW\ne 2RW\ne 3RB$. Between any $B_k,B_{k+1}$, having $p,q,r$ and $u,v,w$ number of R,W,B in the respective blocks, we assume the penalty is already optimal, and perturb the penalty by combining only the Rs with each other into the same block $B_k$, and see if it's more efficient; it increases by 3(ur-qu). If this is not equal to 0, then either putting R in both blocks into $B_k$ or $B_{k+1}$ suffices, since they are negation of each other, so we would combine the blocks s.t. it increases by negative amount, contradiction; if they are 0, q=r; by similar reasoning on other ones, we deduce they are all =0, meaning combining blocks with their respective color doesn't change the optimality.

We're now home free: ,We can WLOG combine them, and now apply this algorithm GLOBALLY to show that (at least one of the) minimum(s) is when it's one block of R...RW...WB...B.
It remains to find the number of ways: There's one way if $BW\ne 2RW\ne 3RB\ne BW$, which is playing all of one type at once; if $BW=2RW\ne 3RB$ there's W+1 ways (erasing 0 to W of white cards, then playing out all blue cards, then all red cards, and finish with the rest of white cards. (Each white card discarded still preserves $BW = 2WR$.)

For the second part, the motivation was that the R and B must now be in one block due to our above reasoning, but we can have white separated, because it holds the same equality as if it were R...RW...WB...B, but it wouldn't hold the equality as the same if we had done R...RW...WB...B with a blue not in the block of blues (easily checked, remember that we can WLOG combine the other blocks). We can apply similar reasoning in other cases to get 1,W+1,B+1,R+1,R+W+B ways in their respective equals.
This post has been edited 2 times. Last edited by huashiliao2020, Sep 7, 2023, 10:38 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mathandski
738 posts
#9
Y by
Guess who else localed a DCY-process :D
Attachments:
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Anto0110
98 posts
#10
Y by
What does DCY means?
Z K Y
N Quick Reply
G
H
=
a