On the 5th June 2026 we will host a hackathon at KCL for UG students interested in Cosmology.
Here is the link to the folder containing the data for the three exercises.
For the Least Squares fit exercise, you have a three column file called “lsqdat.csv” that contains x, y and the error on y, sigma_y and you need to find the best fit straight line which goes through this data. Once you have that, you create a file called “teamname.csv” where “teamname” is the name of your team. For this exercise, given the equation of a straight line is y=mx+c there should be the gradient m on the first line, and the intercept c on the second line (one column, two rows).
Here is the link to the google form where results can be submitted.
All results should be submitted in .csv format, that is comma separated variable format so:-
1.0e0,23.4e0
2.0e0,24.7e0
2.6e0,32.43e0
……..
or
1.35e2
2.43e2
………
If everything is working well (and I am sure things will break down at some point during the day), then your results should be published on the big screen, so you can see how well you are doing relative to everybody else. The lower the value of Chi Squared that you produce the better.
For the second exercise, you are trying to predict the value of which will fit the supernova data. Because we are assuming that the Universe is flat (as confirmed by observations of the Cosmic Microwave Background) that means so that by giving your best bet for you have provided all the information we require. So we only need a single number.
Here are some cosmology notes. Much more here than you will need today!
Here are the slides from the presentation.
The data for this is in the same google directory as for the straight line. The three columns are redshift (z), the difference between the absolute magnitude (m) and the apparent magnitude (M) which we call We don’t know the precise value of the absolute magnitude, or the precise value of the Hubble constant, so we have to treat this as a nuisance parameter, see notes, listen to presentation and ask the helpers or me for more guidance on this.
The third exercise is obtaining the redshift of galaxies from their photometric observations. The Sloan Digital Sky Survey obtains measurements of many millions of galaxies, but it cannot obtain detailed spectra, and hence redshifts, of all of them, or even the vast majority of them. Rather it measures their brightness in five different filter bands. I have provided you with a training set of 8000 galaxies with these five photometric (brightness) measurements, as well as their redshift, as well as a validation set for you to test your fitting algorithms on. Once you have an algorithm you are confident with, you can predict the redshifts of the galaxies in the test data set, and upload them via the form, this will be a one column list of 1000 redshifts (since there are 1000 sets of five brightnesses in the test file, but no redshifts.)
Please feel free to ask any questions you have, and ask me or the other helpers questions during the day.




