Hello there, who are you?

Hey, is this thing on?

I’ve always maintained that the target audience of this blog has size one: In general it’s written for me, and is about stuff I find interesting. If other people find it interesting, that’s great. If not, that’s not a problem. Sometimes I write specific posts that I actually do want other people to read, but most of the time I don’t really care.

On the other hand, Google reader tells me I have 379 subscribers and Google analytics tells me I average about 50-200 visits per day (around 2000-4000 visits per month) depending on how much I’ve been writing recently (and a few giant spikes where I’ve written something that’s got 10k+ visits all on its own).

These aren’t huge numbers, but they’re respectable. Clearly the audience is a bit larger than just me.

So, who are you lot? How’d you get here, and which bits are you actually interested in?

Given that I write about politics, philosophy, mathematics, web comics, voting theory, feminism, programming, cooking, game design and probably more things I’m forgetting about I imagine the only person who is actually interested in everything I have to say is the aforementioned audience of one.

So which bits are you actually interested in? Are there any subjects you particularly would like me to write more about? Chances are I’ll pay only slight attention to it if there are, but there are enough ideas on the back-burner that there’s a good chance I’ve got something to say about it that I haven’t yet.

This entry was posted in Admin on by .

Constructing the negative numbers

Advance warning: This is a post about a standard foundational construction in mathematics – constructing the integers from the natural numbers. It’s partly a prelude to another post, and I plan to do the details in slightly more generality than is normally done, but if you’re interested in this subject it’s probably nothing new and if it’s something new you’re probably not interested in this subject. Also a lot of this is going to be spelled out in way more detail than you’re likely to care about.

Second warning: I’m pretty sure my lecturer when he did this proof for me back more than a decade ago in my first year of my maths degree added the caveat “And now you should forget about this proof and never do it again”. So I’m going against the health advisory of a trained mathematician. Some maths contained herein may be hazardous to your health.

This post is about the following theorem:

Let G be a set with operations + and * such that they obey all the axioms of a ring except for the existence of additive inverses, but have the additional property that + cancels in the sense that if x + z = y + z then x = y.

There is a ring R and an isomorphic embedding \(f : G \to R\). Further, there is a unique (up to isomorphism) minimal such G.

First, let’s prove uniqueness, as it will motivate the construction.

Lemma: Suppose R is minimal. Then every element of R can be written as \(f(x) – f(y)\) for \(x, y \in G\).

Proof: We need only show that the set of such elements form a ring, then the result will follow by minimality.

It suffices to show that it’s closed under the ring operations, but this is just simple algebra:

\[-(f(x) – f(y)) = f(y) – f(x)\] \[(f(x) – f(y)) + (f(u) – f(v)) = f(x + u) – f(y + v)\] \[(f(x) – f(y)) * (f(u) – f(v)) = f(x * u + y * v) – f(x * v + y * u)\]

So this set is a subring of R containing f(G), so it must be R due to minimality. QED

As an aside, note that it is not necessarily the case that every element of R is f(x) or -f(x) for some \(x \in G\). Consider for example \(G = \{ x \in \mathbb{N} : x > 1 \}\).

Now suppose we have another minimal isomorphic embedding \(f’ : G \to R’\). We want to construct an isomorphism \(h : R \to R’\) such that \(h \cdot f = f’\). This will prove uniqueness.

We construct h as follows:

Let \(r = f(x) – f(y)\). Define \(h(r) = f'(x) – f'(y)\).

First we must show this is well defined.

Specifically we will show that if \(f(x) – f(y) = f(u) – f(v)\) then \(f'(x) – f'(y) = f'(u) – f'(v)\). This turns out to just be basic manipulation of the fact that \(f\) and \(f’\) are both isomorphic embeddings:

\[
\begin{aligned}
f(x) – f(y) &= f(u) – f(v) \\
f(x) + f(v) &= f(u) + f(y) \\
f(x + v) &= f(u + y) \\
x + v &= u + y \\
f'(x + v) &= f'(u + y) \\
f'(x) + f'(v) &= f'(u) + f'(y) \\
f'(x) – f'(y) &= f'(u) – f'(v) \\
\end{aligned}
\]

So as a result, \(h\) is well defined. Additionally, you can construct \(h’ : R’ \to R\) in exactly the same manner, and it’s clear by definition that \(h\) and \(h’\) are inverses, so \(h\) is a bijection.

If we pick \(b \in G\) then

\[
\begin{aligned}
h(f(x)) &= h(f(x + b) – f(b)) \\
&= f'(x + b) – f'(b) \\
&= f'(x) \\
\end{aligned}
\]

So we’ve proven that \(h(f(x)) = f'(x)\) and thus \(h \cdot f = f’\).

We still need to show that \(h\) is an isomorphism, but this follows simply from our formulae for \(+\) and \(*\) on things of the form \(f(x) – f(y)\): Each operation you can convert into operations in the original set, pass to \(f’\) and then convert back.

QED

This uniqueness proof nicely informs the construction too. Every element in our target ring is going to be the difference of two elements in our set. Therefore we construct the target ring as the set of differences. But of course two differences might result in the same element, so we define an equivalence relation for when this should happen and quotient out by that.

So we will now construct our ring:

Let \(R = G^2 / \sim\), where \((x,y) \sim (u, v)\) if \(x + v = y + u\) (i.e. if \(x – y = u – v\)).

First we must show this is an equivalence relation. Reflexivity is obvious, symmetry follows from commutativity of addition. We only need to show transitivity.

We’ll need some notation: If \(a = (x, y)\), write \(x = a^+\) and \(y = a^-\).

(This will give us slightly fewer variables to keep track of).

Suppose \(a \sim b\) and \(b \sim c\).

Then
\[\begin{aligned}
a^+ + b^- &= a^- + b^+\\
b^+ + c^- &= b^- + c^+\\
a^+ + b^- + b^+ + c^- &= a^- + b^+ + b^- + c^+\\
a^+ + c^- + (b^- + b^)&= a^- + c^+ + (b^- + b^)\\
a^+ + c^- &= a^- + c^+ \\
a &\sim c \\
\end{aligned}\]

(note we had to use the cancellation property for + here)

Fix \(b \in G\) and define \(f : G \to R\) as \(f(x) = [(x + b, b)] \). (We’re not guaranteed a 0 element in G, which is why we can’t just map it to \([(x, 0)]\)).

We will now prove that \(R\) is a ring and \(f\) an isomorphic embedding into it.

First note that f does not depend on the choice of b.

Proof: \((x + b, b) \sim (x + b’, b’)\) because \(x + b + b’ = x + b’ + b\).

Now note that f is injective: This is because of the cancellation property we required on addition: If \((x + b, b) \sim (y + b, b)\) then \(x + 2b = y + 2b\) and so by cancellation \(x = y\).

In order to show that it’s an isomorphic embedding we first need to construct a ring structure on R.

We’ll use our formulae from above. Define:

\[(x, y) + (u, v) = (x + u, y + v)\] \[(x,y) * (u, v) = (x * u + y * v, x * v + y * u)\]

We first need to show that these are compatible with the equivalence relation \(\sim\).

Now suppose \(a,b,c,d \in G^2\) with \(a \sim c\) and \(b \sim d\).

We first want to show that \(a + b \sim c + d\). i.e. that \((a + b)^+ + (c + d)^- = (a + b)^- + (c + d)^+\).

\[\begin{aligned}
(a + b)^+ + (c + d)^- &= a^+ + b^+ + c^- + d^-\\
&= (a^+ + c^-) + (b^+ + d^-)\\
&= (a^- + c^+) + (b^- + d^+)\\
&= (c^+ + d^+) + (a^- + b^-) \\
&= (c + d)^+ + (a + b)^- \\
&= (a + b)^- + (c + d)^+ \\
\end{aligned}\]

So \(+\) is compatible with the equivalence relation, and thus can be inherited by \(R\).

We now have to do the same with \(*\). To simplify the calculation we’ll show that \(a * b \sim a * d\). The proof that \(a * d \sim c * d\) will be identical, and the whole result will follow from transitivity.

So
\[\begin{aligned}
(a * b)^+ + (a * d)^- &= a^+ * b^+ + a^- * b^- + a^+ * d^- + a^- * d^+ \\
&= a^+ * ( b^+ + d^-) + a^- * (b^- + d^+) \\
&= a^+ * ( b^- + d^+) + a^- * (b^+ + d^-) \\
&= a^+ * b^- + a^- * b^+ + a^+ * d^+ + a^- * d^- \\
&= (a * b)^- + (a * d)^+ \\
a * b &\sim a * d \\
\end{aligned}\]

So the operations are well defined on the equivalence classes.

Now all we have to do is show that they satisfy the ring operations. Ideally without losing the will to live.

It’s obvious by construction that + is commutative and associative (because it is on \(G\)).

The equivalence class \(0 = [(x, x)]\) is a unit for + (it should be evident that every choice of x produces an equivalent element because \(x + y = x + y\)).

Proof: Let \(a \in G^2\) and \(b = (x, x)\).

\[\begin{aligned}
(a + b)^+ + a^- &= a^+ + b^+ + a^- \\
&= a^+ + b^- + a^- \\
&= a^+ + (a + b)^- \\
a + b &\sim a \\
\end{aligned}\]

Negations exist because \(a + (a^-, a^+) = (a^+ + a^-, a^+ + a^-) \sim 0\).

So now we just have to prove that * is associative and distributes over +.

Associative:

\[\begin{aligned}
((a * b) * c)^+ &= (a * b)^+ * c^+ + (a * b)^- * c^- \\
&= a^+ * b^+ * c^+ + a^- * b^- * c^+ + a^- * b^+* c^- + a^+ * b^- * c^-\\
(a * (b * c))^+ &= a^+ * (b * c)^+ + a^- * (b * c)^- \\
&= a^+ * (b * c)^+ + a^- * (b * c)^- \\
&= a^+ * b^+ * c^+ + a^- * b^- * c^+ + a^- * b^+ * c^- + a^- * b^- * c^+ \\
&= ((a * b) * c)^+ \\
\end{aligned}\]

At this point I’m prepared to accept on faith that the negative half works out the same way. Are you? Good.

Distributive (just going to show left distributive. Right should follow similarly):

\[\begin{aligned}
(a * (b + c))^+ &= a^+ * (b + c)^+ + a^- * (b + c)^- \\
&= a^+ * b^+ + a^+ * c^+ + a^- * b^- + a^- * c^- \\
&= (a^+ * b^+ + a^- * b^-) + (a^+ * c^+ + a^- * c^- )) \\
& = (a * b)^+ + (a * c)^+ \\
(a * (b + c))^- &= a^+ * (b + c)^- + a^- * (b + c)^+ \\
&= a^+ * b^- + c^- + a^- * b^+ + a^- * c^+ \\
\end{aligned}\]

Which means we’re done. Phew. That was a lot of work.

Unfortunately, now on to the next lot of work!

Several things more to prove:

Theorem:

If G has a multiplicative unit, which we’ll call 1, then \(f(1)\) is a multiplicative unit for \(R\).

Proof:

\[\begin{aligned}
(x, y) * (1 + b, b) &= (x + x * b + y * b, x * b + y + y * b) \\
&= (x + (x * b + y * b), y + (x * b + y * b))\\
&\sim (x, y) \\
\end{aligned}\]

(Using the fact that (\(x + c, y + c) \sim (x, y) \)).

Theorem:

If \(*\) is commutative on \(G\) then it is commutative on \(R\).

Proof: Follows almost directly from how \(*\) on \(R\) is defined in terms of \(*\) on \(G\).

Ok. Now we’re done.

We apply this construction to \(\mathbb{N}\), and we get \(\mathbb{Z}\): The minimal commutative ring with a 1 that N embeds isomorphically into.

Time to relax.

This entry was posted in Numbers are hard on by .

Calvin and Hobbes, gocomics and dotjs

Ok. So, I like comics. It’s not something I write about, but at any given time I probably have a dozen webcomics that I’m actively subscribed to (by the way, if you’re not, you should be reading Schlock Mercenary and Girl Genius. Not what this post is about, just a heads up).

One thing I really like is discovering large archives of comics I’ve not read, or read a long time ago but had forgotten about / not realised they were available online.

So I was pretty excited when a friend pointed out that Calvin and Hobbes was available on gocomics (or if you don’t want to hunt for the first comic, here it is) especially when I realised to my surprise that I actually didn’t recognise a lot of the most recent ones. I’m pretty sure there aren’t new Calvin and Hobbes, but apparently I’ve read less of it than I thought. So as far as I’m concerned: Yay, new Calvin and Hobbes!

There’s just one problem. The gocomics interface is terrible for reading comic archives. And there’s a lot of archive here. I don’t think I’d be able to make it through this without developing acute RSI.

But! I am a programmer. Solving irritating problems with software is basically my job description. So I shopped around for a way to solve this and came across dotjs (the original is OSX specific, but there’s a fork that works on linux too which is what I’m using). It’s just a nice easy way of injecting site specific javascript.

So, I installed this, created ~/.js/gocomics.com.js and added the following code to it:

function followLinkLike(matcher){
  document.location = $(matcher)[0]["href"]
}
 
document.onkeydown = function(e){
  switch(e.keyCode){
    case 74: followLinkLike("a.prev"); break;
    case 75: followLinkLike("a.next"); break;
  }
};

Problem solved. Gocomics now has keyboard navigation. j will take you backwards, k will take you forwards (I’m a vim user ok. So sue me).

dotjs is a really nice solution to this sort of problem. I’m definitely going to be on the look out for broader applications of it.

This entry was posted in Code on by .

If Programming Language Articles Were People

…then the one I’m about to talk about would be some guy going “I’m not sexist, but those women sure are difficult to work with aren’t they?”

Tim Chevalier asked me to document my calling out of sexism. I was already semi-planning to, but to be honest I was probably going to put it off due to the afore-mentioned crushing feeling of awkwardness. I’ll try not to do that, so this is my first account. It actually happened before the publishing of the last post and the difficulty I felt doing this was somewhat the spur for said post.

I’m going to establish an anonymity policy here though: Anything I mention is going to be at most as public as its source. Something in public on the internet I’m happy to link to and name and shame, something that happens over private email I may reproduce but I’m absolutely not going to name. This isn’t an ideal policy from a combating sexism point of view, but I think it hits a nice “Not being a complete asshole about it” middle ground. I may revise this policy later, but until I explicitly say otherwise this is what I’m going to do.

A developer acquaintance recently sent a link around to me and a few others. It was If Programming Languages Were Women. On writing this, I am very pleased to note that uTest have published a nice apology. So, well done on that. Thanks.

So uTest have handled this well in the end, but this is about the person who sent me the article. This was my response to them, written very much with the assumption that he probably just hadn’t really thought things through and trying to explain why it was a problem:

Yeah, sorry, this is a call out.

This sort of article isn’t really ok. It’s not that it’s wildly
offensive or anything – it’s not really (even if the first three women
described respectively have “serious issues”, are “seriously fugly”
and used to be “slow and a bit ditzy”. Nice).

The problem is that there is a widespread culture of “Just us guys” in
the software world. This isn’t surprising given the gender
distribution, but it in turn makes that gender distribution worse – if
you’re a woman in the industry you are constantly being given
reminders that you’re different, not really part of the core group,
and ultimately that can drive you away.

Imagine you’re a female developer and you read this article. What do
you think reading it? Do you think “Ha ha. You’re right! Programming
languages are totally like women”. Or do you think “Oh, right, thanks.
I forgot for a second there that I’m not really one of the normal
developers, I’m just a woman who happens to also write some code.
Appreciate the reminder”.

Female software developers are far more likely to drop out of the
industry than male ones, and things like this are a large part of why:
When you’re constantly being reminded you’re not actually part of the
group, it’s not terribly surprising you decide to leave the group.

There’s a big gender problem in the software world. Let’s not make it
worse than it is.

(What I am describing here is Othering, or maybe the experience of a Grunch. I thought it would probably be unhelpful to use or explain those words, as being confronted with jargon from an unfamiliar discipline when being told they’re wrong can sometimes make people defensive. I have no idea if this was the right call).

His response was less than ideal:

Agreed, wholeheartedly. Sorry if this didn’t enhance your day as intended.

More girls in our industry would be terrific. However my experience has not been the greatest on that front. I had a coworker that cried when she fell on the wrong side of a dispute over design; that behaviour gets old very quickly and is very unprofessional. Can’t imagine a guy using that particular tactic — with the exception of Steve Jobs perhaps.

Nevertheless, I have subsequently interviewed and offered positions based on talent to female job applicants and without prejudice.

I thought the comedy value and creative merit of the article was worth sharing. I wouldn’t blog this personally. but saying that, I don’t broadcast any of my random thoughts and observations.

I… really didn’t know how to respond to this, so in the end I left it at a single link:

How it works

I mean, I’ve worked with some remarkably difficult people in the past. Most of them have been men. Am I to conclude that men sure are difficult to work with, aren’t they?

This entry was posted in Feminism on by .

Committing to calling out sexism

So my friend Jon Cowie had a recent incident in which he called out some inappropriate behaviour from Comic Relief, who are suggesting the hee-larious prank of, I quote

Take your pants off, put them on the reception desk and say “I’m going commando today!”

In response one of the people involved pointed out that Jon’s vanity domain of mycrot.ch was also problematic (they weren’t serious, but regardless of that I think they were right). To his credit, Jon acknowledged the point, shut down his domain and basically said “Ok. Your move”.

Sadly, the other side were not so gracious about it.

Anyway, you can read Jon’s account of the incident here.

I was very impressed with Jon’s handling of this, but then I started thinking about why I was impressed. It basically boils down to two reasons.

  1. The fact that as a guy Jon was calling it out was actually fairly unusual
  2. When confronted with a response that his behaviour was problematic, rather than getting defensive about it he took the comment on board and acted to address it

2 is just flat out impressive. It’s hard to take constructive criticism well, and we should all be better about it. So, yeah, well done Jon.

But it’s really 1 I want to talk about. Not to diminish it, but the fact that it’s unusual is a major problem. This isn’t a new revelation – it’s fairly well known that guys are not good at calling out guys about sexist behaviour – but the combination of this event and the recent discussions I’ve been having about sexism and gender bias in tech really drove it home to me.

Further, I realised that I’m not an exception to this by a long shot. I don’t think I actually engage in sexist behaviour (if I do it’s not intended and I would appreciate people telling me so I can fix it), but I’m definitely exposed to it from time to time and I don’t really do enough about it. I think this makes me part of the problem.

So, this is my commitment to do better. I can’t promise I will always call out sexism wherever I see it, but I promise I will do my best. I’d like it if you would commit to the same.

I have in fact already acted on this (I will probably elaborate in a later post). What struck me as interesting is how incredibly uncomfortable it made me. I’m not totally clear on why this was, but I’m pretty sure it was a wrong reaction and plan to simply ignore it and soldier on.

But it occurs to me that I’m probably not alone in feeling this way, and unless you’re really motivated to do something about it then going against your own feelings of intense discomfort is quite hard.

So I’d like to propose another thing that we as men who are interested in fighting sexism should do. When you see someone else doing it, say thanks. Good job.

This is not me asking for validation. Feel free to validate my doing this or not as you see fit, but I plan to stick with this regardless of whether anyone thanks me for it, and I hope you will too. But a lot of people won’t, or will try and just find it too difficult, and I think this is a good way to solve that.

Why? Because the best way to make behaviours not uncomfortable is to provide positive reinforcement for them. When you call out sexism and your peers tell you “You’re in the right. Thanks for doing what you’re doing”, you feel less uncomfortable and are more likely to do it again. Moreover, when other people see you calling out sexism and not being a lone voice, they get the message that this is an ok thing to do and are more likely to do it themselves.

It’s also an easier step to take. If you’re not yet comfortable with calling out sexism yourself, you can still help make things better this way.

So, please, the next time you see someone (man or woman) doing their best to fight sexism, support them by saying thanks. Publicly if you can, but even privately will help.

This entry was posted in Feminism on by .