Appendix A: Worked Solutions

Appendix A: Worked Solutions

Every exercise in the book is solved here in full, not merely answered — the route matters more than the destination, and an answer you cannot reproduce teaches nothing. Work the exercise first, then come here: reading a solution feels like understanding in a way that doing one does not.

Exercises 1.

  1. Turn each into a decimal you can compare: -\frac73 = -2.33\ldots, -\sqrt2 = -1.414\ldots, \sqrt5 = 2.236\ldots, and 2.4 is already there. Both negatives come first, and -2.33 < -1.41 because further left on the line means smaller. The only close call is \sqrt5 against 2.4: squaring preserves order for positive numbers, so compare 5 with 2.4^2 = 5.76 — hence \sqrt5 < 2.4. Increasing order: -\frac73 < -\sqrt2 < \sqrt5 < 2.4.
  2. Division outranks addition, so do the division first, and dividing by a fraction is multiplying by its reciprocal: \frac34 \div \frac12 = \frac34 \times 2 = \frac32. Now a common denominator of 6: \frac23 + \frac32 = \frac46 + \frac96 = \frac{13}{6}.
  3. Percentage changes multiply; they do not add. A 20% rise is \times 1.2, a 20% fall is \times 0.8, and together 1.2 \times 0.8 = 0.96 — a 4% decrease. The asymmetry is the whole lesson: the fall is 20% of the raised price, which is more than 20% of the original.
  4. 8^{2/3} = \left(\sqrt[3]{8}\right)^2 = 2^2 = 4 — take the root first and the arithmetic stays small. 5^{-2} = \frac{1}{5^2} = \frac{1}{25}: a negative exponent means reciprocal, not a negative answer. \left(\frac14\right)^{-3/2} = 4^{3/2} = \left(\sqrt4\right)^3 = 2^3 = 8: the negative exponent flips the fraction, then 3/2 says square-root-and-cube.
  5. Suppose \sqrt3 = p/q with p, q integers in lowest terms. Squaring gives p^2 = 3q^2, so 3 divides p^2; because 3 is prime, 3 divides p. Write p = 3k: then 9k^2 = 3q^2, so q^2 = 3k^2, and the same argument gives 3 \mid q. Now 3 divides both p and q, contradicting lowest terms — so no such fraction exists. The appeal to primeness is not decoration: the identical argument with 4 in place of 3 must fail somewhere, and that is where, since \sqrt4 = 2 is perfectly rational.

Exercises 2.

    1. Two numbers with product 6 and sum -5 are -2 and -3: x^2 - 5x + 6 = (x-2)(x-3). (b) A difference of squares, (2x)^2 - 5^2 = (2x-5)(2x+5). (c) A difference of cubes, x^3 - 2^3 = (x-2)(x^2+2x+4); the quadratic factor has discriminant 2^2 - 4\cdot4 = -12 < 0, so over the reals this is as far as it goes.
  1. The y terms are already equal and opposite, so adding the equations eliminates y outright: 8x = 8, so x = 1. Substituting into the first equation, 3 + 2y = 7, so y = 2. Always check in the equation you did not use: 5(1) - 2(2) = 1 ✓.
  2. A quotient is \ge 0 exactly where numerator and denominator share a sign, plus wherever the numerator is zero. The interesting points are x = 1 (numerator zero) and x = -2 (denominator zero). Test the three intervals they cut: for x < -2, \frac{-}{-} > 0 ✓; for -2 < x < 1, \frac{-}{+} < 0; for x > 1, \frac{+}{+} > 0 ✓. Include x = 1, where the quotient equals 0; exclude x = -2 outright, where it is undefined rather than zero. So x < -2 or x \ge 1.
  3. Square the equation you were given instead of solving it: \left(x + \frac1x\right)^2 = x^2 + 2\cdot x\cdot\frac1x + \frac1{x^2} = x^2 + \frac1{x^2} + 2. The left side is 4^2 = 16, so x^2 + \frac1{x^2} = 14. Solving for x first also works, but drags a surd through the whole calculation for no gain.
  4. Let w be the width; the length is w + 3 and the area gives w(w+3) = 40, i.e. w^2 + 3w - 40 = 0, which factors as (w+8)(w-5) = 0. So w = 5 or w = -8, and a width cannot be negative — discard it. The dimensions are 5 \times 8; check 5 \times 8 = 40 ✓. Discarding the negative root is a modelling step, not an algebraic one: the algebra is perfectly happy with it.
  5. Base case: for n = 1 the left side is 1 and the right side is 1^2 = 1 ✓. Inductive step: assume 1 + 3 + \cdots + (2n-1) = n^2. The next odd number is 2(n+1) - 1 = 2n+1, so the sum of n+1 terms is n^2 + 2n + 1 = (n+1)^2 — which is the claim for n+1 ✓. By induction it holds for every n \ge 1. In the picture, 2n+1 is exactly the L-shaped ring that grows an n\times n square into an (n+1)\times(n+1) one, so the algebra and the figure are the same argument told twice.

Exercises 3.

  1. Two separate requirements, and both must hold. The square root needs x + 3 \ge 0, so x \ge -3; the denominator needs x - 1 \ne 0, so x \ne 1. Domain: [-3, 1) \cup (1, \infty).
  2. Perpendicular slopes multiply to -1, so the slope we want is -1 \div \frac13 = -3. Point–slope form through (2,-1): y - (-1) = -3(x-2), so y + 1 = -3x + 6 and y = -3x + 5. Check the point: at x = 2, y = -6 + 5 = -1 ✓.
  3. Read y = -2(x+1)^2 + 3 from the inside out. (x+1)^2 slides the parabola left by 1 — inside-the-bracket moves go the opposite way to what they look like; the factor 2 stretches it vertically; the minus sign flips it upside down; +3 lifts it by 3. The vertex lands at (-1, 3) and the curve opens downward, through (0, 1).
  4. Write y = 2x + 3 and solve for x: x = \frac{y-3}{2}, so f^{-1}(x) = \frac{x-3}{2}. Verify both directions, because being an inverse demands both: f(f^{-1}(x)) = 2\cdot\frac{x-3}{2} + 3 = (x-3) + 3 = x ✓ and f^{-1}(f(x)) = \frac{(2x+3)-3}{2} = x ✓.
  5. (f\circ g)(x) = f(x-2) = \frac{1}{x-2}, which fails when x = 2: domain x \ne 2. (g\circ f)(x) = \frac1x - 2, which fails when x = 0: domain x \ne 0. The two compositions differ, and so do their domains — the restriction appears wherever the division ends up, which is a different place depending on the order.

Exercises 4.

  1. Pull the leading coefficient out of the x terms first, and leave the constant alone: 2x^2 - 12x + 7 = 2(x^2 - 6x) + 7. Half of -6 is -3, so x^2 - 6x = (x-3)^2 - 9. Then 2\left[(x-3)^2 - 9\right] + 7 = 2(x-3)^2 - 18 + 7 = 2(x-3)^2 - 11. The vertex is (3, -11) and the parabola opens upward. Check by putting x = 3 into the original: 18 - 36 + 7 = -11 ✓.
  2. The discriminant is \Delta = k^2 - 4(1)(9) = k^2 - 36. (a) Equal roots need \Delta = 0, so k = \pm 6. (b) No real roots need \Delta < 0, so k^2 < 36, that is -6 < k < 6. Note k = 0 sits in that range, and indeed x^2 + 9 = 0 has no real solution.
  3. Use the sum and product of the roots rather than the roots themselves: \alpha + \beta = 5 and \alpha\beta = 3. Then \alpha^2 + \beta^2 = (\alpha+\beta)^2 - 2\alpha\beta = 25 - 6 = 19, and \frac1\alpha + \frac1\beta = \frac{\beta+\alpha}{\alpha\beta} = \frac53. The roots are in fact \frac{5 \pm \sqrt{13}}{2}, and never needed — which is the point of the exercise.
  4. Look for an integer root among the divisors of the constant term 6. p(1) = 1 - 7 + 6 = 0, so (x-1) is a factor. Dividing out, x^3 - 7x + 6 = (x-1)(x^2 + x - 6), and x^2 + x - 6 = (x+3)(x-2). Completely: (x-1)(x-2)(x+3). Check the constant term, which is the fastest audit: (-1)(-2)(3) = 6 ✓.
  5. h(t) = 20t - 5t^2 = 5t(4-t), which vanishes at t = 0 (the throw) and t = 4 — so it lands after 4 seconds. A parabola is symmetric about its vertex, so the maximum sits halfway between the two roots, at t = 2: h(2) = 40 - 20 = 20 metres. Calculus, when it arrives in Chapter 13, will agree: h'(t) = 20 - 10t is zero at t = 2.

Exercises 5.

  1. A logarithm asks “what power?”. For \log_4 8, put both numbers in base 2: 4 = 2^2 and 8 = 2^3, and 4^{3/2} = \left(2^2\right)^{3/2} = 2^3 = 8, so the answer is \frac32. Next, \ln\frac{1}{e^2} = \ln e^{-2} = -2. And \log_{10}0.001 = \log_{10}10^{-3} = -3. A negative logarithm is the signature of a number below 1, not of anything going wrong.
  2. Take logarithms of both sides — any base will do, natural is conventional: (x+1)\ln 2 = x\ln 5. Expand and gather the x terms: x\ln2 + \ln2 = x\ln5, so \ln 2 = x(\ln 5 - \ln 2) and x = \frac{\ln 2}{\ln 5 - \ln 2} = \frac{\ln 2}{\ln 2.5} \approx 0.756. Check both sides numerically: 2^{1.756} \approx 3.38 and 5^{0.756} \approx 3.38 ✓.
  3. Doubling means 1.08^n = 2, so n = \frac{\ln 2}{\ln 1.08} \approx \frac{0.693}{0.0770} \approx 9.0 years. In general n = \frac{\ln 2}{\ln(1+r)}, and for small r we have \ln(1+r) \approx r, giving n \approx \frac{0.693}{r} = \frac{69.3}{100r} — strictly a rule of 69.3. Practitioners say 72 for two reasons: \ln(1+r) is a little less than r, which makes 69.3 a slight underestimate at realistic rates, and 72 divides cleanly by 2, 3, 4, 6, 8, 9 and 12 — which matters when the whole point is doing it in your head.
  4. Adding logarithms multiplies their arguments: \log_2 12 + \log_2\frac43 = \log_2\!\left(12 \cdot \frac43\right) = \log_2 16 = 4. Spotting that the product is a power of the base is the entire trick — taken separately, \log_2 12 and \log_2\frac43 are both irrational.
  5. Each half-life multiplies what is left by \frac12, and 20\,000 years is \frac{20000}{5730} \approx 3.49 half-lives, so the surviving fraction is \left(\frac12\right)^{3.49} \approx 0.089 — about 9%. The exponent does not have to be a whole number: decay does not pause between half-lives waiting to be counted.

Exercises 6.

  1. To go to radians, multiply by \frac{\pi}{180}: 150° = \frac{150\pi}{180} = \frac{5\pi}{6}. Its reference angle is 30° and it lies in the second quadrant, where sine is positive and cosine negative: \sin 150° = \frac12, \cos 150° = -\frac{\sqrt3}{2}. Going back the other way, multiply by \frac{180}{\pi}: \frac{5\pi}{4} = 225°, third quadrant, reference angle 45°, where both are negative: \sin 225° = \cos 225° = -\frac{\sqrt2}{2}.
  2. Rewrite both double angles in terms of \theta. For the numerator, \cos 2\theta = 1 - 2\sin^2\theta, so 1 - \cos 2\theta = 2\sin^2\theta; for the denominator, \sin 2\theta = 2\sin\theta\cos\theta. Dividing, \frac{2\sin^2\theta}{2\sin\theta\cos\theta} = \frac{\sin\theta}{\cos\theta} = \tan\theta ✓ — valid wherever \sin 2\theta \ne 0, which is the fine print every identity of this shape carries.
  3. Treat it as a quadratic in \sin x and factor: (2\sin x + 1)(\sin x - 1) = 0, so \sin x = -\frac12 or \sin x = 1. On [0, 2\pi), \sin x = 1 gives x = \frac{\pi}{2}, and \sin x = -\frac12 gives the third- and fourth-quadrant angles with reference \frac{\pi}{6}: x = \frac{7\pi}{6} and x = \frac{11\pi}{6}. Three solutions in all. Substituting each back is worth the ten seconds, because the easiest mistake here is finding one angle and forgetting its quadrant partner.
  4. Two sides with the angle between them is exactly the law of cosines: c^2 = 5^2 + 8^2 - 2(5)(8)\cos 60° = 89 - 80\cdot\frac12 = 49, so c = 7. The same three pieces of data give the area without any extra work: \frac12 ab\sin C = \frac12(5)(8)\sin 60° = 20\cdot\frac{\sqrt3}{2} = 10\sqrt3 \approx 17.3.
  5. Compare with y = A\sin(bx + \varphi). The amplitude is |A| = 3 and the period is \frac{2\pi}{b} = \frac{2\pi}{2} = \pi — the 2 inside compresses one full wave into half the usual span. For the shift, factor the b out rather than reading \varphi off directly: 2x - \frac{\pi}{2} = 2\left(x - \frac{\pi}{4}\right), so the graph is an ordinary sine moved \frac{\pi}{4} to the right. Reading the shift as \frac{\pi}{2} is the standard trap.
  6. Principal values are the agreed windows, and the whole exercise is respecting them. \arcsin returns a value in \left[-\frac\pi2, \frac\pi2\right], so \arcsin\frac{\sqrt3}{2} = \frac{\pi}{3} — not \frac{2\pi}{3}, whose sine is also \frac{\sqrt3}{2} but which lies outside the window. \arccos returns a value in [0, \pi], so \arccos\left(-\frac12\right) = \frac{2\pi}{3}. \arctan returns a value in \left(-\frac\pi2, \frac\pi2\right), so \arctan(-1) = -\frac{\pi}{4}. For the simplification, put \theta = \arcsin x and draw the triangle it describes: opposite x, hypotenuse 1, so Pythagoras gives the adjacent side as \sqrt{1-x^2} and therefore \cos(\arcsin x) = \sqrt{1-x^2}.

Exercises 7.

  1. Group the x terms and the y terms and complete the square in each: x^2 - 6x + y^2 + 4y = 12 becomes (x-3)^2 - 9 + (y+2)^2 - 4 = 12, so (x-3)^2 + (y+2)^2 = 25. Centre (3, -2), radius 5. Note the signs reverse: -6x produces a centre coordinate of +3.
  2. The endpoints of a diameter hand you both facts. The centre is their midpoint, \left(\frac{1+5}{2}, \frac{2 + (-4)}{2}\right) = (3, -1), and the radius is half the distance between them: \frac12\sqrt{(5-1)^2 + (-4-2)^2} = \frac12\sqrt{16+36} = \frac{\sqrt{52}}{2} = \sqrt{13}. So (x-3)^2 + (y+1)^2 = 13.
  3. Here a^2 = 25 and b^2 = 9, so a = 5 exceeds b = 3 and the major axis is the horizontal one — always settle that first, because it decides where the foci go. Then c^2 = a^2 - b^2 = 16, so c = 4: the foci are (\pm 4, 0) and the eccentricity is e = \frac{c}{a} = \frac45 = 0.8, nearer 1 than 0, which is why this ellipse looks visibly squashed rather than nearly circular.
  4. Compare with the standard form y^2 = 4ax: here 4a = 12, so a = 3. The focus is at (a, 0) = (3, 0) and the directrix is the vertical line x = -a, that is x = -3. Every point on the parabola is equidistant from that point and that line — which is the definition the algebra encodes.
  5. Substitute the line into the curve: y = x+1 gives (x+1)^2 = 4x, i.e. x^2 - 2x + 1 = 0, i.e. (x-1)^2 = 0. The repeated root is the whole answer: it says the line meets the parabola at exactly one point, x = 1 and y = 2, which is what tangency means algebraically. A line that crossed the curve would leave two distinct roots; one that missed would leave a negative discriminant and none.

Exercises 8.

  1. Two facts give two equations: a + 4d = 14 and a + 11d = 35. Subtracting kills a outright — 7d = 21, so d = 3, and then a = 14 - 4(3) = 2. For the sum, S_{20} = \frac{20}{2}\left[2a + (20-1)d\right] = 10\left(4 + 57\right) = 610.
  2. Split the sum into pieces you already know: \sum_{k=1}^{60}(3k-1) = 3\sum_{k=1}^{60}k - \sum_{k=1}^{60}1 = 3\cdot\frac{60 \cdot 61}{2} - 60 = 3(1830) - 60 = 5430. The \frac{n(n+1)}{2} is Gauss’s pairing trick, and the -60 is the constant term counted once per term, which is the piece people drop.
  3. Count the journeys separately. The first fall is 10 m and happens once. Every rebound after that is travelled twice, up and then down, and the rebound heights form a geometric sequence 10\cdot\frac23,\ 10\left(\frac23\right)^2, \dots. So the total is 10 + 2\sum_{n\ge1}10\left(\frac23\right)^n = 10 + 2 \cdot 10 \cdot \frac{2/3}{1 - 2/3} = 10 + 20(2) = 50 m. Infinitely many bounces covering a finite distance is not a paradox: they also take a finite total time, so the ball genuinely stops.
  4. The binomial theorem gives the x^3 term of (2-x)^7 as \binom{7}{3}(2)^{7-3}(-x)^3 = 35 \cdot 16 \cdot (-1)\,x^3, so the coefficient is -560. Two traps sit in that line: the minus sign belongs to x and must be cubed with it, and the power of 2 is 7-3 = 4, not 3.
  5. This is geometric with first term 1 and ratio r = x - 2, so it converges exactly when |x - 2| < 1, that is 1 < x < 3, and then sums to \frac{1}{1-r} = \frac{1}{1 - (x-2)} = \frac{1}{3-x}. Both endpoints fail, in different ways: at x = 3 the ratio is 1 and the terms never shrink, while at x = 1 the series alternates 1 - 1 + 1 - \cdots and refuses to settle on anything.

Exercises 9.

  1. Six letters, but with repeats: three A’s, two N’s, one B. The count is \frac{6!}{3!\,2!\,1!} = \frac{720}{12} = 60. The division is the correction for indistinguishability — if the three A’s carried little labels, permuting them would count as a new word, and there are 3! ways to label them.
  2. “Exactly two” means choose 2 of the 4 aces and 3 of the 48 non-aces: \frac{\binom42\binom{48}3}{\binom{52}5} = \frac{6 \times 17\,296}{2\,598\,960} \approx 0.0399, about one hand in 25. The word exactly is doing real work: leaving it out would sweep in the hands with three or four aces and give a different, larger answer.
  3. Conditioning simply shrinks the sample space. The outcomes with sum \ge 10 are (4,6), (5,5), (6,4), (5,6), (6,5), (6,6) — six of the 36, all equally likely. Two of those six are doubles, so the probability is \frac26 = \frac13. Compare the unconditional probability of a double, \frac{6}{36} = \frac16: knowing the sum is large has doubled it, because large sums are crowded with high pairs.
  4. Bayes’ theorem, or just careful bookkeeping. P(\text{B and defective}) = 0.4 \times 0.05 = 0.02 and P(\text{A and defective}) = 0.6 \times 0.02 = 0.012, so defective items arrive at rate 0.032 overall. Then P(\text{B} \mid \text{defective}) = \frac{0.02}{0.032} = 0.625. Machine B makes only 40% of the output but 62.5% of the defects: the worse rate more than cancels the smaller share.
  5. Binomial with n = 8, p = \frac14. P(X \le 1) = P(0) + P(1) = \left(\frac34\right)^8 + 8\cdot\frac14\left(\frac34\right)^7 \approx 0.100 + 0.267 = 0.367. The mean is np = 2 and the variance is np(1-p) = 8 \cdot \frac14 \cdot \frac34 = 1.5, so \sigma = \sqrt{1.5} \approx 1.22. Note that the variance is not np: the (1-p) factor is what makes a near-certain or near-impossible event barely vary at all.

Exercises 10.

  1. \vec a + 2\vec b = (2,-1,3) + (2,8,-4) = (4, 7, -1). The dot product is 2(1) + (-1)(4) + 3(-2) = 2 - 4 - 6 = -8. For the angle, \cos\theta = \frac{\vec a \cdot \vec b}{|\vec a||\vec b|} = \frac{-8}{\sqrt{14}\sqrt{21}} = \frac{-8}{\sqrt{294}} \approx -0.467, so \theta \approx 117.8°. The negative dot product had already announced the answer would be obtuse, before any inverse cosine was taken.
  2. The cross product is perpendicular to both by construction, so there is nothing to solve: \vec a \times \vec b = \big((-1)(-2) - (3)(4),\ (3)(1) - (2)(-2),\ (2)(4) - (-1)(1)\big) = (-10, 7, 9). Its length is \sqrt{100 + 49 + 81} = \sqrt{230}, so a unit normal is \frac{1}{\sqrt{230}}(-10, 7, 9). Negating it is equally correct — perpendicularity does not choose a side.
  3. Take two edge vectors from the first vertex: \vec u = (1,2,0) and \vec v = (2,0,1). Then \vec u \times \vec v = (2\cdot1 - 0\cdot0,\ 0\cdot2 - 1\cdot1,\ 1\cdot0 - 2\cdot2) = (2, -1, -4). A cross product’s length is the area of the parallelogram those two edges span, and a triangle is half of it: \frac12\sqrt{4 + 1 + 16} = \frac{\sqrt{21}}{2} \approx 2.29.
  4. A plane is \vec n \cdot (\vec r - \vec r_0) = 0. With \vec n = (2,-1,3) and \vec r_0 = (1,1,1): 2(x-1) - (y-1) + 3(z-1) = 0, which tidies to 2x - y + 3z = 4. The normal’s components are literally the coefficients of x, y, z — so in a plane equation the normal is read off, never computed.
  5. Let the rhombus be spanned by \vec a and \vec b from one corner, with |\vec a| = |\vec b| — that equality is what makes it a rhombus. The diagonals are \vec a + \vec b and \vec a - \vec b, and (\vec a + \vec b)\cdot(\vec a - \vec b) = |\vec a|^2 - |\vec b|^2 = 0. A vanishing dot product means perpendicular, so the diagonals cross at right angles. No coordinates and no trigonometry: the entire proof is one difference of squares.

Exercises 11.

  1. Multiply top and bottom by the conjugate of the denominator, which turns the denominator real: \frac{(3+4i)(1+2i)}{(1-2i)(1+2i)}. Below, (1-2i)(1+2i) = 1 + 4 = 5. Above, 3 + 6i + 4i + 8i^2 = 3 + 10i - 8 = -5 + 10i. So the quotient is \frac{-5+10i}{5} = -1 + 2i. Check by multiplying back: (-1+2i)(1-2i) = -1 + 2i + 2i - 4i^2 = 3 + 4i ✓.
  2. The modulus is r = \sqrt{(-1)^2 + (\sqrt3)^2} = \sqrt4 = 2. The point (-1, \sqrt3) sits in the second quadrant, and its reference angle has tangent \frac{\sqrt3}{1}, i.e. 60°, so \theta = 180° - 60° = 120° = \frac{2\pi}{3}. Polar form: z = 2e^{2\pi i/3}. The quadrant check is not optional — feeding \frac{\sqrt3}{-1} to an inverse tangent returns -60°, which names the opposite ray.
  3. Convert before raising. 1 + i has modulus \sqrt2 and argument \frac{\pi}{4}, so 1+i = \sqrt2\,e^{i\pi/4}. De Moivre raises the modulus and multiplies the argument: (1+i)^{10} = \left(\sqrt2\right)^{10}e^{i \cdot 10\pi/4} = 2^5 e^{i5\pi/2}. Since \frac{5\pi}{2} = 2\pi + \frac{\pi}{2}, that is 32e^{i\pi/2} = 32i. Expanding the tenth power binomially would fill a page and invite a sign error.
  4. Put the target in polar form: 8i = 8e^{i\pi/2}. A cube root takes the cube root of the modulus and divides the argument by three, and the remaining roots sit \frac{2\pi}{3} apart around the circle: 2e^{i\pi/6}, 2e^{i(\pi/6 + 2\pi/3)} = 2e^{i5\pi/6}, and 2e^{i(\pi/6 + 4\pi/3)} = 2e^{i3\pi/2}. In rectangular form, \sqrt3 + i, -\sqrt3 + i, and -2i. Three roots equally spaced on the circle of radius 2 — the pentagon of the chapter’s figure, with five replaced by three.
  5. In polar form the product is r_1e^{i\theta_1} \cdot r_2e^{i\theta_2} = r_1r_2\,e^{i(\theta_1+\theta_2)}, and the modulus of that is r_1r_2 = |z_1||z_2|. Multiplication of complex numbers multiplies lengths and adds angles; the identity asked for is simply the first half of that sentence read off.

Exercises 12.

  1. Each entry is a row of the left matrix dotted with a column of the right. AB = \begin{pmatrix} 1(0)+2(-1) & 1(1)+2(2) \\ 3(0)+4(-1) & 3(1)+4(2)\end{pmatrix} = \begin{pmatrix} -2 & 5 \\ -4 & 11\end{pmatrix}, while BA = \begin{pmatrix} 0(1)+1(3) & 0(2)+1(4) \\ -1(1)+2(3) & -1(2)+2(4)\end{pmatrix} = \begin{pmatrix} 3 & 4 \\ 5 & 6\end{pmatrix}. They differ, and that is the substance rather than an accident of these numbers: a matrix product composes transformations, and doing B then A is not the same act as doing A then B.
  2. \det A = 3(3) - 4(2) = 1. For a 2\times2 the inverse swaps the diagonal entries, negates the off-diagonal ones, and divides by the determinant — which here is 1, so no division: A^{-1} = \begin{pmatrix} 3 & -4 \\ -2 & 3\end{pmatrix}. Then \vec x = A^{-1}\begin{pmatrix}10\\7\end{pmatrix} = \begin{pmatrix}3(10)-4(7)\\-2(10)+3(7)\end{pmatrix} = \begin{pmatrix}2\\1\end{pmatrix}, so x = 2, y = 1. Check both original equations: 3(2)+4(1) = 10 ✓ and 2(2)+3(1) = 7 ✓.
  3. No inverse means a vanishing determinant: 3(4) - 6k = 0, so k = 2. Geometrically the two rows become proportional — (3,2) and (6,4) point along the same line — so the map flattens the entire plane onto a single line. Whole directions are crushed to nothing, and information destroyed cannot be restored, which is precisely what having no inverse means.
  4. Expand along the first row, where the zero saves an entire 2\times2: 1\cdot\det\begin{pmatrix}3&1\\1&0\end{pmatrix} - 0 + 2\cdot\det\begin{pmatrix}-1&3\\2&1\end{pmatrix} = 1(0-1) + 2(-1-6) = -1 - 14 = -15. Choosing the row or column with the most zeros is always the cheaper route, and it is a free choice.
  5. \det R_\theta = \cos^2\theta + \sin^2\theta = 1, so a rotation preserves both area and orientation — as it must, being a rigid turn. Multiplying out R_\alpha R_\beta gives entries \cos\alpha\cos\beta - \sin\alpha\sin\beta and \sin\alpha\cos\beta + \cos\alpha\sin\beta, which are exactly \cos(\alpha+\beta) and \sin(\alpha+\beta); hence R_\alpha R_\beta = R_{\alpha+\beta}. Geometrically: composing two rotations is a rotation through the summed angle. Read the other way, this derives the angle-addition formulas of Chapter 6 — they are that composition written out in coordinates.

Exercises 13.

  1. Form the difference quotient and simplify before taking any limit: \frac{(x+h)^2 + 3(x+h) - x^2 - 3x}{h} = \frac{2xh + h^2 + 3h}{h} = 2x + h + 3. Now let h \to 0: f'(x) = 2x + 3. The cancellation is legal precisely because h \ne 0 while the limit is being taken — the limit is about what happens near 0, never at it, which is the whole reason the definition is phrased with a limit at all.
    1. Product rule: \frac{d}{dx}\left[x^3e^x\right] = 3x^2e^x + x^3e^x = x^2e^x(3+x). (b) Quotient rule: \frac{\frac1x \cdot x - \ln x \cdot 1}{x^2} = \frac{1 - \ln x}{x^2}. (c) Chain rule twice over. The outside is \sqrt{u} with u = 1 + \sin^2 x, contributing \frac{1}{2\sqrt u}; the inside gives \frac{du}{dx} = 2\sin x\cos x. The twos cancel: \frac{\sin x\cos x}{\sqrt{1+\sin^2x}}.
  2. y' = 3x^2 - 2, so the slope at x = 1 is 1, and the point is y(1) = 1 - 2 = -1. Point–slope: y + 1 = 1(x-1), so y = x - 2.
  3. f' = 4x^3 - 12x^2 = 4x^2(x-3), which vanishes at x = 0 and x = 3. Now check the sign, which is what classifies them: 4x^2 is positive either side of 0, so f' has the sign of (x-3) — negative for all x < 3 and positive after. So f falls straight through x = 0 without turning: a flat inflection, not an extremum. At x = 3 it turns from falling to rising — a minimum, with f(3) = 81 - 108 = -27. The moral is that f' = 0 is necessary for an extremum and not sufficient; here the even power 4x^2 refuses to change sign.
  4. Cutting x from each corner leaves a base of side 12 - 2x and a height of x, so V = x(12-2x)^2 on the domain 0 < x < 6. Differentiate with the product rule and factor rather than expanding: V' = (12-2x)^2 + x\cdot 2(12-2x)(-2) = (12-2x)\left[(12-2x) - 4x\right] = (12-2x)(12-6x), zero at x = 6 and x = 2. At x = 6 there is no base left and V = 0, so the maximum is x = 2, giving V = 2(8)^2 = 128 cm³. Checking the ends of the domain is not a formality here: V vanishes at both.

Exercises 14.

  1. \int_0^1(3x^2 - 2x + 4)\,dx = \left[x^3 - x^2 + 4x\right]_0^1 = (1 - 1 + 4) - 0 = 4. And \int_1^e \frac{dx}{x} = \left[\ln x\right]_1^e = 1 - 0 = 1 — which is exactly what singles out e: it is the point where the area under 1/x, measured from 1, first reaches 1.
  2. For \int x\sqrt{x^2+1}\,dx, put u = x^2 + 1, so du = 2x\,dx and x\,dx = \frac{du}{2}: the integral becomes \frac12\int\sqrt u\,du = \frac12 \cdot \frac23 u^{3/2} = \frac13(x^2+1)^{3/2} + C. For \int\tan x\,dx = \int\frac{\sin x}{\cos x}dx, put u = \cos x, so du = -\sin x\,dx: the integral becomes -\int\frac{du}{u} = -\ln|\cos x| + C. Both are one move — find the inner function whose derivative is already sitting in the integrand.
  3. Integration by parts, \int u\,dv = uv - \int v\,du, with u = \ln x and dv = x\,dx: \int x\ln x\,dx = \frac{x^2}{2}\ln x - \int \frac{x^2}{2}\cdot\frac1x\,dx = \frac{x^2}{2}\ln x - \frac{x^2}{4} + C. The entire decision is choosing u = \ln x, because differentiating it simplifies matters; the other assignment makes the remaining integral worse than the one you started with.
  4. \int_0^\pi \sin x\,dx = \left[-\cos x\right]_0^\pi = -(-1) - (-1) = 2. Because \sin x \ge 0 across all of [0,\pi], the integral is the area with no sign correction needed. Over [0, 2\pi] the integral would be 0 while the area is 4 — a distinction that matters the moment the curve crosses the axis.
  5. Slice perpendicular to the axis of revolution: each slice is a disc of radius y = \sqrt x, so V = \pi\int_0^4 y^2\,dx = \pi\int_0^4 x\,dx = \pi\left[\frac{x^2}{2}\right]_0^4 = 8\pi. Squaring the radius is what makes this integral trivial — the square root disappears before any integration happens.

Exercises 15.

  1. Measure the gap: \left|\frac{2n+1}{n+3} - 2\right| = \left|\frac{2n+1 - 2n - 6}{n+3}\right| = \frac{5}{n+3}. Given any \varepsilon > 0, this is below \varepsilon as soon as n + 3 > \frac5\varepsilon, that is n > \frac5\varepsilon - 3. So take N = \frac5\varepsilon; every term beyond it sits within \varepsilon of 2. That is the definition met — you were handed \varepsilon and produced N, and the fact that you always can is the entire content of the claim.
  2. Increasing, by induction: a_1 = \sqrt2 \approx 1.414 and a_2 = \sqrt{2+\sqrt2} \approx 1.848, so the first step holds; and if a_n < a_{n+1} then 2 + a_n < 2 + a_{n+1}, and taking square roots preserves that, so a_{n+1} < a_{n+2}. Bounded above by 2, also by induction: a_1 < 2, and if a_n < 2 then a_{n+1} = \sqrt{2+a_n} < \sqrt4 = 2. An increasing sequence with a ceiling must converge — that is the completeness of \mathbb{R} doing its work. Only now solve for the limit: letting n\to\infty in a_{n+1} = \sqrt{2+a_n} gives L = \sqrt{2+L}, so L^2 - L - 2 = 0, (L-2)(L+1) = 0, and L = 2 since the terms are positive. The order matters: that equation would hand you an answer even for a sequence that diverged, so convergence has to be established first.
    1. Diverges. Compare with the harmonic series: \frac{n}{n^2+1} \ge \frac{1}{2n} for every n \ge 1, since cross-multiplying gives 2n^2 \ge n^2 + 1, i.e. n^2 \ge 1. As \sum\frac{1}{2n} is half the harmonic series and diverges, so does this. It diverges slowly — the partial sum after 100\,000 terms is only about 11.4, growing by \ln 10 \approx 2.3 per decade — which is why series like this are so often mistaken for convergent. (b) Converges, by the ratio test: \frac{a_{n+1}}{a_n} = \frac{(n+1)!}{(n+1)^{n+1}}\cdot\frac{n^n}{n!} = \left(\frac{n}{n+1}\right)^n \to \frac1e < 1. (c) Converges, by the alternating series test: \frac{1}{\sqrt n} decreases monotonically to 0. Not absolutely, though — \sum\frac{1}{\sqrt n} diverges — so this is conditional convergence, and rearranging its terms could change the sum.
  3. Let g(x) = \cos x - x, which is continuous everywhere. Then g(0) = 1 > 0 and g(1) = \cos 1 - 1 \approx -0.46 < 0. A continuous function on [0,1] taking values of opposite sign at the endpoints must cross zero somewhere between them, so there is a c \in (0,1) with \cos c = c. Note what the theorem does and does not give: existence, but not the value. That value is c \approx 0.739, and no amount of algebra will produce it in closed form.
  4. Integrate the geometric series term by term. From \frac{1}{1+t} = 1 - t + t^2 - t^3 + \cdots, integrating from 0 to x gives \ln(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \cdots. The radius of convergence is 1, and the two endpoints behave differently: at x = 1 the series is the alternating harmonic series, which converges (to \ln 2); at x = -1 it becomes -\left(1 + \frac12 + \frac13 + \cdots\right), the harmonic series, which diverges. So the interval of convergence is (-1, 1] — half-open, and the asymmetry is the interesting part.

Exercises 16.

  1. Not independent. Rather than assuming, hunt for a relation: if c_1(1,2,1) + c_2(2,1,0) = (4,5,2), then the third coordinates give c_1 = 2 immediately (the second vector contributes nothing there), and the first coordinates then give 2 + 2c_2 = 4, so c_2 = 1. Check the middle coordinate, which has had no say so far: 2(2) + 1(1) = 5 ✓. So (4,5,2) = 2(1,2,1) + (2,1,0) — the third vector lies in the span of the first two and the set is dependent. Three vectors in \mathbb{R}^3 certainly can be independent, so this had to be tested rather than guessed.
  2. The second row of A is exactly twice the first, so the two rows say one thing: x + 2y + 3z = 0. Take y and z as free and solve for x = -2y - 3z; then the kernel is \{(-2y-3z,\ y,\ z)\} = \operatorname{span}\{(-2,1,0),\ (-3,0,1)\}, of dimension 2. The rank is 1, since only one row is independent and so the image is a line. Rank–nullity: 1 + 2 = 3 = \dim\mathbb{R}^3 ✓ — dimension is conserved, one direction surviving and two crushed.
  3. \det(A - \lambda I) = (4-\lambda)(3-\lambda) - (1)(2) = \lambda^2 - 7\lambda + 10 = (\lambda-5)(\lambda-2), so \lambda = 5 and \lambda = 2. For \lambda = 5, A - 5I = \begin{pmatrix}-1&1\\2&-2\end{pmatrix} and the first row says -v_1 + v_2 = 0, giving \vec v = (1,1). For \lambda = 2, A - 2I = \begin{pmatrix}2&1\\2&1\end{pmatrix} and 2v_1 + v_2 = 0 gives \vec v = (1,-2). Check both: A(1,1) = (5,5) = 5(1,1) ✓ and A(1,-2) = (2,-4) = 2(1,-2) ✓. In each case the two rows repeated the same equation, which is the confirmation that \lambda was right.
  4. \det(A - \lambda I) = (1-\lambda)^2 - 4 = 0 gives 1 - \lambda = \pm2, so \lambda = 3 and \lambda = -1, with eigenvectors (1,1) and (1,-1) respectively. Hence P = \begin{pmatrix}1&1\\1&-1\end{pmatrix}, D = \begin{pmatrix}3&0\\0&-1\end{pmatrix} and A = PDP^{-1}. Then A^5 = PD^5P^{-1} where D^5 = \begin{pmatrix}243&0\\0&-1\end{pmatrix}, and multiplying out gives \frac12\begin{pmatrix}3^5-1 & 3^5+1\\ 3^5+1 & 3^5-1\end{pmatrix} = \begin{pmatrix}121&122\\122&121\end{pmatrix}. Squaring A repeatedly would need four matrix products; in the eigenbasis it is one exponentiation of two ordinary numbers, and the same trick is what makes A^{100} no harder.
  5. Suppose A\vec v_1 = \lambda_1\vec v_1 and A\vec v_2 = \lambda_2\vec v_2 with \lambda_1 \ne \lambda_2, and suppose c_1\vec v_1 + c_2\vec v_2 = \vec 0. Apply A to that relation: c_1\lambda_1\vec v_1 + c_2\lambda_2\vec v_2 = \vec 0. Now multiply the original relation by \lambda_2 and subtract, which kills the \vec v_2 term: c_1(\lambda_1 - \lambda_2)\vec v_1 = \vec 0. Since \lambda_1 \ne \lambda_2 and \vec v_1 \ne \vec 0, we get c_1 = 0, and then c_2\vec v_2 = \vec 0 forces c_2 = 0. So the only relation is the trivial one. The same argument extends by induction to any number of distinct eigenvalues, and that is what guarantees an n\times n matrix with n distinct eigenvalues can be diagonalised.

Exercises 17.

  1. Differentiate in x with y held frozen: f_x = 3x^2y - ye^{xy} (the chain rule supplies the y from the exponent). Then in y with x frozen: f_y = x^3 - xe^{xy}. Differentiating each once more the other way, both mixed partials come out as 3x^2 - e^{xy}(1 + xy) ✓. That agreement is Clairaut’s theorem, not luck — for functions with continuous second partials the order of differentiation never matters, which is why the Hessian is symmetric.
  2. \nabla f = (2x + 3y,\ 3x - 2y), so at (1,2) it is (8, -1). “Toward (4,6)” means along the displacement (4,6) - (1,2) = (3,4), which has length 5, so the unit direction is \frac15(3,4) — normalising is compulsory, since a directional derivative measures rate per unit distance. Then D_{\hat u}f = \nabla f \cdot \hat u = \frac{8(3) + (-1)(4)}{5} = \frac{20}{5} = 4. Steepest descent is straight against the gradient: -\frac{(8,-1)}{\sqrt{65}}.
  3. \nabla f = (3x^2 - 3,\ 2y) = \vec 0 requires x = \pm1 and y = 0, giving (1,0) and (-1,0). The second derivatives are f_{xx} = 6x, f_{yy} = 2, f_{xy} = 0, so D = f_{xx}f_{yy} - f_{xy}^2 = 12x. At (1,0), D = 12 > 0 with f_{xx} = 6 > 0: a local minimum. At (-1,0), D = -12 < 0: a saddle — downhill in x, uphill in y. The same cubic-plus-square shape is why gradient descent can stall on a saddle without being anywhere near a minimum.
  4. Lagrange sets \nabla f = \lambda\nabla g, so (2x, 2y) = \lambda(1, 2), giving x = \frac\lambda2 and y = \lambda — hence y = 2x, independent of \lambda, which is usually the useful form. Substituting into the constraint, x + 2(2x) = 5, so 5x = 5, x = 1 and y = 2; the minimum value is 1 + 4 = 5. Sanity check the geometry: (1,2) is a multiple of the line’s normal (1,2), and the closest approach from a point to a line is always along the perpendicular — which is what the multiplier condition has just rediscovered.
  5. In polar coordinates x^2 + y^2 = r^2 and the area element becomes dA = r\,dr\,d\theta — that extra r is the whole reason this integral is doable. The disc of radius 2 is simply 0 \le r \le 2, 0 \le \theta \le 2\pi: \int_0^{2\pi}\!\!\int_0^2 e^{-r^2}r\,dr\,d\theta = 2\pi\left[-\tfrac12 e^{-r^2}\right]_0^2 = \pi\left(1 - e^{-4}\right) \approx 3.08. In Cartesian coordinates the same integral has no elementary antiderivative at all.

Exercises 18.

  1. Separate the variables: y\,dy = x\,dx, so integrating both sides gives \frac{y^2}{2} = \frac{x^2}{2} + c, i.e. y^2 - x^2 = C. The initial condition y(0) = 2 gives C = 4, so y^2 - x^2 = 4, and taking the branch through (0,2), y = \sqrt{x^2+4}. Geometrically the solution curves are the hyperbolas y^2 - x^2 = C — one through every starting point, never crossing, exactly as the slope-field picture promises.
  2. Write it as y' + P(x)y = Q(x) with P = 1, so the integrating factor is \mu = e^{\int P\,dx} = e^x. Multiplying through makes the left side an exact derivative: \left(e^xy\right)' = xe^x. Integrate the right side by parts (Chapter 14), with u = x and dv = e^x dx: \int xe^x\,dx = xe^x - \int e^x dx = (x-1)e^x + C. So e^xy = (x-1)e^x + C and y = x - 1 + Ce^{-x}. Verify by substitution: y' + y = \left(1 - Ce^{-x}\right) + \left(x - 1 + Ce^{-x}\right) = x ✓ — the Ce^{-x} terms cancel, which is what “homogeneous solution” means.
  3. Try y = e^{rx}; the equation becomes the characteristic polynomial r^2 - r - 6 = 0, i.e. (r-3)(r+2) = 0, so r = 3 and r = -2 and the general solution is y = Ae^{3x} + Be^{-2x}. The conditions give A + B = 1 and 3A - 2B = 8; solving, A = 2 and B = -1, so y = 2e^{3x} - e^{-2x}. Check: y(0) = 1 ✓ and y'(0) = 6 + 2 = 8 ✓.
  4. Here r^2 + 4 = 0 gives r = \pm 2i — imaginary roots, which by Euler’s formula means oscillation rather than growth: y = A\cos 2t + B\sin 2t. From y(0) = 3, A = 3; from y'(0) = -2A\sin 0 + 2B\cos 0 = 2B = 8, B = 4. So y = 3\cos 2t + 4\sin 2t. To read off the amplitude, combine the two into one sinusoid: \sqrt{A^2 + B^2} = \sqrt{9+16} = 5. The motion is a single oscillation of amplitude 5, not two separate ones.
  5. Newton’s law of cooling applies to the excess over the surroundings, so let u = T - 20: then u' = -ku and u = u_0e^{-kt}, giving T = 20 + 70e^{-kt} since the initial excess is 90 - 20 = 70. From T(5) = 70: 50 = 70e^{-5k}, so e^{-5k} = \frac57 and k = \frac{\ln(7/5)}{5} \approx 0.0673 per minute. For T = 40 the excess must fall to 20: e^{-kt} = \frac{20}{70} = \frac27, so t = \frac{\ln(7/2)}{k} \approx 18.6 minutes. Modelling T itself rather than the excess is the classic error — it would predict the coffee cooling past room temperature and on toward absolute zero.

Exercises 19.

  1. The set is \{1,2,3,4\}. Closure holds because 5 is prime, so no product of two nonzero residues is divisible by 5 — that is the only axiom in real doubt. Multiplication mod 5 is associative and 1 is the identity; inverses exist since 2 \times 3 = 6 \equiv 1 and 4 \times 4 = 16 \equiv 1, so 2 and 3 invert each other while 1 and 4 are self-inverse. Orders, found by repeated multiplication: |1| = 1; 2, 4, 3, 1 so |2| = 4; 3, 4, 2, 1 so |3| = 4; 4, 1 so |4| = 2. Every order divides 4, the group’s size, as Lagrange requires — and the elements of order 4 generate everything, so this group is cyclic.
  2. Suppose e and e' are both identities. Then e = ee' because e' is an identity, and ee' = e' because e is one, so e = e'. For inverses, suppose b and c both invert a. Then b = be = b(ac) = (ba)c = ec = c. Both proofs are the same trick — write the object down twice, using a different defining property each time — and neither needs commutativity, so they hold in every group.
  3. \mathbb{Z}_{12} is cyclic, so every subgroup is generated by a single element, and \langle k\rangle has order \frac{12}{\gcd(k,12)}. Distinct subgroups therefore come from k = 1, 2, 3, 4, 6, 12: orders 12, 6, 4, 3, 2, 1 — one for each divisor of 12, and every order divides 12 ✓. The converse of Lagrange is false in general (a divisor need not have a subgroup), but for cyclic groups it holds exactly, with precisely one subgroup per divisor.
  4. (\mathbb{Z}, \times) is not a group. Closure, associativity and the identity 1 are all fine; inverses fail2 \times n = 1 has no integer solution, and in fact only \pm1 are invertible. (\mathbb{Q}\setminus\{0\}, \times) is a group: closure holds because a product of nonzero rationals is a nonzero rational, associativity is inherited, 1 is the identity, and \frac pq has inverse \frac qp. Removing 0 is essential and not cosmetic, since 0 could never have an inverse.
  5. To prove something is the inverse of ab, multiply and get the identity: (ab)\left(b^{-1}a^{-1}\right) = a\left(bb^{-1}\right)a^{-1} = aea^{-1} = aa^{-1} = e, using associativity to re-bracket. The same on the other side gives \left(b^{-1}a^{-1}\right)(ab) = e, and since inverses are unique (exercise 2), b^{-1}a^{-1} is (ab)^{-1}. The order reverses because undoing a composite means undoing the last step first — socks then shoes going on, shoes then socks coming off.

Exercises 20.

  1. A density must be non-negative and enclose total area 1: 2x \ge 0 on [0,1] and \int_0^1 2x\,dx = \left[x^2\right]_0^1 = 1 ✓. Then E[X] = \int_0^1 x\cdot 2x\,dx = \frac23 — above the midpoint, as it should be for a density that leans right. For the variance, first E[X^2] = \int_0^1 x^2 \cdot 2x\,dx = \frac12, so \operatorname{Var}(X) = E[X^2] - \left(E[X]\right)^2 = \frac12 - \frac49 = \frac{1}{18}. And P\left(X > \frac12\right) = \int_{1/2}^1 2x\,dx = 1 - \frac14 = \frac34: three quarters of the probability sits in the upper half of the range.
  2. P(T > 10) = \int_{10}^\infty \frac15e^{-t/5}\,dt = \left[-e^{-t/5}\right]_{10}^\infty = e^{-2} \approx 0.135. The mean is \int_0^\infty t\cdot\frac15e^{-t/5}\,dt = 5 minutes — for an exponential, the mean is exactly the reciprocal of the rate, so it can be read straight off the density. Notice P(T > 10) = \left(e^{-1}\right)^2 = P(T>5)^2: the exponential is memoryless, so waiting two mean-lifetimes is like waiting one twice over.
  3. Sixes are binomial with n = 180 and p = \frac16, so \mu = np = 30 and \sigma = \sqrt{np(1-p)} = \sqrt{180 \cdot \frac16 \cdot \frac56} = \sqrt{25} = 5. “At least 40” on a discrete count becomes 39.5 under a continuous approximation — the continuity correction, worth half a standard error here. Then z = \frac{39.5 - 30}{5} = 1.9, and P(Z > 1.9) \approx 0.029. So about a 3% chance, which is the CLT of this chapter doing the work: the binomial is being replaced by a normal curve of matching mean and spread.
  4. The standard error is \frac{s}{\sqrt n} = \frac{4}{\sqrt{64}} = \frac48 = 0.5, and 95% coverage needs 1.96 of them: the margin is 1.96 \times 0.5 = 0.98. So the interval is 50.2 \pm 0.98 = (49.22,\ 51.18). Read it correctly: it does not say \mu has a 95% chance of lying there, it says this procedure captures the true \mu in 95% of samples like this one. And since the margin goes as \frac{1}{\sqrt n}, halving it would take 256 measurements rather than 128.
  5. Under the null hypothesis of fairness, the sample proportion has mean 0.5 and standard error \frac{\sqrt{0.5 \times 0.5}}{\sqrt{1000}} = \frac{0.5}{\sqrt{1000}} \approx 0.0158. The observed proportion is 0.570, so z = \frac{0.570 - 0.5}{0.0158} \approx 4.43 — more than four standard errors out, with a two-sided p-value below 0.0001. Reject fairness decisively at the 5% level. Note how modest the effect is in absolute terms: 570 rather than 500 heads looks unremarkable, and it is the sample size that makes it overwhelming evidence.

Exercises 21.

  1. \cos\theta = \frac{\vec a \cdot \vec b}{|\vec a||\vec b|}. The dot product is 1(2) + 2(1) + 2(2) = 8, and both vectors have length \sqrt{1+4+4} = 3, so the similarity is \frac{8}{9} \approx 0.889. That corresponds to an angle of about 27°: despite having their components in a different order, the two point in nearly the same direction.
  2. Minimising L = \sum_i\left(y_i - (wx_i + b)\right)^2 and setting both partials to zero gives the normal equations w\sum x^2 + b\sum x = \sum xy and w\sum x + nb = \sum y. From the data, \sum x = 6, \sum x^2 = 14, \sum y = 14, \sum xy = 0 + 3 + 8 + 18 = 29, and n = 4: so 14w + 6b = 29 and 6w + 4b = 14. The second halves to 3w + 2b = 7, giving b = \frac{7-3w}{2}; substituting, 14w + 3(7-3w) = 29, so 5w = 8, w = 1.6 and then b = 1.1. The fitted line is y = 1.6x + 1.1.
  3. The weight matrix is 256 \times 512 = 131\,072 numbers, plus 256 biases — 131\,328 parameters in the layer. A forward pass computes each of the 256 outputs as a dot product of length 512, so 256 \times 512 = 131\,072 multiplications per example: one per weight. That is the rule of thumb worth carrying — a dense layer costs about as many multiplications as it has weights, which is why parameter count and compute cost move together.
  4. \det(C - \lambda I) = (5-\lambda)(2-\lambda) - 4 = \lambda^2 - 7\lambda + 6 = (\lambda - 6)(\lambda - 1), so \lambda = 6 and \lambda = 1. The total variance is the trace, 5 + 2 = 7, and it equals the sum of the eigenvalues — always true, and a free check on the arithmetic. The first principal component therefore explains \frac67 \approx 86\% of the variance: one direction carries nearly all the structure and the second is close to noise, which is exactly the situation that makes dimensionality reduction worth doing.
  5. Scaling every vector by c > 0 multiplies the numerator \vec a \cdot \vec b by c^2, and multiplies each norm by c — so the denominator by c^2 as well. They cancel, and the cosine is unchanged. For documents this is precisely the property you want: a long article and a short post on the same subject have similar word proportions but very different vector lengths, so Euclidean distance would report them as dissimilar for no reason except length. Cosine discards length and compares direction, which is where the meaning sits.

Exercises 22.

  1. Write \sigma = \left(1+e^{-x}\right)^{-1} and differentiate: \sigma' = -\left(1+e^{-x}\right)^{-2}\cdot\left(-e^{-x}\right) = \frac{e^{-x}}{\left(1+e^{-x}\right)^2}. Now split that product deliberately: \frac{1}{1+e^{-x}} \cdot \frac{e^{-x}}{1+e^{-x}} = \sigma\,(1-\sigma), because 1 - \sigma = \frac{e^{-x}}{1+e^{-x}}. The derivative is largest where \sigma'' = 0, which is x = 0; there \sigma = \frac12 and \sigma' = \frac14. That ceiling of \frac14 is the reason deep stacks of sigmoids vanish: ten layers multiply by at most \left(\frac14\right)^{10}.
  2. L' = 2w + 4, and the update is w \leftarrow w - 0.25L'. From w_0 = 0: L'(0) = 4, so w_1 = -1. Then L'(-1) = 2, so w_2 = -1.5. Then L'(-1.5) = 1, so w_3 = -1.75. The steps halve each time and it is heading for w^* = -2, where L' = 0 — approaching geometrically and never quite arriving, which is the ordinary behaviour of gradient descent on a quadratic.
  3. \text{ReLU}(u) = \max(0,u) is flat for u < 0 and the identity for u > 0, and here u = 3x - 6 is negative exactly when x < 2. So f'(x) = 0 for x < 2, and f'(x) = 3 for x > 2 by the chain rule. For x < 2 the unit is dead: backpropagation multiplies by that zero, so no gradient at all reaches the weight 3 from this example, and the example teaches it nothing. If enough of the data sits on that side, the unit never recovers — the dying-ReLU problem, and the reason variants like leaky ReLU exist.
  4. The chain rule multiplies the per-layer factors, so what arrives at layer 1 is scaled by 0.5^{10} \approx 0.00098 — roughly a thousandth. That is the vanishing gradient: the early layers barely learn. With 1.5 instead, 1.5^{10} \approx 57.7, and updates overshoot: the exploding gradient. Both are the same arithmetic, since repeated multiplication is unforgiving on either side of 1, and keeping those factors near 1 is much of what normalisation layers and careful initialisation are for.
  5. L' = 2(w-a) + 2(w-b) = 4w - 2(a+b), and L'' = 4 > 0 everywhere — a positive second derivative everywhere is exactly convexity, so the one critical point must be the global minimum rather than merely a local one. Setting L' = 0 gives w = \frac{a+b}{2}: the mean. This is the two-point version of a fact used constantly — the mean is the number that minimises total squared distance to a set of points — and it is why squared error and averaging always turn up in each other’s company.

Exercises 23.

  1. Exponentiate each logit: e^2 = 7.389, e^0 = 1, e^{-2} = 0.135, which sum to 8.524. Dividing each by that total gives (0.867,\ 0.117,\ 0.016), and those sum to 1 ✓. Adding 10 to every logit multiplies every numerator by e^{10} and the denominator by e^{10} as well, so everything cancels and the probabilities are identical — softmax depends only on the differences between logits. Real implementations use this deliberately, subtracting the largest logit before exponentiating so that e^{z} never overflows.
  2. The cross-entropy contributed by one example is -\ln q for the true class. So -\ln 0.9 \approx 0.105 and -\ln 0.01 \approx 4.605: the confidently wrong example contributes about 44 times the loss of the confidently right one, and its gradient dominates in the same proportion. That is by design rather than by accident — the logarithm makes being confidently wrong hurt steeply while being right adds almost nothing left to learn from.
  3. H = -\sum_i p_i\log_2 p_i = -\left[\frac12\log_2\frac12 + 5 \cdot \frac{1}{10}\log_2\frac{1}{10}\right] = 0.5 + 1.661 = 2.16 bits. A fair die gives H = \log_2 6 \approx 2.585 bits. The loaded die is more predictable and so carries less information per roll, and the fair die is the maximum-entropy case — the general rule being that uncertainty is greatest when nothing is favoured.
  4. Take logarithms, which is legitimate because \ln is increasing and therefore leaves the location of the maximum where it was: \ln\prod_i e^{-(y_i - wx_i)^2/2} = -\frac12\sum_i(y_i - wx_i)^2. Maximising that expression is the same as minimising \sum_i(y_i - wx_i)^2, which is least squares exactly. So least squares is maximum likelihood under Gaussian noise: the squared-error loss is not an arbitrary choice of penalty but an assumption about how the noise behaves, written in a different language.
  5. Training error must fall monotonically, because every degree-d polynomial is also available to a degree-(d+1) fit — extra flexibility cannot make the best fit to the sample worse, so the curve can only descend. Test error decomposes as bias^2 + variance + irreducible noise. At low degrees bias dominates: the model is too rigid to follow the real shape, and each added degree sheds more bias than it adds variance, so test error falls. Past the sweet spot the shape is already captured and further degrees can only fit the noise — which is different in the next sample — so variance climbs and takes test error with it. Twelve degrees on fifteen points is deep in that second regime: the model is memorising the sample instead of the pattern, which is what the degree-11 curve in this chapter’s figure is doing as it lurches through every point.