Spaces:
Running
Running
File size: 9,869 Bytes
0ed0d6b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | AOPS_QUERIES: dict[str, list[str]] = {
"algebra": ["linear equations", "quadratic formula", "polynomial functions", "systems of equations"],
"radical_expressions": [
"simplifying radicals",
"rationalizing denominators",
"radical equations",
"nested radicals",
"square root properties",
],
"functions_and_graphs": [
"linear function slope intercept",
"parabola vertex form",
"graphing quadratic functions",
"domain range functions",
"function transformations",
],
"inequalities_optimization": [
"AM-GM inequality",
"Cauchy-Schwarz inequality",
"arithmetic geometric mean proof",
"inequality olympiad techniques",
"optimization constrained",
],
"absolute_value": [
"absolute value equations",
"absolute value inequalities",
"solving absolute value expressions",
],
"nonlinear_systems": [
"nonlinear systems of equations",
"symmetric systems algebra",
"substitution nonlinear",
"quadratic linear system",
],
"polynomial_techniques": [
"polynomial remainder theorem",
"factor theorem",
"polynomial long division",
"evaluating polynomials at roots",
"factoring higher degree polynomials",
],
"geometry": [
"triangle congruence",
"circle theorems",
"coordinate geometry",
"area volume",
"similar triangles",
"angle bisector",
"Pythagorean theorem",
"polygon properties",
"inscribed angles",
"power of a point",
"Menelaus Ceva theorem",
"Stewart theorem",
"cyclic quadrilateral",
"geometric transformations",
"triangle inequality",
"Euler line",
"orthocenter circumcenter",
"solid geometry volume",
"law of cosines",
"law of sines",
"Ptolemy theorem",
"radical axis",
"homothety",
"inversion geometry",
"nine-point circle",
"triangle area formula",
"spiral similarity",
"Brahmagupta formula",
"Heron formula",
"isogonal conjugate",
"symmedian",
"triangle centers",
"cross ratio",
"Desargues theorem",
"projective geometry",
"affine geometry",
],
"calculus": ["derivative rules", "definite integral", "limits", "chain rule"],
"trigonometry": ["trigonometric identities", "law of sines cosines", "unit circle"],
"combinatorics": [
"permutation combination",
"pigeonhole principle",
"binomial theorem",
"inclusion exclusion",
"counting techniques",
"generating functions",
"graph theory basics",
"Catalan numbers",
"stars and bars",
"derangements",
"Burnside lemma",
"recursion combinatorics",
"double counting",
"bijection proof",
"Pascal triangle properties",
"Stirling numbers",
"partition function",
"Ramsey theory",
"Latin squares",
"block designs",
"chromatic polynomial",
"planar graphs",
"Euler formula graphs",
"coloring problems",
"combinatorial proof",
"lattice paths counting",
"ballot problem",
"Polya enumeration",
"graph matching",
"Hall theorem",
"Dilworth theorem",
"extremal graph theory",
"Turan theorem",
"Ramsey number",
"probabilistic method combinatorics",
],
"number_theory": [
"prime factorization",
"modular arithmetic",
"gcd lcm",
"divisibility rules",
"Fermat little theorem",
"Euler totient function",
"Chinese remainder theorem",
"quadratic residues",
"Legendre symbol",
"Diophantine equations",
"floor function properties",
"arithmetic functions",
"Bezout identity",
"Wilson theorem",
"prime counting",
"perfect numbers",
"Mersenne primes",
"Gaussian integers",
"p-adic numbers",
"continued fractions",
"Pell equation",
"sum of squares",
"primitive roots",
"Mobius function",
"Lifting the Exponent",
],
"statistics": [
"mean median mode",
"standard deviation variance",
"normal distribution",
"probability distribution",
"hypothesis testing",
"confidence interval",
"regression analysis",
"correlation coefficient",
"central limit theorem",
"binomial distribution",
"Poisson distribution",
"chi-squared test",
"t-test",
"ANOVA",
"sampling methods",
"z-score",
],
"probability": ["conditional probability", "Bayes theorem", "expected value", "counting principle"],
}
# AoPS category names per topic — used as a supplementary source alongside keyword search.
AOPS_CATEGORIES: dict[str, str] = {
"combinatorics": "Combinatorics",
"number_theory": "Number theory",
"geometry": "Geometry",
}
# Generic static-HTML sources per topic.
# Each entry is a list of dicts: {index_url, link_pattern, source_tag, max_pages (optional)}.
# generic_html.py fetches the index, discovers links matching link_pattern, and ingests each page.
GENERIC_HTML_SOURCES: dict[str, list[dict]] = {
"radical_expressions": [
{
"index_url": "https://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx",
"link_pattern": r"tutorial\.math\.lamar\.edu/Classes/Alg/(?:Radical|Simplif|Rationali|SolveRadical)",
"source_tag": "pauls",
},
],
"functions_and_graphs": [
{
"index_url": "https://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx",
"link_pattern": r"tutorial\.math\.lamar\.edu/Classes/Alg/(?:Graph|Lines|Function|Parabola|Circle|Ellipse)",
"source_tag": "pauls",
},
],
"inequalities_optimization": [
{
"index_url": "https://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx",
"link_pattern": r"tutorial\.math\.lamar\.edu/Classes/Alg/.*Inequalities",
"source_tag": "pauls",
},
{
# cut-the-knot algebra index — confirmed 200 on 2026-05-09
"index_url": "https://www.cut-the-knot.org/arithmetic/algebra/index.shtml",
"link_pattern": r"cut-the-knot\.org/arithmetic/algebra/",
"source_tag": "ctk",
"crawl_delay_seconds": 120,
"max_pages": 20,
},
],
"absolute_value": [
{
"index_url": "https://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx",
"link_pattern": r"tutorial\.math\.lamar\.edu/Classes/Alg/.*AbsValue",
"source_tag": "pauls",
},
],
"nonlinear_systems": [
{
"index_url": "https://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx",
"link_pattern": r"tutorial\.math\.lamar\.edu/Classes/Alg/(?:NonlinearSystems|Systems)",
"source_tag": "pauls",
},
],
"polynomial_techniques": [
{
"index_url": "https://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx",
"link_pattern": r"tutorial\.math\.lamar\.edu/Classes/Alg/(?:Polynomial|DivisionAlg|ZeroFact|FindingZero|FactorThm|RemainderThm)",
"source_tag": "pauls",
},
],
"statistics": [
{
# NIST e-Handbook EDA section 3 — distributions, descriptive techniques
# Public domain (U.S. government work). Robots.txt: allowed.
"index_url": "https://itl.nist.gov/div898/handbook/eda/section3/eda3.htm",
"link_pattern": r"itl\.nist\.gov/div898/handbook/eda/section3/eda3\d",
"source_tag": "nist",
},
{
# NIST e-Handbook PRC section 2 — hypothesis testing, confidence intervals
"index_url": "https://itl.nist.gov/div898/handbook/prc/section2/prc2.htm",
"link_pattern": r"itl\.nist\.gov/div898/handbook/prc/section2/prc2\d",
"source_tag": "nist",
},
{
# Penn State STAT 414 — probability and distributions. CC BY-NC 4.0.
# No robots.txt: allowed.
"index_url": "https://online.stat.psu.edu/stat414/",
"link_pattern": r"online\.stat\.psu\.edu/stat414/lesson/",
"source_tag": "pennstate",
},
{
# Penn State STAT 415 — inference, regression, ANOVA. CC BY-NC 4.0.
"index_url": "https://online.stat.psu.edu/stat415/",
"link_pattern": r"online\.stat\.psu\.edu/stat415/lesson/",
"source_tag": "pennstate",
},
],
}
# One index URL per topic — pauls.py scrapes these to discover individual section pages
PAULS_INDEX_URLS: dict[str, str | None] = {
"algebra": "https://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx",
"calculus": "https://tutorial.math.lamar.edu/Classes/CalcI/CalcI.aspx",
"trigonometry": "https://tutorial.math.lamar.edu/Classes/Trig/Trig.aspx",
"statistics": None, # Paul's Notes has no statistics section
"probability": "https://tutorial.math.lamar.edu/Classes/CalcI/CalcI.aspx",
"geometry": None, # AoPS-only
"combinatorics": None, # AoPS-only
"number_theory": None, # AoPS-only
# gap-fill topics — Paul's Notes content sourced via GENERIC_HTML_SOURCES
"radical_expressions": None,
"functions_and_graphs": None,
"inequalities_optimization": None,
"absolute_value": None,
"nonlinear_systems": None,
"polynomial_techniques": None,
}
|