Monday, October 3, 2011

Five proofs that the squrate root of 2 is irrational

This weekend I went through a few proofs that the square root of 2 is irrational.

  1. The elementary proof is the one that everyone sees. You assume
    that \(\sqrt{2}\) can be represented as \(\frac{p}{q}\) where \(p\)
    and \(q\) share no common factors, that is \(\gcd(p,q)=1\). By
    multiplying out both sides you're lead to the result that both
    \(p\) and \(q\) must have 2 as a factor. See
    Wikipedia for the proof.
  2. The second proof is a stronger result, and relies on the
    fundamental theorem of arithmetic to prove that \(\sqrt{p}\)
    where \(p\) is a prime number must be irrational.
  3. The third proof again relies on the fundamental theorem of
    arithmetic and states that \(\sqrt[k]{n}\), the k-th root of a
    number \(n\) that is not a perfect k-th power is irrational.
  4. The fourth proof is one that I hadn't seen before. It is
    elementary and of course Wikipedia has it. I like the one I found
    in Galois Theory by Ian Stewart:
    1. Assume that there exist integers a, b with \(b \neq 0\) such
      that \((a/b)^2=2\).
    2. Show that we may assume \(a,b > 0\).
    3. Observe that if such an expression exists, then there must be
      one in which \(b\) is as small as possible.
    4. Show that \((\frac{2b-a}{a-b})^2 = 2\).
    5. Show that \(2b-a>0,a-b>0\).
    6. Show that \(a-b<b\), a contradiction.
  5. The fifth proof uses the rational root theorem on the
    polynomial \(x^2-2=0\).

Wednesday, September 21, 2011

Richard Feynman - No Ordinary Genius

Richard Feynman - No Ordinary Genius

Friday, September 16, 2011

Working out a neat probability rule

Working out a neat probability rule from divisbyzero.com.

For small \(x\) (on the order of \(1/10000\)), what is \(1 - (1-x)^t\), where \(t\) is some large number.

Using the binomial theorem expansion

$$(1+x)^n = {n\choose 0}x^0 + {n\choose 1}x^1 + \ldots + {n\choose n}x^n$$

we have:

\begin{eqnarray} (1-x)^t &=& {t\choose 0}(-x)^0 + {t\choose 1}(-x)^1 + \ldots + {t\choose t}(-x)^t \\ &\approx& 1 - {t\choose 1}x + O(x^2) \\ &=& 1 - tx + O(x^2) \\ \end{eqnarray} Thus the original equation can be approximated by:

\begin{eqnarray} 1-(1-x)^t &\approx& 1 - (1 - tx + O(x^2)) \\ &=& tx - O(x^2) \end{eqnarray} The original post was trying to approximate \(1-(1-D/P)^L\), and with \(x=D/P\) and \(t=L\), we arrive at:

\begin{eqnarray} 1-(1-\frac{D}{P})^L &\approx& 1 - (1 - \frac{LD}{P} + O(\left(\frac{D}{P}\right)^2)) \\ &=& \frac{LD}{P} - O(\left(\frac{D}{P}\right)^2) \end{eqnarray}

Friday, September 9, 2011

Unicode programming

#include "むすめは/まおちゃん.h"
char const literal[] = "俺です、俺俺";

Monday, August 15, 2011

Dear procrastinator

Hacker News | Dear procrastinator: "Procrastination has nothing to do with disciplining yourself or 'just doing it' ... The reason why human-beings procrastinate is to feel in control of their life. The act of rebelling against an oppressor, an authorative figure telling you what to do, is your way of regaining mastery over your own fate. Very much the same way kids throw a tantrum when their parents order them to do something, the procrastinator puts off tasks because he has come to harbor resentment ..."
Interesting.

Thursday, August 11, 2011

Debugging Org-mode clocktable time summary

At one time, the following used to work:
#+TBLFM: $3='(org-clock-time% @2$2 $2);%.1f;::$4='(org-clock-time% "40:00" $2);%.1f;
My table would end up getting columns that showed
  • The percentage (time for this row / total time),
  • The percentage (time for this row / 40 hours)
Either due to an Emacs upgrade, or an Org-mode upgrade, this broke. So now I get 0 as the percentage.

Thursday, August 4, 2011

Introduction to anime

STEINS;GATE » Episode 18
“Fractal Androgynous”
Okarin has to convince Ruka to reverse her D-mail, but she refuses to believe that she was once a man. If she was a man, how could she get Okarin to love her?

Ladies and gentlemen, here's anime!