Killing Our Citizens

Several years ago a man was shot in the demilitarized zone (DMZ) between North and South Korea. He was shot by South Korean soldiers after repeated warnings, as he tried to swim across the Imjin river (BBC article). I find this story  disturbing on two levels. One is of course that a person was killed, there should always be a moment to reflect when we are faced with a death of a fellow citizen. However the second is a more subtle point, I have brought up this story with several friends and there is a very little sympathy for this man. I find this hard to comprehend. He broke the law in entering the DMZ, he knew those laws, but I still think we should stand up collectively and denounce this act.

I have made this point to many people, but the law does not decide what is right from wrong, it is a rough set of guidelines for conducting ourselves in a society. For instance, if you drive through a red traffic light to block another car from hitting a child who happens to have walked onto the road, you would have technically broken the law. But I doubt a judge would punish you for this infraction. We do not know the particulars of this recent case, but can you imagine a scenario where this man really deserved to be shot in the back and killed?

Legally this soldier was following orders. But I don’t think the legality defines the rightness or wrongness of this or any situation. If I didn’t drive my car passed the red light to protect the helpless child on the road, I would not be held to account in a legal court, but I would still have done the wrong thing in not helping the child.

Why do we find it so easy to relinquish our autonomous moral character to legal (civilised) conformity. Its a bit like Milgrom’s Experiment. If you’re not familiar with this, it is the infamous psychological experiment whereby a volunteer is persuaded to inflict pain on another person. Through obedience to authority the majority of participants are quite willing to inflict life threatening pain. This explains how a soldier is stripped of their critical thinking and could thus make such a call. But it does not explain why we would have such a deadly legal framework in place, even in a place such as the DMZ.

Asked if the soldiers’ response was excessive, Brigadier General Cho Jong-sul at a  briefing said: “It was legitimate. In a combat area like this, anyone who ignores our soldiers’ repeated warnings and tries to run away to North Korea will get shot.” (

I think it is time to question legitimacy and this raises the question of civil disobedience. Right now we are just talking about this issue. But lets say we had time to do something about it. For example, “in the US the state defines it as civil disobedience to, let’s say, derail an ammunition train that’s supplying ammo for the Vietnam conflict; but the state is wrong in defining that as civil disobedience, because it’s legal and proper and should be done. It’s proper to carry out actions that will prevent the criminal acts of the state, just as it is proper to violate a traffic ordinance in order to prevent the kid from being killed.” –  from the Chomsky-Foucault debate ’71.

Lunar New Year Hunting for signs of Modified Gravity

We just finished the Korean Lunar New Year holiday called Solnal (or 설날). I was not feeling physically adventurous so didn’t do any traveling over this time, but rather relaxed at home with some nice whisky, read “Antifragile” by Nassim Nicholas Taleb, finished watching the first series of “Westworld” and then just for a bit of fun, done some hunting (or practice hunting) for deviations from Einstein’s gravity.

Martin White recently wrote a paper (arXiv:1609.08632) on the possible advantages of using Marked (weighted) correlation functions as a tool for investigating modified gravity. So I (with Yi Zheng) thought we would have a go at trying this, and I’ll present here what I find.

To do this analysis we need:
1) some code for calculating the correlation functions. I have already written a fast MPI+tree code for measuring these kind of statistics (KSTAT).
2) Cosmological N-body simulations of different gravity models. I contacted Baojiu Li to ask if we can use his simulations of modified gravity. He was happy to help and collaborate on this project 🙂


Baojiu provided us with dark matter halo snapshots at z=0. The size of the box is 1024Mpc on the side and the sample is split into a high mass (M>10^13 Msun) and a low mass (M
<10^13 Msun) samples. There is one GR (general relativity) or rather Newtonian simulation and two simulations of the f(R) gravity with varying values for the |fR0| parameter, |f(R0)|=10^-5 and 10^-6.

Density Estimation

To estimate the density at every galaxy (or DM halo) I opted to use the Voronoi Tesselation scheme. Two reasons for this: 1) I never tried before so thought it would be good to learn 2) I know that the Voronoi should have good resolution on small scales owing to its intrinsic lack of a smoothing scale (although this is not exactly true, as we shall see later).

In mathematics a Voronoi diagram is a way of partitioning N-dimensional data into individual cells. The nice propertiy being that the inverse of the volumne of each cell is an estimate of the density at that point. There is no need to work on fixed grid cells for computing the density.

import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import Voronoi, voronoi_plot_2d

infile='galaxy_file.ascii' ## filename with 3 columns (x,y,z) coords 
points = np.genfromtxt(infile)


This is a Voronoi diagram of a subsample of the galaxy data (blue points)

To construct the Voronoi diagram from the data I used the publicly available python code contained within the scipy spatial package. The density is then computed from the inverse of the volume of each cell. However, I could not find an easy way to access the Voronoi volume elements, thankfully someone already thought of this -> here.

from scipy.spatial import Voronoi,Delaunay
import numpy as np

def tetravol(a,b,c,d):
    '''Calculates the volume of a tetrahedron, given vertices a,b,c,d'''
    return tetravol

def vol(vor,p):
    '''Calculate volume of 3d Voronoi cell based on point p.'''
    for v in vor.regions[vor.point_region[p]]:
    for simplex in tri.simplices:
    return vol


for simi in sim:
    for massi in mass:
            xx = np.genfromtxt(infile)
            print infile
            for i in range(ngal):


now the function “vol” will compute the volume of each cell associate with each galaxy. The density is obtained by simply inverting this. In this python script we are looping over the 2 mass bins (mlt13,mgt13) and the 3 simulation (gr, f5, f6).

The one problem with using the Voronoi for density estimation is that it will perform badly near the boundary. To avoid this I trimmed 20Mpc/h (little larger than mean inter-particle spacing) from all edges – throwing away data but preserving a clean sample.

Computing the weights

Following White (2017) we compute weights based as a function of the density (in units of mean density) with two free parameters \rho_star and p.



for simi in sim:
    for massi in mass:
        xx = np.genfromtxt(infile)
        points=xx[:,0:3] #x,y,z positions
        rhonorm=xx[:,3] #normalised density
        for pstari in range(1,4):
            for rhostari in range(1,4):
                print outfile

above we can see how the distributions of the weighs look compared to each other. On the left we show just the distribution of density, with its characteristic log-normal shape. The weighted functions can be seen to give more importance to under-dense regions, as is clear from the above equation when p>0.

The two-point correlation function

Firstly looking at just the usual correlation function. We plot the modified gravity simulation results normalised to the GR simulation. We see that there is a relative bias between the samples. The weaker F6 has a constant %5 bias difference with GR in both mass bins. For the stronger F5, the higher mass halos again have a relatively constant bias difference with GR, however the lower mass halos exhibit a much larger deviation from GR which seems to increase on larger scales. The errorbars are from 125 jackknife subsamples.

The weighted correlation functions…

I continue this work over at overleaf…

Gravitational Microlensing

More adventures with Gorae (whale). This time gravitational microlensing with KMTnet. Next time we find out about distance in the Universe. Check back soon!


** These articles were originally published by Gorae magazine. Gorae is a children’s magazine that is distributed to many schools and kids centers through donation. Gorae’s philosophy is to make children socially aware. If you would like to support them please consider donating a small amount and provide another school or center with a copy of gorae magazine.

Food 2.0

Several years ago I came across an article describing some crazy entrepreneurs plan to design an optimal food that is cheap, simple and satisfies all dietary requirements etc. It’s called soylent and they seem to be doing well so far.

They made their recipe open source allowing others to tinker with alternative recipes. There is now a large community of people producing tailored recipes, see

I like optimisation problems so I thought I’d have a go at designing my own recipe, trying to max out the recommended daily amount of protein, carbohydrates, fats and all manner of other things that I don’t really understand. Now, I don’t take this too seriously, and further I would add that I’m not sure that getting the 100% recommended daily allowance of everything will necessarily make our bodies any better in the long term. Our bodies many even, by genetic design, be better adapted when we have extreme variation in dietary intake. Nonetheless, I like experiments so I’ll document what I find.

I created a recipe on the DIY Soylent site called Sab’s Chow, ordered the products on (they deliver to Korea) and now just started trying it. It tastes good! I’ll post more on the progress of this recipe, as time passes, if indeed I survive 😉

Gravitational Waves

About 1 year ago I started writing science articles for a children’s magazine in Korea called “whale” (or in Korean “gorae” written as 고래). In these article we focus on new discoveries in the fields of physics and astronomy.

I only recently got around to translating them into english with the accompanying illustrations. I will post these semi-regularly on this blog with tag “gorae” or under the category of “outreach”. Check back here if you want to see more. This time we cover gravitational waves, next time it will be planets outside our solar system; exoplanets!


** These articles were originally published by Gorae magazine. Gorae is a children’s magazine that is distributed to many schools and kids centers through donation. Gorae’s philosophy is to make children socially aware. If you would like to support them please consider donating a small amount and provide another school or center with a copy of gorae magazine.