A Bayesian network has five discrete variables: A (2 states), B (3 states), C (2 states), D (2 states) and E (4 states). The arrows are A→C, B→C, C→D, B→E and D→E. How many free parameters does it need, and how does this compare with the full joint table?

Probabilistic models, Bayesian networks
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can count free parameters of conditional probability tables (CPTs) from the parent structure.

Key idea

A node with r states and parents having q joint configurations needs (r−1) q free numbers, because each row of its CPT must sum to 1.

Steps

  1. Write the factorisation from the graph: p(A,B,C,D,E)=p(A) p(B) p(C∣A,B) p(D∣C) p(E∣B,D).
  2. Count each table as (states −1) × (number of parent configurations). A: (2−1)⋅1=1. B: (3−1)⋅1=2.
  3. C has parents A,B, so 2⋅3=6 parent configurations and (2−1)⋅6=6 parameters. D has parent C: (2−1)⋅2=2.
  4. E has parents B,D, so 3⋅2=6 configurations and (4−1)⋅6=18 parameters.
  5. Total: 1+2+6+2+18=29 free parameters.
  6. The full joint table has 2⋅3⋅2⋅2⋅4=96 entries, hence 96−1=95 free parameters. The network uses 29 because it assumes conditional independences.

Common mistakes

How long your answer should be

Half a page, with one line per node.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: What is a factor graph, and why is it the natural structure on which to run message passing?
Next in Probabilistic models: In the DAG with edges A→C, B→C, C→D and C→E, decide whether each statement is true, using d-separation: (i) A⊥B; (ii) A⊥B∣D; (iii) A⊥D∣C; (iv) D⊥E∣C; (v) D⊥E; (vi) A⊥E∣B?