Let's look at the probability at each node and find out how many probabilities would appear there.
The nodes carrying Late Wake-up and Rainy Day are the parent nodes as there are no nodes leading to such nodes. The different nodes can be seen in the following points:
- Node (Late Wake-up): Being one of the parent nodes, we will be looking just to find out the probability of waking up late. Hence, the count of probability to be found out is 1 here.
- Node (Rainy Day): Like the late wake-up node, the count of probability is 1 here as well.
- Node (Accident on the highway): As it is a child node of rainy day, it talks about the probability of the accident given the rainy day and the probability of the accident given it's not a rainy day. So, the count of probability is 2 here.
- Node (Traffic Jam): It has got two parents (rainy day and accident). Rainy day has got two values, which are true and false, the same as accident. Combining both will yield four different combinations. Hence, the count of probability will be 4.
- Node (Late for work) and Node (Late for meeting): A similar explanation applies to these two nodes as well. The count for the probabilities of these is 4:
The total number of probabilities are 1 + 2 + 1 + 4 + 4 + 4 = 16.
Had it been just a normal joint probability distribution instead of BN, we would have had 26-1 probabilities. Hence, BN makes the network quite compact. Also, another more basic assumption we have to be mindful of is that each node is conditionally independent of its non-descendants given its immediate parents. For example, waking up late and being late for a meeting are conditionally independent in the case that late for work is also there. Generally, we can express BN in the following manner, which displays how joint distribution can be translated into a compact structure:
If G is the graph, Xi is a node in the graph G, and P are the parents of the Xi node.
Here are a few notes about the equations:
- The right-hand side of the equation is the application of the chain rule, which exhibits conditional independence relations. It is a graph-structured approximation of the joint probability distribution.
- Of course, the graph has to be acyclic.
- It can provide the convenience to display the relationship among various events.
Now, let's take a simple scenario to showcase the CPT. The following is the combination of three events as shown:
If it rains, the dog starts barking and the man skips work:
- Probability of rain (yes/no)
- Probability that the dog will bark (yes/no)
- Probability that the man will skip work (yes/no)
Let's have the network prepared as a directed acyclic graph. All these nodes reflect an event, and directed arrows are conditional probabilities. We will see here how to read this graph:
- Connector 1 indicates the probability of the dog barking if it rains
- Connector 2 indicates the probability of the man skipping his work if the dog barks
The following diagram shows the flow chart for both the probabilities: