Teachers

Canvas

This course uses Canvas. See tips and guides for Canvas.

Log into Canvas

In connection with Story #85, an MCMC take on Magic Squares, I've uploaded com5d to the site. Use it, play with it, constuct magic squares of sizes 4 x 4, 5 x 5, 6 x 6, perhaps higher. This is achieved via the MCMC for f(x) = \exp[-\lambda Q(x)] / constant, with positive \lambda. You may also play with *negative \lambda*, to encourage outcomes as far as possible from magic-ness: sums of rows, columns, diagonals, far away from the magic number (34 for 4 x 4, 111 for 6 x 6, etc.). The exercise is then to find the Bayesian MAP, maximising Q(x) as score: the worst ever squares. 

I think it's pretty hard to do this by pure math -- so run chains and see what happens. My current guesses, for 4 x 4 and 6 x 6 (after tne minutes of playnig) are 114 and 540. If you can beat these numbers, tell me, and I'll give you tyve kroner (les Rudolf Nilsen).

Sep. 4, 2025 11:16 AM

(Text below is being edited as we do more, so to speak, so read also updates.)

We've done (more or less): Ch7 exercises 1, 2, 3, 4, 5, 9, 12, 13, 15, 16, 17; then Stories #41 (Odin's children, Bayesian part), #13 (antidrepressant, Bayesian part), #54 (Star Trek, Bayesian part), #85 (Magic Squares). Up soon, start working: Story #31 (counting hjort, Bayesian part), #17 (cigarettes). 

Tentative plan Mon Sep 8: Story #31 (counting hjort, Bayesian part); more on 7.18, 7.19; Oblig 2021, #2, Exam 2017, #1. 

Wed Sep 10: Exam 2021, #2, #4, Exam 2017, #4. 

Links to these exam & obig sets are on the vevside. Note, and be happy about it, that we're *already* able to do various earlier exam, exam project, oblig problems. 

Sep. 2, 2025 2:21 PM

We're doing MCMC, in the Mon Sep 1 ff week, and indeed later on. Check how Nils solved his first ever sudoku puzzle, by using 12 hours to set up & code up a class of MCMCs and then let it run for a million times (where "one million", taking 1 minute, is a ridiculoulsy *small* number, given the state space of 116,121,600 possibilities). 

Nils has also used MCMC to find magic squares, say of size 10 x 10 (all rows, all columns, both diagonals, sum to 505); see Story #85. We don't this as an "explicit exercise" in this course, but look it through, try your hand, find a magic 6 x 6 square.

https://www.mn.uio.no/math/english/research/projects/focustat/the-focustat-blog!/sudokustory.html

https://www.mn.uio.no/math/english/research/projects/focustat/the-focustat-blog!/gaudisquare.html 

Sep. 2, 2025 1:57 PM