Some examples of compact convex sets

Due to reasons (connected to incomplete von-neumann morgenstern orders if you must know) I’ve been thinking about the Krein-Milman theorem recently, and I realised that I had some misconceptions in my head that were obviously false when I thought about them for five minutes. Here are some examples to illustrate its boundaries.

The Krein-Milman theorem says that every compact convex subset of a locally convex vector space is the closed convex hull of its extreme points.

Consider \(\mathbb{R}^n\) with the normal euclidean norm. Then the unit ball \(\overline{B}(0, 1)\) is a compact convex set with infinitely many extreme points.

The same is true of any \(l^p\) norm with \(1 < p < \infty\), because such spaces are strictly convex.

It is not true for \(p = 1\) (whose extreme points are the points \(\pm e_n\)), or for \(l^\infty\) (whose extreme points are the set of points with \(x_i = \pm 1\)), both of whose unit balls have finitely many extreme points.

Moreover you cannot drop the “closed” part. Not every point is a convex combination of finitely many extreme points:

Consider \(A \subseteq l^\infty\) defined by \(A = \{x : |x_n| \leq \frac{1}{n}\}\). This is convex (because it’s a product of convex sets) and compact (it’s closed, so complete, and you can construct \(\epsilon\)-nets explicitly). Then the extreme points are the set of all points \(\{x : |x_n| = \frac{1}{n}\}\).

Let \(y = \sum\limits_n \lambda_i x_i\) be a finite combination of extreme points. Then \(n y_i\) can only take the \(2^n\) (and in particular finitely many) values \(\sum\limits_n \pm \lambda i\).

Consider \(y_n = 2^{-n}\). Then \(y \in A\) and \(n y_n\) takes infinitely many values and thus \(y\) cannot be a combination of finitely many extreme points of \(A\).

Note that it is true that every point in a compact convex set is a sum \(\sum\limits_{n=0}^\infty p_n x_n\) where \(\sum p_n = 1\) and the \(x_n\) are extreme points, you just need the sum to be infinite.

Edit: Actually I think it’s not, though I don’t yet have a counterexample. In general you may need a full integral over a probability measure on the extreme points. I’m going to have a thing about how to construct such.

This entry was posted in Numbers are hard on by .

How to learn a new city

Epistemic status: I’ve no real experience here. This is just what I’ve been doing. It seems to work pretty well? It might not work for you.

So as you may have gathered I’ve moved to Zürich recently. A lot of the last few weeks have been me going “Halp how do I find my way around here?”.

It’s now at the point where I think I’ve got a handle on the basics. There’s still a lot I’m confused by (I can’t even pronounce the street names correctly), but I no longer feel too bewildered about how to get where I need to go.

So, here’s what I’ve been doing. It’s less of a unified theory of exploration and more a collection of helpful things.

The basic principles are:

  1. Walk everywhere
  2. Use Google maps (or your favourite equivalent), but use it sparingly
  3. Be goal directed, but vary your route
  4. Keep an eye out for places you’ve seen before

Walking everywhere

(I’m aware not everyone can do this. I don’t really have any good suggestions there, sorry. The problem of reporting on what I do that works for me without any broader experience is that it’s generally quite tailored to my particular capabilities)

The basic motivation is that I’ve found walking is vastly better for getting to grips with a route than anything else. Cycling (or, I imagine, driving) you have too much coming at you and everything is too fast to properly take it in. Public transportation, while a hallmark of modern civilization, is actively harmful for helping you understand the geography of something. Walking puts everything straight into your spatial memory and helps you get a feel for how it all connects up. Lots of bits of London didn’t make much geographical sense to me until I stopped considering them in terms of which tube station they were near to.

You should also learn the public transport network of course. Sometimes you want to go further than you can realistically walk, and also once you know how to walk from A to B quite well you don’t need to keep relearning that route and can start to think about how to make your trip more efficient. You just avoid public transport when you’re trying to learn the area you’d be travelling through.

Maps with GPS

This is for three main reasons:

  1. Getting a rough idea of a good route before you set out (you should ideally not follow that route precisely, but it helps give you a good sketch to start with) when you don’t really know where you’re going. Don’t do this unless you’re sure you need to.
  2. Occasionally confirming you are where you think you are so that you don’t learn wrong information
  3. As a panic button

3 is the important one. Basically: The essence of learning is experimentation. The main thing you need to be able to experiment is to be able to afford to fail. If it’s not costly to fail, it’s not costly to try things. Having GPS to tell you where you are and how to get where you need to be means you can never get too badly lost and are thus free to explore. This is really important.

(Note: You should also determine whether any areas of the city are unsafe and worth avoiding. Zürich is very safe so I haven’t had to worry about that. If you’re unsure, ask for advice and only explore when it’s light out)

Goal directed

This is my standard approach to learning so it’s not surprising I’d promote it here. Essentially I find that asking the questions that you need to learn how to answer and then learning enough to answer them is by far the most useful way to learn a subject. You can explore aimlessly if you want (if you do, I recommend taking a companion along, but that’s mostly because I find aimlessly wandering on my own boring and will tune out and not learn anything).

So yeah, basically you should be asking lots of questions of the form “I am at A. How do I get to B?”. You can use maps for this if you like, or you can go by dead reckoning.

Try not to go by a route you’ve already done. Learning how lots of different bits connect up is very helpful – I find the more connections I know the better the whole thing sticks in my memory and makes sense.

Landmarks

This is again about the connections thing: It’s very useful to be able to go “Oh, that’s where I am” and tie little bits of knowledge together. These don’t have to be fancy scenic landmarks or anything – I actually find distinctive shops one of the better things for this, though churches and giant cranes are also useful too.

And the rest…

I’m sure there are lots of other useful techniques. To be honest, I’d love to know what they are, because this seems to be working much less well for my new office than it has for my new city, so maybe there are some useful tricks I’m missing…

This entry was posted in Open sourcing my brain on by .

My algorithm for deciding what to cook

I don’t really follow recipes. I sometimes read recipes for inspiration, but I rarely end up following them more than even vaguely.

Instead I just haphazardly thrash around until I come up with something to cook. This works surprisingly well.

It occurred to me earlier that the way I do this is a greedy algorithm. As well as being an interesting insight, this is an amusing pun (here let me explain the joke: You see, a greedy algorithm is both a solution finding algorithm from computer science but also someone who eats lots of food is “greedy”. Therefore the humour derives from the double meaning of the word greedy in this context: It is both accurate from an algorithmic design point of view and also carries the hidden implication that you are going to eat lots of food. Is this funny yet? I can explain more if you like).

That is to say it works by maintaining a set of ingredients. The algorithm is then:

  1. Find an ingredient which would go well with the existing set of ingredients.
  2. If I am in the mode for that ingredient, accept it and add it to the list.
  3. Repeat until the current set of ingredients seems like it could be turned into a complete meal.

This seems to produce consistently good results.

The problem is that it requires a good implementation of step 1 in order to function. I think mine is basically performing a rejection sampling on the set of available things (i.e. wandering randomly through the supermarket / browsing through my cupboard / fridge) until I find something that catches my eye and go “Oooh. That could work”. The empty set is a special case here where it requires me finding out what I’m in the mood for.

It also requires being able to figure out what goes well together without actually trying it. Some people seem to find this hard. All I can offer as advice is that a protracted period of vegetarianism in which you can’t eat cheese works really well for developing this skill (at least that’s how I did it). The problem with meat and cheese is that they constitute a dominant flavour for the dish, so it’s very easy to just make them the centre piece and not do much else to it. Without that as a crutch what you will make will tend to be very boring unless you figure out how to make a variety of different flavours work well together, and you’re forced to learn out of survival instinct. It’s not dissimilar to the immersive way of learning a language I imagine.

Here is a dish I made recently that resulted from this:

Gnocchi with Aubergine/tomato/Caper sauce

Gnocchi is self-explanatory. The sauce is as follows:

  • Approx 1 kg aubergine
  • 1 head of garlic
  • approx 50g butter
  • “some” olive oil.
  • coarse salt “to taste” (sorry, I know. But I have no idea how much I used, except I tend to salt things quite heavily).
  • About 5 tsp of capers
  • 1 pretty embarrassingly weak red chilli (note: recipe needs more chilli than I used)
  • fresh thyme until I got bored stripping it off the stems
  • 800g canned chopped tomatoes

It proceeded in two stages. To be honest, I’m a little disappointed in the second stage because the first was so amazing and the end result was merely really good. You might want to stop halfway through and just eat the aubergine bit.

Step 1:

Cut the aubergine into roughly cm cubes. Peel but don’t crush the garlic. Chop the chilli without removing the seeds (you may wish to remove the seeds if you have a real chilli rather than the pathetic imitation chillis I found in a Swiss supermarket). Put these in a pressure cooker with the butter and enough olive oil that the aubergine is lightly oiled but not soaked in it and as much thyme as you can be bothered with. Stir it all up, then pressure cook for 10 minutes once the pressure is up.

The result was basically perfect salty garlicky soft cooked aubergine. The pressure cooker basically fixed all the pathologies of cooking aubergine where there’s a complex dysfunctional middle ground between undercooked and burned.

Step 2 is simply to add the tomatoes and capers, stir and then pressure cook for another 5 minutes.

The result is a really nice garlicky sharp sauce a little reminiscent of puttanesca (it didn’t have olives, but they’d probably have been a good addition now that I think about it).

The basic starting point of this recipe was gnocchi, found while browsing the supermarket. I then added the aubergine, and everything else just build up around there.

Of course, now I’m using a subtly different algorithm for tonight’s dinner: The aubergine intermediate step was really good. What could I serve that with? (The answer BTW is that it’s going to be served with a quinoa done with dill, lemon and feta plus a side of fresh made guacamole. I’m pretty excited by this plan).

This entry was posted in Food, Open sourcing my brain on by .

GO. VOTE. DAMMIT.

From the facebook thread for my last post:

Jon Pretty replied with:

I’m not going to vote. The expected utility of me voting is infinitesimal. In the unlikely scenario that my vote decides the election, it will change just a single representative. What practical difference does that make? Virtually nothing. Sure, the turnout will be one vote higher, but that’s even less relevant.

If I believed voting was useful, I’d play the lottery; one where I’m even less likely to win, and where the winnings are small enough that they wouldn’t change my life in any noticeable way.

People sometimes ask me “what if everyone thought like that?” Well, they don’t, and I rely on that fact, so I’m not going to encourage everyone to think like me. If more people did think like me, I’d think differently and I’d start voting, because my vote might actually have more chance of making a difference then.

[…]

And my reply:

The basis of modern civilization is lots of people doing things that have no strong net benefit to them that on aggregate make things better for everyone. e.g. for a trivial example, the net effect of not littering is small, but the aggregate effect of even a relatively small percentage of the population littering is large. Choosing to opt out of those small things because you trust other people to pick up your trash for you is a selfish attitude which I can not allow to spread.

And the thing is, you think you’re being unique with your “What if everyone thought like that? Well they don’t”. They do. You’re not even in a minority here – electoral turnout for the EU elections is generally completely pathetic in the UK. About 65% of the population didn’t vote in the EU elections last time.

And this turnout is not uniformly distributed. Extremists are more likely to vote than non-extremist, so your wishy washy “I’m not going to vote because it doesn’t make a difference” bullshit is basically you participating in the statistics of handing power to awful people. Sure your individual contribution to it is infinitesimal, but your attitude of apathy is the same as most of the others responsible, and by both practising and promoting that attitude you are selfishly making the world a worse place.

So, in short, yes I’m going to fucking judge you for not voting. Go vote.

Your Russell Brand studied “Oh but I’m not allowed to be special so why bother” political apathy does not impress me. Go fucking vote.

This entry was posted in voting on by .

Go vote, dammit

Hello everyone. I’m here in Zurich. I’m not dead. At some point when the dust has settled I will post about that, but this is not that post.

What this post is is reminder that if you live in the UK and entitled to vote then you should be voting in your local and MEP elections tomorrow (that is, the 22nd of May. Thursday). It’s important.

(If you’re not in the UK but are eligible to vote then ideally you should be voting too – e.g. I’ve asked my sister to vote as my proxy – but this notice comes too late for you)

If you have no idea how to vote, honestly you will probably still be a net benefit if you pick a random one of the main three parties. You shouldn’t do that, but it’s at least a better option than not voting (I’m not a big fan of the status quo, but I’m a bigger fan of the status quo than I am of UKIP, who are polling distressingly well). If you want to spend 5 minutes of your time on figuring out how to vote in the european elections instead of flipping a coin, votematch will give you a decent idea of which of the parties running will best support your preferences.

(It’s much harder to figure out how to vote in the local elections because a lack of good information caused by everyone pretending they’re not important. My general policy is to have my local vote follow my general politics).

For myself, I’m voting green in everything. They’re basically the most left wing of all our parties who are in with a chance, and you might have picked that up about my politics.

(It’s unclear that this is the perfect decision from a tactical point of view, but it’s not a bad idea from a tactical point of view – the greens have historically done well in local elections, and their polling in the MEP elections is decent enough that I think they’ve got a chance – and I think there are secondary benefits to increasing the Green’s vote share by making them seem like more plausible candidates in future elections)

Obviously if you just want to follow my lead and vote along with me like the good loyal audience you are, that’d be grand, but really you shouldn’t do that. Spend a little bit of time today making up your mind if you already haven’t, and then go out and vote.

This entry was posted in voting on by .