Pamphlet (zine?) Making

February 10, 2010 by christopherolah

I’ve been producing some some printed copies of certain Free books.

3 MIT Guides to Lockpicking (pdf) and 1 _why's poigant guide to ruby (pdf)

I use psbook and psnup to make the books into pamphlets, print them, and bind them. The I give them out at hacklab.to!

My Math Notation

February 9, 2010 by christopherolah

Over the last year I’ve begun to diverge quite heavily from standard Mathematical notation. My experience in CS is compelling me to document this API notation.

Purpose

While real Mathematicians have been surprisingly supportive of me inventing my own notation, I feel compelled to justify it. My thoughts can be summarised in the syllogism:

  1. Some notations allow certain thoughts to be expressed more easily than other notations.
  2. The ease with which thoughts can be expressed changes the thoughts that are expressed.
  3. Therefore notation can change thought.

Given this, I wish to make my notation capable of more conveniently expressing otherwise awkward thoughts.

Notation 1: \{set\}

Very early on this year, I got tired of writing: “For an open set u,”  and “Let s be a compact set.”

I was also exposed to the notation of writing the `set (class) of sets’ as \{set\}. So I decided to use this notation for expressing any set. For example: u \in\{op en\} and s\in\{compact\}.

More recently, I’ve been treating them as functions that returns sets to express more complicated ideas. For example, I’d replace “let p be an accumulation point of the set s on the topology T” with p\in\{accumulation\}(s,T).

Great for notes. Even outside math.

Notation 2: S^\forall, ~~ S^\exists

I recently got sick and tired of writing long chains of for alls and exists. I noticed that there were some very common patterns in there use. A typical example would be:

(\forall a \in A)(\forall b\in B)(\exists c\in C)(a+b=c)

We’re just saying that for any member of this set, or for some member of that set… Why can’t we just have an operator that acts on the set to do this for us?

I don’t see any reason. S^\forall: Place holder for all members of S. S^\exists: There is at least one member of S that can take this place.

Note: if S^\forall or S^\exists is used multiple times in one formula, they are the same variable. If you want to specify a different one:

  • S^{\forall'} : Any member of S that is not the same as S^\forall.
  • S^{'\forall}: Any member of S, possibly the same as S^\forall.

Note: Order of operations for evaluating these operators: Nested, left to right of first instances. If one wishes to vary from this order, denote the operators alternative position n as S^{n\forall} or S^{n\exists}. If the standard notation is used in conjunction with this, the standard notation takes precedence in order of operations.

Example 1: Accumulation Point Defenition

p \in \{accumulation\}(S,T) \iff \{s|p\in s\in S\}^\forall\cup S \neq 0

Example 2: Hausdorff Space

S \in T_2 (X,T) \iff N(S^\forall)^\exists\cap N(S^{\forall'})^\exists =0

My Baby Kernel, My Baby Kernel….

January 31, 2010 by christopherolah

(About the title: I heard a certain commercial as I was writing it and couldn’t resist… Why do people insist on having TVs loud enough that I can clearly here it from another room?)

Over the Summer I got curious about all that low level stuff again (I was the previous Summer as well, that led to me designing a simple processor — read glorified 8-bit calculator that couldn’t divide — on paper). Someone at hacklab.to pointed me towards some resources and soon I making a kernel.

I implemented output (write to the terminal) and a tiny bit of memory management (just give pointers to sections of memory, note which ones you gave, unnote them — nothing to avoid memory fragmentation). I never got around to input, but I had a lot of fun. Here’s a screenshot (yes I’m obssesed with making things colourful — I’ve even played around with syntax highlighted math!):

Good resources are available at osdev, if you’re interested.

Derivative of the Derivative?

January 17, 2010 by christopherolah

Recently I had a very odd thought. Can we do calculus on functions that take and return functions (eg, (\mathbb{R} \to \mathbb{R}) \to (\mathbb{R} \to \mathbb{R}))?

Well, we’d need to have a conceptual idea of space between functions. Well, we could borrow one from the real numbers by constructing a trivial set of functions that are isomorphic to the real numbers: \{x \to kx | k \in \mathbb{R}\}.

Great. So we have an organized set of functions. It seems appropriate to call this a function space. Now we just need a functions that acts on it so we can do calculus.

Because it would be ironic, let’s choose \frac{d}{dx} as our function.

Hm… what happens when we apply \frac{d}{dx} to functions of the form x \to kx? \frac{d}{dx}(x \to kx)=x\to k.

Blast it! That’s outside our function space! What will we do? We’ll add another function space \{x \to k | k \in \mathbb{R}\}.

The cartesian product of those two earily similar to the second degree real polynomial space, P^2(\mathbb{R})… Let’s consider them to be the same thing!

So, it seems reasonable to say that the Jacobian of the n-dimensional version of this is:

J\left(\frac{d}{dx}\right) = \frac{d}{dx_{(1,2,3....)}}\left(\frac{d}{dx}\right)_{1,2,3...}= ~ \small \left[\begin{array}{cccc} 0&1&0&\ldots\\ 0&0&2&\ldots\\ 0&0&0&\ldots\\ \vdots&\vdots&\vdots&\ddots\\ \end{array}\right] ~~~ (in ~P^n(\mathbb{R})

Just some random thoughts. I mentioned this to a math professor and he said some stuff had been done on it in the field of functional analysis, but a quick search didn’t show much…

Fractal Christmas Cards and More

January 4, 2010 by christopherolah

For Christmas, I was handing out fractal Christmas Cards (they had images made in gnofract4d with the equation beneath… I gave my mom a handbound book with pictures of fractals made in sage in it since I didn’t get the latest revision of the math textbook done in time to get that). Thus, I made many fractals. At the end, I noticed something.

First I’ll make a (IMHO, reasonable) conjecture:

\forall n \in \mathbb{R}, n > 2; k \in \{x|x\in \mathbb{C}; \lim_{N\to\infty} (z\to z^n+x)^N(x) \neq \pm \infty\}

\implies

\{x|x\in \mathbb{C}; \lim_{N\to\infty} (z\to z^n+k)^N(x) \neq \pm \infty\} \in \{\text{connected}\}

Now, it’s often interesting to look at julia sets when they fracture, thus they make good pictures. And it is easy to find the point of fracture on the positive real number line.

The (z\to z^n+x)-orbits of these points exhibit a rather simple behaviour: z converges to a value that satisfies z=z^n+x if it is possible.

So we want to find the maximum value of z-z^n (ie. M\cdot (z\to z-z^n)^{\to}(\mathbb{R}^+) where M is the supreumum).

This is trivial to find: z|_{\frac{d}{dz}z-z^n=0}=\sqrt[n-1]{\frac{1}{n}} and if we plug that into z-z^n we get \sqrt[n-1]{\frac{1}{n}} -(\sqrt[n-1]{\frac{1}{n}})^n

Limits and the Infinitesimal Number

January 4, 2010 by christopherolah

I’ve been thinking about the infinitesimal number, \delta = \frac{1}{\infty}, recently. In particular, that one could use it to evaluate limits.

What is a limit, really? I’ve been reading some topology recently and I think that it really is a function that returns an accumulation point (hint: these are alternatively known as limit points). More specifically, I believe that \lim_{x\to a} f(x) is an attempt to find a value y such that (a,y) is a limit point of the graph of the the function f.

But I’ve digressed since the simpler, “It’s the value as we approach the point” is perhaps more useful to us…

Consider \lim_{x\to a} f(x). How is this defferent from f(x\pm\delta)? The difference is that we’re looking for the hypothetical value that the function is becoming (also the value of the point which any open set containing it intersected with the graph is not null), not its value when it is infinitly close. Consider \lim_{x\to 2} x: the difference is 2 versus 2\pm \delta. So, we need to get rid of the infintesimal difference. Let \mathbb{R}(x) represent the rounding of anumber x to the nearest real number. Then,

\lim_{x\to a} f(x) = \mathbb{R}\cdot f(x\pm\delta)

Does this have any applications? I beleive it may provide a more elegant way to present Calculus.

Why can’t I take the first principles defenition of a derivative and:

\frac{dy}{\rlap{---}dx} = \lim _{h\to 0} \frac{f(x+h) -f(x)}{\rlap{--}h}

? Because the defenition of a limit would give us zero, that being the closest real number. But instead, we could just say that a value is close to delta and use that. Not useing h because I see no reason to use a random symbol when there is a logical one.

dy = f(x+dx) -f(x)|_{dx\simeq\delta}

And we have a differential form, let’s add vectors (for more dimensions):

dy = f(\vec{x}+\vec{dx}) -f(\vec{x})|_{|\vec{dx}|\simeq\delta}

and for yet more clarity:

dy = y(\vec{x}+\vec{dx}) -y(\vec{x})|_{|\vec{dx}|\simeq\delta}

which is far less cumborsome than

l\lim_{\vec{dx \to 0}} \frac{f(\vec{x}+\vec{dx}) -f(\vec{x})}{|\vec{dx}|}=0

And has almost identical properties (I suppose that since it is + \delta it will be forward facing, eg, d|x|(0) = \delta instead of undefined).

Just some random thoughts.

dy = f(\vec{x}+\vec{dx}) -f(\vec{x})|_{|\vec{dx}|\simeq\delta}

Formation of Escape-Time Fractals

December 19, 2009 by christopherolah

We’ve all seen images of escape-time fractals. But have you ever wondered how they form? I was playing around with sage’s complex_plot function and got some interesting images…

For reference, here is the identity function (notice that it is also the zeroth iteration: f^0(x)=x).

Identity Function

Mandelbrot Set Example

Recall that the definition of the Mandelbrot set is \left\{x|x\in \mathbb{C}; \lim_{n\to\infty}(z\to z^2+x)^n(x)\neq\pm\infty\right\}. (If this is notation confuses you, you may wish to refer to my previous post on anonymous functions.)

Iteration 1

(z\to z^2+x)^1(x) (equivalent to x^2+x)

Iteration 2

Iteration 2

(z\to z^2+x)^2(x) (equivalent to (x^2+x)^2+x)

Iteration 3

(z\to z^2+x)^3(x) (equivalent to ((x^2+x)^2+x)^2+x)

Iteration 4

Iteration 4

(z\to z^2+x)^4(x) (equivalent to (((x^2+x)^2+x)^2+x)^2+x)

Iteration 5

Iteration 5

(z\to z^2+x)^5(x) (equivalent to ((((x^2+x)^2+x)^2+x)^2+x)^2+x)
Iteration 6

Iteration 6

(z\to z^2+x)^6(x) (equivalent to (((((x^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)
Iteration 7

Iteration 7

(z\to z^2+x)^7(x) (equivalent to ((((((x^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)
Iteration 8

Iteration 8

(z\to z^2+x)^8(x) (equivalent to (((((((x^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)
Iteration 9

Iteration 9

(z\to z^2+x)^9(x) (equivalent to ((((((((x^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)

Iteration 10

Iteration 10

(z\to z^2+x)^10(x) (equivalent to (((((((((x^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)^2+x)+x)

Julia Set of 0.3 Example

We can do this with other fractals. Recall that the Julia Set of 0.3 is defined as \left\{x|x\in \mathbb{C}; \lim_{n\to\infty}(z\to z^2+0.3)^n(x)\neq\pm\infty\right\}.
Iteration 1 of the Julias Set of 0.3

Iteration 1 of the Julias Set of 0.3

(z\to z^2+0.3)^1(x)  (equivalent to x^2+0.3)
Iteration 2 of the Julia Set of 0.3

Iteration 2 of the Julia Set of 0.3

(z\to z^2+0.3)^2(x)  (equivalent to (x^2+0.3)^2+0.3)
Iteration 3 of the Julia Set of 0.3

Iteration 3 of the Julia Set of 0.3

(z\to z^2+0.3)^3(x)  (equivalent to ((x^2+0.3)^2+0.3)^2+0.3)
Iteration 4 of the Julia Set of 0.3

Iteration 4 of the Julia Set of 0.3

(z\to z^2+0.3)^4(x)  (equivalent to (((x^2+0.3)^2+0.3)^2+0.3)^2+0.3)
And so on…
Update:
Here is a far more developed and higher resolution image of the Julia set of 0.3.I don’t know what the red is.
Julia Set of 0.3

Complex plot of the Julia Set of 0.3

Here is a animation of the transition of generalised Mandelbrot set from the power of -4 to 4, inspired by this Youtube video:
Generalized Mandlebrot from the power of -4 to 4

Generalized Mandlebrot from the power of -4 to 4

Update 2:

Here are animations of the forming Mandlebrot set and Julia set respectivly:

Formation of the Mandlebrot Set

Formation of the Mandlebrot Set

The Formation of the Julia Set

The Formation of the Julia Set

hacklab.to = awesome

December 17, 2009 by christopherolah

I thought I’d mention that hacklab.to is awesome. It’s Toronto’s hacker collective!

A wide variety of fields and interests are represented at the lab. There are the things you would expect: software, hardware, math, science, engineering, etc… but also things like linguistics (the creator of Toki Pona is a hacklaber!), lock picking (disturbingly easy: see the MIT Guide), art (Alex recently gave a really neat workshop on block printing), and so on… And of course, there is cross-pollination.

It’s worth mentioning that there’s a CNC laser cutter and 3d-printer.

If you’re a Torontonian and interested, you should definitely come by for the open house on Tuesdays. People are friendly; no one bights!

Auditing University Courses as a High School Student

December 17, 2009 by christopherolah

As a high school student who is somewhat advanced in certain subjects, I’ve been enjoying auditing university courses at the University of Toronto. Not only have I learnt a lot about the subjects I’ve audited, I’ve also met lots of interesting people and learned a lot about University life.

Up to this point, no professor has refused to let me audit their course. In fact, they’ve all been very friendly, although the ones that teach higher level courses are often concerned that I’ll “confuse myself.” (The professor of 237 was very adamant that math is like a house and needs firm foundations before it can be built higher. He’s probably right… But I think that a lot of people have a firm (enough) foundation before the powers that be notice this.)

So far, that hasn’t been a problem. In fact, I’ve found that most of the content is fairly straight-forward, and the lectures are much more interesting than high-school ones (probably because I don’t already know the content…). The one thing that did throw me off a little were some unfamiliar notations I ran into when I started MAT237 (multi-variable calculus).

I would encourage any fellow `advanced’ high-school students to do this as well.

Anonymous Functions in Math and CS

December 17, 2009 by christopherolah

Consider:

f(x) = ...

This is how one normally declares a function in math: by describing what the value of the function applied to a variable would be. One consequence of this approach is that ir necessitates a variable name, in this case f, being assigned to the function.

This may not sound significant or problematic, but consider what the parallel of this in a different class of objects, like numbers would be. Before doing anything, we’d have to assign a variable to the number! For example, we couldn’t just write 3*2, we’d have to write x=2; y=3; x*y. This may still not seem significant. After all, it’s only functions; people only have to define them occasionally.

I’d like to mention a theory that someone (Kelly Rose, one of the leaders — read teachers — of hacklab.to’s math reading group) mentioned to me recently, that the reason two people (Newton and Leibniz) effectively simultaneously discovered calculus after people failed to for however many thousand years was that notation had developed that allowed for the discovery. (Interesting side note: this individual suggested that category theory may be the next big change.)

If this is theory is correct (and I’m not sure how we could every be certain) then it is the best example I can think of, of something I’ve been thinking about for several weeks: the importance of notation. (I’m using the term `notation’ loosely as including something that isn’t truly a new idea but is a new way of presenting the idea.)

It seems obvious to me that if one makes an idea difficult to represent, a person will avoid using it (or make an easier way to represent it). In some ways, this is applying the Sapir-Whorf hypothesis to things other than spoken language: the medium (traditional language, visualisation, notation, etc) of thinking effects the thoughts themselves. (If you’ve been nodding along, consider the effects English must be having on you mind; you may now wish to look at Lojban.)

I believe this is true, to an extent that I am probably failing to convey. (It’s why, for example, I find it deeply troubling that \pi isn’t defined as 2\pi: think about all the students who would have had a better understanding of trigonometry and more respect for math in general if it wasn’t for the fact that Pi Is Wrong.)

But we’ve digressed. Back to functions. We need to ask, is there a way to avoid defining a variable when using functions. In fact there is: x \to .... For example, the following to statements are identical:

f(x)=x^2+3; f(2)

(x\to x^2+3)(2)

We call (x\to x^2+3) an anonymous function. Another notation for this is using lambda calculus. We represent a function with \lambda x. ~ .... For example, the earlier example would be (\lambda x . x^2+3).

This has endless usefullness in math. It can provide an ellegant way to represent the Mandelbrot set, for example:

\left\{x\in \mathbb{C}| \lim_{n\to\infty}(z\to z^2+x)^n(x)\neq\pm\infty\right\}

Translation for non-mathematicians: the set of complex numbers x such that if we square x, add x, square that and add x, and so on infinitely, we won’t end up with infinity.

We can also use this to define functions that return functions using it. For example, we can define the differential operator, \frac{d}{dx}:

\frac{d}{dx}(f) = (x \to \lim_{h\to 0} \frac{f(x+h)-f(x)}{h})

We can also use anonymous functions in programing. For example, python allows us to use lambda calculus in it. The following is perfectly valid:

>>> (lambda x: x*x +3)(2)
7

Now, you may have noticed that we can do some really interesting things with this. And could do even more interesting things, if we could make recursive functions.

Some programing languages support anonymous recursive functions. For example, in javascript, functions are passed a `callee’ argument that allows one to recurse on itself. Thus, we can implement an anonymous function that gives us a term in the Fibonacci sequence.

(function (x) {
  if (x <= 2) {
    return 1;
  } else {
    return arguments.callee(x - 1) + arguments.callee(x - 2);
  }
})(6) // = 8

More on this is available here.

But what about in math? There doesn’t seem to be a well defined notation for anonymous recursive functions in math… So, I’ve had to invent my own.

In lambda calculus, I’ve always perceived the lambda to be a place holder for the function. So, I’m rather fond of the notation \lambda x = .... If one uses that notation, it’s a small step to use a lambda on the other side of the the equals sign…

We can use this notation to do some very cool things. For example, we can use this to make the Cantor set:

\left(\lambda s = \lambda \left[m(s),\frac{2*m(s)+M(S)}{3}\right] \cup \lambda \left[\frac{m(s)+2*M(S)}{3},M(s)\right]\right)[0,1]

Translation for non-mathematicians: Take the line segment from 0 to 1, remove the middle third, then remove the middle third from the remaining pieces, and so on infinitely.

Of course, this notation does run into problems when one wants to have nested lambda calculus, but this can be fixed by using subscripts, ie \lambda_1, \lambda_2, ~....