add APMO segmentation script and solution data for 2002 and 2003
Browse files
APMO/segment_script/segment_02_03.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import re
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
from tqdm import tqdm
|
| 6 |
+
from loguru import logger
|
| 7 |
+
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
from typing import Tuple, List
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
project_root = Path(__file__).parent.parent.parent
|
| 13 |
+
|
| 14 |
+
problem_tag = 'Problem'
|
| 15 |
+
solution_tag = 'Solution'
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def analyze(text: str) -> Tuple[List, int]:
|
| 19 |
+
"""
|
| 20 |
+
Analyze the text and return the tags and problem number.
|
| 21 |
+
|
| 22 |
+
Args:
|
| 23 |
+
text (str): The markdown text to analyze.
|
| 24 |
+
|
| 25 |
+
Returns:
|
| 26 |
+
Tuple[List, int]: A tuple containing the tags and problem number.
|
| 27 |
+
"""
|
| 28 |
+
problem_pattern = re.compile(r'\n(\d+)\.\s+', re.IGNORECASE)
|
| 29 |
+
solution_pattern = re.compile(r'(?:\n|# )Solution(?:\s+(\d*)\.?|\.|\n)', re.IGNORECASE)
|
| 30 |
+
|
| 31 |
+
tags = []
|
| 32 |
+
tags.extend([(x, problem_tag) for x in problem_pattern.finditer(text)])
|
| 33 |
+
problem_num = len(tags)
|
| 34 |
+
|
| 35 |
+
tags.extend([(x, solution_tag) for x in solution_pattern.finditer(text)])
|
| 36 |
+
tags.sort(key=lambda x: x[0].start())
|
| 37 |
+
return tags, problem_num
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def segment(text: str, tags):
|
| 41 |
+
starts = []
|
| 42 |
+
ends = []
|
| 43 |
+
|
| 44 |
+
for i in range(len(tags)):
|
| 45 |
+
starts.append(tags[i][0].end())
|
| 46 |
+
if i + 1 < len(tags):
|
| 47 |
+
ends.append(tags[i + 1][0].start())
|
| 48 |
+
else:
|
| 49 |
+
ends.append(len(text))
|
| 50 |
+
|
| 51 |
+
return [text[start:end].strip().strip('#').strip() for start, end in zip(starts, ends)]
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def join(tags, segments):
|
| 55 |
+
problem, solution = '', ''
|
| 56 |
+
problem_label, problem_match, solution_match = '', '', ''
|
| 57 |
+
pairs = []
|
| 58 |
+
|
| 59 |
+
for tag, segment in zip(tags, segments):
|
| 60 |
+
if tag[1] == problem_tag:
|
| 61 |
+
problem = segment
|
| 62 |
+
problem_match = tag[0].group(0)
|
| 63 |
+
problem_label = tag[0].group(1)
|
| 64 |
+
else:
|
| 65 |
+
solution = segment
|
| 66 |
+
solution_match = tag[0].group(0)
|
| 67 |
+
pairs.append((problem, solution, problem_label, problem_match, solution_match))
|
| 68 |
+
|
| 69 |
+
return pairs
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def write_pairs(output_file: Path, pairs):
|
| 73 |
+
year = re.search(r'(\d{4})', output_file.stem).group(1)
|
| 74 |
+
|
| 75 |
+
output_jsonl_text = ""
|
| 76 |
+
for problem, solution, problem_label, problem_match, solution_match in pairs:
|
| 77 |
+
output_jsonl_text += json.dumps(
|
| 78 |
+
{
|
| 79 |
+
'year': year,
|
| 80 |
+
'tier': "T1",
|
| 81 |
+
'problem_label': problem_label,
|
| 82 |
+
'problem_type': None,
|
| 83 |
+
'problem': problem,
|
| 84 |
+
'solution': solution,
|
| 85 |
+
'metadata': {
|
| 86 |
+
'resource_path': output_file.relative_to(project_root).as_posix(),
|
| 87 |
+
'problem_match': problem_match,
|
| 88 |
+
'solution_match': solution_match
|
| 89 |
+
}
|
| 90 |
+
},
|
| 91 |
+
ensure_ascii=False
|
| 92 |
+
) + '\n'
|
| 93 |
+
|
| 94 |
+
output_file.write_text(output_jsonl_text, encoding="utf-8")
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def main():
|
| 98 |
+
compet_base_path = Path(__file__).resolve().parent.parent
|
| 99 |
+
compet_md_path = compet_base_path / "md"
|
| 100 |
+
seg_output_path = compet_base_path / "segmented"
|
| 101 |
+
|
| 102 |
+
total_problem_count = 0
|
| 103 |
+
total_solution_count = 0
|
| 104 |
+
|
| 105 |
+
for apmo_md in tqdm(list(compet_md_path.glob('**/*.md')), desc='Segmenting'):
|
| 106 |
+
if not("2002" in apmo_md.stem or "2003" in apmo_md.stem):
|
| 107 |
+
continue
|
| 108 |
+
|
| 109 |
+
output_file = seg_output_path / apmo_md.relative_to(compet_md_path).with_suffix('.jsonl')
|
| 110 |
+
output_file.parent.mkdir(parents=True, exist_ok=True)
|
| 111 |
+
|
| 112 |
+
text = '\n' + apmo_md.read_text(encoding="utf-8")
|
| 113 |
+
|
| 114 |
+
tags, problem_num = analyze(text)
|
| 115 |
+
|
| 116 |
+
segments = segment(text, tags)
|
| 117 |
+
pairs = join(tags, segments)
|
| 118 |
+
if pairs and problem_num > 0:
|
| 119 |
+
write_pairs(output_file, pairs)
|
| 120 |
+
|
| 121 |
+
total_problem_count += problem_num
|
| 122 |
+
total_solution_count += len(pairs)
|
| 123 |
+
else:
|
| 124 |
+
logger.warning(f"No problem found in {apmo_md}")
|
| 125 |
+
|
| 126 |
+
logger.info(f"Total problem count: {total_problem_count}")
|
| 127 |
+
logger.info(f"Total solution count: {total_solution_count}")
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
if __name__ == '__main__':
|
| 131 |
+
main()
|
APMO/segmented/en-apmo2002_sol.jsonl
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"year": "2002", "tier": "T1", "problem_label": "1", "problem_type": null, "problem": "Let $a_{1}, a_{2}, a_{3}, \\ldots, a_{n}$ be a sequence of non-negative integers, where $n$ is a positive integer.\n\nLet\n\n$$\nA_{n}=\\frac{a_{1}+a_{2}+\\cdots+a_{n}}{n}\n$$\n\nProve that\n\n$$\na_{1}!a_{2}!\\ldots a_{n}!\\geq\\left(\\left\\lfloor A_{n}\\right\\rfloor!\\right)^{n}\n$$\n\nwhere $\\left\\lfloor A_{n}\\right\\rfloor$ is the greatest integer less than or equal to $A_{n}$, and $a!=1 \\times 2 \\times \\cdots \\times a$ for $a \\geq 1$ (and $0!=1$ ). When does equality hold?", "solution": "Assume without loss of generality that $a_{1} \\geq a_{2} \\geq \\cdots \\geq a_{n} \\geq 0$, and let $s=\\left\\lfloor A_{n}\\right\\rfloor$. Let $k$ be any (fixed) index for which $a_{k} \\geq s \\geq a_{k+1}$.\n\nOur inequality is equivalent to proving that\n\n$$\n\\frac{a_{1}!}{s!} \\cdot \\frac{a_{2}!}{s!} \\cdot \\ldots \\cdot \\frac{a_{k}!}{s!} \\geq \\frac{s!}{a_{k+1}!} \\cdot \\frac{s!}{a_{k+2}!} \\cdot \\ldots \\cdot \\frac{s!}{a_{n}!}\n$$\n\nNow for $i=1,2, \\ldots, k, a_{i}!/ s!$ is the product of $a_{i}-s$ factors. For example, 9!/5! $=9 \\cdot 8 \\cdot 7 \\cdot 6$. The left side of inequality (1) therefore is the product of $A=a_{1}+a_{2}+\\cdots+a_{k}-k s$ factors, all of which are greater than $s$. Similarly, the right side of (1) is the product of $B=(n-k) s-$ $\\left(a_{k+1}+a_{k+2}+\\cdots+a_{n}\\right)$ factors, all of which are at most $s$. Since $\\sum_{i=1}^{n} a_{i}=n A_{n} \\geq n s, A \\geq B$. This proves the inequality. [ 5 marks to here.]\n\nEquality in (1) holds if and only if either:\n(i) $A=B=0$, that is, both sides of (1) are the empty product, which occurs if and only if $a_{1}=a_{2}=\\cdots=a_{n}$; or\n(ii) $a_{1}=1$ and $s=0$, that is, the only factors on either side of (1) are 1 's, which occurs if and only if $a_{i} \\in\\{0,1\\}$ for all $i$. [2 marks for both (i) and (ii), no marks for (i) only.]", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n1. ", "solution_match": "# Solution 1."}}
|
| 2 |
+
{"year": "2002", "tier": "T1", "problem_label": "1", "problem_type": null, "problem": "Let $a_{1}, a_{2}, a_{3}, \\ldots, a_{n}$ be a sequence of non-negative integers, where $n$ is a positive integer.\n\nLet\n\n$$\nA_{n}=\\frac{a_{1}+a_{2}+\\cdots+a_{n}}{n}\n$$\n\nProve that\n\n$$\na_{1}!a_{2}!\\ldots a_{n}!\\geq\\left(\\left\\lfloor A_{n}\\right\\rfloor!\\right)^{n}\n$$\n\nwhere $\\left\\lfloor A_{n}\\right\\rfloor$ is the greatest integer less than or equal to $A_{n}$, and $a!=1 \\times 2 \\times \\cdots \\times a$ for $a \\geq 1$ (and $0!=1$ ). When does equality hold?", "solution": "Assume without loss of generality that $0 \\leq a_{1} \\leq a_{2} \\leq \\cdots \\leq a_{n}$. Let $d=a_{n}-a_{1}$ and $m=\\left|\\left\\{i: a_{i}=a_{1}\\right\\}\\right|$. Our proof is by induction on $d$.\n\nWe first do the case $d=a_{n}-a_{1}=0$ or 1 separately. Then $a_{1}=a_{2}=\\cdots=a_{m}=a$ and $a_{m+1}=\\cdots=a_{n}=a+1$ for some $1 \\leq m \\leq n$ and $a \\geq 0$. In this case we have $\\left\\lfloor A_{n}\\right\\rfloor=a$, so the inequality to be proven is just $a_{1}!a_{2}!\\ldots a_{n}!\\geq(a!)^{n}$, which is obvious. Equality holds if and only if either $m=n$, that is, $a_{1}=a_{2}=\\cdots=a_{n}=a$; or if $a=0$, that is, $a_{1}=\\cdots=a_{m}=0$ and $a_{m+1}=\\cdots=a_{n}=1$. [ 2 marks to here.]\n\nSo assume that $d=a_{n}-a_{1} \\geq 2$ and that the inequality holds for all sequences with smaller values of $d$, or with the same value of $d$ and smaller values of $m$. Then the sequence\n\n$$\na_{1}+1, a_{2}, a_{3}, \\ldots, a_{n-1}, a_{n}-1\n$$\n\nthough not necessarily in non-decreasing order any more, does have either a smaller value of $d$, or the same value of $d$ and a smaller value of $m$, but in any case has the same value of $A_{n}$. Thus, by induction and since $a_{n}>a_{1}+1$,\n\n$$\n\\begin{aligned}\na_{1}!a_{2}!\\ldots a_{n}! & =\\left(a_{1}+1\\right)!a_{2}!\\ldots a_{n-1}!\\left(a_{n}-1\\right)!\\cdot \\frac{a_{n}}{a_{1}+1} \\\\\n& \\geq\\left(\\left\\lfloor A_{n}\\right\\rfloor!\\right)^{n} \\cdot \\frac{a_{n}}{a_{1}+1} \\\\\n& >\\left(\\left\\lfloor A_{n}\\right\\rfloor!\\right)^{n}\n\\end{aligned}\n$$\n\nwhich completes the proof. Equality cannot hold in this case.", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n1. ", "solution_match": "\nSolution 2."}}
|
| 3 |
+
{"year": "2002", "tier": "T1", "problem_label": "2", "problem_type": null, "problem": "Find all positive integers $a$ and $b$ such that\n\n$$\n\\frac{a^{2}+b}{b^{2}-a} \\text { and } \\frac{b^{2}+a}{a^{2}-b}\n$$\n\nare both integers.", "solution": "By the symmetry of the problem, we may suppose that $a \\leq b$. Notice that $b^{2}-a \\geq 0$, so that if $\\frac{a^{2}+b}{b^{2}-a}$ is a positive integer, then $a^{2}+b \\geq b^{2}-a$. Rearranging this inequality and factorizing, we find that $(a+b)(a-b+1) \\geq 0$. Since $a, b>0$, we must have $a \\geq b-1$. [3 marks to here.] We therefore have two cases:\n\nCase 1: $a=b$. Substituting, we have\n\n$$\n\\frac{a^{2}+a}{a^{2}-a}=\\frac{a+1}{a-1}=1+\\frac{2}{a-1},\n$$\n\nwhich is an integer if and only if $(a-1) \\mid 2$. As $a>0$, the only possible values are $a-1=1$ or 2. Hence, $(a, b)=(2,2)$ or $(3,3)$. [1 mark.]\n\nCase 2: $a=b-1$. Substituting, we have\n\n$$\n\\frac{b^{2}+a}{a^{2}-b}=\\frac{(a+1)^{2}+a}{a^{2}-(a+1)}=\\frac{a^{2}+3 a+1}{a^{2}-a-1}=1+\\frac{4 a+2}{a^{2}-a-1} .\n$$\n\nOnce again, notice that $4 a+2>0$, and hence, for $\\frac{4 a+2}{a^{2}-a-1}$ to be an integer, we must have $4 a+2 \\geq a^{2}-a-1$, that is, $a^{2}-5 a-3 \\leq 0$. Hence, since $a$ is an integer, we can bound $a$ by $1 \\leq \\bar{a} \\leq 5$. Checking all the ordered pairs $(a, b)=(1,2),(2,3), \\ldots,(5,6)$, we find that only $(1,2)$ and $(2,3)$ satisfy the given conditions. [3 marks.]\n\nThus, the ordered pairs that work are\n\n$$\n(2,2),(3,3),(1,2),(2,3),(2,1),(3,2)\n$$\n\nwhere the last two pairs follow by symmetry. [2 marks if these solutions are found without proof that there are no others.]", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n2. ", "solution_match": "\nSolution."}}
|
| 4 |
+
{"year": "2002", "tier": "T1", "problem_label": "3", "problem_type": null, "problem": "Let $A B C$ be an equilateral triangle. Let $P$ be a point on the side $A C$ and $Q$ be a point on the side $A B$ so that both triangles $A B P$ and $A C Q$ are acute. Let $R$ be the orthocentre of triangle $A B P$ and $S$ be the orthocentre of triangle $A C Q$. Let $T$ be the point common to the segments $B P$ and $C Q$. Find all possible values of $\\angle C B P$ and $\\angle B C Q$ such that triangle $T R S$ is equilateral.", "solution": "We are going to show that this can only happen when\n\n$$\n\\angle C B P=\\angle B C Q=15^{\\circ} .\n$$\n\nLemma. If $\\angle C B P>\\angle B C Q$, then $R T>S T$.\nProof. Let $A D, B E$ and $C F$ be the altitudes of triangle $A B C$ concurrent at its centre $G$. Then $P$ lies on $C E, Q$ lies on $B F$, and thus $T$ lies in triangle $B D G$.\n\n\nNote that -\n\n$$\n\\angle F A S=\\angle F C Q=30^{\\circ}-\\angle B C Q>30^{\\circ}-\\angle C B P=\\angle E B P=\\angle E A R\n$$\n\nSince $A F=A E$, we have $F S>E R$ so that\n\n$$\nG S=G F-F S<G E-E R=G R .\n$$\n\nLet $T_{x}$ be the projection of $T$ onto $B C$ and $T_{y}$ be the projection of $T$ onto $A D$, and similarly for $R$ and $S$. We have\n\n$$\nR_{x} T_{x}=D R_{x}+D T_{x}>\\left|D S_{x}-D T_{x}\\right|=S_{x} T_{x}\n$$\n\nand\n\n$$\nR_{y} T_{y}=G R_{y}+G T_{y}>G S_{y}+G T_{y}=S_{y} T_{y}\n$$\n\nIt follows that $R T>S T$.\n[1 mark for stating the Lemma, 3 marks for proving it.]\nThus, if $\\triangle T R S$ is equilateral, we must have $\\angle C B P=\\angle B C Q$.\n\n\nIt is clear from the symmetry of the figure that $T R=T S$, so $\\triangle T R S$ is equilateral if and only if $\\angle R T A=30^{\\circ}$. Now, as $B R$ is an altitude of the triangle $A B C, \\angle R B A=30^{\\circ}$. So $\\triangle T R S$ is equilateral if and only if $R T B A$ is a cyclic quadrilateral. Therefore, $\\triangle T R S$ is equilateral if and only if $\\angle T B R=\\angle T A R$. But\n\n$$\n\\begin{aligned}\n90^{\\circ} & =\\angle T B A+\\angle B A R \\\\\n& =(\\angle T B R+\\angle R B A)+(\\angle B A T+\\angle T A R) \\\\\n& =\\left(\\angle T B R+30^{\\circ}\\right)+\\left(30^{\\circ}+\\angle T A R\\right)\n\\end{aligned}\n$$\n\nand so\n\n$$\n30^{\\circ}=\\angle T A R+\\angle T B R\n$$\n\nBut these angles must be equal, so $\\angle T A R=\\angle T B R=15^{\\circ}$. Therefore $\\angle C B P=\\angle B C Q=15^{\\circ}$. [3 marks for finishing the proof with the assumption that $\\angle C B P=\\angle B C Q$.]", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n3. ", "solution_match": "# Solution."}}
|
| 5 |
+
{"year": "2002", "tier": "T1", "problem_label": "4", "problem_type": null, "problem": "Let $x, y, z$ be positive numbers such that\n\n$$\n\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}=1\n$$\n\nShow that\n\n$$\n\\sqrt{x+y z}+\\sqrt{y+z x}+\\sqrt{z+x y} \\geq \\sqrt{x y z}+\\sqrt{x}+\\sqrt{y}+\\sqrt{z}\n$$", "solution": "$$\n\\begin{aligned}\n\\sum_{\\text {cyclic }} \\sqrt{x+y z} & =\\sqrt{x y z} \\sum_{\\text {cyclic }} \\sqrt{\\frac{1}{x}+\\frac{1}{y z}} \\\\\n& =\\sqrt{x y z} \\sum_{\\text {cyclic }} \\sqrt{\\frac{1}{x}\\left(\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}\\right)+\\frac{1}{y z}} \\quad[1 \\text { mark. }] \\\\\n& =\\sqrt{x y z} \\sum_{\\text {cyclic }} \\sqrt{\\left(\\frac{1}{x}+\\frac{1}{y}\\right)\\left(\\frac{1}{x}+\\frac{1}{z}\\right)} \\quad[1 \\text { mark.] }\n\\end{aligned}\n$$\n\n$$\n\\begin{aligned}\n& =\\sqrt{x y z} \\sum_{\\text {cyclic }} \\sqrt{\\left(\\frac{1}{x}+\\frac{1}{\\sqrt{y z}}\\right)^{2}+\\frac{(\\sqrt{y}-\\sqrt{z})^{2}}{x y z}} \\quad[2 \\text { marks. }] \\\\\n& \\geq \\sqrt{x y z} \\sum_{\\text {cyclic }}\\left(\\frac{1}{x}+\\frac{1}{\\sqrt{y z}}\\right) \\quad[1 \\text { mark. }] \\\\\n& =\\sqrt{x y z}\\left(1+\\sum_{\\text {cyclic }} \\frac{1}{\\sqrt{y z}}\\right) \\quad[1 \\text { mark. }] \\\\\n& =\\sqrt{x y z}+\\sum_{\\text {cyclic }} \\sqrt{x} \\quad[1 \\text { mark. }]\n\\end{aligned}\n$$\n\nNote. It is easy to check that equality holds if and only if $x=y=z=3$.", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n4. ", "solution_match": "\nSolution 1."}}
|
| 6 |
+
{"year": "2002", "tier": "T1", "problem_label": "4", "problem_type": null, "problem": "Let $x, y, z$ be positive numbers such that\n\n$$\n\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}=1\n$$\n\nShow that\n\n$$\n\\sqrt{x+y z}+\\sqrt{y+z x}+\\sqrt{z+x y} \\geq \\sqrt{x y z}+\\sqrt{x}+\\sqrt{y}+\\sqrt{z}\n$$", "solution": "Squaring both sides of the given inequality, we obtain\n\n$$\n\\begin{aligned}\n& \\sum_{\\text {cyclic }} x+\\sum_{\\text {cyclic }} y z+2 \\sum_{\\text {cyclic }} \\sqrt{x+y z} \\sqrt{y+z x} \\\\\n& \\quad \\geq x y z+2 \\sqrt{x y z} \\sum_{\\text {cyclic }} \\sqrt{x}+\\sum_{\\text {cyclic }} x+2 \\sum_{\\text {cyclic }} \\sqrt{x y} \\quad \\text { [1 mark.] }\n\\end{aligned}\n$$\n\nIt follows from the given condition $\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}=1$ that $x y z=\\sum_{\\text {cyclic }} x y$. Therefore, the given inequality is equivalent to\n\n$$\n\\sum_{\\text {cyclic }} \\sqrt{x+y z} \\sqrt{y+z x} \\geq \\sqrt{x y z} \\sum_{\\text {cyclic }} \\sqrt{x}+\\sum_{\\text {cyclic }} \\sqrt{x y} . \\quad[2 \\text { marks.] }\n$$\n\nUsing the Cauchy-Schwarz inequality [or just $x^{2}+y^{2} \\geq 2 x y$ ], we see that\n\n$$\n(x+y z)(y+z x) \\geq\\left(\\sqrt{x y}+\\sqrt{x y z^{2}}\\right)^{2}, \\quad[1 \\text { mark. }]\n$$\n\nor\n\n$$\n\\sqrt{x+y z} \\sqrt{y+z x} \\geq \\sqrt{x y}+\\sqrt{z} \\sqrt{x y z} . \\quad[1 \\text { mark. }]\n$$\n\nTaking the cyclic sum of this inequality over $x, y$ and $z$, we get the desired inequality. [2 marks.]", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n4. ", "solution_match": "\nSolution 2."}}
|
| 7 |
+
{"year": "2002", "tier": "T1", "problem_label": "4", "problem_type": null, "problem": "Let $x, y, z$ be positive numbers such that\n\n$$\n\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}=1\n$$\n\nShow that\n\n$$\n\\sqrt{x+y z}+\\sqrt{y+z x}+\\sqrt{z+x y} \\geq \\sqrt{x y z}+\\sqrt{x}+\\sqrt{y}+\\sqrt{z}\n$$", "solution": "This is another way of presenting the idea in the first solution.\nUsing the condition $\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}=1$ and the AM-GM inequality, we have\n\n$$\n\\begin{aligned}\nx+y z-\\left(\\sqrt{\\frac{y z}{x}}+\\sqrt{x}\\right)^{2} & =y z\\left(1-\\frac{1}{x}\\right)-2 \\sqrt{y z} \\\\\n& =y z\\left(\\frac{1}{y}+\\frac{1}{z}\\right)-2 \\sqrt{y z}=y+z-2 \\sqrt{y z} \\geq 0\n\\end{aligned}\n$$\n\nwhich gives\n\n$$\n\\sqrt{x+y z} \\geq \\sqrt{\\frac{y z}{x}}+\\sqrt{x} . \\quad[3 \\text { marks. }]\n$$\n\nSimilarly, we have\n\n$$\n\\sqrt{y+z x} \\geq \\sqrt{\\frac{z x}{y}}+\\sqrt{y} \\text { and } \\sqrt{z+x y} \\geq \\sqrt{\\frac{x y}{z}}+\\sqrt{z}\n$$\n\nAddition yields\n\n$$\n\\sqrt{x+y z}+\\sqrt{y+z x}+\\sqrt{z+x y} \\geq \\sqrt{\\frac{y z}{x}}+\\sqrt{\\frac{z x}{y}}+\\sqrt{\\frac{x y}{z}}+\\sqrt{x}+\\sqrt{y}+\\sqrt{z}\n$$\n\n[2 marks.] Using the condition $\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}=1$ again, we have\n\n$$\n\\sqrt{\\frac{y z}{x}}+\\sqrt{\\frac{z x}{y}}+\\sqrt{\\frac{x y}{z}}=\\sqrt{x y z}\\left(\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}\\right)=\\sqrt{x y z}, \\quad[1 \\text { mark. }]\n$$\n\nand thus\n\n$$\n\\sqrt{x+y z}+\\sqrt{y+z x}+\\sqrt{z+x y} \\geq \\sqrt{x y z}+\\sqrt{x}+\\sqrt{y}+\\sqrt{z} . \\quad[1 \\text { mark. }]\n$$", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n4. ", "solution_match": "\nSolution 3."}}
|
| 8 |
+
{"year": "2002", "tier": "T1", "problem_label": "4", "problem_type": null, "problem": "Let $x, y, z$ be positive numbers such that\n\n$$\n\\frac{1}{x}+\\frac{1}{y}+\\frac{1}{z}=1\n$$\n\nShow that\n\n$$\n\\sqrt{x+y z}+\\sqrt{y+z x}+\\sqrt{z+x y} \\geq \\sqrt{x y z}+\\sqrt{x}+\\sqrt{y}+\\sqrt{z}\n$$", "solution": "This is also another way of presenting the idea in the first solution.\nWe make the substitution $a=\\frac{1}{x}, b=\\frac{1}{y}, c=\\frac{1}{z}$. Then it is enough to show that\n\n$$\n\\sqrt{\\frac{1}{a}+\\frac{1}{b c}}+\\sqrt{\\frac{1}{b}+\\frac{1}{c a}}+\\sqrt{\\frac{1}{c}+\\frac{1}{a b}} \\geq \\sqrt{\\frac{1}{a b c}}+\\sqrt{\\frac{1}{a}}+\\sqrt{\\frac{1}{b}}+\\sqrt{\\frac{1}{c}},\n$$\n\nwhere $a+b+c=1$. Multiplying this inequality by $\\sqrt{a b c}$, we find that it can be written\n\n$$\n\\sqrt{a+b c}+\\sqrt{b+c a}+\\sqrt{c+a b} \\geq 1+\\sqrt{b c}+\\sqrt{c a}+\\sqrt{a b} . \\quad[1 \\text { mark. }]\n$$\n\nThis is equivalent to\n\n$$\n\\begin{aligned}\n& \\sqrt{a(a+b+c)+b c}+\\sqrt{b(a+b+c)+c a}+\\sqrt{c(a+b+c)+a b} \\\\\n& \\geq a+b+c+\\sqrt{b c}+\\sqrt{c a}+\\sqrt{a b}, \\quad[1 \\text { mark. }]\n\\end{aligned}\n$$\n\nwhich in turn is equivalent to\n\n$$\n\\sqrt{(a+b)(a+c)}+\\sqrt{(b+c)(b+a)}+\\sqrt{(c+a)(c+b)} \\geq a+b+c+\\sqrt{b c}+\\sqrt{c a}+\\sqrt{a b}\n$$\n\n[1 mark.] (This is a homogeneous version of the original inequality.) By the Cauchy-Schwarz inequality (or since $b+c \\geq 2 \\sqrt{b c}$ ), we have\n\n$$\n\\left[(\\sqrt{a})^{2}+(\\sqrt{b})^{2}\\right]\\left[(\\sqrt{a})^{2}+(\\sqrt{c})^{2}\\right] \\geq(\\sqrt{a} \\sqrt{a}+\\sqrt{b} \\sqrt{c})^{2}\n$$\n\nor\n\n$$\n\\sqrt{(a+b)(a+c)} \\geq a+\\sqrt{b c} . \\quad[2 \\text { marks. }]\n$$\n\nTaking the cyclic sum of this inequality over $a, b, c$, we get the desired inequality. [2 marks.]", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n4. ", "solution_match": "# Solution 4."}}
|
| 9 |
+
{"year": "2002", "tier": "T1", "problem_label": "5", "problem_type": null, "problem": "Let R denote the set of all real numbers. Find all functions $f$ from R to R satisfying:\n(i) there are only finitely many $s$ in R such that $f(s)=0$, and\n(ii) $f\\left(x^{4}+y\\right)=x^{3} f(x)+f(f(y))$ for all $x, y$ in $\\mathbf{R}$.", "solution": "The only such function is the identity function on $R$.\nSetting $(x, y)=(1,0)$ in the given functional equation (ii), we have $f(f(0))=0$. Setting $x=0$ in (ii), we find\n\n$$\nf(y)=f(f(y))\n$$\n\n[1 mark.] and thus $f(0)=f(f(0))=0$ [1 mark.]. It follows from (ii) that $f\\left(x^{4}+y\\right)=$ $x^{3} f(x)+f(y)$ for all $x, y \\in \\mathbf{R}$. Set $y=0$ to obtain\n\n$$\nf\\left(x^{4}\\right)=x^{3} f(x)\n$$\n\nfor all $x \\in \\mathrm{R}$, and so\n\n$$\nf\\left(x^{4}+y\\right)=f\\left(x^{4}\\right)+f(y)\n$$\n\nfor all $x, y \\in \\mathbf{R}$. The functional equation (3) suggests that $f$ is additive, that is, $f(a+b)=$ $f(a)+f(b)$ for all $a, b \\in \\mathbf{R}$. [1 mark.] We now show this.\n\nFirst assume that $a \\geq 0$ and $b \\in R$. It follows from (3) that\n\n$$\nf(a+b)=f\\left(\\left(a^{1 / 4}\\right)^{4}+b\\right)=f\\left(\\left(a^{1 / 4}\\right)^{4}\\right)+f(b)=f(a)+f(b)\n$$\n\nWe next note that $f$ is an odd function, since from (2)\n\n$$\nf(-x)=\\frac{f\\left(x^{4}\\right)}{(-x)^{3}}=\\frac{f\\left(x^{4}\\right)}{-x^{3}}=-f(x), \\quad x \\neq 0\n$$\n\nSince $f$ is odd, we have that, for $a<0$ and $b \\in R$,\n\n$$\n\\begin{aligned}\nf(a+b) & =-f((-a)+(-b))=-(f(-a)+f(-b)) \\\\\n& =-(-f(a)-f(b))=f(a)+f(b)\n\\end{aligned}\n$$\n\nTherefore, we conclude that $f(a+b)=f(a)+f(b)$ for all $a, b \\in R$. [2 mers.].]\nWe now show that $\\{s \\in \\mathrm{R} \\mid f(s)=0\\}=\\{0\\}$. Recall that $f(0)=0$. Assume that there is a nonzero $h \\in \\mathrm{R}$ such that $f(h)=0$. Then, using the fact that $f$ is additive, we inductively have $f(n h)=0$ or $n h \\in\\{s \\in R \\mid f(s)=0\\}$ for all $n \\in \\mathbf{N}$. However, this is a contradiction to the given condition (i). [1 mark.]\n\nIt's now easy to check that $f$ is one-to-one. Assume that $f(a)=f^{\\prime}(b)$ for some $a, b \\in \\mathbb{P}$. Then, we have $f(b)=f(a)=f(a-b)+f(b)$ or $f(a-b)=0$. This implies that $a-b \\in\\{s \\in$ $\\mathbf{R} \\mid f(s)=0\\}=\\{0\\}$ or $a=b$, as desired. From (1) and the fact that $f$ is one-to-one, we deduce that $f(x)=x$ for all $x \\in \\mathbf{R}$. [1 mark.] This completes the proof.", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n5. ", "solution_match": "# Solution 1."}}
|
| 10 |
+
{"year": "2002", "tier": "T1", "problem_label": "5", "problem_type": null, "problem": "Let R denote the set of all real numbers. Find all functions $f$ from R to R satisfying:\n(i) there are only finitely many $s$ in R such that $f(s)=0$, and\n(ii) $f\\left(x^{4}+y\\right)=x^{3} f(x)+f(f(y))$ for all $x, y$ in $\\mathbf{R}$.", "solution": "Again, the only such function is the identity function on R .\nAs in Solution 1, we first show that $f(f(y))=f(y), f(0)=0$, and $f\\left(x^{4}\\right)=x^{3} f(x)$. [2 marks.] From the latter follows\n\n$$\nf(x)=0 \\Longrightarrow f\\left(x^{4}\\right)=0\n$$\n\nand from condition (i) we get that $f(x)=0$ only possibly for $x \\in\\{0,1,-1\\}$. [1 mark.]\nNext we prove\n\n$$\nf(a)=b \\Longrightarrow f(\\sqrt[4]{|a-b|})=0\n$$\n\nThis is clear if $a=b$. If $a>b$ then\n\n$$\n\\begin{aligned}\nf(a) & =f((a-b)+b)=(a-b)^{3 / 4} f(\\sqrt[4]{a-b})+f(f(b)) \\\\\n& =(a-b)^{3 / 4} f(\\sqrt[4]{a-b})+f(b) \\\\\n& =(a-b)^{3 / 4} f(\\sqrt[4]{a-b})+f(f(a)) \\\\\n& =(a-b)^{3 / 4} f(\\sqrt[4]{a-b})+f(a),\n\\end{aligned}\n$$\n\nso $(a-b)^{3 / 4} f(\\sqrt[4]{a-b})=0$ which means $f(\\sqrt[4]{|a-b|})=0$. If $a<b$ we get similarly\n\n$$\n\\begin{aligned}\nf(b) & =f((b-a)+a)=(b-a)^{3 / 4} f(\\sqrt[4]{b-a})+f(f(a)) \\\\\n& =(b-a)^{3 / 4} f(\\sqrt[4]{b-a})+f(b)\n\\end{aligned}\n$$\n\nand again $f(\\sqrt[4]{|a-b|})=0$. [2 marks.]\nThus $f(a)=b \\Longrightarrow|a-b| \\in\\{0,1\\}$. Suppose that $f(x)=x+b$ for some $x$, where $|b|=1$. Then from $f\\left(x^{4}\\right)=x^{3} f(x)$ and $f\\left(x^{4}\\right)=x^{4}+a$ for some $|a| \\leq 1$ we get $x^{3}=a / b$, so $|x| \\leq 1$. Thus $f(x)=x$ for all $x$ except possibly $x= \\pm 1$. [ 1 mark.] But for example,\n\n$$\nf(1)=f\\left(2^{4}-15\\right)=2^{3} f(2)+f(f(-15))=2^{3} \\cdot 2-15=1\n$$\n\nand\n\n$$\nf(-1)=f\\left(2^{4}-17\\right)=2^{3} f(2)+f(f(-17))=2^{3} \\cdot 2-17=-1\n$$\n\n[1 mark.] This finishes the proof.", "metadata": {"resource_path": "APMO/segmented/en-apmo2002_sol.jsonl", "problem_match": "\n5. ", "solution_match": "# Solution 2."}}
|
APMO/segmented/en-apmo2003_sol.jsonl
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"year": "2003", "tier": "T1", "problem_label": "1", "problem_type": null, "problem": "Let $a, b, c, d, e, f$ be real numbers such that the polynomial\n\n$$\np(x)=x^{8}-4 x^{7}+7 x^{6}+a x^{5}+b x^{4}+c x^{3}+d x^{2}+e x+f\n$$\n\nfactorises into eight linear factors $x-x_{i}$, with $x_{i}>0$ for $i=1,2, \\ldots, 8$. Determine all possible values of $f$.", "solution": "From\n\n$$\nx^{8}-4 x^{7}+7 x^{6}+a x^{5}+b x^{4}+c x^{3}+d x^{2}+e x+f=\\left(x-x_{1}\\right)\\left(x-x_{2}\\right) \\ldots\\left(x-x_{8}\\right)\n$$\n\nwe have\n\n$$\n\\sum_{i=1}^{8} x_{i}=4 \\quad \\text { and } \\quad \\sum x_{i} x_{j}=7\n$$\n\nwhere the second sum is over all pairs $(i, j)$ of integers where $1 \\leq i<j \\leq 8$. Since this sum can also be written\n\n$$\n\\frac{1}{2}\\left[\\left(\\sum_{i=1}^{8} x_{i}\\right)^{2}-\\sum_{i=1}^{8} x_{i}^{2}\\right]\n$$\n\nwe get\n\n$$\n14=\\left(\\sum_{i=1}^{8} x_{i}\\right)^{2}-\\sum_{i=1}^{8} x_{i}^{2}=16-\\sum_{i=1}^{8} x_{i}^{2}\n$$\n\nso\n\n$$\n\\sum_{i=1}^{8} x_{i}^{2}=2 \\quad \\text { while } \\quad \\sum_{i=1}^{8} x_{i}=4 . \\quad[3 \\text { marks }]\n$$\n\nNow\n\n$$\n\\sum_{i=1}^{8}\\left(2 x_{i}-1\\right)^{2}=4 \\sum_{i=1}^{8} x_{i}^{2}-4 \\sum_{i=1}^{8} x_{i}+8=4(2)-4(4)+8=0\n$$\n\nwhich forces $x_{i}=1 / 2$ for all $i$. [3 marks] Therefore\n\n$$\nf=\\prod_{i=1}^{8} x_{i}=\\left(\\frac{1}{2}\\right)^{8}=\\frac{1}{256} . \\quad[1 m x]\n$$\n\nAlternate solution: After obtaining (1) [3 marks], use Cauchy's inequality to get\n\n$$\n16=\\left(x_{1} \\cdot 1+x_{2} \\cdot 1+\\cdots+x_{8} \\cdot 1\\right)^{2} \\leq\\left(x_{1}^{2-}+x_{2}^{2}+\\cdots+x_{8}^{2}\\right)\\left(1^{2}+1^{2}+\\cdots+1^{2}\\right)=8 \\cdot 2=16\n$$\n\nor the power mean inequality to get\n\n$$\n\\frac{1}{2}=\\frac{1}{8} \\sum_{i=1}^{8} x_{i} \\leq\\left(\\frac{1}{8} \\sum_{i=1}^{8} x_{i}^{2}\\right)^{1 / 2}=\\frac{1}{2} . \\quad[2 \\text { marks }]\n$$\n\nEither way, equality must hold, which can only happen if all the terms $x_{i}$ are equal, that is, if $x_{i}=1 / 2$ for all $i$. [1 mark] Thus $f=1 / 256$ as above. [ 1 mark]", "metadata": {"resource_path": "APMO/segmented/en-apmo2003_sol.jsonl", "problem_match": "\n1. ", "solution_match": "# Solution."}}
|
| 2 |
+
{"year": "2003", "tier": "T1", "problem_label": "2", "problem_type": null, "problem": "Suppose $A B C D$ is a square piece of cardboard with side length $a$. On a plane are two parallel lines $\\ell_{1}$ and $\\ell_{2}$, which are also $a$ units apart. The square $A B C D$ is placed on the plane so that sides $A B$ and $A D$ intersect $\\ell_{1}$ at $E$ and $F$ respectively. Also, sides $C B$ and $C D$ intersect $\\ell_{2}$ at $G$ and $H$ respectively. Let the perimeters of $\\triangle A E F$ and $\\triangle C G H$ be $m_{1}$ and $m_{2}$ respectively. Prove that no matter how the square was placed, $m_{1}+m_{2}$ remains constant.", "solution": "Let $E H$ intersect $F G$ at $O$. The distance from $G$ to line $F D$ and line $E F$ are both $a$. So $F G$ bisects $\\angle E F D$. Similarly, $E H$ bisects $\\angle B E F$. So $O$ is an excentre of $\\triangle A E F$. Similarly, $O$ is an excentre of $\\triangle C G H$. [2 marks] Construct these excircles with centre $O$. Let $M, N, P, Q$ be on sides $A B, B C, C D, D A$ respectively, where these excircles touch the square. Then $O M \\perp A B, O N \\perp B C, O P \\perp C D$, and $O Q \\perp D A$. Since $A B \\| C D$ and $A D \\| B C, M, O, P$ are collinear and $N, O, Q$ are collinear. Now $M P=N Q=a$. [2 marks] Using the fact that the two tangents from a point to a circle have the same length, we get $E F=E M+F Q$ and $G H=G N+H P$. [1 mark] Then\n\n$$\nm_{1}=A E+A F+E F=A E+A F+(E M+F Q)=A M+A Q=O Q+O M\n$$\n\nand\n\n$$\nm_{2}=C G+C H+G H=C G+C H+(G N+H P)=C N+C P=O P+O N . \\quad[1 \\text { mark }]\n$$\n\nTherefore\n\n$$\nm_{1}+m_{2}=(O Q+O M)+(O P+O N)=M P+N Q=2 a . \\quad[1 \\mathrm{mark}]\n$$", "metadata": {"resource_path": "APMO/segmented/en-apmo2003_sol.jsonl", "problem_match": "\n2. ", "solution_match": "\nSolution 1."}}
|
| 3 |
+
{"year": "2003", "tier": "T1", "problem_label": "2", "problem_type": null, "problem": "Suppose $A B C D$ is a square piece of cardboard with side length $a$. On a plane are two parallel lines $\\ell_{1}$ and $\\ell_{2}$, which are also $a$ units apart. The square $A B C D$ is placed on the plane so that sides $A B$ and $A D$ intersect $\\ell_{1}$ at $E$ and $F$ respectively. Also, sides $C B$ and $C D$ intersect $\\ell_{2}$ at $G$ and $H$ respectively. Let the perimeters of $\\triangle A E F$ and $\\triangle C G H$ be $m_{1}$ and $m_{2}$ respectively. Prove that no matter how the square was placed, $m_{1}+m_{2}$ remains constant.", "solution": "Extend $A B$ to $I$ and $D C$ to $J$ so that $A E=B I=C J$. Let $\\ell_{2}$ intersect $I J$ at $M$, and let $K$ lie on $I J$ so that $G K \\perp I J$. Then, since $A E=G K, \\triangle A E F$ and $\\triangle K G M$ are congruent. [1 mark] Thus, since $G K=C J$ and $G C=K J$,\n\n$$\nm_{1}+m_{2}=\\operatorname{perimeter}(K G M)+\\operatorname{perimeter}(C G H)=\\operatorname{perimeter}(H M J) . \\quad[\\mathbf{2} \\text { marks }]\n$$\n\nLet $L$ lie on $C D$ so that $E L \\perp C D$. Then a circle with centre $E$ and radius $a$ will touch $D C$ at $L, I J$ at $I$, and the interior of $H M$ at some point $N$, so\n\n$$\n\\operatorname{perimeter}(H M J)=J H+(H N+N M)+J M=(J H+H L)+(M I+J M)=J L+I J=a+a=2 a\n$$\n\n[4 marks] Thus $m_{1}+m_{2}=2 a$.", "metadata": {"resource_path": "APMO/segmented/en-apmo2003_sol.jsonl", "problem_match": "\n2. ", "solution_match": "# Solution 2."}}
|
| 4 |
+
{"year": "2003", "tier": "T1", "problem_label": "2", "problem_type": null, "problem": "Suppose $A B C D$ is a square piece of cardboard with side length $a$. On a plane are two parallel lines $\\ell_{1}$ and $\\ell_{2}$, which are also $a$ units apart. The square $A B C D$ is placed on the plane so that sides $A B$ and $A D$ intersect $\\ell_{1}$ at $E$ and $F$ respectively. Also, sides $C B$ and $C D$ intersect $\\ell_{2}$ at $G$ and $H$ respectively. Let the perimeters of $\\triangle A E F$ and $\\triangle C G H$ be $m_{1}$ and $m_{2}$ respectively. Prove that no matter how the square was placed, $m_{1}+m_{2}$ remains constant.", "solution": "Without loss of generality, assume the square has side $a=1$. Let $\\theta$ be the acute angle between $\\ell_{1}$ (or $\\ell_{2}$ ) and the sides $A B$ and $C D$ of the square. Then, letting $E F=x$ and $G H=y$, we have\n\n$$\nE A=x \\cos \\theta, \\quad A F=x \\sin \\theta, \\quad C H=y \\cos \\theta, \\quad C G=y \\sin \\theta\n$$\n\nThus\n\n$$\nm_{1}+m_{2}=(x+y)(\\sin \\theta+\\cos \\theta+1) . \\quad[2 \\text { marks }]\n$$\n\nDraw lines parallel to $\\ell_{1}, \\ell_{2}$ through $A$ and $C$ respectively. The distance between these lines is $\\sin \\theta+\\cos \\theta$ [1 mark], as can be seen by drawing a mutual perpendicular to these lines through $B$, say. Also, the altitudes from $A$ to $E F$ and from $C$ to $G H$ have lengths $x \\sin \\theta \\cos \\theta$ and $y \\sin \\theta \\cos \\theta$ respectively [ 1 mark]. Therefore the distance between $\\ell_{1}$ and $\\ell_{2}$ must be\n\n$$\n(\\sin \\theta+\\cos \\theta)-x \\sin \\theta \\cos \\theta-y \\sin \\theta \\cos \\theta\n$$\n\nBut we are given that this distance is $a=1$, so\n\n$$\n(x+y) \\sin \\theta \\cos \\theta+1=\\sin \\theta+\\cos \\theta\n$$\n\nor\n\n$$\nx+y=\\frac{\\sin \\theta+\\cos \\theta-1}{\\sin \\theta \\cos \\theta} \\cdot \\quad[1 \\text { mark }]\n$$\n\nTherefore, by (1),\n\n$$\n\\begin{aligned}\nm_{1}+m_{2} & =\\frac{(\\sin \\theta+\\cos \\theta-1)(\\sin \\theta+\\cos \\theta+1)}{\\sin \\theta \\cos \\theta} \\\\\n& =\\frac{\\left(\\sin ^{2} \\theta+\\cos ^{2} \\theta+2 \\sin \\theta \\cos \\theta\\right)-1}{\\sin \\theta \\cos \\theta} \\\\\n& =\\frac{1+2 \\sin \\theta \\cos \\theta-1}{\\sin \\theta \\cos \\theta}=2 . \\quad[2 \\text { marks }]\n\\end{aligned}\n$$", "metadata": {"resource_path": "APMO/segmented/en-apmo2003_sol.jsonl", "problem_match": "\n2. ", "solution_match": "\nSolution 3."}}
|
| 5 |
+
{"year": "2003", "tier": "T1", "problem_label": "3", "problem_type": null, "problem": "Let $k \\geq 14$ be an integer, and let $p_{k}$ be the largest prime number which is strictly less than $k$. You may assume that $p_{k} \\geq 3 k / 4$. Let $n$ be a composite integer. Prove:\n(a) if $n=2 p_{k}$, then $n$ does not divide $(n-k)$ !;\n(b) if $n>2 p_{k}$, then $n$ divides $(n-k)$ !.", "solution": "(a) Note that $n-k=2 p_{k}-k<2 p_{k}-p_{k}=p_{k}$, so $p_{k} \\nmid(n-k)$ !, so $2 p_{k} \\nless(n-k)$ !. [1 mark]\n(b) Note that $n>2 p_{k} \\geq 3 k / 2$ implies $k<2 n / 3$, so $n-k>n / 3$. So if we can find integers $a, b \\geq 3$ such that $n=a b$ and $a \\neq b$, then both $a$ and $b$ will appear separately in the product $(n-k)!=1 \\times 2 \\times \\cdots \\times(n-k)$, which means $n \\mid(n-k)!$. Observe that $k \\geq 14$ implies $p_{k} \\geq 13$, so that $n>2 p_{k} \\geq 26$.\n\nIf $n=2^{\\alpha}$ for some integer $\\alpha \\geq 5$, then take $a=2^{2}, b=2^{\\alpha-2}$. [ 1 mark] Otherwise, since $n \\geq 26>16$, we can take $a$ to be an odd prime factor of $n$ and $b=n / a$ [1 mark], unless $b<3$ or $b=a$.\n\nCase (i): $b<3$. Since $n$ is composite, this means $b=2$, so that $2 a=n>2 p_{k}$. As $a$ is a prime number and $p_{k}$ is the largest prime number which is strictly less than $k$, it follows that $a \\geq k$. From $n-k=2 a-k \\geq$ $2 a-a=a>2$ we see that $n=2 a$ divides into $(n-k)$. [ 2 marks]\n\nCase (ii): $b=a$. Then $n=a^{2}$ and $a>6$ since $n \\geq 26$. Thus $n-k>n / 3=a^{2} / 3>2 a$, so that both $a$ and $2 a$ appear among $\\{1,2, \\ldots, n-k\\}$. Hence $n=a^{2}$ divides into $(n-k)!$. [2 marks]", "metadata": {"resource_path": "APMO/segmented/en-apmo2003_sol.jsonl", "problem_match": "\n3. ", "solution_match": "\nSolution."}}
|
| 6 |
+
{"year": "2003", "tier": "T1", "problem_label": "4", "problem_type": null, "problem": "Let $a, b, c$ be the sides of a triangle, with $a+b+c=1$, and let $n \\geq 2$ be an integer. Show that\n\n$$\n\\sqrt[n]{a^{n}+b^{n}}+\\sqrt[n]{b^{n}+c^{n}}+\\sqrt[n]{c^{n}+a^{n}}<1+\\frac{\\sqrt[n]{2}}{2}\n$$", "solution": "Without loss of generality, assume $a \\leq b \\leq c$. As $a+b>c$, we have\n\n$$\n\\frac{\\sqrt[n]{2}}{2}=\\frac{\\sqrt[n]{2}}{2}(a+b+c)>\\frac{\\sqrt[n]{2}}{2}(c+c)=\\sqrt[n]{2 c^{n}} \\geq \\sqrt[n]{b^{n}+c^{n}} \\quad \\quad[2 \\text { marks }]\n$$\n\nAs $a \\leq c$ and $n \\geq 2$, we have\n\n$$\n\\begin{aligned}\n\\left(c^{n}+a^{n}\\right)-\\left(c+\\frac{a}{2}\\right)^{n} & =a^{n}-\\sum_{k=1}^{n}\\binom{n}{k} c^{n-k}\\left(\\frac{a}{2}\\right)^{k} \\\\\n& \\leq\\left[1-\\sum_{k=1}^{n}\\binom{n}{k}\\left(\\frac{1}{2}\\right)^{k}\\right] a^{n} \\quad\\left(\\text { since } c^{n-k} \\geq a^{n-k}\\right) \\\\\n& =\\left[\\left(1-\\frac{n}{2}\\right)-\\sum_{k=2}^{n}\\binom{n}{k}\\left(\\frac{1}{2}\\right)^{k}\\right] a^{n}<0\n\\end{aligned}\n$$\n\nThus\n\n$$\n\\sqrt[n]{c^{n}+a^{n}}<c+\\frac{a}{2} . \\quad[3 \\text { marks }]\n$$\n\nLikewise\n\n$$\n\\sqrt[n]{b^{n}+a^{n}}<b+\\frac{a}{2} \\quad \\quad[1 \\text { mark }]\n$$\n\nAdding (1), (2) and (3), we get\n\n$$\n\\sqrt[n]{a^{n}+b^{n}}+\\sqrt[n]{b^{n}+c^{n}}+\\sqrt[n]{c^{n}+a^{n}}<\\frac{\\sqrt[n]{2}}{2}+c+\\frac{a}{2}+b+\\frac{a}{2}=1+\\frac{\\sqrt[n]{2}}{2} . \\quad[1 \\text { mark }]\n$$", "metadata": {"resource_path": "APMO/segmented/en-apmo2003_sol.jsonl", "problem_match": "\n4. ", "solution_match": "# Solution."}}
|
| 7 |
+
{"year": "2003", "tier": "T1", "problem_label": "5", "problem_type": null, "problem": "Given two positive integers $m$ and $n$, find the smallest positive integer $k$ such that among any $k$ people, either there are $2 m$ of them who form $m$ pairs of mutually acquainted people or there are $2 n$ of them forming $n$ pairs of mutually unacquainted people.", "solution": "Let the smallest positive integer $k$ satisfying the condition of the problem be denoted $r(m, n)$. We shall show that\n\n$$\nr(m, n)=2(m+n)-\\min \\{m, n\\}-1\n$$\n\nObserve that, by symmetry, $r(m, n)=r(n, m)$. Therefore it suffices to consider the case where $m \\geq n$, and to prove that\n\n$$\nr(m, n)=2 m+n-1 . \\quad[1 \\text { mark }]\n$$\n\nFirst we prove that\n\n$$\nr(m, n) \\geq 2 m+n-1\n$$\n\nby an example. Call a group of $k$ people, every two of whom are mutually acquainted, a $k$-clique. Consider a set of $2 m+n-2$ people consisting of a $(2 m-1)$-clique together with an additional $n-1$ people none of whom know anyone else. (Call such people isolated.) Then there are not $2 m$ people forming $m$ mutually acquainted pairs, and there also are not $2 n$ people forming $n$ mutually unacquainted pairs. Thus $r(m, n) \\geq$ $(2 m-1)+(n-1)+1=2 m+n-1$ by the definition of $r(m, n)$. [1 mark]\n\nTo establish (1), we need to prove that $r(m, n) \\leq 2 m+n-1$. To do this, we now show that\n\n$$\nr(m, n) \\leq r(m-1, n-1)+3 \\quad \\text { for all } m \\geq n \\geq 2\n$$\n\nLet $G$ be a group of $t=r(m-1, n-1)+3$ people. Notice that\n\n$$\nt \\geq 2(m-1)+(n-1)-1+3=2 m+n-1 \\geq 2 m \\geq 2 n\n$$\n\nIf $G$ is a $t$-clique, then $G$ contains $2 m$ people forming $m$ mutually acquainted pairs, and if $G$ has only isolated people, then $G$ contains $2 n$ people forming $n$ mutually unacquainted pairs. Otherwise, there are three people in $G$, say $a, b$ and $c$, such that $a, b$ are acquainted but $a, c$ are not. Now consider the group $A$ obtained byremoving $a, b$ and $c$ from $G$. A has $t-3=r(m-1, n-1)$ people, so by the definition of $r(m-1, n-1)$, A either contains $2(m-1)$ people forming $m-1$ mutually acquainted pairs, or else contains $2(n-1)$ people forming $n-1$ mutually unacquainted pairs. In the former case, we add the acquainted pair $a, b$ to $A$ to form $m$ mutually acquainted pairs in $G$. In the latter case, we add the unacquainted pair $a, c$ to $A$ to form $n$ mutually unacquainted pairs in $G$. This proves (2). [3 marks]\n\nTrivially, $r(s, 1)=2 s$ for all $s[\\mathbf{1}$ mark], so $r(m, n) \\leq 2 m+n-1$ holds whenever $n=1$. Proceeding by induction on $n$, by (2) we obtain\n\n$$\nr(m, n) \\leq r(m-1, n-1)+3 \\leq 2(m-1)+(n-1)-1+3=2 m+n-1\n$$\n\nwhich completes the proof. [1 mark]\nNote. Give an additional 1 mark to any student who gets at most 5 marks by the above marking scheme, but in addition gives a valid argument that $r(2,2)=5$.", "metadata": {"resource_path": "APMO/segmented/en-apmo2003_sol.jsonl", "problem_match": "\n5. ", "solution_match": "# Solution."}}
|