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
Integration Bee Kaizo
Calcul8er   56
N 40 minutes ago by Blossom_tree_17
Hey integration fans. I decided to collate some of my favourite and most evil integrals I've written into one big integration bee problem set. I've been entering integration bees since 2017 and I've been really getting hands on with the writing side of things over the last couple of years. I hope you'll enjoy!
56 replies
Calcul8er
Mar 2, 2025
Blossom_tree_17
40 minutes ago
Geometry
Lukariman   1
N 2 hours ago by Primeniyazidayi
Given acute triangle ABC ,AB=b,AC=c . M is a variable point on side AB. The circle circumscribing triangle BCM intersects AC at N.

a)Let I be the center of the circle circumscribing triangle AMN. Prove that I always lies on a fixed line.

b)Let J be the center of the circle circumscribing triangle MBC. Prove that line segment IJ has a constant length.
1 reply
Lukariman
5 hours ago
Primeniyazidayi
2 hours ago
Kingdom of Anisotropy
v_Enhance   24
N 2 hours ago by deduck
Source: IMO Shortlist 2021 C4
The kingdom of Anisotropy consists of $n$ cities. For every two cities there exists exactly one direct one-way road between them. We say that a path from $X$ to $Y$ is a sequence of roads such that one can move from $X$ to $Y$ along this sequence without returning to an already visited city. A collection of paths is called diverse if no road belongs to two or more paths in the collection.

Let $A$ and $B$ be two distinct cities in Anisotropy. Let $N_{AB}$ denote the maximal number of paths in a diverse collection of paths from $A$ to $B$. Similarly, let $N_{BA}$ denote the maximal number of paths in a diverse collection of paths from $B$ to $A$. Prove that the equality $N_{AB} = N_{BA}$ holds if and only if the number of roads going out from $A$ is the same as the number of roads going out from $B$.

Proposed by Warut Suksompong, Thailand
24 replies
v_Enhance
Jul 12, 2022
deduck
2 hours ago
Incentre-excentre geometry
oVlad   2
N 2 hours ago by Double07
Source: Romania Junior TST 2025 Day 2 P2
Consider a scalene triangle $ABC$ with incentre $I$ and excentres $I_a,I_b,$ and $I_c$, opposite the vertices $A,B,$ and $C$ respectively. The incircle touches $BC,CA,$ and $AB$ at $E,F,$ and $G$ respectively. Prove that the circles $IEI_a,IFI_b,$ and $IGI_c$ have a common point other than $I$.
2 replies
oVlad
Yesterday at 12:54 PM
Double07
2 hours ago
Evan Chen Multivariable Calculus Book
Existing_Human1   7
N 2 hours ago by Blossom_tree_17
What do you guys think of Evan Chen's multivariable calculus book (or whatever you want to call it), through MIT? Is it useful for learning multivariable calculus? Here is a link: book
7 replies
Existing_Human1
Today at 1:21 AM
Blossom_tree_17
2 hours ago
Great similarity
steven_zhang123   4
N 2 hours ago by khina
Source: a friend
As shown in the figure, there are two points $D$ and $E$ outside triangle $ABC$ such that $\angle DAB = \angle CAE$ and $\angle ABD + \angle ACE = 180^{\circ}$. Connect $BE$ and $DC$, which intersect at point $O$. Let $AO$ intersect $BC$ at point $F$. Prove that $\angle ACE = \angle AFC$.
4 replies
steven_zhang123
Today at 2:13 PM
khina
2 hours ago
Unexpected FE
Taco12   18
N 2 hours ago by lpieleanu
Source: 2023 Fall TJ Proof TST, Problem 3
Find all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that for all integers $x$ and $y$, \[ f(2x+f(y))+f(f(2x))=y. \]
Calvin Wang and Zani Xu
18 replies
Taco12
Oct 6, 2023
lpieleanu
2 hours ago
Powers of a Prime
numbertheorist17   33
N 4 hours ago by OronSH
Source: USA TSTST 2014, Problem 6
Suppose we have distinct positive integers $a, b, c, d$, and an odd prime $p$ not dividing any of them, and an integer $M$ such that if one considers the infinite sequence \begin{align*}
		ca &- db \\
		ca^2 &- db^2 \\
		ca^3 &- db^3 \\
		ca^4 &- db^4 \\
&\vdots
	\end{align*} and looks at the highest power of $p$ that divides each of them, these powers are not all zero, and are all at most $M$. Prove that there exists some $T$ (which may depend on $a,b,c,d,p,M$) such that whenever $p$ divides an element of this sequence, the maximum power of $p$ that divides that element is exactly $p^T$.
33 replies
numbertheorist17
Jul 16, 2014
OronSH
4 hours ago
Expected Intersections from Random Pairing on a Circle
tom-nowy   2
N 4 hours ago by lele0305
Let $n$ be a positive integer. Consider $2n$ points on the circumference of a circle.
These points are randomly divided into $n$ pairs, and $n$ line segments are drawn connecting the points in each pair.
Find the expected number of intersection points formed by these segments, assuming no three segments intersect at a single point.
2 replies
tom-nowy
4 hours ago
lele0305
4 hours ago
question4
sahadian   5
N 4 hours ago by Mamadi
Source: iran tst 2014 first exam
Find the maximum number of Permutation of set {$1,2,3,...,2014$} such that for every 2 different number $a$ and $b$ in this set at last in one of the permutation
$b$ comes exactly after $a$
5 replies
sahadian
Apr 14, 2014
Mamadi
4 hours ago
Find all functions $f$: \(\mathbb{R^+}\) \(\rightarrow\) \(\mathbb{R^+}\) such
guramuta   5
N 4 hours ago by jasperE3
Source: Balkan MO SL 2021
A5: Find all functions $f$: \(\mathbb{R^+}\) \(\rightarrow\) \(\mathbb{R^+}\) such that:
$$f(xf(x+y)) = xf(y) + 1 $$
5 replies
2 viewing
guramuta
6 hours ago
jasperE3
4 hours ago
number theory
frost23   3
N 5 hours ago by frost23
given any positive integer n show that there are two positive rational numbers a and b not equal to b which are such that a-b, a^2- b^2....................a^n-b^n are all integers
3 replies
frost23
5 hours ago
frost23
5 hours ago
Prove the statement
Butterfly   0
Today at 11:13 AM
Given an infinite sequence $\{x_n\} \subseteq  [0,1]$, there exists some constant $C$, for any $r>0$, among the sequence $x_n$ and $x_m$ could be chosen to satisfy $|n-m|\ge r $ and $|x_n-x_m|<\frac{C}{|n-m|}$.
0 replies
Butterfly
Today at 11:13 AM
0 replies
Morphism in a ring makes it a field
RobertRogo   1
N Today at 10:16 AM by ysharifi
Source: Daniel Jinga, Ionel Popescu, RNMO SHL, 2003
Let $A$ be a ring with unity in which $1+1 \neq 0$ and there is a morphism $f$ from the group $(A,+)$ to the monoid $(A,\cdot)$ such that for all $a\in A\setminus \{0\}$, there is a $b \in A$ such that $f(b)=a^2$. Prove that $A$ is a field.
1 reply
RobertRogo
Yesterday at 4:02 PM
ysharifi
Today at 10:16 AM
A Ball-Drawing problem
Vivacious_Owl   9
N Apr 28, 2025 by Vivacious_Owl
Source: Inspired by a certain daily routine of mine
There are N identical black balls in a bag. I randomly take one ball out of the bag. If it is a black ball, I throw it away and put a white ball back into the bag instead. If it is a white ball, I simply throw it away and do not put anything back into the bag. The probability of getting any ball is the same.
Questions:
1. How many times will I need to reach into the bag to empty it?
2. What is the ratio of the expected maximum number of white balls in the bag to N in the limit as N goes to infinity?
9 replies
Vivacious_Owl
Apr 24, 2025
Vivacious_Owl
Apr 28, 2025
A Ball-Drawing problem
G H J
G H BBookmark kLocked kLocked NReply
Source: Inspired by a certain daily routine of mine
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Vivacious_Owl
4 posts
#1
Y by
There are N identical black balls in a bag. I randomly take one ball out of the bag. If it is a black ball, I throw it away and put a white ball back into the bag instead. If it is a white ball, I simply throw it away and do not put anything back into the bag. The probability of getting any ball is the same.
Questions:
1. How many times will I need to reach into the bag to empty it?
2. What is the ratio of the expected maximum number of white balls in the bag to N in the limit as N goes to infinity?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
alexheinis
10583 posts
#2 • 1 Y
Y by Vivacious_Owl
1. Suppose we have $k$ black and $l$ white balls in the bag. The quantity $f:=2k+l$ decreases by exactly 1 with each step. Hence we need exactly $2N$ steps to empty the bag. I will think about 2 at a later time.
I think we can use the reflection principle to count paths with a given maximum.
This post has been edited 2 times. Last edited by alexheinis, Apr 24, 2025, 5:00 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Vivacious_Owl
4 posts
#3
Y by
Correct!
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
solyaris
637 posts
#4 • 2 Y
Y by GreenKeeper, Saucitom
Nice problem! What is the real source of the problem? ('Inspired by a certain daily routine' seems somewhat implausible: The problem is certainly very carefully designed.) Do you have references for the problem (and maybe a solution)?

I suspect a rigorous answer to part 2 will be tricky and technical: I don't think reflection principle will be useful due to the lack of symmetry.

Let me give some heuristics that are hopefully correct and should even give a stronger result. I will write $n = N$ for convenience. First of all we will represent the urn model by a random walk: Let $S_k$ denote the number of white balls in the bag at time $k$ (i.e. after $k$ steps). Note that $S_k = j$ implies that at time $k$ there are $j$ white balls and $n- \frac{k+j} 2$ black balls in the urn (which is consistent with alexheinis answer to part 1). Thus we have
$$
P(S_{k+1} = j+1| S_k = j) = \frac{n - \frac 1 2 (j+k)}{n + \frac 1 2 (j-k)} =: p_{k,j}
$$and $P(S_{k+1} = j-1| S_k = j) = 1 - p_{k,j}$. Thus $S_k$, $0 \le k \le 2n$ is a random walk (on nonnegative integers) with increments $\pm 1$. The increments however are not independent, and also depend on the time, so this is messy. So far this is rigorous. Now we want to consider $n \to \infty$ and scale time and space by $n$.

If we had a simple random walk, scaling time by $n$ and space by $\sqrt n$ gives Brownian motion. In our random walk we locally should also expect random fluctuations to be of size $\sqrt n$, so in the space scaling of $n$, we should expect all randomness to dissapear, i.e. the paths of our random walk should converge to a deterministic curve. The slope of this curve should correspond to the local drift of the random walk, which is given by $2 p_{k,j} - 1$. Introducing $t := \frac k n$ and $x := \frac j n$, the above one-step-transition thus gives the differential equation
$$
x' = 2 \frac{1 - \frac 1 2 (x+t)}{1 + \frac 1 2(x-t) }-1 = \frac{2-t-3x}{2-t+x}.
$$We also have the initial value $x(0) = 0$. The maximum of $x$ on the interval $[0,2]$ should give the ratio of the maximum number of white balls in the bag to $n$. Now this is a purely analytic problem. I don't know if one can solve the ODE by hand, but with help of wolfram we seem to get an implicit description of $x$, namely
$$
\ln(1-\frac 1 2 (x+t)) +  \frac{x}{1 - \frac 1 2 (x+t)} = 0. 
$$At the maximum of $x$ we have $x' = 0$, i.e. $2-t-3x = 0$ and using this to eliminate $t$ in the above implicit description we get a maximum avlue of $x = \frac 1 e$. I didn't double check my calculations and I also didn't perform simulations in order to see whether this is plausible, but it seems reasonable.

Note that (if there are no computational mistakes above), we get something stronger: The scaled random walk paths should converge to the above deterministic curve, so the scaled
maximum should not just converge to $\frac 1 e$ in expectation, but also in distribution. (If true, this should also be visible in simulations.)

The above obviously is not a proof. It would require some effort to show the claimed convergence of the random walk paths, but in priciple it should be possible.There also might be simpler arguments for the convergence in expectation, e.g. with arguments of a combinatorial flavor.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
GreenKeeper
1696 posts
#5
Y by
solyaris wrote:
I don't know if one can solve the ODE by hand
https://en.wikipedia.org/wiki/Homogeneous_differential_equation#Special_case
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
solyaris
637 posts
#6
Y by
Thanks for pointing that out! So indeed the ODE can be solved by hand (and I would hope that this reproduces the solution given by Wolfram alpha).
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
GreenKeeper
1696 posts
#7 • 1 Y
Y by Saucitom
Yeah the solution of the ODE is correct. Also I wrote a simple simulation in Python:
import numpy as np
 
N = 10**4
SIMS = 10**3
 
maxs = []
 
for _ in range(SIMS):
    blacks = N
    whites = 0
    whites_max = 0
 
    for _ in range(2 * N):
        random_ball = np.random.randint(blacks + whites)
 
        if random_ball < blacks:
            blacks -= 1
            whites += 1
        else:
            whites -= 1
 
        whites_max = max(whites_max, whites)
 
    maxs.append(whites_max)
 
print(np.mean(maxs) / N)
print(np.exp(-1))

The results look promising. For $N=10^4$ and $10^3$ simulations I got approximately $0.3702$, a decent match for $1/e\doteq0.3679$. I might try the distribution later if nobody beats me to it.

UPDATE: For $N=10^5$ and $10^4$ simulations I got approximately $0.3684$, so it seems that $1/e$ is indeed correct.
This post has been edited 3 times. Last edited by GreenKeeper, Apr 26, 2025, 7:36 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Vivacious_Owl
4 posts
#8 • 1 Y
Y by Saucitom
Glad you like the problem! I came up with it while taking vitamin pills. Dose of one pill was too high so I would take half a pill and put the other back in the bottle. I noticed that at first when the bottle was new I mostly got a whole pill each time, but then as the halves accumulated they started to appear more often and after a little it’s mostly them you get with occasional wholes until the end. This was counterintuitive to me at the time. Initially I assumed that they would equalize in number and remain in this equilibrium until the very end. But as often the case with probabilities our intuition fails. If you plot the graphs of white and black balls you’ll see that after crossing the white ball curve stays above the black one until the very end. Moreover the difference between them after crossing grows for a while, reaches max at a point and starts decreasing towards the end.

Considering the continuous case in your notation the differential equations of the process are dy/dt=-y/(x+y) and dx/dt=(y-x)/(x+y). where y is the ratio of the expected number of black balls in the bag to N in the limit as N goes to infinity. From them follows the invariant t+x+2y=2 and the solution t=2+y(ln(y)-2) (considering the initial conditions t=0, x=0, y=1). Now dx/dt=0 when y=x which gives x=y=1/e at t=2-3/e

BTW the invariant could be deduced directly from the problem. Consider the number of times you need to touch the balls to empty the bag. Think of it not as if you replace one ball for another but simply change its color by touching it. In the middle of the process it’s T times you have already touched the balls + X times for each white ball you have left and 2Y times for each black one. It’s 2N in total. So T+X+2Y=2N

The max difference between the white and black balls I was referring to at beginning can be inferred from the differential equations (x-y)'=(2y-x)/(x+y)=0 so x=2y and y=1/e^2, x=2/e^2, t=2-4/e^2
This post has been edited 1 time. Last edited by Vivacious_Owl, Apr 26, 2025, 1:48 AM
Reason: typo
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Saucitom
86 posts
#9
Y by
Very nice discussion! This problem reminds me of a variation of Polya Urn, which appears last year at Miklos-Schweitzer (P11). In both cases, one can approximate the solution with an ODE.
This post has been edited 1 time. Last edited by Saucitom, Apr 26, 2025, 3:34 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Vivacious_Owl
4 posts
#10
Y by
The next step would be to generalize it to an arbitrary number of ball colors (or better in this case mark them with numbers maybe). Say initially there are N balls marked 0 in the bag. Then you randomly pick a ball and replace k-th ball number with a ball marked k+1. It could be a separate post with a beautiful and well known result!
Z K Y
N Quick Reply
G
H
=
a