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

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

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

And special thanks to all of the amazing AoPS team members who have helped build AoPS. We’ve come a long way from here:IMAGE
1571 replies
rrusczyk
Mar 24, 2025
SmartGroot
Mar 26, 2025
Unlimited candy in PAGMO
JuanDelPan   21
N 9 minutes ago by akliu
Source: Pan-American Girls' Mathematical Olympiad 2021, P5
Celeste has an unlimited amount of each type of $n$ types of candy, numerated type 1, type 2, ... type n. Initially she takes $m>0$ candy pieces and places them in a row on a table. Then, she chooses one of the following operations (if available) and executes it:

$1.$ She eats a candy of type $k$, and in its position in the row she places one candy type $k-1$ followed by one candy type $k+1$ (we consider type $n+1$ to be type 1, and type 0 to be type $n$).

$2.$ She chooses two consecutive candies which are the same type, and eats them.

Find all positive integers $n$ for which Celeste can leave the table empty for any value of $m$ and any configuration of candies on the table.

$\textit{Proposed by Federico Bach and Santiago Rodriguez, Colombia}$
21 replies
JuanDelPan
Oct 6, 2021
akliu
9 minutes ago
set with c+2a>3b
VicKmath7   48
N 26 minutes ago by akliu
Source: ISL 2021 A1
Let $n$ be a positive integer. Given is a subset $A$ of $\{0,1,...,5^n\}$ with $4n+2$ elements. Prove that there exist three elements $a<b<c$ from $A$ such that $c+2a>3b$.

Proposed by Dominik Burek and Tomasz Ciesla, Poland
48 replies
VicKmath7
Jul 12, 2022
akliu
26 minutes ago
A property of divisors
rightways   10
N an hour ago by akliu
Source: Kazakhstan NMO 2016, P1
Prove that one can arrange all positive divisors of any given positive integer around a circle so that for any two neighboring numbers one is divisible by another.
10 replies
rightways
Mar 17, 2016
akliu
an hour ago
Famous geo configuration appears on the district MO
AndreiVila   3
N an hour ago by chirita.andrei
Source: Romanian District Olympiad 2025 10.4
Let $ABCDEF$ be a convex hexagon with $\angle A = \angle C=\angle E$ and $\angle B = \angle D=\angle F$.
[list=a]
[*] Prove that there is a unique point $P$ which is equidistant from sides $AB,CD$ and $EF$.
[*] If $G_1$ and $G_2$ are the centers of mass of $\triangle ACE$ and $\triangle BDF$, show that $\angle G_1PG_2=60^{\circ}$.
3 replies
AndreiVila
Mar 8, 2025
chirita.andrei
an hour ago
No more topics!
Guess the leader's binary string!
cjquines0   78
N Mar 30, 2025 by de-Kirschbaum
Source: 2016 IMO Shortlist C1
The leader of an IMO team chooses positive integers $n$ and $k$ with $n > k$, and announces them to the deputy leader and a contestant. The leader then secretly tells the deputy leader an $n$-digit binary string, and the deputy leader writes down all $n$-digit binary strings which differ from the leader’s in exactly $k$ positions. (For example, if $n = 3$ and $k = 1$, and if the leader chooses $101$, the deputy leader would write down $001, 111$ and $100$.) The contestant is allowed to look at the strings written by the deputy leader and guess the leader’s string. What is the minimum number of guesses (in terms of $n$ and $k$) needed to guarantee the correct answer?
78 replies
cjquines0
Jul 19, 2017
de-Kirschbaum
Mar 30, 2025
Guess the leader's binary string!
G H J
G H BBookmark kLocked kLocked NReply
Source: 2016 IMO Shortlist C1
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
eibc
598 posts
#68 • 2 Y
Y by Sagnik123Biswas, RaymondZhu
The answer is $2$ if $n = 2k$, and $1$ otherwise. Assume WLOG the leader is Titu, the deputy leader is Zuming, and the contestant is Po-Shen.

Let Titu's binary string be $S = \overline{b_1b_2\cdots b_n}$, where each of the $b_i$ equals $0$ or $1$. Then for each $1 \le i \le n$, $\tbinom{n - 1}{k}$ of Zuming's strings have their $i$th digit equal to $b_i$, and the other $\tbinom{n - 1}{k - 1}$ strings have their $i$th digit equal to $1 - b_i$. If $n \ne 2k$, so that $\tbinom{n - 1}{k} \ne \tbinom{n - 1}{k - 1}$, then Po-Shen will be able to deduce all of the digits of $s$ simply by looking at each position, so he needs $1$ guess.

Otherwise, Po-Shen will not be able to figure out the digits of Titu's string by simply looking at every position across all of Zuming's strings. Then I claim that in this case, there are $2$ possible strings. To prove this, let $s' \neq s$ be a string which produces the same $\tbinom{n}{k}$ strings from Zuming. Suppose that $s'$ differs from $s$ in $d > 0$ places.

If $d = k$, then $s'$ is written down by Zuming which is obviously not possible. If $d < k$, then consider all of Zuming's strings which differ from $s$ in the same $d$ places that $s$ does; then these differ from $d$ in at most $k - d$ places, which poses a contradiction.

If $d = n$, then in fact $s'$ will produce the same $\tbinom{n}{k}$ strings from Zuming (as the $k$ places which differed from $s$ for each string will now have the same digits as $s'$, and the $k$ places which were the same will now have different digits from $s'$). If $k < d < n$ then the same reasoning for when $ d < k$ works again. Hence there are $2$ possible strings that Titu could have written in this scenario (bitwise complements), 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.
ryanbear
1055 posts
#69
Y by
For each digit, the number of correct values is ${n-1 \choose k}$ and the number of incorrect values is ${n-1 \choose k-1}$. If $n=2k$, then they are equal. If $n>2k$, then there are more correct values. If $n<2k$, then there are more correct values. As a result, if $n \neq 2k$, then only $1$ guess is needed.
If $n=2k$, then note that if a binary string works, then the string with all its digits inverted also works. As a result, WLOG the last digit is $0$. Then, remove the last digit to everything. If the removed digit is $0$, then it becomes another problem but with $1$ less digit. If the removed digit is $1$, then it becomes another problem but with $1$ less digit and $1$ less swap. So there is $1$ possible value, but multiply by $2$ because the last digit could be $1$, so the answer is $2$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Sagnik123Biswas
419 posts
#70
Y by
If $n=2k$, then it takes $2$ moves. Otherwise $1$ move. We can recover each bit by making use of the fact that $\binom{n-1}{k} \neq \binom{n-1}{k-1}$ when $2k \neq n$. However when $n=2k$, the the produced list anyways has $2$ possible generators. So we do casework, and are able to get it in $2$ moves.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathLuis
1471 posts
#71
Y by
Note that we are given $\binom{n}{k}$ strings, consider one fixed position in each of them, by an easy counting we know that $\binom{n-1}{k}$ strings will have this digit in the right position and $\binom{n-1}{k-1}$ of them will have this digit changed, now if $n \ne 2k$ then since those two quantities are different we can easly differenciate them and thus re-construct the original string in only 1 guess. But if $n=2k$ then note that if we swap all the digits in the leader's binary string then after repeating the process we get that the deputy leader shares to the student the same list of binary strings as the string un-swapped, therefore, there is exactly 2 possible outcomes both correct from what the deputy leader gives to the student, and as a result the student is forced to make at least 2 guesses, now to achieve exactly 2 guesses just do the following, take all $k+1$ strings where the last $k-1$ digits remain fixed, and now we have two outcomes, one is assuming that those $k-1$ have all changed and that among the $k+1$ strings exactly one digit changes each time thus the student can guess one only string, on the other hand the student can assume that those $k-1$ digits never suffered a change and each time among those $k+1$ strings, $k$ strings change, giving a inverted string compared to your first choice, it is clear that by what we have seen, one of these two strings is correct so it takes at most 2 guesses.
Therefore the minimun for $n \ne 2k$ is 1 and for $n=2k$ is 2 thus we are done :cool:.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blueprimes
324 posts
#72
Y by
We claim the answer is $1$ for $n \ne 2k$ and $2$ when $n = 2k$.

$\textbf{Case 1: } n \ne 2k$
Note that among the $\binom{n}{k}$ strings, for each digit, it stays the same in $\binom{n - 1}{k}$ strings and toggles in $\binom{n - 1}{k - 1}$. Since $\binom{n - 1}{k} \ne \binom{n - 1}{k - 1}$, we can uniquely identify the digit in the original string by simply counting the number of instances of $0$s and $1$s. This yields $1$ as the minimum number of guesses.

$\textbf{Case 2: } n = 2k$
First we show that we cannot get the correct answer in $1$ guess. Let $s$ be the chosen $n$-digit binary string, and let $s'$ be the string $s$ when all of its digits are toggled. We claim that both $s$ and $s'$ yield the same list, say $\ell$, of altered strings. This is easy to see: Given any alteration of $k$ digits on $s$, a unique equivalent alteration exists for $s'$ by simply toggling the other $k$ digits.

We will now also show that $s$ and $s'$ are the only two strings that can generate this list $\ell$. By considering a constant binary vector shift, we can WLOG $s$ is the all-$0$ string and $s'$ is the all-$1$ string. But all strings in $\ell$ have precisely $k$ $0$s which is impossible to achieve with any other strings.

Now to show that we can get the correct answer in at most $2$ attempts, just generate the list over all strings and see what works. By our above claim, we get it in at most $2$ tries.

We are done!
This post has been edited 1 time. Last edited by blueprimes, Feb 18, 2025, 6:43 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ezpotd
1251 posts
#73
Y by
We claim the answer is $1$ if $n \neq 2k$ and $2$ otherwise.

Case if $n = 2k$: For every string, the string formed by inverting each bit is present in the set, so by symmetry we require at least $2$ attempts. To prove that $2$ attempts is sufficient, consider the first half of the string. For each subset of $i$ bits of the first half, there are $\binom ki \binom{k}{k - i}$ strings with these $i$ bits inverted. There are thus only two distinct strings that have a unique first half, one of which that has all of the first half inverted and one with none. Thus it suffices to take the first half of all the strings and only note the two strings that have no matches in the list. Out of these, one is the correct string with the first half inverted and the second is the correct string with the second half inverted. We do not know which one. Invert the first half of both of these, then one of them is the correct answer.

Case if $n \neq 2k$: For each bit, we can determine the inverted form appears $\binom{n - 1}{k - 1}$ times in the list and the correct form appears $\binom{n - 1}{k}$ times, and since these values are guaranteed to be distinct by $n \neq 2k$, we can uniquely determine each bit correctly on the first try.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
lpieleanu
2853 posts
#74
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.
eg4334
617 posts
#75
Y by
The answer is $\boxed{1, n \neq 2k}$ and $\boxed{2, n = 2k}$
If $n \neq 2k$, then for each index of the string the correct one appears $\binom{n-1}{k}$ and the incorrect one appears $\binom{n-1}{k-1}$. Therefore the correct one can always be deduced.
This argument fails however when $\binom{n-1}{k} = \binom{n-1}{k-1} \implies n = 2k$. In this case, clearly the string and its complement both work so we require two guesses. To achieve this, simply fix the first digit and use the same argument above on the rest of the string. For example consider $n=6, k=3$ with the string $101110$. If the first digit truly is $1$, then we know the first two digits are correct in $\binom{4}{3}$ ways but the first digit is correct and second digit incorrect in $\binom{4}{2}$ ways. Thus we can deduce the second digit and in a similar fashion the rest of the sting. The case where the first digit is incorrect gives the other case, so we are done.
This post has been edited 1 time. Last edited by eg4334, Dec 10, 2024, 1:33 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cursed_tangent1434
565 posts
#76
Y by
First notice that the $n^{th}$ digit will be flipped in $$\binom{n-1}{k-1}$$of the given binary strings. So unless $$\binom{n-1}{k-1} = \frac{\binom{n}{k}}{2}\implies n=2k$$Po-Shen can directly find what each digit must be and in find the correct string in 1 guess. Now, suppose $n=2k$. Notice half the binary strings given will end in 0 and the other half in 1. Now, consider the remaining $n-1$ digits of each binary string. Assume that the last digit was flipped and became $x \in {0,1}$. Then, of first $n-1$ digits in the $\frac{\binom{n}{k}}{2}$ strings ending with $x$, we will have $k-1$ digits being flipped, which is identical to the case when Titu selects $n-1$ and $k-1$ and since clearly $n-1 \neq \frac{k-1}{2}$ the first $n-1$ digits can be determined in 1 guess. Thus, Po-Shen has to guess the last digit (with two options) requiring 2 guesses in total to hit the right answer.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Eka01
204 posts
#77
Y by
Solved with a slight hint/being told that I was wrong.
Obviously the number of strings written by deputy leader are $\binom{n}{k}$. For a particular place, the number of strings where it has the correct digit is $\binom{n-1}{k}$ so if the number of places it is written incorrectly is not equal to the number of places it is written correctly, then the contestant can uniquely determine all the places without leaving anything to chance. A quick calculation shows that this happens iff $n \neq 2k$. If $n=2k$, then fix any digit, say the foremost one, then if we fixed the correct digit, then we can instead view the case as being given a string of length $n-1$ and all the strings varying from this in $\frac{n}{2}$ places. Otherwise, we can view it as being given a string of length $n-1$ varying in $\frac{n-2}{2}$ places. In each of these cases, the contestant needs just one attempt, hence $2$ guesses are sufficient for the $n=2k$ case.
This post has been edited 1 time. Last edited by Eka01, Dec 28, 2024, 7:44 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
smileapple
1010 posts
#78
Y by
If $n\neq 2k$, then $1$ guess suffices. Specifically, Po-Shen can look at the $i$th bit across all $\binom{n}k$ strings written down. The original bit will appear $\binom{n-1}k$ times and the flipped bit will appear $\binom{n-1}{k-1}\neq\binom{n-1}k$ times as $n\neq 2k$. Hence Po-Shen can extract the $i$th bit of the original string for all $i$ and obtain the correct answer.

If $n=2k$, then $2$ guesses is the minimum. Note that $2$ guesses are necessary as both Titu's original string and its complement, with all bits flipped, fit Zuming's description. On the other hand, if the first bit is determined, then Po-Shen can reduce the situation to one with $n'=2k-1$ by considering only the $\binom{n-1}k$ matching strings and throwing away the rest, extracting the other $n-1$ bits. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
NTguy
23 posts
#79 • 1 Y
Y by alexanderhamilton124
Very cool problem, there are $\binom{n}{k}$ total strings, and in $\binom{n-1}{k-1}$ of them, a particular digit will have been changed. So, for each digit we need to count the number of strings where it is $0$ and $1$. Whichever of $0$ and $1$ comes $\binom{n}{k} - \binom{n-1}{k-1}$ times is the correct digit. The only problem arises when $\binom{n}{k} = 2\cdot \binom{n-1}{k-1}$ which is true iff $n=2k$. For this case, first assume the first digit in the leader's string is $1$. Then, in the $\binom{n-1}{k-1}$ strings which have $0$ as the first digit, we know that the first digit has changed, leaving an $n-1$ digit number with $k-1$ digits changed. This is the same as the case of $n \neq 2k$. So, from this we can deduce the entire string and guess it. If it is wrong, we know that the first digit is $0$, and repeat this process. So, for $n=2k$ we require $2$ guesses and for $n \neq 2k$ we require only $1$ guess.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
alexanderhamilton124
383 posts
#80 • 1 Y
Y by L13832
For $n$ odd, and for $n$ even and $k \neq \frac{n}{2}$, the answer is $1$. Consider any digit place. The right digit occurs $\binom{n - 1}{k}$ times in this place, and the wrong one appears $\binom{n - 1}{k - 1}$. These two are clearly not equal for this case, so the contestant simply picks the one that apears $\binom{n - 1}{k}$ times for each digit, which gives us one guess.

For $n = 2k$, we can't do it in one guess. This is because if the leader gives the string which is different from this string in all places, we get the same set of strings. We now prove we can do it in two guesses. Randomly pick the first digit. Consider a digit place. The right digit will appear $\binom{n - 2}{k}$ times and the wrong one will appear $\binom{n - 2}{k - 1}$ times (even if the first digit is wrong, the digits in this place will have the same number of occurrences in the reverse order). These two aren't equal since $n - 2$ is even, so pick the one that appears $\binom{n - 2}{k}$ times for each digit place. Give this as the answer. If it's wrong, that means we picked the first digit wrong and then simply do this with the second digit.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Maximilian113
521 posts
#81
Y by
Note that swapping $k$ with $n-k$ and vice versa yield equivalent cases, so WLOG assume that $k \leq \frac{n}{2}.$

If $n \neq 2k,$ we have $2k < n.$ Therefore there are multiple pairs of strings that differ at $2k$ places, those places must be where a bit flipped. Therefore in the other positions the bits must not have changed, therefore we can determine them. And, since we have all $\binom{n}{k}$ strings it follows that we can use this method to uniquely determine the original string, so $\boxed{1}$ guess.

If $n = 2k,$ we can look at pairs of strings that differ by $n-2$ places. Then, for the other $2$ places, one of them must have been changed twice, while the other one has to have been original. Therefore if we fix the first digit, taking all pairs of such strings and analyzing the pairs of unchanged bits allows us to determine the string. Hence we have at most $\boxed{2}$ possibilites as there were $2$ possibilites for the first digit.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
de-Kirschbaum
187 posts
#82
Y by
We claim that the contestant can guess it in $1$ if $k \neq \frac{n}{2}$ and $2$ if $k=\frac{n}{2}$.

If $k \neq \frac{n}{2}$ then we know that each digit will be flipped $\binom{n-1}{k-1}$ times and be correct $\binom{n}{k}-\binom{n-1}{k-1}=\binom{n-1}{n-k-1} \neq \binom{n-1}{k-1}$ times. Thus at each digit the contestant can look at all of the binary strings written and pick the digit that appears $\binom{n-1}{n-k-1}$ times and that gives them the correct bit.

If $k=\frac{n}{2}$ then we know that $\binom{n-1}{n-k-1}=\binom{n-1}{k-1}$ so the contestant can no longer pick the correct digit just by looking at the number of times they appear. However, the contestant can guess the first bit to be $1$ or $0$ (unflipped) and then assume the rest of the $n-1$ bits are flipped in $\frac{n}{2}$ places, then following the strategy in the previous case the contestant can guess a number according to that. If the first bit was guessed correctly, then the contestant will recover the original string following this method because then obviously all the flips must happen in the $n-1$ bits. If the first bit was guessed incorrectly, the contestant will recover the complement of the original string, but either way since the first bit is either $1$ or $0$ it takes two guesses to guarantee the original string.
Z K Y
N Quick Reply
G
H
=
a