Given 365 cards, in which distinct numbers are written. We may ask for any three cards, the order of numbers written in them. Is it always possible to find out the order of all 365 cards by 2000 such questions?
Problem
Source: ARO 2005 - problem 9.4
Tags: induction, ceiling function, search, combinatorics unsolved, combinatorics
17.05.2005 10:36
Suppose I already know the order of i cards, where 3^(k-1)=<i<3^k. I find the number of questions needed to know the position of an (i+1)th card relative to the i cards. If k=1, then it takes only 1 question. Suppose that it takes m questions where k=m. Then for k=m+1, I use one question in this way: I pick two cards so that there are at most (3^m)-1 cards less than the smaller of the chosen cards, between the two chosen cards, and more than the larger chosen card. I can do this since I have at most 3^(m+1)-1 cards. Then I pick the extra card. Now I will know which group that card belongs to, and it will take m further question to determine its exact location relative to the rest of the cards. So, by induction, it will take k more questions to add one more card to our knowledge of relative positions. Then it will take 1+(2*3)*2+(2*3^2)*3+(2*3^3)*4+(2*3^4)*5+123*6=1831 questions to determine the relative order of the 365 cards. Which is what we want. Is this correct?
27.08.2009 22:53
The same problem with $ 400$ cards and $ 2035$ questions was Argentina IMO TST 2006 problem 2
04.04.2012 16:23
yes it is always posible.suppose that $f(n)$ be the least number of questions that required for find orders of $n+1$ number such that we know order of $n$ of them,$g(n)$ be the minimum number of such questions that require for finding order of $n$ number,so it is obvious that $g(n+1)\leq g(n)+f(n)$. now prove that $f(n)=f(\left \lceil \frac{n-2}{3} \right \rceil)+1$ and then we find that $g(365)\leq 1828$ and the desired result.
11.12.2014 01:12
I think my proof is different from the ones above, it's kind of like a triple merge sort from computer science. hopefully I didn't make some silly mistake. Suppose we have $3n$ cards. We divide the cards into $3$ groups and sort each of them independently, so that we obtain one group $a_1<a_2...<a_n$, another $b_1<b_2...<b_n$ and the last group $c_1<c_2...<c_n$. So I ask a question about $a_1,b_1,c_1$, and whichever is the smallest must be the smallest in the entire list, WLOG $a_1$, then I ask a question about $a_2,b_1,c_1$ so whichever is the smallest out of these will be the next smallest in the entire list, and I can keep adding $1$ element in order, and with $3n-2$ questions the entire list will be in order (since for the last $3$ I add them all at once). Now just keep applying the above strategy and you get the recursion $f(3n)=3f(n)+3n-2$ I'm too lazy to count for $365$, but counting for $405$ isn't too hard so I just did that and you need to know that for $5$ cards you can do it in $4$ questions (the strategy is not hard) For $405$ it would take $403 + 3(133) + 9(43) + 27(13) + 81 (4) = 1864$, and so for $365$ we can do it in less than $2000$ questions for sure. Edit: I manned up and did the calculation for $365$, it gives $1655$ questions, now its just a question of whether or not my proof is right. I should also mention the proof by Yossarian is essentially like a binary search but ternary, so I guess both strategies come from computer science.
13.04.2019 21:29
Pedram-Safaei wrote: yes it is always posible.suppose that $f(n)$ be the least number of questions that required for find orders of $n+1$ number such that we know order of $n$ of them,$g(n)$ be the minimum number of such questions that require for finding order of $n$ number,so it is obvious that $g(n+1)\leq g(n)+f(n)$. now prove that $f(n)=f(\left \lceil \frac{n-2}{3} \right \rceil)+1$ and then we find that $g(365)\leq 1828$ and the desired result. How do you prove that?