0% found this document useful (0 votes)
668 views15 pages

Odds and Probability - Elements of AI 3-1

This document discusses probability and how it allows modern AI to deal with uncertainty in real-world problems. It provides examples of how probability can quantify risks and uncertainties, like the chances of a self-driving car encountering unexpected events. Probability is seen as the best approach for reasoning under uncertainty, allowing uncertainties to be discussed rationally by expressing them as numbers that can be measured and compared. Quantifying uncertainty through probability is important for domains like medical decision making where risks and benefits must be weighed.

Uploaded by

Mubasher Hussain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
668 views15 pages

Odds and Probability - Elements of AI 3-1

This document discusses probability and how it allows modern AI to deal with uncertainty in real-world problems. It provides examples of how probability can quantify risks and uncertainties, like the chances of a self-driving car encountering unexpected events. Probability is seen as the best approach for reasoning under uncertainty, allowing uncertainties to be discussed rationally by expressing them as numbers that can be measured and compared. Quantifying uncertainty through probability is important for domains like medical decision making where risks and benefits must be weighed.

Uploaded by

Mubasher Hussain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

7/22/2020 Odds and probability - Elements of AI

Elements of AI

I. Odds and probability


In the previous section, we discussed search and its application where there
is perfect information – such as in games like chess. However, in the real
world things are rarely so clear cut.

Instead of perfect information, there is a host of unknown possibilities, ranging from


missing information to deliberate deception.

Take a self-driving car for example — you can set the goal to get from A to B in an efficient
and safe manner that follows all laws. But what happens if the traffic gets worse than
expected, maybe because of an accident ahead? Sudden bad weather? Random events like a
ball bouncing in the street, or a piece of trash flying straight into the car’s camera?

https://course.elementsofai.com/3/1 1/15
7/22/2020 Odds and probability - Elements of AI

A self-driving car needs to use a variety of sensors, including sonar-like ones and cameras, to
detect where it is and what is around it. These sensors are never perfect as the data from the
sensors always includes some errors and inaccuracies called “noise”. It is very common then
that one sensor indicates that the road ahead turns left, but another sensor indicates the
opposite direction. This needs to be resolved without always stopping the car in case of even
a slightest amount of noise.

Probability
One of the reasons why modern AI methods actually work in real-world problems – as
opposed to most of the earlier “good old-fashioned" methods in the 1960-1980s – is their
ability to deal with uncertainty.

https://course.elementsofai.com/3/1 2/15
7/22/2020 Odds and probability - Elements of AI

Note

The history of dealing with uncertainty


The history of AI has seen various competing paradigms for handling uncertain and imprecise
information. For example, you may have heard of fuzzy logic. Fuzzy logic was for a while a
contender for the best approach to handle uncertain and imprecise information and used in
many customer-applications such as washing machines where the machine could detect the
dirtiness (a matter of degrees, not only dirty or clean) and adjust the program accordingly.

However, probability has turned out to be the best approach for reasoning under uncertainty,
and almost all current AI applications are based, to at least some degree, on probabilities.

https://course.elementsofai.com/3/1 3/15
7/22/2020 Odds and probability - Elements of AI

Why probability matters


We are perhaps most familiar with applications of probability in games: what are the
chances of getting three of a kind in poker (about 1 in 47), what are the chances of winning in
the lottery (very small), and so on. However, far more importantly, probability can also be
used to quantify and compare risks in everyday life: what are the chances of crashing your
car if you exceed the speed limit, what are the chances that the interest rates on your
mortgage will go up by five percentage points within the next five years, or what are the
chances that AI will automate particular tasks such as detecting fractured bones in X-ray
images or waiting tables in a restaurant.

https://course.elementsofai.com/3/1 4/15
7/22/2020 Odds and probability - Elements of AI

Note

The key lesson about probability


The most important lesson about probability that we’d like you to take away is not probability
calculus. Instead, it is the ability to think of uncertainty as a thing that can be quantified at least
in principle. This means that we can talk about uncertainty as if it were a number: numbers can
be compared (“is this thing more probable than that thing”), and they can often be measured.

Granted, measuring probabilities is hard: we usually need many observations about a


phenomenon to draw conclusions. However, by systematically collecting data, we can critically
evaluate probabilistic statements, and our numbers can sometimes be found to be right or
wrong. In other words, the key lesson is that uncertainty is not beyond the scope of rational
thinking and discussion, and probability provides a systematic way of doing just that.

The fact that uncertainty can be quantified is of paramount importance, for example, in
decisions concerning vaccination or other public policies. Before entering the market, any
vaccine is clinically tested, so that its benefits and risks have been quantified. The risks are
never known to the minutest detail, but their magnitude is usually known to sufficient
degree that it can be argued whether the benefits outweigh the risks.

Note

Why quantifying uncertainty matters


If we think of uncertainty as something that can’t be quantified or measured, the uncertainty
aspect may become an obstacle for rational discussion. We may for example argue that since
https://course.elementsofai.com/3/1 5/15
7/22/2020 Odds and probability - Elements of AI

we don’t know exactly whether a vaccine may cause a harmful side-e ect, it is too dangerous to
use. However, this may lead us to ignore a life-threatening disease that the vaccine will
eradicate. In most cases, the benefits and risks are known to su cient precision to clearly see
that one is more significant than the other.

The above lesson is useful in many everyday scenarios and professionally: for example,
medical doctors, judges in a court of law, or investors have to process uncertain information
and make rational decisions based on them. Since this is an AI course, we will discuss how
probability can be used to automate uncertain reasoning. The examples we will use include
medical diagnosis (although it is usually not a task that we’d wish to fully automate), and
identifying fraudulent email messages (“spam”).

Answered

Exercise 8: Probabilistic forecasts


For this exercise, remember the key points from the above discussion: probability
can be quantified (expressed as a number) and it can be right or wrong. But also
keep in mind, that it is usually not possible to draw conclusions about whether a
particular number was right or wrong based on a single observation.
Consider the following four probabilistic forecasts and outcomes. What can we
conclude based on the outcome about the correctness of the forecasts? Can we
conclude that the probability given by the forecast was indeed the correct
https://course.elementsofai.com/3/1 6/15
7/22/2020 Odds and probability - Elements of AI

probability (choose "right"), that the forecast was wrong (choose "wrong"), or can
we conclude neither way (choose "cannot be concluded")?

The weather forecast says it's Right Wrong Cannot be concluded


going to rain with 90%
probability tomorrow but the
day turns out to be all sun and
no rain.

The answer is not correct


We can't conclude that the weather forecast was wrong based on only the single
event. The forecast said it's going to rain with 90% probability, which means it would
not rain with 10% probability or in one out of 10 days. It is perfectly plausible that the
day in question was the 1 in 10 event. Concluding that the probability 90% was correct
would also be wrong because by the same argument, we could then conclude that
80% chance of rain was also correct, and both cannot be correct at the same time.

The weather forecast says it's Right Wrong Cannot be concluded


going to rain with 0% probability
tomorrow but the day turns out
to be rainy.

The answer is correct


The weather forecast was wrong because a 0% probability means that it should
definitely not rain. But it did.

Suppose you monitor a weather Right Wrong Cannot be concluded


https://course.elementsofai.com/3/1 7/15
7/22/2020 Odds and probability - Elements of AI

forecaster for a long time. You


only consider the days for
which the forecast gives 80%
chance of rain. You find that in
the long run, on the average it
rains on three out of every five
days.

The answer is not correct


The weather forecasts are wrong if they predict 80% chance of rain and it rains only
60% (three out of five) of the time in the long run. (Note that we'd really need to keep
track of the accuracy for a long time to reach this conclusion but that's what "in the
long run" means.) In practice, weather forecasters actually tend to provide this kind of
'wrong' predictions just to be safe: people are often quite disappointed when the
weather turns out to be worse than predicted but pleasantly surprised when it turns
out better than predicted.

In the United States presidential Right Wrong Cannot be concluded


election 2016, a well-known
political forecast blog, Five-
Thirty-Eight, gave Clinton a
71.4% chance of winning (vs
Trump's 28.6%). However,
contrary to the prediction,
Donald Trump was elected the
45th president of the United
States.

The answer is not correct


Cannot be concluded to be wrong (or right). Sometimes unlikely things happen.
Considering the previous item, it would actually have been wrong to predict, say, 90%
https://course.elementsofai.com/3/1 8/15
7/22/2020 Odds and probability - Elements of AI

or 100% chance for Trump if there simply isn't enough information available to
anticipate the outcome. In other words, perhaps Trump's victory had a rare (or rareish)
event with 28.6% probability. Such events are expected to happen in more than one
out of four cases, after all.

1/4 answers correct

Odds
Probably the easiest way to represent uncertainty is through odds. They make it particularly
easy to update beliefs when more information becomes available (we will return to this in
the next section).

Before we proceed any further, we should make sure you are comfortable with doing basic
manipulations on ratios (or fractions). As you probably recall, fractions are numbers like 3/4
or 21/365. We will need to multiply and divide such things, so it's good to refresh these
operations if you feel unsure about them. A compact presentation for those who just need a
quick reminder is Wikibooks: Multiplying Fractions. Another fun animated presentation of
the basic operations is Math is Fun: Using Rational Numbers. Feel free to consult your
favorite source if necessary.

By odds, we mean an expression like 3:1 (three to one), which means that we expect that for
every three cases of an outcome, for example winning a bet, there is one case of the opposite
outcome, not winning the bet. (In gambling terms, the odds are usually given from the
bookmakers point of view, so 3:1 usually means that your chances of winning are 1:3.) The
other way to express the same would be to say that the chances of winning are 3/4 (three in

https://course.elementsofai.com/3/1 9/15
7/22/2020 Odds and probability - Elements of AI

four). These are called natural frequencies since they involve only whole numbers. With
whole numbers, it is easy to imagine, for example, four people out of whom, three have
brown eyes. Or four days out of which it rains on three (if you’re in Helsinki).

Note
https://course.elementsofai.com/3/1 10/15
7/22/2020 Odds and probability - Elements of AI

Why we use odds and not percentages


Three out of four is of course the same as 75% (mathematicians prefer to use fractions like 0.75
instead of percentages). It has been found that people get confused and make mistakes more
easily when dealing with fractions and percentages than with natural frequencies or odds. This is
why we use natural frequencies and odds whenever convenient.

An important thing to notice is that while expressed as two numbers, 3 and 1 for example,
the odds can actually be thought of as a single fraction or a ratio, for example 3/1 (three
divided by one) which is equal to 3. Thus, the odds 3:1 is the same as the odds 6:2 or 30:10
since these ratios are also equal to 3. Likewise, the odds 1:5 can be thought of as 1/5 (one
divided by five) which equals 0.2. Again, this is the same as the odds 2:10 or 10:50 because
that's what you get by dividing 2 by 10 or 10 by 50. But be very careful! The odds 1:5 (one win
for every five losses), even if it can be expressed as the decimal number 0.2, is different from
20% probability (or probability 0.2 using the mathematicians' notation). The odds 1:5 mean
that you'd have to play the game six times to get one win on the average. The probability 20%
means that you'd have to play five times to get one win on the average.

For odds that are greater than one, such as 5:1, it is easy to remember that we are not dealing
with probabilities because no probability can be greater than 1 (or greater than 100%), but
for odds that are less than one such as 1:5, the danger of confusion lurks around the corner.

So make sure you always know when we are talking about odds and when we are talking
about probabilities.

The following exercise will help you practice dealing with correspondence between odds
and probabilities. Don't worry if you make some mistakes at this stage: the main goal is to
learn the skills that you will need in the next sections.

https://course.elementsofai.com/3/1 11/15
7/22/2020 Odds and probability - Elements of AI

Answered

Exercise 9: Odds
As we already mentioned above, the odds 3:1 – for example three rainy days for
each rainless day – corresponds to probability 0.75 (or in percentages 75%).
In general, if the odds in favor of an event are x:y, the probability of the event is
given by x / (x+y). Try that with the odds 3:1 if you like. You should get the answer
0.75.
As we also pointed out, the odds 6:2 corresponds to exactly the same probability
as the odds 3:1 because when we let x=6 and y=2, and write them in the formula x
/ (x+y), we get 6/(6+2), which comes out as 6/8 = 3/4 = 0.75.
Your task:
For the first three items 1–3, convert from odds to probabilities expressed as
natural frequencies; for example from 1:1 to 1/2. Give your answer as a fraction, for
example 2/3.
For the last three items 4–6, convert the odds into probabilities expressed as
percentages (e.g. 4.2%). Give your answer in percentages using a single decimal,
for example 12.2%.
Hint: the calculations are to be calculated with a simple calculator and the
formulas can be found above.

https://course.elementsofai.com/3/1 12/15
7/22/2020 Odds and probability - Elements of AI

The odds for getting three of a kind in poker are about 1:46.
Your answer: 3:1

Your answer is not correct


Incorrect. There are 46 situations where you do not get three of a kind for one where you get it,
so the probability is 1/(1+46) = 1/47.

The odds for rain in Helsinki are 206:159.


Your answer: 206:159

Your answer is not correct


Incorrect. There are 206 rainy days for 159 dry days, so the probability is 206/(206+159) =
206/365.

The odds for rain in San Diego are 23:342.


Your answer: 206:159

Your answer is not correct


Incorrect. There are 23 rainy days for 342 dry days, so the probability is 23/(23+342) = 23/365.

The odds for getting three of a kind in poker are about 1:46.
Your answer: 206:159

Your answer is not correct

https://course.elementsofai.com/3/1 13/15
7/22/2020 Odds and probability - Elements of AI

Incorrect. Previously we had the probability as 1/(1+ 46) = 1/47, which gives us roughly 0.0213,
which rounds to 2.1%.

The odds for rain in Helsinki are 206:159.


Your answer: 206:159

Your answer is not correct


Incorrect. Previously we had the probability as 206/(206 + 159) = 206/365, which gives us
roughly 0.5644, which rounds to 56.4%.

The odds for rain in San Diego are 23:342.


Your answer: 206:159

Your answer is not correct


Incorrect. Previously we had the probability as 23/(23 + 342) = 23/365, which gives us roughly
0.0630, which rounds to 6.3%.

The answer is not correct

https://course.elementsofai.com/3/1 14/15
7/22/2020 Odds and probability - Elements of AI

Next section

II. The Bayes rule →

Course overview

About

FAQ

Privacy Policy

My profile Sign out

https://course.elementsofai.com/3/1 15/15

You might also like