2018 in Graphs and Charts, Part 1

When most people think of graphs, they would probably think back to mathematics lessons in middle or high school, where it typically refers to a plot of how quantities change in relation to one another. Graph sketching was for some reason a large part of the university admission process for mathematics and computer science related courses, even if many of the curves that candidates were tasked to sketch could be approached in a rather uninspired algorithmic way.

There is a looser definition, which is closer to what I’d call a chart, which is a graphical representation of data. Some people do say things like “line graph” or “bar graph” (interestingly, “pie graph” is rare).

Moving away from mathematics and data representation, a graph also refers to a glyph or character in terms of typography, leading to terms like digraph for pairs of letters that make a single sound, though I don’t think usage of the term by itself is common.

As a software engineer, there is a fourth definition – a graph is also a structure comprising a set of nodes and a set of edges that connect these nodes. This structure is very useful for modelling many things with network-like structure, such as in communications, path-finding, or reasoning about state machines. You could say the core of my Masters’ thesis about MCMAS-Dynamic was a novel algorithm for exploring certain types of graphs quickly; one of what I’d call my flagship projects at Palantir also revolves around graph algorithms.

There is a risk of shoehorning all kinds of problems as problems solvable with graphs, in this sense (I remember some jokes I had with a couple of friends at university on trees, a specific subset of graphs, applying to everything). Nonetheless, graphs are very useful. I’ll use both the computer-science graphs and the looser ‘graphical data representation’ as I recap some of the things that I did (or happened to me) in 2018.

Travel

There was quite a bit less travel this year, and you could say the destinations involved were maybe a little less exotic (though I still maintain that the trips were good). One thing this map doesn’t quite show is the frequency each route was taken (though looking at this it seems that each path was actually taken once; I’ve made two trips to Singapore, one through Frankfurt and one direct).

I think most of this is just a decrease in travel for work, which was lower than normal. Leisure travel remained about where it has generally been (a total of 32 days this year, though that does include quite a few weekends). I don’t know if this is because of Brexit making my pounds buy less meaning I’m less likely to think about travelling. This could be relevant to the US or Zurich, but not necessarily elsewhere where the cost of living tends to be lower. Writing this, I remember my restaurant-quality six-euro dinner in Croatia…

Going forward, I hope to have a more interesting graph/network in 2019. Hopefully Brexit won’t get too much in the way of that – you might think that as a Singaporean I won’t be directly affected, but I will be. The pound might depreciate, making overseas travel expensive, and the length of the non-EU queues might increase. There is also talk of the Schengen version of ESTA coming up as well.

Logic Puzzles

I joint-set one of the puzzles for Palantir’s 2018 puzzlehunt, and have also been doing quite a few logic puzzles, including sudoku; I placed pretty decently at this year’s UK sudoku championship, and a bit more weakly in the puzzle division. Considering puzzles more broadly, they can be classified into a variety of types. Sudoku probably counts specifically as its own class, but there are also more general ‘number placement’ puzzles – you might have heard of Kakuro. There are other genres – ‘loops’ like Slitherlink; ‘object placement’ like Battleship and ‘shading’ like Nurikabe, among others.

I had the impression I was substantially better at sudoku than most general puzzles (a good chunk of this might just be experience-related), and probably better at number placement too. Conversely, I always struggled a lot with spatial reasoning in school and at Math Olympiads, so I thought my skills with loops would be weak.

One of the sites that hosts these puzzle contests is Logic Masters India. They ran a series of puzzle contests in 2015 that were split by genre. They also have a rating system, to facilitate comparison of skill across contests. A player’s overall rating is an aggregation of rating events; the computation of this aggregation is a little complex, but figuring out the score at an individual rating event isn’t too hard.

  • An event has a raw score, computed from individual puzzles – raw scores are compared to determine overall ranking.
  • Define ranking score (RS) as one’s percentile performance in the contest multiplied by 10. In other words, the top contestant scores 1000, and the median contestant scores 500.
  • Define point score (PS) as the ratio of one’s score relative to the top scorer, multiplied by 1000. The top scorer thus scores 1000; someone who scored half as much as the top scorer scores 500.
  • The overall rating score is a weighted average of the two: 0.75 * RS + 0.25 * PS.

I tried out each of the contests in the set, along with a sudoku contest, and calculated my overall rating scores for each, which are reflected in the graph above. Expectedly, sudoku is strongest (experience, probably). I didn’t realise drawing snakes was considered a genre by itself, though given it is I knew I would be terrible at those as I usually approach those with mainly intuition. I don’t know what the intended standard deviation of ratings are, so it’s difficult to comment on the significance of the differences.

Stock Market

The price over time of a security is a good example of a time series. This naturally lends itself well to a line graph, with price as the vertical axis and time as the horizontal axis.

One can similarly graph the size of a portfolio; the above reflects the value of my workplace pension, re-based to 100 at the start of this year. However, this is for the most part only sampled monthly (or sometimes bi-monthly, depending on whether there were other events that made me look at my portfolio), so the resolution of the data is very limited.

This year has (and it’s good) reminded me why there is an equity risk premium. Consider that a zero-growth environment would mean a straight increasing line, as additional contributions are coming in. Hence, the small decline from January to February or stagnation in October actually refer to periods where the market went down; the steeper-than-normal gain in May and August refer to periods where the market went up. This makes a fair bit more sense if one also looks at the performance of an accumulating world index tracker.

Source: Morningstar. Disclaimer: I do hold as part of my portfolio the Fidelity World Index P fund.

As expected, prices slumped in February and October, while rallying in May and July. Interestingly, there is a rather pronounced late-March to early-April decline that isn’t reflected in our original graph. This is an artifact of sampling – the March reading was taken on the 21st of March, and the April reading on the 23rd of April, by which time prices had already mostly recovered.


Leave a Reply