Probabilistic Reasoning (Unit-3)
Probabilistic Reasoning (Unit-3)
Probabilistic Reasoning (Unit-3)
Probabilistic reasoning
Uncertainty:
A agent working in real environment almost never has access to whole truth about its
environment. Therefore agent needs to work under uncertainty.
With this knowledge representation, we might write A→B, which means if A is true
then B is true, but consider a situation where we are not sure about whether A is true or
not then we cannot express this statement, this situation is called uncertainty.
Causes of Uncertainty: Uncertainty in AI can arise from various sources, including:
Information Occurred from Unreliable Sources:
AI systems rely on data to make decisions and predictions. However, data obtained from
various sources may not always be reliable. Data can be incomplete, inconsistent, or
biased, leading to uncertainty in the outcomes generated by AI systems.
Experimental Errors: In scientific research and experimentation, errors can occur at
various stages, such as data collection, measurement, and analysis. These errors can
introduce uncertainty in the results and conclusions drawn from the experiments.
Equipment Fault: In many AI systems, machines and sensors are used to collect data
and make decisions. However, these machines can be subject to faults, malfunctions,
or inaccuracies, leading to uncertainty in the outcomes generated by AI systems.
Temperature Variation: Many real-world applications of AI, such as weather
prediction, environmental monitoring, and energy management, are sensitive to
temperature variations. However, temperature measurements can be subject to
uncertainty due to factors such as sensor accuracy, calibration errors, and
environmental fluctuations.
Climate Change: Climate change is a global phenomenon that introduces uncertainty
in various aspects of our lives. For example, predicting the impacts of climate change
on agriculture, water resources, and infrastructure requires dealing with uncertain data
and models.
Missing data
Noisy data
Incomplete knowledge
Theoretical ignorance
Probabilistic reasoning:
Probabilistic reasoning is a way of knowledge representation where we apply the
concept of probability to indicate the uncertainty in knowledge. In probabilistic
reasoning, we combine probability theory with logic to handle the uncertainty. We use
probability in probabilistic reasoning because it provides a way to handle the uncertainty.
In the real world, there are lots of scenarios, where the certainty of something is not
confirmed, such as "It will rain today," "behavior of someone for some situations," "A
match between two teams or two players." These are probable sentences for which we
can assume that it will happen but not sure about it, so here we use probabilistic
reasoning.
Need of probabilistic reasoning in AI:
When there are unpredictable outcomes.
When specifications or possibilities of predicates becomes too large to handle.
When an unknown error occurs during an experiment.
In probabilistic reasoning, there are two ways to solve problems with uncertain
knowledge:
1. Bayes' rule
2. Bayesian Statistics
As probabilistic reasoning uses probability and related terms, so before understanding
probabilistic reasoning, let's understand some common terms:
Probability: Probability can be defined as a chance that an uncertain event will occur. It
is the numerical measure of the likelihood that an event will occur. The value of
probability always remains between 0 and 1 that represent ideal uncertainties.
0 ≤ P(A) ≤ 1,
where P(A) is the probability of an event A.
P(A) = 0, indicates total uncertainty in an event A.
P(A) =1, indicates total certainty in an event A.
We can find the probability of an uncertain event by using the below formula.
Conditional probability:
Conditional probability is a probability of occurring an event when another event has
already happened. For Example, let’s consider the case of rolling two dice, sample
space of this event is as follows:
Now, consider an event A = getting 3 on the first die and B = getting a sum of 9.
Then the probability of getting 9 when on the first die it’s already 3 is P(B | A),
which can be calculated as follows:
All the cases for the first die as 3 are (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6).
In all of these cases, only one case has a sum of 9.
Thus, P(B | A) = 1/36.
In case, we have to find P(A | B),
All cases where the sum is 9 are (3, 6), (4, 5), (5, 4), and (6, 3).
In all of these cases, only one case has 3 on the first die i.e., (3, 6)
Thus, P(A | B) = 1/36.
Example: In a class, there are 70% of the students who like English and 40% of the
students who likes English and mathematics, and then what is the percent of students
those who like English also like mathematics?
Solution: Let, A is an event that a student likes Mathematics
B is an event that a student likes English.
Hence, 57% are the students who like English also like Mathematics.
Bayes' theorem
Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian reasoning, which
determines the probability of an event with uncertain knowledge. Bayes' theorem was
named after the British mathematician Thomas Bayes. The Bayesian inference is an
application of Bayes' theorem, which is fundamental to Bayesian statistics.
Bayes’ Theorem is used to determine the conditional probability of an event.
Here, the joint probability P(A ⋂ B) of both events A and B being true such that,
P(B ⋂ A) = P(A ⋂ B)
Each node corresponds to the random variables, and a variable can be continuous or
discrete.
Arc or directed arrows represent the causal relationship or conditional probabilities
between random variables. These directed links or arrows connect the pair of nodes in
the graph.
These links represent that one node directly influence the other node, and if there is
no directed link that means that nodes are independent with each other
o In the above diagram, A, B, C, and D are random variables represented
by the nodes of the network graph.
o If we are considering node B, which is connected with node A by a
directed arrow, then node A is called the parent of Node B.
o Node C is independent of node A.
Let's take the observed probability for the Burglary and earthquake component:
P(B= True) = 0.002, which is the probability of burglary.
P(B= False)= 0.998, which is the probability of no burglary.
P(E= True)= 0.001, which is the probability of a minor earthquake
P(E= False)= 0.999, Which is the probability that an earthquake not occurred.
We can provide the conditional probabilities as per the below tables:
Conditional probability table for Alarm A:
The Conditional probability of Alarm A depends on Burglar and earthquake:
From the formula of joint distribution, we can write the problem statement in the form of
probability distribution:
P(S, D, A, ¬B, ¬E)
= P (S|A) *P (D|A)*P (A|¬B ^ ¬E) *P (¬B) *P (¬E).
= 0.75* 0.91* 0.001* 0.998*0.999
= 0.00068045.
Hence, a Bayesian network can answer any query about the domain by using Joint
distribution.
Applications of Bayesian Networks in AI
Some of the most common applications of Bayesian networks in AI include:
1. Prediction and classification: Bayesian belief networks can be used to predict the
probability of an event or classify data into different categories based on a set of
inputs. This is useful in areas such as fraud detection, medical diagnosis, and image
recognition.
2. Decision making: Bayesian networks can be used to make decisions based on
uncertain or incomplete information. For example, they can be used to determine the
optimal route for a delivery truck based on traffic conditions and delivery schedules.
3. Risk analysis: Bayesian belief networks can be used to analyze the risks associated
with different actions or events. This is useful in areas such as financial planning,
insurance, and safety analysis.
4. Anomaly detection: Bayesian networks can be used to detect anomalies in data, such
as outliers or unusual patterns. This is useful in areas such as cybersecurity, where
unusual network traffic may indicate a security breach.
5. Natural language processing: Bayesian belief networks can be used to model the
probabilistic relationships between words and phrases in natural language, which is
useful in applications such as language translation and sentiment analysis.
6. Spam Filtering: One of the significant applications of Bayesian networks is in spam
filtering algorithms. By analyzing the content, context, and other relevant features of
emails, Bayesian networks help detect and sort unwanted or malicious emails,
protecting users from potential threats.
7. Image Processing: Bayesian networks also play a crucial role in image processing
tasks. By leveraging their probabilistic modeling capabilities, these networks assist in
converting images into a digital format, allowing for enhanced image analysis, object
recognition, and other image-related tasks.
What Is The Markov Model?
Markov Model in machine learning is a model that states that future events are only
influenced or affected by current events and not by previous ones. The model’s primary
purpose is to determine the probability of upcoming events with the help of present
events.
Two commonly applied types of Markov model are used when the system being
represented is autonomous -- that is, when the system isn't influenced by an external
agent. These are as follows:
1. Markov chains. These are the simplest type of Markov model and are used to
represent systems where all states are observable. Markov chains show all
possible states, and between states, they show the transition rate, which is the
probability of moving from one state to another per unit of time. Applications of
this type of model include prediction of market crashes, speech recognition and
search engine algorithms.
2. Hidden Markov models. These are used to represent systems with some
unobservable states. In addition to showing states and transition rates, hidden
Markov models also represent observations and observation likelihoods for each
state. Hidden Markov models are used for a range of applications, including
thermodynamics, finance and pattern recognition.