Assignments and Exercises

To practice with the course subjects, you are offered both practical assignments (which contribute towards your course grade), and various training exercises. If you need any help or feedback, try your fellow students or ask the instructor during the lectures.


Practical assignments

The practical assignments are a mandatory part of the course and are preferably done in groups of two.

The practical assignments consist of questions and (coding) exercises. Some can be answered and explained using the theory discussed in class; others are to be answered using freely available Bayesian network software tools or other software packages (see below) and/or by consulting sources other than the course material.

Assignments, resources and submission instructions (including deadlines) will be made available through Brightspace. NOTE(!) The assignment deadlines will be strictly enforced.


Software for practical assignments

Numerous software packages and libraries exist for constructing and reasoning with probabilistic graphical models. Examples of libraries include pyBBN, pgmpy, libpgm and pomegranate for python; bnlearn, gRain and RHugin for R; Bayes-stack for Haskell, and Mens X Machina for Matlab. Also, specific languages have been developed to facilitate probabilistic modelling, such as BUGS, PRISM, Stan and PyMC. A 2025 overview and comparison, specifically focussing on structure and parameter learning, can be found here.

Bayesian network software

None of the above-mentioned libraries, however, come with the nice GUIs that the following Bayesian network software packages have. For practical assignments A and B, you should install one of the GUI-based packages of your choice. A list of possible options is given below; most of these have a free downloadable (demo-) version.(BayesFusion or Hugin-Lite are recommended.) The software may also help you to gain more insight in inference (Chapter 4) and BN construction (Chapter 5).

Note that most software packages allow a choice between inference algorithms. Be sure to select an exact inference algorithm (e.g. Lauritzen/Spiegelhalter, Jensen, Hugin, Shenoy/Shafer, Pearl, Variable Elimination) and not an approximate one (e.g. (Loopy) belief propagation, variational inference, sampling, Monte Carlo simulation)!

Specific packages are listed here:
Probabilistic programming assignment software


Exercises


Lecture notes exercises

The lecture notes contain various exercises for the subjects treated in the course, and provide hints or answers to most of them. For each lecture, the relevant exercises are listed in the class schedule. You are strongly advised to make the exercises, most of which are former exam questions. Doing so will form a good preparation for the written test in the sense that you practice with the theory; this allows you to assess your own advancement during the course.

A lot of exercises require training to solve, just as any 'mathy' subject. Be aware that solutions seem simple if you look at completely worked out examples; you need training to come up with solutions yourself (as required in the written exam). For this reason, we provide more exercises than just the completely worked out ones. For almost all exercises, the lecture notes provide at least the outcome or a hint, but do not consult these before putting in a serious effort yourself.

Many exercises can be solved using different approaches; if your outcome matches the one given, this usually means that you used a correct approach to solve it. Note that exercises are all very different, except for those addressing Pearl's algorithm. This shows that you can expect a question that requires demonstrating that you can apply Pearl during the exam. It also shows that the other exam questions are not simply variants of questions you have already practiced. In each case you need to try and identify the underlying theory from the course that you need to solve the problem. (See the studymanual/syllabus for more details on what we expect.)

Syllabus questions

The studymanual/syllabus (on Brighspace) lists questions per chapter from the lecture notes to guide your selfstudies. The answer to each question is in the associated chapter, but trying to reproduce it by formulating your own answer will reveal what you did and did not grasp from the material covered in the chapter. This type of question is not representative of an exam question, yet not being able to answer them indicates a lack of crucial knowlegde and understanding, warranting a need to go through the material again!

former exams

The majority of the exercises in the lecture notes are former exam questions and therefore representative of the type of questions you can expect for the written test (see also remark about exercises above). Several actual exams are available through A-Eskwadraat. Note that all exams include a question about Pearl's algorithm, so be sure to train that! Also, expect all exams to include questions that at first glance do not resemble what you have seen before. If you are sufficiently fluent in the course subjects and its pre-requisites, you should be confident that you will be able to solve these with what you have learned.