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

G
Topic
First Poster
Last Poster
k a May Highlights and 2025 AoPS Online Class Information
jlacosta   0
May 1, 2025
May is an exciting month! National MATHCOUNTS is the second week of May in Washington D.C. and our Founder, Richard Rusczyk will be presenting a seminar, Preparing Strong Math Students for College and Careers, on May 11th.

Are you interested in working towards MATHCOUNTS and don’t know where to start? We have you covered! If you have taken Prealgebra, then you are ready for MATHCOUNTS/AMC 8 Basics. Already aiming for State or National MATHCOUNTS and harder AMC 8 problems? Then our MATHCOUNTS/AMC 8 Advanced course is for you.

Summer camps are starting next month at the Virtual Campus in math and language arts that are 2 - to 4 - weeks in duration. Spaces are still available - don’t miss your chance to have an enriching summer experience. 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 upcoming events:
[list][*]May 9th, 4:30pm PT/7:30pm ET, Casework 2: Overwhelming Evidence — A Text Adventure, a game where participants will work together to navigate the map, solve puzzles, and win! All are welcome.
[*]May 19th, 4:30pm PT/7:30pm ET, What's Next After Beast Academy?, designed for students finishing Beast Academy and ready for Prealgebra 1.
[*]May 20th, 4:00pm PT/7:00pm ET, Mathcamp 2025 Qualifying Quiz Part 1 Math Jam, Problems 1 to 4, join the Canada/USA Mathcamp staff for this exciting Math Jam, where they discuss solutions to Problems 1 to 4 of the 2025 Mathcamp Qualifying Quiz!
[*]May 21st, 4:00pm PT/7:00pm ET, Mathcamp 2025 Qualifying Quiz Part 2 Math Jam, Problems 5 and 6, Canada/USA Mathcamp staff will discuss solutions to Problems 5 and 6 of the 2025 Mathcamp Qualifying Quiz![/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
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
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, 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
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
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
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
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

Paradoxes and Infinity
Mon, Tue, Wed, & Thurs, Jul 14 - Jul 16 (meets every day of the week!)

Intermediate: Grades 8-12

Intermediate Algebra
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
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3

Precalculus
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
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
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

AIME Problem Series A
Thursday, May 22 - Jul 31

AIME Problem Series B
Sunday, Jun 22 - Sep 21

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
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
May 1, 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
Maximum number of divisor in Binom Coeff.
nataliaonline75   0
5 minutes ago
Let $k \geq 2$, determine the maximal number of divisors from $n \choose k $ may have in the range $n-k+ 1,...,n$ , as $n$ runs through integers $\geq k$.
0 replies
nataliaonline75
5 minutes ago
0 replies
Nice geometry...
Sadigly   1
N 6 minutes ago by aaravdodhia
Source: Azerbaijan Senior NMO 2020
Let $ABC$ be a scalene triangle, and let $I$ be its incenter. A point $D$ is chosen on line $BC$, such that the circumcircle of triangle $BID$ intersects $AB$ at $E\neq B$, and the circumcircle of triangle $CID$ intersects $AC$ at $F\neq C$. Circumcircle of triangle $EDF$ intersects $AB$ and $AC$ at $M$ and $N$, respectively. Lines $FD$ and $IC$ intersect at $Q$, and lines $ED$ and $BI$ intersect at $P$. Prove that $EN\parallel MF\parallel PQ$.
1 reply
Sadigly
Sunday at 10:17 PM
aaravdodhia
6 minutes ago
Inspired by lbh_qys.
sqing   5
N 11 minutes ago by sqing
Source: Own
Let $ a,b>0   $ . Prove that
$$ \frac{a}{a^2+a +b+1}+ \frac{b}{b^2+a +b+1}  \leq  \frac{1}{2} $$$$ \frac{a}{a^2+ab+a+b+1}+ \frac{b}{b^2+ab+a+b+1} \leq   \sqrt 2-1  $$$$\frac{a}{a^2+ab+a+1}+ \frac{b}{b^2+ab+b+1} \leq  \frac{2(2\sqrt 2-1)}{7} $$$$\frac{a}{a^2+ab+b+1}+ \frac{b}{b^2+ab+a+1} \leq  \frac{2(2\sqrt 2-1)}{7} $$
5 replies
sqing
Today at 3:45 AM
sqing
11 minutes ago
AM=CN in Russia
mathuz   25
N 20 minutes ago by Ilikeminecraft
Source: AllRussian-2014, Grade 11, day1, P4
Given a triangle $ABC$ with $AB>BC$, $ \Omega $ is circumcircle. Let $M$, $N$ are lie on the sides $AB$, $BC$ respectively, such that $AM=CN$. $K(.)=MN\cap AC$ and $P$ is incenter of the triangle $AMK$, $Q$ is K-excenter of the triangle $CNK$ (opposite to $K$ and tangents to $CN$). If $R$ is midpoint of the arc $ABC$ of $ \Omega $ then prove that $RP=RQ$.

M. Kungodjin
25 replies
mathuz
Apr 29, 2014
Ilikeminecraft
20 minutes ago
IMO 2010 Problem 6
mavropnevma   41
N 20 minutes ago by pi271828
Let $a_1, a_2, a_3, \ldots$ be a sequence of positive real numbers, and $s$ be a positive integer, such that
\[a_n = \max \{ a_k + a_{n-k} \mid 1 \leq k \leq n-1 \} \ \textrm{ for all } \ n > s.\]
Prove there exist positive integers $\ell \leq s$ and $N$, such that
\[a_n = a_{\ell} + a_{n - \ell} \ \textrm{ for all } \ n \geq N.\]

Proposed by Morteza Saghafiyan, Iran
41 replies
mavropnevma
Jul 8, 2010
pi271828
20 minutes ago
Simson lines on OH circle
DVDTSB   2
N 29 minutes ago by SomeonesPenguin
Source: Romania TST 2025 Day 2 P4
Let \( ABC \) and \( DEF \) be two triangles inscribed in the same circle, centered at \( O \), and sharing the same orthocenter \( H \ne O \). The Simson lines of the points \( D, E, F \) with respect to triangle \( ABC \) form a non-degenerate triangle \( \Delta \).
Prove that the orthocenter of \( \Delta \) lies on the circle with diameter \( OH \).

Note. Assume that the points \( A, F, B, D, C, E \) lie in this order on the circle and form a convex, non-degenerate hexagon.

Proposed by Andrei Chiriță
2 replies
+2 w
DVDTSB
4 hours ago
SomeonesPenguin
29 minutes ago
2 player game, n-> n+p, where p is prime divisor of n
parmenides51   4
N 31 minutes ago by AylyGayypow009
Source: 2021 Greek Junior MO p2 (served as Greek JBMO TST p2 since the latter didn't take place)
Anna and Basilis play a game writing numbers on a board as follows:
The two players play in turns and if in the board is written the positive integer $n$, the player whose turn is chooses a prime divisor $p$ of $n$ and writes the numbers $n+p$. In the board, is written at the start number $2$ and Anna plays first. The game is won by whom who shall be first able to write a number bigger or equal to $31$.
Find who player has a winning strategy, that is who may writing the appropriate numbers may win the game no matter how the other player plays.
4 replies
parmenides51
Jul 3, 2021
AylyGayypow009
31 minutes ago
Tangents inducing isogonals
nikolapavlovic   55
N 36 minutes ago by SimplisticFormulas
Source: Serbian MO 2017 6
Let $k$ be the circumcircle of $\triangle ABC$ and let $k_a$ be A-excircle .Let the two common tangents of $k,k_a$ cut $BC$ in $P,Q$.Prove that $\measuredangle PAB=\measuredangle CAQ$.
55 replies
nikolapavlovic
Apr 2, 2017
SimplisticFormulas
36 minutes ago
Find all integers satisfying this equation
Sadigly   2
N 43 minutes ago by ilovenumbertheories
Source: Azerbaijan NMO 2019
Find all $x;y\in\mathbb{Z}$ satisfying the following condition: $$x^3=y^4+9x^2$$
2 replies
Sadigly
Sunday at 8:30 PM
ilovenumbertheories
43 minutes ago
Locus of the circumcenter of triangle PST
v_Enhance   14
N an hour ago by Ilikeminecraft
Source: USA TSTST 2013, Problem 4
Circle $\omega$, centered at $X$, is internally tangent to circle $\Omega$, centered at $Y$, at $T$. Let $P$ and $S$ be variable points on $\Omega$ and $\omega$, respectively, such that line $PS$ is tangent to $\omega$ (at $S$). Determine the locus of $O$ -- the circumcenter of triangle $PST$.
14 replies
v_Enhance
Aug 13, 2013
Ilikeminecraft
an hour ago
Problem 6 (Second Day)
darij grinberg   43
N an hour ago by cj13609517288
Source: IMO 2004 Athens
We call a positive integer alternating if every two consecutive digits in its decimal representation are of different parity.

Find all positive integers $n$ such that $n$ has a multiple which is alternating.
43 replies
darij grinberg
Jul 13, 2004
cj13609517288
an hour ago
Dou Fang Geometry in Taiwan TST
Li4   8
N an hour ago by X.Allaberdiyev
Source: 2025 Taiwan TST Round 3 Mock P2
Let $\omega$ and $\Omega$ be the incircle and circumcircle of the acute triangle $ABC$, respectively. Draw a square $WXYZ$ so that all of its sides are tangent to $\omega$, and $X$, $Y$ are both on $BC$. Extend $AW$ and $AZ$, intersecting $\Omega$ at $P$ and $Q$, respectively. Prove that $PX$ and $QY$ intersects on $\Omega$.

Proposed by kyou46, Li4, Revolilol.
8 replies
Li4
Apr 26, 2025
X.Allaberdiyev
an hour ago
geometry
EeEeRUT   4
N an hour ago by Tkn
Source: Thailand MO 2025 P4
Let $D,E$ and $F$ be touch points of the incenter of $\triangle ABC$ at $BC, CA$ and $AB$, respectively. Let $P,Q$ and $R$ be the circumcenter of triangles $AFE, BDF$ and $CED$, respectively. Show that $DP, EQ$ and $FR$ concurrent.
4 replies
EeEeRUT
Today at 6:44 AM
Tkn
an hour ago
min A=x+1/x+y+1/y if 2(x+y)=1+xy for x,y>0 , 2020 ISL A3 for juniors
parmenides51   14
N 2 hours ago by GayypowwAyly
Source: 2021 Greece JMO p1 (serves also as JBMO TST) / based on 2020 IMO ISL A3
If positive reals $x,y$ are such that $2(x+y)=1+xy$, find the minimum value of expression $$A=x+\frac{1}{x}+y+\frac{1}{y}$$
14 replies
parmenides51
Jul 21, 2021
GayypowwAyly
2 hours ago
flipping rows on a matrix in F2
danepale   17
N Apr 26, 2025 by eg4334
Source: Croatia TST 2016
Let $N$ be a positive integer. Consider a $N \times N$ array of square unit cells. Two corner cells that lie on the same longest diagonal are colored black, and the rest of the array is white. A move consists of choosing a row or a column and changing the color of every cell in the chosen row or column.
What is the minimal number of additional cells that one has to color black such that, after a finite number of moves, a completely black board can be reached?
17 replies
danepale
Apr 27, 2016
eg4334
Apr 26, 2025
flipping rows on a matrix in F2
G H J
Source: Croatia TST 2016
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
danepale
99 posts
#1 • 3 Y
Y by nguyendangkhoa17112003, Adventure10, Mango247
Let $N$ be a positive integer. Consider a $N \times N$ array of square unit cells. Two corner cells that lie on the same longest diagonal are colored black, and the rest of the array is white. A move consists of choosing a row or a column and changing the color of every cell in the chosen row or column.
What is the minimal number of additional cells that one has to color black such that, after a finite number of moves, a completely black board can be reached?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
shinichiman
3212 posts
#2 • 9 Y
Y by baopbc, ineX, NTA1907, jev2001, tpdtthltvp, cookie112, bluedragon17, Adventure10, KK_1729
Answer

Solution
This post has been edited 4 times. Last edited by shinichiman, Apr 28, 2016, 1:08 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
SFScoreLow
91 posts
#3 • 2 Y
Y by vjdjmathaddict, Adventure10
Inductive solution. We prove that at least $2N-4$ additional squares must be colored black. Number the rows $1$ to $N$ from bottom to top and columns $1$ to $N$ from left to right. Initially cells $(1,1)$ and $(N, N)$ are black.

Lemma. Every $2 \times 2$ square must contain an even number of black squares to begin with.
Proof. A move does not change the parity of the number of black squares within a $2 \times 2$ square since we either change $1, -1 \longleftrightarrow -1, 1$ or $1, 1 \longleftrightarrow -1, -1$. $\blacksquare$

Let $(i, j)_S$ denote the square containing cells $(i, j), (i+1, j), (i, j+1), (i+1, j+1)$.

Finally, proceed by induction. Base case $N = 2$ is trivial. Consider an $N \times N$ board. The squares $(1,1)_S$ and $(N-1, N-1)_S$ must contain at least one other black cell. Suppose cell $(2,2)$ (or $(N-1, N-1)$ symmetrically) is colored. If there are two black cells in the first row or first column, we can invoke the induction hypothesis to get that there are at least $2(N-1) - 2 + 2 = 2N-2$ black cells on the board to begin with. If, collectively, row $1$ and column $1$ contain only one black cell (on $(1,1)$) we can consider the two sequence of squares $(1, 2)_S \rightarrow (1,3)_S \rightarrow \cdots \rightarrow (1, N-1)_S$ and $(2,1)_S \rightarrow (3, 1)_S \rightarrow \cdots \rightarrow (N-1, 1)_S$ to get that there are at least $2(N-1)+1 = 2N-1$ black squares on the board. So we can assume that neither $(2,2)$ nor $(N-1, N-1)$ are colored.

WLOG $(1,2)$ is colored black. If $(N, N-1)$ is also coloured, we consider $(1, 2)_S \rightarrow (1,3)_S \rightarrow \cdots \rightarrow (1, N-1)_S$ and $(N-1,N-2)_S \rightarrow (N-1, N-3)_S \rightarrow \cdots \rightarrow (N-1, 1)_S$ to get that there are at least $2N$ black squares (each square in the sequences above 'adds' a black cell, creating a snake-like pattern extending across the board. Note that by adding a black cell to $(1, k)_S$ we also add one to $(1, k+1)_S$ because otherwise $(2,2)$ must be colored black). Hence (since $(N, N-1)$ and $(N-1, N-1)$ are both white) $(N-1, N)$ is colored black. This allows us to consider $(1, 2)_S \rightarrow (1,3)_S \rightarrow \cdots \rightarrow (1, N-2)_S$ and $(N-1, N-1)_S \rightarrow (N-2, N-1) \rightarrow \cdots \rightarrow (2, N-1)$ to conclude that at least $2(N-1) = 2N-2$ squares are colored unless the cell $(2, N-1)$, the overlap of $(1, N-2)_S$ and $(2, N-1)_S$, is black. But then cell $(1, N)$ must be colored black so that $(1, N-1)_S$ contains two black cells. In all cases we must have at least $2N-2$ squares colored black in order for the procedure to work. The construction is noted in the post above.
This post has been edited 3 times. Last edited by SFScoreLow, Apr 30, 2016, 1:48 AM
Reason: typos
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
v_Enhance
6877 posts
#4 • 9 Y
Y by Mathematicsislovely, CALCMAN, v4913, hakN, Executioner230607, HamstPan38825, Mango247, Mango247, MS_asdfgzxcvb
Solution from Twitch Solves ISL:

The answer is $2n-4$ additional cells.

We'll do the usual reduction: all the moves commute with each other and doing the same move twice does nothing. Also, it'll be more natural to get from all-white to the ``starting'' state; we'll do so as they are equivalent anyways.

Thus, we may as well assume (by permuting rows/columns)
  • we operated on the first $a$ rows;
  • we operated on the first $b$ columns.
The given hypothesis is equivalent to saying that if we do this operation on an initially empty board, then we got $k$ black cells, and at least two of them are not in the same row or column. The problem asks for the smallest possible value of $k-2$.
However, the point is that we have the explicit value \[ k = a(n-b) + b(n-a). \]It will be more economical actually to write \[ n^2 - k = ab + (n-a)(n-b) 	\le \sqrt{ \left( a^2+(n-a)^2 \right) 	\left( b^2+(n-b)^2 \right)}. \]We now analyze two cases:
  • If any of $a$ or $b$ are $0$ or $n$, we may directly check we need $k \ge 2n$ in order to have two black cells not in the same row or column.
  • Otherwise, $x^2 + (n-x)^2 \le 1 + (n-1)^2$ for $1 \le x \le n-1$, so \[ n^2 - k \le 1^2 + (n-1)^2 \]which means $k \ge 2n-2$.
In conclusion, $k-2 \ge 2n-4$; and moreover equality occurs at $a=b=1$, which is checked to indeed work.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bluedragon17
87 posts
#5
Y by
This is a very badly written solution, I am sorry for that :( . Also, my solution is almost the same solution as shinichiman's but I did not use the notation he used.
The answer is $2N-4$.

$N=2$ is trivial, so we let $N\ge3$.
Let $a_{k}$ be the number of times we change the colors in the $k$th column(and similarly $b_k$ for the rows.) For any cell $(i,j)$ we have,
$\Rightarrow a_{i} + b_{j} = 2k$ (if $(i,j)$ is black)
or
$\Rightarrow a_{i} + b_{j}= 2k+1$ (if $(i,j)$ is white )

$\textbf{Case:1}$ There is exactly one black cell in the first column.

So except for this cell, $a_1 + b_j$ is odd for all $j>1$. But since $(n,n)$ is initially black, we need all of the cells in the $n$th column to be black which gives us $N-2$ more cells( $b_j$ have the same parity). Also, notice that for any $k$th row, $a_k+b_j$ has the same parity, so initially, they are either all black or all white. (leaving the first cell in all the columns). To minimize we keep $1$ black cell in all these columns, so we get another $N-2$ from here giving us a total of $2N-4$ $\blacksquare$

$\textbf{Case:2}$ There is more than one black cell in the first column.

$a_1+b_j$ is again odd, so $b_j$ has the same parity but only for the black cells and of course, $j>1$.. So all the cells in the rows of these black cells are either all black or all white, we set all of them to be white to minimize. Thus, if we have $k\geq2$ additional black cells in the first column, we basically have $N-k$ additional black cells in the rest of the columns except for the last one. Using the same parity argument for the last column, we see that we atleast need $k-2$ additional black cells taking account of the fact that $(N,N)$ is already black.
$\Rightarrow$$k+(N-2)(N-k) + k-1 \geq k + 2(N-2) + k-2 > 2N-4$ $\blacksquare$
This post has been edited 4 times. Last edited by bluedragon17, Apr 13, 2022, 12:46 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mogmog8
1080 posts
#6 • 1 Y
Y by centslordm
Denote the square in the $i$th row and $j$th column as $(i,j)$. WLOG let $(1,1)$ and $(n,n)$ be the diagonally painted squares. We claim the answer is $2n-4$, which works when we paint the symmetric difference of the first column and last row. Swapping the last row and all the columns after the first gives a fully painted grid.

If we end up swapping $a$ rows and $b$ columns, we begin with $ab+(n-a)(n-b)$ painted squares. This is because $(i,j)$ must begin painted if and only if both row $i$ and column $j$ are swapped or they are both not swapped.

Consider when $a=0$. Then, we cannot swap the first or last column since $(1,1)$ and $(n,n)$ need to be swapped an even number of times. Hence, all of the first and last column need to be painted, resulting in at least $2n$ painted squares. If $a=n$, we must paint the first and last column so we again have at least $2n$ painted squares. Similarly, $b=0$ and $b=n$ yield at least $2n$ painted squares.

We claim that $ab+(n-a)(n-b)\ge 2n-2$ when $0<a,b<n$. Indeed, \[0\le (n-a-b)^2=[n^2+2ab-n(a+b)]-[n(a+b)-a^2-b^2]\]so \begin{align*}[ab+(n-a)(n-b)]-[2n-2]&=2ab+n^2-n(a+b)-2n+2\\&\ge n(a+b)-a^2-b^2-2n+2\\&=[n(a-1)-a^2+1]+[n(b-1)-b^2+1]\\&=(n-a-1)(a-1)+(n-b-1)(b-1)\\&\ge 0\end{align*}as desired. $\square$
This post has been edited 1 time. Last edited by Mogmog8, Feb 24, 2023, 8:54 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HamstPan38825
8866 posts
#7
Y by
The answer is $2n-4$. For a construction, color one row that contains one of the corner squares black, a column that contains the other corner square black, and their intersection white. We will look at the problem backwards, where we start from a completely black grid and attempt to leave as minimal black squares left as possible via valid operations.

Claim. Suppose that $k \geq n-1$ rows and columns that are not along the periphery of the grid are chosen. Then the number of intersection points between these rows and columns is at least $(n-2)(k-n+2)$.

Proof. Tautological. $\blacksquare$

Thus, if $k \geq n-1$ rows and columns are chosen, the number of white squares (squares toggled exactly once) within the interior $(n-2) \times (n-2)$ square is at most $(n-2)^2-(n-2)(k-n+2) = (n-2)(2n-4-k)$.

On the other hand, the number of squares that are now white that share a row or column with each one of the corner squares is precisely $k$ respectively. Thus, we can guarantee at most $\text{max}(k, 2n-2-k) = k$ more white squares among the non-corner periphery squares, as both of the edge rows and columns can be toggled or neither can be toggled to keep the corner square black. (Note that the two other corners can be made white.) As a result, the total number of white squares is at most $$N = (n-2)(2n-k) + 2k + 2 = n(n-2) + 2 - (n-4)(k-n+2) \leq n^2-2n+2.$$This proves the bound for $k \geq n-1$; if $k \leq n-2$, the total number of toggled squares is obviously at most $n^2-2n$.
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
#8
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.
joshualiu315
2534 posts
#9
Y by
For this solution, denote $(i,j)$ as the square in the $i$th row and $j$th column; we will consider getting from the all-white state to our starting position as it is easier to work with.

The answer is $\boxed{2n-4}$. Letting the original shaded squares be $(1,1)$ and $(n,n)$, the optimal coloring being the symmetric difference of row $1$ and column $n$.

For simplicity, denote each row/column as \textit{toggled} if it differs from its original state and \textit{original} otherwise. Suppose we toggle $a$ rows and $b$ columns. For $(i,j)$, ending up as a white square in the starting position requires both row $i$ and column $j$ to either be both toggled or both original, hence the number of black squares in the starting position is

\[n^2-ab+(n-a)(n-b) \ge n^2-\sqrt{(a^2+(n-a)^2)(b^2+(n-b)^2)}\]
where the inequality follows by Cauchy. Then, it follows that the RHS is optimized at $a=b=1$, which corresponds to $2n-2$ squares starting out black. Taking away the corners gives our desired minimum.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dolphinday
1326 posts
#10
Y by
All moves are commutative, so we only need to invert rows and columns at most once, and order doesn't matter.
$\newline$
Consider starting from an all-white position, and inverting to our starting position.
$\newline$
If we invert $a$ rows and $b$ columns, then the total number of black squares in our starting position is $n^2- (ab + (n - a)(n - b))$, because a square is left white(and needs to be colored black) if it is inverted $0$ times or $2$ times.
Our goal is to minimize $ab + (n - a)(n - b)$.
$\newline$
Note that \[(ab + (n - a)(n - b)) \leq \sqrt{(a^2 + (n - a)^2)(b^2 + (n - a)^2}\]\[\sqrt{(a^2 + (n - a)^2)(b^2 + (n - a)^2} \geq \sqrt{(1^2 + (n - 1)^2)(1^2 + (n - 1)^2} = n^2 - 2n + 2\].
\[n^2 - (n^2 - 2n + 2) = 2n - 2\].
Subtracting two(because the corner cells are already filled in) gives us $2n - 4$ which is achievable by coloring $n - 2$ cells on the bottom row(without coloring in the corner cell) and then coloring $n - 2$ cells on the left column without coloring in the corner cell.
$\newline$
Swapping the bottom row and then the leftmost column makes everything white, and from there it is easy to swap to make everything black.
This post has been edited 1 time. Last edited by dolphinday, Jan 6, 2024, 3:27 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
shendrew7
796 posts
#11
Y by
Noting that operations are commutable and that it is useless to operate on a single row/column multiple times, suppose we operate on $x$ rows and $y$ columns, where $0 \leq x, y \leq n$. Then the number of squares toggled an even number of times is
\[ab + (n-a)(n-b) = n^2-(a+b)n+2ab,\]
or the number of originally black squares. To minimize this expression, note $(x,y) = (0,n)$ fails, so the next best we can do is $(x,y)=(1,n-1)$, which is easy to construct. Thus our answer is
\[\left(n^2-n \cdot n + 2(n-1)\right) - 2 = \boxed{2n-4}.\]
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
two_steps
102 posts
#12
Y by
is this correct?

Let $a_{i,j} \in \{0,1\}$ refer to the color of the cell at the $i$th row $j$th column, where $1$ is black and $0$ is white. A move is equivalent to adding one to each cell of a row/column modulo $2$. Note that applying the move to the same row/column twice is pointless, and the order of the moves doesn't matter. Next, observe that once we've determined whether the first row is flipped, we also determine whether each of the columns are flipped. (If $a_{1,j}$ is currently white, we must flip column $j$, and otherwise, we don't.) Once we apply these determined moves, each row must be monochromatic (since we've determined everything else).

Let row $1$ have $k$ black cells after we've determined if it's flipped. Then, we'd have to flip $n-k$ columns. For each row, the flipped cells and not flipped cells must initially have different colors in order for the rows to be monochromatic after applying the column moves. Thus, there are either $k$ or $n-k$ black cells in each row (including the first). For a fixed $2\le k\le n-2$, the least number of additional black cells is
\[n\min\{k,n-k\}-2\ge 2n-2\]For $k=1$ or $n-1$, we actually can't achieve $n$ since it would imply that the original configuration solely consists of the first column black. The next smallest value is
\[(n-1) + \underbrace{1 + \cdots + 1}_{n-1} - 2 = 2n-4\]For $k=0$ or $n$, the original configuration would consist of monochromatic rows, yielding a minimum of $2n$. Overall, the minimum is $2n-4$. This may be achieved by coloring $a_{1,k}$ and $a_{k, n}$ black for $2\le k \le n-1$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
peace09
5419 posts
#13
Y by
Posting solely to commemorate the remarkable idiocy of my solution... I guess that's what happens when you spend less than 25% of the last week asleep :coolspeak:

One can reduce any sequence of moves to the states of $2n$ toggles, one for each row and column. The corners being black implies that exactly one of $r_1,c_1$ and exactly one of $r_n,c_n$ are toggled. Whence the answer is $\boxed{2n-4}$ by toggling $r_1,c_n$ (Case 1), in which case optimality follows since pairs of non-vertex points on opposite sides are of opposite states. If $r_1,r_n$ are toggled (or $c_1,c_n$ but WLOG let it be the former; Case 2), ... let's do something silly: label a row by $1$ if it is untoggled and $i$ if it toggled, and let each cell be the product of its row and column. If $r_u$ is the number of untoggled rows and so on, we want to min
\[\text{Im}((r_u+r_ti)(c_u+c_ti))=r_uc_t+r_tc_u.\]Here in Case 2, we have $r_t,c_u\ge2$, at which point the minimum is clearly $2n\ge2n-4$ at, say, $(0,n,n-2,2)$.
This post has been edited 2 times. Last edited by peace09, Apr 27, 2024, 8:16 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blueprimes
355 posts
#14
Y by
For $N = 1$ the answer is trivially $0$. For $N \ge 2$ we claim the answer is $2N - 4$.

For construction, define column $i$ as the column with $i - 1$ columns to the left of it. Define similarly for rows from the bottom. Then assign each cell a coordinate $(i, j)$ on column $i$ and row $j$. WLOG $(1, 1)$ and $(N, N)$ are black. Then color $(i, j)$ black if $1 \le i \le N - 1, j = 0$ or $i = N, 1 \le j \le N - 1$. Note that this configuration is valid as we can toggle the columns $1, 2, \dots, N - 1$ and row $1$ which turns it all black.

To show it is the actual minimum, consider the all-black array. It suffices to show that if we toggle rows/columns that leaves two opposite corners black, then there must be at least $2N - 2$ black cells on the array. Suppose we toggle $1 \le r \le N$ rows and $1 \le c \le N$ columns, there will be
$$rc + (N - r)(N - c) = 2rc - N(r + c) + N^2 = \frac{(2r - N)(2c - N) + N^2}{2}$$black cells. WLOG $r \ge c$. Then $(2r - N, 2c - N) = (N, -N), (N - 2, -N), (N - 2, -N + 2) \implies (r, c) = (N, 0), (N - 1, 0), (N - 1, 1)$ generate the three smallest possible values of the above quantity in order. Clearly toggling $N$ or $N - 1$ rows cannot form two opposite black corners, but $(N - 1, 1)$ has a valid construction (we described it earlier.) Hence plugging in we have
$$(\text{number of black cells}) \ge \frac{(N - 2)(-N + 2) + N^2}{2} = \frac{4N - 4}{2} = 2N - 2$$and 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.
EpicBird08
1753 posts
#15
Y by
My solution is different from the rest of the solutions on this thread, would appreciate if someone could check it. :)

Assume that the two diagonally black corners are in the top left and bottom right. The problem is equivalent to coloring the entire grid white as we can then flip the color of every row to get an entirely black grid.

The answer is $\boxed{2n-4}.$ For the construction, we color all the edge pieces on the top and right edges of our grid black, giving $2n - 4$ additional black squares colored. This can be turned into the grid with all black squares as we flip the color of the first row and the last column to get an entirely white grid.

Now we will show that we cannot do better. Assume for the sake of contradiction that at most $2n-5$ additional black squares can be colored so that the grid can be made entirely white. Notice that flipping the color of any row or column twice will do nothing, so we can assume that we flip the color of any row or column at most once.

To turn the bottom right black square into a white square, we must flip the color of exactly one of the last row or the last column. Without loss of generality, suppose that we flip the color of the last row. Then the bottom left corner is now colored black, so we must flip the color of the first column to make it white. Since we use at most $2n-5$ additional black squares and there are $2n-4$ edge squares which we flipped the color of, there is at least one edge square at this point which is now black. Suppose that this edge square is on the bottom row. Since we already flipped the bottom row, we must flip the color of the column of this black square. The result is a shaded square on the top edge. Since we already flipped the column of this new square, we must flip the top row of the grid, which shades the top left corner black. Since we flipped both the top row and leftmost column of the grid, this is a contradiction, and we are done.
This post has been edited 2 times. Last edited by EpicBird08, Dec 26, 2024, 2:28 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Maximilian113
575 posts
#16
Y by
We claim that the minimum is $2n-4.$ For the construction, pick a corner point not shaded yet and shade everything between this point and a shaded corner, as well as with the other shaded corner. (excluding the endpoints) Then, we can shade the two rows/columns passing through our unshaded corner point to make the entire board white, then we invert the board by inverting every row.

It now suffices to prove the bound. Since every operation is inversible and commutative, it suffices to start from a white board, and find a set of operations that makes at least $2$ squares in two corners black at the end, while minimizing the number of black squares at the end too. Suppose that we toggle $a$ rows and $b$ columns. Then clearly $a+b \geq 2$ in order for it to be possible to choose rows and columns so that the two corner squares are turned black. Similarly we have $a+b \leq n-2.$ Then, observe that after the operations, there are always $na+nb-2ab$ black squares. This also equals $\frac12 \left( n^2-(n-2a)(n-2b) \right).$ It thus suffices to maximize $(n-2a)(n-2b).$ Clearly both of these factors are either positive or negative. If they are both positive, we wish to minimize both $a, b.$ Thus either $(a, b) = (1, 1), (2, 0), (0, 2).$ In the former case we get $2n-2,$ while the other cases yield $n.$ Clearly the maximum is $2n-2$ so in total we would need to add $2n-4$ black squares in the original grid. This result can be similarly found if $(n-2a), (n-2b)$ are both negative. Therefore, the minimum is indeed $2n-4$ black squares.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Marcus_Zhang
980 posts
#17
Y by
Bad write up
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
eg4334
637 posts
#18
Y by
sketch
This post has been edited 1 time. Last edited by eg4334, Apr 26, 2025, 1:27 AM
Z K Y
N Quick Reply
G
H
=
a