Check my working (Practice)https://checkmyworking.com/en© 2010-2023 <a href="https://somethingorotherwhatever.com">Christian Lawson-Perfect</a> Fri, 08 Dec 2023 08:54:27 GMTNikola (getnikola.com)http://blogs.law.harvard.edu/tech/rss- grunt -> hunt, grow -> how, ground -> hound, grandstand -> handstand, etc.https://checkmyworking.com/2011/12/grunt-hunt-grow-how-ground-hound-grandstand-handstand-etc/Christian Lawson-Perfect<p>I noticed that a remarkable number of words starting with<strong> gr</strong> are still words if you swap the <strong>gr</strong> for <strong>h</strong>. For example, the words in the title of this post. How many words is this true for? Which pair of prefixes has the most words in common?</p>
<p>Here’s <a href="http://somethingorotherwhatever.com/prefixchange.py">a Python script</a> I wrote to answer those questions. Here’s <a href="http://somethingorotherwhatever.com/words.txt">the list of words I used</a>. And <a href="http://somethingorotherwhatever.com/prefixchange.txt">here are the results</a>. I only looked at prefixes of one or two letters.</p>
<p>The best pair was <strong>no</strong> and <strong>u</strong>. Here’s <a href="http://somethingorotherwhatever.com/uno.txt">the list of suffixes they have in common</a>. Most of it is words which can be prefixed with <strong>un</strong> or <strong>non</strong>. That isn’t very interesting, so I think the real winner is (<strong>b</strong>,<strong>st</strong>), with 1085 suffixes in common. It’s the first pair where one of the prefixes is two letters, and where most of the words aren’t just words with another Latin prefix in front of them.</p>
<p>I could do loads of calculations like this. If you import the Python script as a module, you can have a look at all the data it computes. Very interesting!</p>
<p>The word list I used probably skewed the results quite a bit because it contains lots of words which are conjugations or pluralisations or whatever of the same root word, as well as a load of really weird words which probably occur once in the whole corpus. I think if I look at this again I’ll use something like <a href="http://ucrel.lancs.ac.uk/bncfreq/flists.html">this frequency list</a>, and use the frequencies of words as a weighting for scoring prefix-pairs.</p>musingspracticehttps://checkmyworking.com/2011/12/grunt-hunt-grow-how-ground-hound-grandstand-handstand-etc/Thu, 01 Dec 2011 00:00:00 GMT
- An infinite series problemhttps://checkmyworking.com/2011/05/an-infinite-series-problem/Christian Lawson-Perfect<p>A couple of undergrads came into maths-aid today with a problem: does the series \[\sum_{n=1}^{\infty} \frac{1}{n \ln(n+1)}\] converge?</p>
<p>
<!-- TEASER_END -->
</p>
<p>Use the integral test: the sum converges if and only if \[\lim_{N \to \infty}\left( \int_1^N \frac{1}{n \ln(n+1)}dn \right)\] is finite.</p>
<p>Try the substitution \(t = \ln \left ( n + 1 \right )\).</p>
<p>\(\frac{dt}{dn} = \frac{ 1 }{ n + 1 }\), so \(dn = \left ( n + 1 \right ) dt\).</p>
<p>The integral then becomes \[\int_{\ln(2)}^{\ln(N+1)} \! \frac{ n + 1 }{ n t } \, dt\]</p>
<p>I’ve still got \(n\) in there a couple of times, but bear with me…</p>
<p>You can split the fraction into two bits: \[\frac{ n + 1 }{ n t } = \frac{ n }{ n t } + \frac{ 1 }{ n t } = \frac{ 1 }{ t } + \frac{ 1 }{ n t }\]</p>
<p>So the integral is then \[ \begin{align} \int_{\ln(2)}^{\ln(N+1)} \! \left( \frac{ 1 }{ t } + \frac{ 1 }{ n t } \right) \, dt &= \left[ \ln n \right]_{\ln(2)}^{\ln(N+1)} +\int_{\ln(2)}^{\ln(N+1)} \! \frac{ 1 }{ n t } \, dt \\ & = \ln \left ( \ln( N+1) \right ) – \ln(\ln 2) + \int_{\ln(2)}^{\ln(N+1)} \! \frac{ 1 }{ n t } \, dt \end{align}\]</p>
<p>\(\ln \left ( \ln(N+1) \right ) – \ln(\ln 2)\) is unbounded as \(N\) tends to infinity, but what about the other integral, that I can’t see how to do?</p>
<p>It doesn’t matter, because it’s definitely positive. So I’m sure the total integral is at least \(\ln \left ( \ln( N+1) \right ) – \ln(\ln 2)\).</p>
<p>The integral is unbounded, hence the series diverges.</p>
<p>(I wrote this post using my <a href="https://checkmyworking.com/misc/writemaths/">write maths, see maths</a> thing. It was very easy!)</p>
<p><strong>Update:</strong> A couple of other Newcastle PhDs, David Cushing and David Elliott, both pointed out that \(\frac{1}{n \ln(n+1)} \gt \frac{1}{(n+1)\ln(n+1)}\), which integrates straightforwardly to \(\ln(\ln(n+1))\). Much nicer!</p>practicehttps://checkmyworking.com/2011/05/an-infinite-series-problem/Wed, 25 May 2011 23:00:00 GMT
- Hardy’s Course of Pure Mathematicshttps://checkmyworking.com/2011/02/hardys-course-of-pure-mathematics-2/Christian Lawson-Perfect<p>A while ago I bought a copy of Hardy’s “A Course of Pure Mathematics” for a fiver. I think I must’ve got it from <a href="http://westwoodbooks.co.uk/">Westwood Books</a> ((Westwood Books has a really good collection of maths books – one of the owners is an ex-mathematician, and he finds his way to be in just the right place when departments clear out their libraries. I found a book by the only other mathematising Perfect I know of at Westwood. Great place!)) in Sedbergh.</p>
<p>Anyway, my imagination has completely run dry for the moment, so I’ve decided to do some exercises from the book to pass some time. Maybe this could become a series of posts?</p>
<p>Hardy says in the preface,</p>
<blockquote><p>This book has been designed primarily for the use of first year students at the Universities whose abilities reach or approach something like what is usually described as `scholarship standard’.</p>
<p>…</p>
<p>I regard the book as being really elementary.</p></blockquote>
<p>Nothing taxing, then. It occurs that I’m opening myself up to accusations of sloppy thinking and gross inaptitude at mathematics, but I suppose I’m better off knowing if that’s the case.</p>
<p>
<!-- TEASER_END -->
</p>
<p>So here we go, <strong>Chapter 1, Exercise 1</strong>:</p>
<blockquote><p>1. If \(r\) and \(s\) are rational numbers, then \(r+s\), \(r-s\), \(rs\), and \(\frac{r}{s}\) are rational numbers, unless in the last case \(s = 0\) (when \(\frac{r}{s}\) is of course meaningless)</p></blockquote>
<p>As \(r\) and \(s\) are rational, let \(r = \frac{a}{b}\), and \(s = \frac{c}{d}\), \(a,b,c,d \in \mathbb{N}\), \(b,d \gt 0\). Then,</p>
<p>\[r + s = \frac{a}{b} + \frac{c}{d} = \frac{ad}{bd} + \frac{cb}{bd} = \frac{ad+cb}{bd}. \]</p>
<p>\(ad+cb\) and \(bd\) are integers, so \(r+s\) is rational. Same idea for \(r-s\).</p>
<p>\[rs = \frac{a}{b} \cdot \frac{c}{d} = \frac{a}{b} \times c \div d = \frac{ac}{bd}.\]</p>
<p>\(ac\) and \(bd\) are integers, so \(rs\) is rational.</p>
<p>Now assume \(c \gt 0\).</p>
<p>\[\frac{r}{s} = r \div s = \frac{a}{b} \div \frac{c}{d} = \frac{a}{b} \div c \times d = \frac{ad}{bc}.\]</p>
<p>\(ad\) and \(bc\) are integers so \(\frac{r}{s}\) is rational.</p>
<blockquote><p>2. If \(\lambda\), \(m\) and \(n\) are positive rational numbers, and \(m \gt n\), then \(\lambda(m^2-n^2)\), \(2\lambda m n\), and \(\lambda(m^2+n^2)\) are positive rational numbers. Hence show how to determine any number of right-angled triangles the lengths of all of whose sides are rational.</p></blockquote>
<p>Using the facts from part 1, \(m^2\) and \(n^2\) are rational numbers, hence \(m^2+n^2\) and \(m^2-n^2\) are rational numbers, hence \(\lambda(m^2-n^2)\), \(2\lambda m n\), and \(\lambda(m^2+n^2)\) are rational numbers. So I just need to show that they’re positive.</p>
<p>\(m^2+n^2\) is positive plus positive, so positive. Hence, \(\lambda(m^2+n^2)\) is positive times positive, so positive.</p>
<p>\(\lambda m n\) is all positives multiplied together, so positive.</p>
<p>As \(m \gt n\), \(m^2 \gt n^2\). So \(m^2 -n^2\) is positive, and hence \(\lambda(m^2+n^2)\) is positive.</p>
<p>Now for the triangles. For any rational numbers \(\lambda\), \(m\) and \(n\), construct a triangle with hypotenuse \(\lambda(m^2+n^2)\) and one of the other sides \(\lambda(m^2-n^2)\). I’ve just shown these are both rational. Now, the length \(l\) of the other side is given by</p>
<p>\[ \begin{align} l^2 = \left( \lambda(m^2+n^2) \right)^2 – \left( \lambda(m^2-n^2) \right)^2 &= \lambda^2(m^4+2m^2n^2+n^4) – \lambda^2(m^4 – 2m^2n^2 +n^4) \\ &= 4\lambda^2m^2n^2 = (2\lambda m n)^2. \end{align}\]</p>
<p>So \(l = 2\lambda m n\), which I showed before to be a rational number.</p>
<p>I’m not sure why Hardy felt the need to include \(\lambda\) here. I suppose to get across that you can scale the triangle by a rational factor and it’ll still have all sides rational.</p>
<blockquote><p>3. Any terminated decimal represents a rational number whose denominator contains no factors other than \(2\) or \(5\). Conversely, any such rational number can be expressed, and in one way only, as a terminated decimal.</p></blockquote>
<p>Just for kicks, let’s do an induction.</p>
<p><em>Inductive hypothesis</em>: Let \(x\) be a terminated decimal. If \(x\) has a terminated decimal representation with \(n\) digits after the point, \(10^nx\) is an integer.</p>
<p><em>Base case</em>: If \(n = 0\), \(x\) is already an integer.</p>
<p><em>Inductive step</em>: Assume IH true for \(n=k\). Now suppose we have an \(x = a + 0.x_1x_2x_3 \dots x_{k+1}\), \(a\) an integer. Then \(10x = 10a + x_1.x_2x_3 \dots x_{k+1}\). Let \(d = 10x – 10a\), so just the fractional part. \(d\) has \(k\) digits after the decimal place, so \(10^kd\) is an integer by the IH.</p>
<p>Hence,</p>
<p>\[10^{k+1}x = (10x) \cdot 10^k = (10a + d) \cdot 10^k = 10^{k+1}a +10^kd, \]</p>
<p>which is an integer plus an integer, so an integer. So the induction holds for all \(n \geq 0\).</p>
<p>So, if \(x\) is a terminated decimal with \(n\) digits after the decimal place, \(x = \frac{10^nx}{10^n}\), where the numerator and denominator of the fraction are both integers, so \(x\) is a rational number. The denominator is \(10^n = (2 \times 5)^n\), so has no factors other than \(2\) or \(5\).</p>
<p>For the `conversely…’ part, suppose we have a number \(y = \frac{m}{2^a5^b}\), \(a,b \geq 0\). Cancel twos and fives until the numerator doesn’t have two or five as a factor, to get \(y = \frac{n}{2^c5^d}\), with \(c,d \geq 0\).</p>
<p>If \(c \gt d\), multiply top and bottom by \(5^{c-d}\) to get \(y = \frac{5^{c-d}n}{2^c5^c} = \frac{5^{c-d}n}{10^c}\). Get a decimal representation of \(y\) by writing down \(5^{c-d}n\) and shifting the decimal point \(c\) places left.</p>
<p>Vice versa for \(d \gt c\).</p>
<p>Can’t be bothered to think of some formatting for a lemma about the uniqueness of decimal representations, so: suppose two decimal representations of a number \(x\) differ in the digit \(k\) places to the right of the decimal point, and call those digits \(x_k\) and \(x_k’\). So \(x = x + (x_k’) \cdot 10^{-k} – x_k \cdot 10^{-k}\).</p>
<p>So \( (x_k’) \cdot 10^{-k} – x_k \cdot 10^{-k} = 0\), hence \(x_k = x_k’\), a contradiction.</p>
<p>So a number has a unique decimal representation ((strictly I’ve only proven at most one, but I don’t care about proving every number has at least one decimal representation)).</p>
<blockquote><p>4. The positive rational numbers may be arranged in the form of a simple series as follows:</p>
<p>\[ \frac{1}{2}, \frac{2}{1}, \frac{1}{2}, \frac{3}{1}, \frac{2}{2}, \frac{1}{3}, \frac{4}{1}, \frac{3}{2}, \frac{2}{3}, \frac{1}{4}, \dots \]</p>
<p>Show that \(\frac{p}{q}\) is the \(\left[ \frac{1}{2}(p+q-1)(p+q-2)+q \right]\) <sup>th </sup>term of the series.</p></blockquote>
<p>This series is obtained by laying out the fractions \(\frac{p}{q}\) in a table, with \(p\) increasing rightwards and \(q\) increasing downwards, and reading off the top-right-to-bottom-left diagonals. Note that on the diagonals, \(p+q\) is constant, because by moving left you decrease \(p\) by 1, but moving down increases \(q\) by 1. There are \(p+q-1\) fractions in each diagonal.</p>
<p>So if we’ve got a fraction \(\frac{p}{q}\), consider the square whose diagonal is the one containing our \(\frac{p}{q}\). Its sides have length \(p+q-1\), so its area is \((p+q-1)^2\).</p>
<p>Now take away the fractions lying on the diagonal, leaving \((p+q-1)^2 – (p+q-1) = (p+q-1)(p+q-2)\) fractions inside the square. The fractions in the top-left half appear in the series before \(\frac{p}{q}\), and the ones in the bottom-right half appear after it. The top-left half contains \(\frac{1}{2}(p+q-1)(p+q-2)\) fractions.</p>
<p>Finally, \(\frac{p}{q}\) is the \(q\)<sup>th</sup> fraction encountered in its diagonal, because that diagonal starts at \(\frac{p+q-1}{1}\), so in total \(\frac{p}{q}\) is the \(\left[ \frac{1}{2}(p+q-1)(p+q-2) + q \right]\)<sup>th</sup> term in the series.</p>practicehttps://checkmyworking.com/2011/02/hardys-course-of-pure-mathematics-2/Tue, 15 Feb 2011 00:00:00 GMT