M2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Advanced AI & ML- Module 2:

Uncertain Knowledge and Reasoning: Quantifying Uncertainty: Acting under


Uncertainty, Basic Probability Notation, Inference using Full Joint Distributions,
Independence, Baye’s Rule and its use. Wumpus World Revisited
Uncertainty plays a significant role in artificial intelligence (AI) and machine learning. It
refers to the lack of complete information or the presence of randomness and variability
in data or in the outcomes of AI models. Dealing with uncertainty is crucial in AI for
making informed decisions, handling noisy data, and building robust and reliable
systems. Agents may need to handle uncertainty, whether due to partial observability,
nondeterminism, or a combination of the two. An agent may never know for certain what
state it’s in or where it will end up after a sequence of actions.
Example 1:
The story talks about an automated taxi trying to get someone to the airport on time. The
taxi makes a plan to leave 90 minutes before the flight and drive carefully. But it can't be
sure the plan will work perfectly because there are many things that could go wrong, like
the car breaking down, getting into an accident, or even something unexpected like a
meteor hitting the car. So, the taxi hopes the plan will work, but it's not 100% sure.
Example 2:
Let us try to write rules for dental diagnosis using propositional logic, so that we can see
how the logical approach breaks down. Consider the following simple rule:
Toothache ⇒ Cavity .
The problem is that this rule is wrong. Not all patients with toothaches have cavities; some
of them have gum disease, an abscess, or one of several other problems:
Toothache ⇒ Cavity ∨ GumProblem ∨ Abscess ...
Unfortunately, in order to make the rule true, we have to add an almost unlimited list of
possible problems. We could try turning the rule into a causal rule:
Cavity ⇒ Toothache .
But this rule is not right either; not all cavities cause pain. The only way to fix the rule is
to make it logically exhaustive: to augment the left-hand side with all the qualifications
required for a cavity to cause a toothache. Trying to use logic to cope with a domain like
medical diagnosis thus fails for three main reasons:
• Laziness: It is too much work to list the complete set of antecedents or consequents
needed to ensure an exceptionless rule and too hard to use such rules.
• Theoretical ignorance: Medical science has no complete theory for the domain.
• Practical ignorance: Even if we know all the rules, we might be uncertain about a
particular patient because not all the necessary tests have been or can be run.
Probability provides a way of summarizing the uncertainty that comes from
our laziness and ignorance, thereby solving the qualification problems.

Basic probability notations:


A fully specified probability model associates a numerical probability P(ω)
with each possible world. The basic axioms of probability theory say that
every possible world has a probability between 0 and 1 and that the total
probability of the set of possible worlds is 1:

P ( ¬ A ) = probability that A is false


P ( A ∧ B ) = probability that both A and B are true
P ( A ∨ B ) = probability that either A or B (or both) are true

Some properties of probability:


1. 0 ≤ P(A) ≤ 1
2. P(True)=1 (hence P(False)=0)
3. P(A ∨ B) = P(A) + P(B) − P(A ∧ B)
4. Alternatively, if A and B are mutually exclusive (A ∧ B = F) then:
P(A ∨ B) = P(A) + P(B)

Conditional /Unconditional probability


1) P(A ) is the unconditional (or prior) probability of fact A.
An agent can use the unconditional probability of A to reason about A in the
absence of further information.
2) If further evidence B becomes available, the agent must use the
conditional (or posterior) probability:
P(A|B)
the probability of A given that (all) the agent knows (is) B

Conditional probabilities are defined in terms of unconditional ones


Whenever P ( B ) > 0,
𝐏(𝐀 ∧ 𝐁)
𝐏 ( 𝐀 |𝐁) =
𝐏(𝐁)

This can be equivalently expressed as the product rule:

P (A ∧ B) =P ( A | B ) P ( B )
=P ( B | A ) P ( A )
Important terminology:
• A random variable X describes an outcome that cannot be determined in
advance
– E..g. The roll of a die
– E.g. Number of e-mails received in a day
• The sample space (domain) S of a random variable X is the set of all possible
values of the variable
– E.g. For a die, S = {1, 2, 3, 4, 5, 6}
– E.g. For number of emails received in a day, S is the natural numbers
• An event is a subset of S.
– E.g. e = {1} corresponds to a die roll of 1
– E.g. number of e-mails in a day more than 100

If X is a random variable, we use the bold case P ( X ) to denote a vector of


values for the probabilities of each individual element that X can take.
Example:
P (Weather = sunny) = 0.6
P (Weather = rain) = 0.2
P (Weather = cloudy) = 0.18
P (Weather = snow) = 0.02
Then P (Weather) = (0.6, 0.2, 0.18, 0.02) (the value order of “sunny”, “rain”,
cloudy”, “snow” is assumed)
P (Weather) is called a probability distribution for the random variable
Weather

For continuous variables we can define the probability that a random


variable takes on some value x as a parameterized function of x.
P(NoonTemp = x) = Uniform[18C,26C](x)

The above sentence expresses the belief that the temperature at noon is
distributed uniformly between 18 and 26 degrees Celsius. We call this a
probability density function.

Joint Probability Distribution


If X 1, . . . , Xn are random variables, P ( X 1, . . . , Xn ) denotes their joint
probability distribution (JPD), an n-dimensional matrix specifying the
probability of every possible combination of values for X 1, . . . , Xn
Example 1:
Example 2:

• P (cavity ∨ toothache)=0.108 + 0.012 + 0.072 + 0.008 + 0.016 + 0.064 =


0.28
• adding the entries in the first row gives the unconditional or marginal
probability 4 of cavity.
P(cavity)=0.108 + 0.012 + 0.072 + 0.008 = 0.2
• we can compute the probability of a cavity, given evidence of a toothache,
as follows:

we can also compute the probability that there is no cavity, given a


toothache.
A joint probability distribution P ( X 1, . . . , Xn ) provides complete
information about the probabilities of its random variables. However, JPD’s
are often hard to create (again because of incomplete knowledge of the
domain). Even when available, JPD tables are very expensive, or impossible,
to store because of their size. A JPD table for n random variables, each
ranging over k distinct values, has kn entries! A better approach is to come
up with conditional probabilities as needed and compute the others from
them.

Independent :
Now, unless one is in the deity business, one should not imagine that one’s dental
problems influence the weather. And for indoor dentistry, at least, it seems safe to
say that the weather does not influence the dental variables. In particular, the
weather is independent of one’s dental problems. (Refer class notes)
Weather and dental problems are independent

An Alternative to joint probability distribution: The Bayes Rule:


Bayes’ Theorem is used to determine the conditional probability of an event. The
general statement of Bayes’ theorem is “The conditional probability of an event
A, given the occurrence of another event B, is equal to the product of the event
of B, given A and the probability of A divided by the probability of event B.” i.e.
𝑃(𝐵|𝐴)𝑃(𝐴)
𝑝(𝐴|𝐵) =
𝑃(𝐵)
• P(A) and P(B) are the probabilities of events A and B
• P(A|B) is the probability of event A when event B happens
• P(B|A) is the probability of event B when A happens

Often, we perceive as evidence the effect of some unknown cause and we would
like to determine that cause. In that case, Bayes’ rule becomes.
The conditional probability P (effect | cause) quantifies the relationship in the
causal direction, whereas P (cause | effect) describes the diagnostic direction. In
a task such as medical diagnosis, we often have conditional probabilities on
causal relationships (that is, the doctor knows P (symptoms | disease)) and want
to derive a diagnosis, P (disease | symptoms).
Example:
• You go to the doctor complaining about the symptom of having a fever
(evidence).
• The doctor knows that bird flu causes a fever 95% of the time.
• The doctor knows that if a person is selected randomly from the population,
there is a 10−7 chance of the person having bird flu.
• In general, 1 in 100 people in the population suffer from fever.
• What is the probability that you have bird flu (hypothesis)?

THE WUMPUS WORLD REVISITED (Refer class notes)

To calculate the probability that each of the three squares contains a pit.
(For this example we ignore the wumpus and the gold.) The relevant properties
of the wumpus world are that
(1) a pit causes breezes in all neighboring squares, and
(2) each square other than [1,1] contains a pit with probability 0.2.

The first step is to identify the set of random variables we need:


• As in the propositional logic case, we want one Boolean variable P ij for
each square, which is true iff square [i, j] actually contains a pit.
• We also have Boolean variables Bij that are true iff square [i, j] is breezy;
we include these variables only for the observed squares; in this case, [1,1],
[1,2], and [2,1].
The next step is to specify the full joint distribution, P(P 1,1,...,P4,4, B1,1, B1,2,
B2,1). Applying the product rule, we have

Let We are interested in answering queries such as P(P1,3 | known, b): how
likely is it that [1,3] contains a pit, given the observations so far?

To answer this query, Let Unknown be the set of Pi,j variables for squares other
than the Known squares and the query square [1,3].

*****************************All the best********************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy