DeepLLM Quiz
Statistics and Probability

Directed graphical models: drawing a probability distribution as a factorisation

10 questions on nodes, arrows, parents and children, how a directed graph factorises a joint distribution, acyclic graphs and what missing links tell you.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    A graph has an arrow from a to c and an arrow from b to c, and no other links. Which factorisation of the joint distribution does it represent?

    • p(c) times p(a given c) times p(b given c)
    • p(a) times p(b given a) times p(c given b)
    • p(a) times p(b) times p(c given a and b)

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

A doctor thinks about a patient in terms of causes and effects: a lifestyle factor makes a disease more likely, the disease produces symptoms, and a test responds to the disease. Writing that down as a table of probabilities for every combination of every variable would be hopeless, but drawing it as a diagram is easy and instructive. Boxes, or nodes, stand for the variables, and arrows say which variables each one depends on directly. A probabilistic graphical model turns such a diagram into a precise statement about a joint distribution, and this quiz is about reading that statement correctly.

The central idea is factorisation. Any joint distribution can be broken into a product of conditional distributions by repeated use of the product rule, one factor for each variable. A directed graph records exactly which variables appear in the condition of each factor: the parents of the node. You will practise writing down the factorisation that a small graph represents, and drawing the graph for a given factorisation. You will see why the same distribution can be drawn in different ways depending on the order of the variables, and why a graph in which every pair of nodes is linked says nothing at all, while a graph with missing links carries real information.

The quiz also covers a few ground rules. Arrows must never form a loop, which is what it means to be a directed acyclic graph. The product of properly normalised conditional distributions is automatically normalised. And there are other kinds of graphical model, with undirected links, suited to different jobs. The questions are scenarios with small graphs, so that you practise the skill of going from picture to formula and back.

A few misreadings come up often. An arrow does not by itself prove causation, it is a statement about how the joint distribution is decomposed. A missing arrow is as informative as a present one. And a node in a probabilistic graph is a random variable, which makes it quite different from a unit in a neural network diagram, even if the drawings look alike. Seeing a model as a graph pays off in practice. The picture shows at a glance which variables interact, it suggests how a new model could be designed by adding nodes and links for the quantities that matter, and it prepares the ground for efficient computation, since many calculations on a distribution can be organised as operations on the graph. Whether you are building a model of a medical condition, of a machine's failure modes or of the way a sentence is generated, the habit of asking what the parents of each variable are is a clear way to think about its structure.

The quiz suits learners who know the sum and product rules of probability and want to see how they organise complicated models, and practitioners who meet Bayesian networks in papers. It needs no calculus. There are 10 questions, each with an explanation, and it takes about four minutes.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation follows each answer, with the small factorisations written out in words.

›Do I need to know probability theory?

You should know the product rule, which says that a joint probability is a conditional probability times a marginal one. The quiz on the sum and product rules covers it. Beyond that, the questions explain each term they use and no calculus is needed.

›What is a directed graphical model?

It is a diagram in which each node stands for a random variable and each arrow expresses a probabilistic relationship between two variables. The graph captures the way the joint distribution over all the variables is decomposed into a product of factors, each depending on only a subset of the variables. These models are also called Bayesian networks.

›How is a joint distribution read off a directed graph?

For each node, write down a conditional distribution of that variable given its parents, meaning the nodes with arrows pointing into it, and multiply all these together. A node with no incoming arrows gets an ordinary distribution with no condition. The product over all nodes is the joint distribution described by the graph.

›Why does the choice of ordering matter?

The product rule can be applied to the variables in any order, and each order gives a different decomposition and therefore a different graph, although the underlying joint distribution is the same. The left-hand side is symmetrical in the variables, but the right-hand side, and its diagram, depends on the order chosen.

›What does a fully connected graph say?

Every pair of nodes is joined by a link, each node having all lower-numbered nodes as parents. Such a graph can represent any joint distribution at all, so it asserts nothing. The interesting information in a graph lies in its absent links, which restrict the family of distributions it can describe.

›Why must the graph have no directed cycles?

The factorisation needs an order in which each variable is conditioned only on variables that come earlier. If arrows formed a closed loop, no such order would exist. A directed graph without cycles is called a directed acyclic graph, and it is equivalent to saying that the nodes can be numbered so that every link goes from a lower number to a higher one.

›How do directed and undirected graphical models differ?

Directed models, whose links carry arrows, are useful for expressing causal relationships between variables. Undirected models, also called Markov random fields, have links without direction and suit soft constraints between variables. Both can be seen as special cases of a more general representation called factor graphs.

More quizzes