Solve set: functions, exp/log, trig and Euler, series, polynomials, inequalities
Overview
Section titled “Overview”| Module | S-M00 · solve · pen and paper, checked by SymPy · Pass 2 · 4 to 6 h |
| You write | solve/S-M00.toml in your repo: 60 answers in ASCII math (ol start S-M00 writes the template) |
| Problems | course/solve/S-M00/problems.md, reproduced in section 4 |
| Checked by | ol check S-M00: each answer is compared with a hidden key by SymPy (symbolically, then numerically at seeded points); a part passes at 80% |
| Needs | nothing. Each part points to the chapter section that teaches it |
| Used by | the four build modules of this topic (M00.1 to M00.4) as their pen-and-paper check; parts 1 and 6 are M00.5 (functions, inverses, monotonicity, inequalities), which M01.1 and M05.2 assume |
| Milestone | MS-P2 (the Pass 2 gate: every math module and solve part of the pass) |
| Optional depth | OpenStax, Precalculus 2e (free), ch. 1 (functions), 2 to 3 (linear and polynomial functions, inequalities), 6 (exponentials and logs), 5 to 8 (trigonometry, complex numbers), 11 (sequences and series) |
Key Takeaways
Section titled “Key Takeaways”- A function assigns exactly one output to each input in its domain; its inverse exists exactly when no two inputs share an output, and undoes it: .
- A strictly monotonic function (always increasing, or always decreasing) is one-to-one, so it has an inverse; that is why , , the sigmoid, and softplus can all be inverted.
- Solving an inequality is solving the matching equation and testing the sign between its solutions; multiplying or dividing by a negative number, or applying a decreasing function, flips the direction.
- The other four parts are the pen-and-paper side of
M00.1toM00.4: if a problem in part 2 to 5 stops you, read the beat 2 section of that module’s chapter it names.
How to work this chapter
Section titled “How to work this chapter”ol start S-M00 # writes solve/S-M00.toml with an empty answer per question$EDITOR solve/S-M00.toml # answer = "(x + 7)/3", one line per questionol check S-M00 # per-question pass/fail; feedback never shows the expected answerAnswers are ASCII math: x^2, sqrt(x), log(x) (natural log), E, pi, I, oo; intervals like (-oo, 2) U [3, 5); sets {1, 2}; vectors [1, 2]. A wrong answer reports where it differs (q4 FAIL: differs at x=1.30), not what it should be.
1. Why now
Section titled “1. Why now”Pass 2 turns the math under your tracer system into code: logarithms that measure information (M00.1), rotations that encode position (M00.2), ladders of frequencies (M00.3), and polynomial evaluation that kernels run (M00.4), and after them calculus, linear algebra, probability, and optimization. Each of those chapters assumes you can manipulate the expressions fluently by hand: invert a function, combine logarithms, use an angle-addition formula, sum a geometric series, factor a polynomial, and solve an inequality. A bug in a derivation becomes a bug in code that tests catch late and explain poorly. This set checks the hand skills first, with a checker that accepts any correct form of an answer. Parts 1 and 6 also teach M00.5, functions, inverses, monotonicity, and inequalities, which has no build module of its own because none of it becomes code; M01.1 (limits and derivatives) and M05.2 build on it directly.
2. Principles
Section titled “2. Principles”| Symbol | Meaning | Type / shape |
|---|---|---|
| a function from the set (its domain) to the set | ||
| the output of at the input | ||
| the domain: the inputs where is defined | a set or interval | |
| the range: the outputs actually takes | a set or interval | |
| composition, | ||
| the inverse function: exactly when | ||
| , | the open interval and the closed interval | |
union of sets, written U in answers | ||
| the sigmoid | ||
| absolute value: if , otherwise |
2.1 Functions, domains, ranges, composition
Section titled “2.1 Functions, domains, ranges, composition”A function assigns to each input in its domain exactly one output . A formula alone leaves the domain implicit: it is every real where the formula makes sense. needs , so its domain is ; needs . The range is the set of outputs that actually occur: the sigmoid takes every value strictly between 0 and 1 and never reaches either, so its range is . Composition chains functions: applies first. Order matters: with and , but .
2.2 Inverses and monotonicity
Section titled “2.2 Inverses and monotonicity”is one-to-one when different inputs give different outputs. Then every output in the range comes from exactly one , and the inverse undoes : and . To find it, write and solve for ; the graph of is the graph of reflected across the line .
A function is strictly increasing when implies (strictly decreasing: ). Either kind, called strictly monotonic, is one-to-one, because different inputs are ordered and so are their outputs. , , , , and softplus are strictly increasing; is not monotonic on all of (), so it has an inverse only on a half-line, where is it. M01.1 gives the practical test: a function whose derivative is positive everywhere is strictly increasing.
2.3 Inequalities
Section titled “2.3 Inequalities”An inequality is solved the way an equation is, with one extra rule: multiplying or dividing both sides by a negative number reverses the direction ( means ), and so does applying a strictly decreasing function. Applying a strictly increasing function (, , on non-negative numbers) keeps it, which is how becomes .
For a polynomial or a quotient of polynomials, find where it is zero or undefined, cut the line there, and test the sign on each piece. is zero at 2 and 3, positive outside and negative between, so on . An endpoint where the expression is zero belongs to the answer for and , never one where it is undefined. An absolute value is a distance: means “within 2 of 3”, the interval . Two inequalities appear again in optimization and information theory: for (with equality at ; multiply by and get ), and (equality only at ), the inequality behind Gibbs’ inequality in M11.1.
2.4 Where the other parts are taught
Section titled “2.4 Where the other parts are taught”| Part | Questions | Taught in |
|---|---|---|
| 2. exponents, logarithms, units | q11 to q22 | M00.1 sections 2.1 to 2.4 |
| 3. trigonometry, complex numbers, Euler | q23 to q34 | M00.2 sections 2.1 to 2.6 |
| 4. sequences and geometric series | q35 to q44 | M00.3 sections 2.1 to 2.5 |
| 5. polynomials | q45 to q52 | M00.4 sections 2.1 to 2.5 |
3. Worked example by hand
Section titled “3. Worked example by hand”A worked solution of a sibling of q5 and q6: the inverse and range of .
- Range. takes every value in , so takes every value in and every value in , approaching 2 as and 0 as without reaching either. Range:
(0, 2). - Monotonic, so invertible. As grows, shrinks, the denominator shrinks, and grows: is strictly increasing, hence one-to-one on .
- Solve for , for :
- Check. , and . Correct.
- Answer, as you would write it in
solve/S-M00.toml(in the variable of the question):answer = "log(y/(2 - y))". The checker also acceptslog(y) - log(2 - y)or-log(2/y - 1), because it tests equality, not spelling: symbolically first, then at 32 seeded points of the domain the key declares.
And one inequality, a sibling of q56: . The numerator is zero at and the denominator at . Signs: for both factors are negative and the quotient positive; for the numerator is positive and the denominator negative, so the quotient is negative; for it is positive. Zero at is allowed by ; divides by zero. Answer: [-1, 4).
4. Problem set
Section titled “4. Problem set”Write each answer in solve/S-M00.toml as answer = "..." under its [qN] header. The tag after each question is the answer type.
Functions and inverses
Section titled “Functions and inverses”q1. . Give . [expr in x]
q2. . Give for . [expr in x]
q3. for . Give . [expr in x]
q4. and . Give . [expr in x]
q5. The sigmoid is . Give its inverse, the logit , for . [expr in p]
q6. Give the range of (the set of values it takes over all real ). [interval]
q7. Give the domain of (the real where it is defined). [interval]
q8. Is one-to-one on all of ? (Hint: is it monotonic?) [bool]
q9. and . Compute . [number]
q10. Softplus is . Give for . [expr in y]
Exponents, logarithms, and units of information
Section titled “Exponents, logarithms, and units of information”q11. . [number]
q12. . [number]
q13. Simplify for . [expr in x]
q14. Solve for . [number], decimal ok
q15. How many bits is one nat? [number], decimal ok
q16. A model’s mean negative log-likelihood is nats per token on a text of tokens and bytes. Give its bits per byte. [number], decimal ok
q17. A model’s perplexity is per token. Give its mean NLL in bits per token. [number]
q18. Write and . Express in and . [expr in a, b]
q19. Solve . [number]
q20. Solve . [number]
q21. A quantity decays as with . After what time is it half of ? [expr in k]
q22. How many decimal digits does have? (Use .) [number]
Trigonometry, complex numbers, and Euler’s formula
Section titled “Trigonometry, complex numbers, and Euler’s formula”q23. . [number]
q24. . [number]
q25. Write as one trigonometric function of and . [expr in a, b]
q26. Rotate the point counterclockwise by . Give the image. [vector]
q27. with , where is the rotation by . Give . [number]
q28. . [number]
q29. . [number]
q30. Rotate by the angle with and : compute . [number]
q31. . [number]
q32. Express using only exponentials and . [expr in t]
q33. For the unit complex numbers and , simplify , where is the complex conjugate. [expr in a, b]
q34. A RoPE dimension pair rotates by radians at position , with . After how many positions does the pattern repeat (the period)? [number]
Sequences and geometric series
Section titled “Sequences and geometric series”q35. (forever). [number]
q36. Give in closed form for . [expr in r, n]
q37. The sum of the first 10 terms of [number]
q38. The RoPE ladder of a 128-dimensional head with base is for . Give the ratio . [number]
q39. . [number]
q40. An exponential moving average starts at with and sees at every step. Give . [number]
q41. In q40, . Give the weight on the oldest gradient . [number]
q42. . [number]
q43. Write (27 repeating) as a fraction. [number]
q44. ALiBi with 4 heads uses the slopes . Give their sum. [number]
Polynomials
Section titled “Polynomials”q45. Evaluate at (Horner’s rule makes it three multiply-adds). [number]
q46. Divide by . Give the quotient. [expr in x]
q47. Give all roots of . [set]
q48. Give the roots of . [set]
q49. Give the smaller root of exactly (radicals allowed) or to 15 significant digits. [number]
q50. Without solving, give the product of the roots of . [number]
q51. How many real roots does have? [number]
q52. The Taylor polynomial of of degree 3 around 0 is . Give . [vector]
Inequalities
Section titled “Inequalities”q53. Solve . [interval]
q54. Solve . [interval]
q55. The smallest integer with (the bits needed to number 1000 items). [number]
q56. Solve . [interval]
q57. For which probabilities is the surprisal greater than 3 bits? [interval]
q58. Solve . [interval]
q59. The smallest value of over . [number]
q60. Solve over . [interval]
5. Pitfalls
Section titled “5. Pitfalls”| Pitfall | Where it bites later | Caught by |
|---|---|---|
| inverting the steps in the original order ( for ) | every inverse in M07.1 (inverse-CDF sampling) | q1, q3 |
| composing in the wrong order: instead of | the chain rule in M01.2 and backpropagation in L0.1 | q4, q9 |
| a closed endpoint where the expression is undefined | the domain of in every loss | q7, q56 |
rewriting losses in M11.1 | q11, q18 | |
| one term too many, or the wrong weight, in a geometric sum | Adam’s bias correction (M02.2) | q37, q40, q41 |
| decimals where an exact value is asked | none: an exact value is what the checker can prove equal | every exact number answer, with the message “give an exact value (no decimals)” |
6. Where it’s used next
Section titled “6. Where it’s used next”| Direction | Module | How it uses this |
|---|---|---|
| Forward | M00.1 | part 2 is the pen-and-paper side of its logarithms and units |
| Forward | M00.2 | part 3: rotations, Euler’s formula, and the relative-angle identity of q33 |
| Forward | M00.3 | part 4: geometric sums, the RoPE ratio (q38), ALiBi slopes (q44), EMA weights (q40, q41) |
| Forward | M00.4 | part 5: Horner (q45), factoring, Vieta, and the cancellation case (q49) |
| Forward | M01.1 | limits (q42) and monotonicity (q8) start calculus |
| Forward | M05.2 | functions, inverses, and bijections in discrete math |
| Forward | M07.1 | inverse functions become inverse-CDF sampling |